mirror of
https://github.com/RoboSats/taptrade-core.git
synced 2025-08-08 02:50:03 +00:00
add electrum server to regtest docker
This commit is contained in:
@ -40,7 +40,7 @@ pub fn init_coordinator_wallet() -> Result<CoordinatorWallet<sled::Tree>> {
|
||||
auth: Auth::Cookie {
|
||||
file: env::var("BITCOIN_RPC_COOKIE_FILE_PATH")?.into(),
|
||||
},
|
||||
network: bdk::bitcoin::Network::Signet,
|
||||
network: bdk::bitcoin::Network::Regtest,
|
||||
wallet_name: env::var("BITCOIN_RPC_WALLET_NAME")?,
|
||||
sync_params: None,
|
||||
};
|
||||
@ -51,7 +51,7 @@ pub fn init_coordinator_wallet() -> Result<CoordinatorWallet<sled::Tree>> {
|
||||
let wallet = Wallet::new(
|
||||
Bip86(wallet_xprv, KeychainKind::External),
|
||||
Some(Bip86(wallet_xprv, KeychainKind::Internal)),
|
||||
bitcoin::Network::Signet,
|
||||
bitcoin::Network::Regtest,
|
||||
sled_db,
|
||||
)?;
|
||||
|
||||
@ -276,7 +276,7 @@ mod tests {
|
||||
auth: Auth::Cookie {
|
||||
file: env::var("BITCOIN_RPC_COOKIE_FILE_PATH").unwrap().into(),
|
||||
},
|
||||
network: bdk::bitcoin::Network::Signet,
|
||||
network: bdk::bitcoin::Network::Regtest,
|
||||
wallet_name: env::var("BITCOIN_RPC_WALLET_NAME").unwrap(),
|
||||
sync_params: None,
|
||||
};
|
||||
@ -287,7 +287,7 @@ mod tests {
|
||||
let wallet = Wallet::new(
|
||||
Bip86(wallet_xprv, KeychainKind::External),
|
||||
Some(Bip86(wallet_xprv, KeychainKind::Internal)),
|
||||
Network::Signet,
|
||||
Network::Regtest,
|
||||
MemoryDatabase::new(),
|
||||
)
|
||||
.unwrap();
|
||||
|
@ -41,7 +41,7 @@ impl BondTx for Transaction {
|
||||
|
||||
fn bond_output_sum(&self, bond_address: &str) -> Result<u64> {
|
||||
let bond_script = Address::from_str(bond_address)?
|
||||
.require_network(Network::Signet)?
|
||||
.require_network(Network::Regtest)?
|
||||
.script_pubkey();
|
||||
|
||||
for output in self.output.iter() {
|
||||
|
@ -4,8 +4,30 @@ services:
|
||||
container_name: bitcoin
|
||||
ports:
|
||||
- 8332:8332
|
||||
networks:
|
||||
- bitcoin
|
||||
volumes:
|
||||
- bitcoin:/home/bitcoin/.bitcoin
|
||||
|
||||
fulcrum:
|
||||
build: ./fulcrum
|
||||
container_name: fulcrum
|
||||
ports:
|
||||
- 5321:5321
|
||||
volumes:
|
||||
- fulcrum-volume:/home/fulcrum/fulcrum_data
|
||||
networks:
|
||||
- bitcoin
|
||||
restart: always
|
||||
depends_on:
|
||||
bitcoin:
|
||||
condition: service_started
|
||||
|
||||
|
||||
volumes:
|
||||
bitcoin:
|
||||
bitcoin:
|
||||
fulcrum-volume:
|
||||
|
||||
networks:
|
||||
bitcoin:
|
||||
driver: bridge
|
18
taptrade-cli-demo/rpc_node/regtest/fulcrum/Dockerfile
Normal file
18
taptrade-cli-demo/rpc_node/regtest/fulcrum/Dockerfile
Normal file
@ -0,0 +1,18 @@
|
||||
FROM debian:latest
|
||||
|
||||
RUN apt update
|
||||
|
||||
RUN mkdir -p /home/fulcrum
|
||||
|
||||
COPY ./fulcrum /home/fulcrum/.
|
||||
COPY ./config.conf /home/fulcrum/.
|
||||
|
||||
WORKDIR /home/fulcrum
|
||||
|
||||
RUN mkdir fulcrum_data
|
||||
RUN chmod +x ./fulcrum
|
||||
|
||||
EXPOSE 5321
|
||||
|
||||
#CMD ["tail", "-f"]
|
||||
CMD ["./fulcrum", "config.conf"]
|
1087
taptrade-cli-demo/rpc_node/regtest/fulcrum/config.conf
Normal file
1087
taptrade-cli-demo/rpc_node/regtest/fulcrum/config.conf
Normal file
File diff suppressed because it is too large
Load Diff
BIN
taptrade-cli-demo/rpc_node/regtest/fulcrum/fulcrum
Executable file
BIN
taptrade-cli-demo/rpc_node/regtest/fulcrum/fulcrum
Executable file
Binary file not shown.
@ -33,7 +33,7 @@ impl Bond {
|
||||
debug!("Assembling bond transaction");
|
||||
// parse bond locking address as Address struct and verify network is testnet
|
||||
let address: Address =
|
||||
Address::from_str(&bond_target.bond_address)?.require_network(Network::Signet)?;
|
||||
Address::from_str(&bond_target.bond_address)?.require_network(Network::Regtest)?;
|
||||
|
||||
// build bond locking transaction. Use coin selection to add at least enough outputs
|
||||
// to have the full trading sum as change as evidence for the coordinator that the maker owns
|
||||
@ -84,7 +84,7 @@ mod tests {
|
||||
let wallet = Wallet::new(
|
||||
Bip86(wallet_xprv, KeychainKind::External),
|
||||
Some(Bip86(wallet_xprv, KeychainKind::Internal)),
|
||||
Network::Signet,
|
||||
Network::Regtest,
|
||||
MemoryDatabase::default(),
|
||||
)
|
||||
.unwrap();
|
||||
|
@ -27,7 +27,7 @@ pub struct TradingWallet {
|
||||
|
||||
pub fn get_wallet_xprv(xprv_input: Option<String>) -> Result<ExtendedPrivKey> {
|
||||
let xprv: ExtendedPrivKey;
|
||||
let network: Network = Network::Signet;
|
||||
let network: Network = Network::Regtest;
|
||||
|
||||
if let Some(xprv_i) = xprv_input {
|
||||
xprv = ExtendedPrivKey::from_str(&xprv_i)?;
|
||||
@ -45,7 +45,7 @@ impl TradingWallet {
|
||||
let wallet = Wallet::new(
|
||||
Bip86(trader_config.wallet_xprv, KeychainKind::External),
|
||||
Some(Bip86(trader_config.wallet_xprv, KeychainKind::Internal)),
|
||||
bitcoin::Network::Signet,
|
||||
bitcoin::Network::Regtest,
|
||||
MemoryDatabase::default(), // non-permanent storage
|
||||
)?;
|
||||
|
||||
|
Reference in New Issue
Block a user