Skip to content

Commit

Permalink
Merge pull request #19 from BoltzExchange/second-wallet
Browse files Browse the repository at this point in the history
feat: second wallet for CLI aliases
  • Loading branch information
maybeast authored Jul 28, 2024
2 parents eb65b49 + 8b17da5 commit a121aad
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 2 deletions.
4 changes: 2 additions & 2 deletions aliases.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ run_in_container() {
docker exec -it boltz-scripts bash -c "source /etc/profile.d/utils.sh && $(printf '%q ' "$@")"
}

alias bitcoin-cli-sim='run_in_container bitcoin-cli-sim'
alias elements-cli-sim='run_in_container elements-cli-sim'
alias bitcoin-cli-sim='run_in_container bitcoin-cli-sim -rpcwallet=client'
alias elements-cli-sim='run_in_container elements-cli-sim -rpcwallet=client'
alias boltzcli-sim='run_in_container boltzcli-sim'

lightning-cli-sim() {
Expand Down
3 changes: 3 additions & 0 deletions data/backend/boltz.conf
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,8 @@ maxZeroConfAmount = 0
port = 18_443
cookie = "/root/.bitcoin/regtest/.cookie"

wallet = "regtest"

[currencies.lnd]
host = "lnd-2"
port = 10_009
Expand All @@ -99,6 +101,7 @@ maxZeroConfAmount = 40_294_967
zmqpubrawtx = "tcp://elementsd:31000"
zmqpubhashblock = "tcp://elementsd:31002"

wallet = "regtest"

[rsk]
providerEndpoint = "http://anvil:8545"
Expand Down
12 changes: 12 additions & 0 deletions images/scripts/utils.sh
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,12 @@ bitcoind-init() {
else
echo "Failed to generate blocks"
fi

bitcoin-cli-sim createwallet client || bitcoin-cli-sim loadwallet client

CLIENT_ADDRESS=$(bitcoin-cli-sim -rpcwallet=client getnewaddress "" bech32m)
bitcoin-cli-sim -rpcwallet=regtest sendtoaddress $CLIENT_ADDRESS 10
bitcoin-cli-sim -rpcwallet=regtest -generate 1
}

regtest-start(){
Expand All @@ -78,6 +84,12 @@ elements-init(){
echo "mining 150 liquid blocks..."
elements-cli-sim -generate 150 > /dev/null
elements-cli-sim rescanblockchain 0 > /dev/null

elements-cli-sim createwallet client || elements-cli-sim loadwallet client true

CLIENT_ADDRESS=$(elements-cli-sim -rpcwallet=client getnewaddress)
elements-cli-sim -rpcwallet=regtest sendtoaddress $CLIENT_ADDRESS 10
elements-cli-sim -rpcwallet=regtest -generate 1
}

# TODO: currently not being used
Expand Down

0 comments on commit a121aad

Please sign in to comment.