Skip to content
This repository has been archived by the owner on Jul 26, 2024. It is now read-only.

Commit

Permalink
fixup!
Browse files Browse the repository at this point in the history
  • Loading branch information
dni committed Mar 25, 2024
1 parent 350f3ce commit d2b655e
Show file tree
Hide file tree
Showing 5 changed files with 95 additions and 13 deletions.
9 changes: 8 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
data
data/*
!data/elements
data/elements/*
!data/elements/elements.conf
!data/elements/liquid.cookie

!data/boltz
data/boltz/*
!data/boltz/boltz.conf
!data/boltz/seed.dat

!data/boltz-client
data/boltz-client/*
!data/boltz-client/boltz.toml
74 changes: 74 additions & 0 deletions data/boltz-client/boltz.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
# Path the the log file
logfile = ""

electrumUrl = "localhost:19001"
electrumLiquidUrl = "localhost:19002"

[BOLTZ]
# By default the daemon automatically connects to the official Boltz instance for the network LND is on
# This value is used to override that
url = ""

[DATABASE]
# Path to the SQLite database file
# path = "/home/michael/test.db"

[LND]
# Host of the gRPC interface of LND
host = "127.0.0.1"

# Port of the gRPC interface of LND
port = 10009

# Path to a macaroon file of LND
# The daemon needs to have permission to read various endpoints, generate addresses and pay invoices
macaroon = "~/regtest/data/lnd-1/data/chain/bitcoin/regtest/admin.macaroon"

# Path to the TLS certificate of LND
certificate = "~/regtest/data/lnd-1/tls.cert"

[CLN]
host = "127.0.0.1"
port = 9736

rootcert = "~/regtest/data/clightning-1/regtest/ca.pem"
privatekey = "~/regtest/data/clightning-1/regtest/client-key.pem"
certchain = "~/regtest/data/clightning-1/regtest/client.pem"


[RPC]
# Host o.f
host = "127.0.0.1"

# Port of the gRPC interface
port = 9002

# Whether the REST proxy for the gRPC interface should be disabled
restDisabled = false

# Host of the REST proxy
restHost = "127.0.0.1"

# Port of the REST proxy
restPort = 9003

# Path to the TLS cert for the gRPC and REST interface
tlsCert = ""

# Path to the TLS private key for the gRPC and REST interface
tlsKey = ""

# Whether the macaroon authentication for the gRPC and REST interface should be disabled
noMacaroons = true

# Path to the admin macaroon for the gRPC and REST interface
adminMacaroonPath = ""

# Path to the read only macaroon for the gRPC and REST interface
readOnlyMacaroonPath = ""

[SWAP]
#autoSwap = true
#channelImbalanceThreshhold = 1
#acceptZeroConf = true
#liquidAddress = "el1qq2490pg57wqtnh3ttmp2d9uxs3wg5aa3usjxv2nrvcycz2utscm69e652lwjcrynemeds7v5ltnwgq4hwrv6q65dnqkf9fayn"
11 changes: 5 additions & 6 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ services:
- 9002:9002
volumes:
- ./data/clightning-2:/data/clightning/
- ./data/boltz/:/root/.boltz/
- ./data/boltz-client/:/root/.boltz/
- ./data/elements/:/root/.elements/

anvil:
Expand Down Expand Up @@ -109,17 +109,16 @@ services:
- --large-channels
- --network
- regtest
- --bind-addr=0.0.0.0:9737
- --bind-addr=0.0.0.0:9735
- --bitcoin-rpcconnect=bitcoind
- --bitcoin-rpcport=18443
- --bitcoin-rpcuser=regtest
- --bitcoin-rpcpassword=regtest
- --grpc-port=9738
- --grpc-port=9736
- --dev-bitcoind-poll=3
expose:
- 9737
ports:
- 9738:9738
- 9735
- 9736
volumes:
- ./data/clightning-2:/root/.lightning/

Expand Down
8 changes: 5 additions & 3 deletions docker-scripts.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ elements-cli-sim() {
docker exec regtest-elementsd-1 elements-cli "$@"
}

boltz-cli-sim() {
boltzcli-sim() {
docker exec regtest-boltz-client-1 boltzcli "$@"
}

Expand Down Expand Up @@ -96,9 +96,9 @@ regtest-start-log(){
regtest-stop(){
docker compose down --volumes
# clean up lightning node data
sudo rm -rf ./data/clightning-1 ./data/lnd-1 ./data/lnd-2 ./data/boltz/boltz.db ./data/elements/liquidregtest ./data/bitcoin/regtest
sudo rm -rf ./data/clightning-1 ./data/clightning-2 ./data/lnd-1 ./data/lnd-2 ./data/boltz/boltz.db ./data/elements/liquidregtest ./data/bitcoin/regtest
# recreate lightning node data folders preventing permission errors
mkdir ./data/clightning-1 ./data/lnd-1 ./data/lnd-2
mkdir ./data/clightning-1 ./data/clightning-2 ./data/lnd-1 ./data/lnd-2
}

regtest-restart(){
Expand Down Expand Up @@ -135,6 +135,7 @@ regtest-init(){

lightning-sync(){
wait-for-clightning-sync 1
wait-for-clightning-sync 2
wait-for-lnd-sync 1
wait-for-lnd-sync 2
}
Expand All @@ -143,6 +144,7 @@ lightning-init(){
# create 10 UTXOs for each node
for i in 0 1 2 3 4; do
fund_clightning_node 1
fund_clightning_node 2
fund_lnd_node 1
fund_lnd_node 2
done
Expand Down
6 changes: 3 additions & 3 deletions regtest
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ run(){
}

failed="false"
blockheight=171
channel_count=2
blockheight=183
channel_count=3
utxos=5
channel_size=24000000 # 0.024 btc
balance_size=12000000 # 0.012 btc
Expand All @@ -45,7 +45,7 @@ done
for i in 1 2; do
# run "cln-$i blockheight" $blockheight $(lightning-cli-sim $i getinfo | jq -r ".blockheight")
run "cln-$i utxo count" $utxos $(lightning-cli-sim $i listfunds | jq -r ".outputs | length")
run "cln-$i openchannels" $channel_count $(lightning-cli-sim $i getinfo | jq -r ".num_active_channels")
run "cln-$i openchannels" 2 $(lightning-cli-sim $i getinfo | jq -r ".num_active_channels")
run "cln-$i channel[0].state" "CHANNELD_NORMAL" $(lightning-cli-sim $i listfunds | jq -r ".channels[0].state")
run "cln-$i channel[0].amount_msat" $((channel_size * 1000)) $(lightning-cli-sim $i listfunds | jq -r ".channels[0].amount_msat")
run "cln-$i channel[0].our_amount_msat" $((balance_size * 1000)) $(lightning-cli-sim $i listfunds | jq -r ".channels[0].our_amount_msat")
Expand Down

0 comments on commit d2b655e

Please sign in to comment.