Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some minor LND updates mostly etcd related #6

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
75 changes: 75 additions & 0 deletions docker-compose-etcd-notls.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
version: '3.4'
services:
bitcoind:
image: kylemanna/bitcoind
volumes:
- ./bitcoin.conf:/bitcoin/.bitcoin/bitcoin.conf

etcd-alice:
restart: unless-stopped
image: 'bitnami/etcd:3.4.16'
environment:
- ALLOW_NONE_AUTHENTICATION=yes
- ETCD_LISTEN_CLIENT_URLS=http://0.0.0.0:2379
- ETCD_ADVERTISE_CLIENT_URLS=http://0.0.0.0:2379
- ETCD_MAX_TXN_OPS=16384
- ETCD_MAX_REQUEST_BYTES=104857600

etcd-bob:
restart: unless-stopped
image: 'bitnami/etcd:3.4.16'
environment:
- ALLOW_NONE_AUTHENTICATION=yes
- ETCD_LISTEN_CLIENT_URLS=http://0.0.0.0:2379
- ETCD_ADVERTISE_CLIENT_URLS=http://0.0.0.0:2379
- ETCD_MAX_TXN_OPS=16384
- ETCD_MAX_REQUEST_BYTES=104857600

lnd-alice:
restart: unless-stopped
build:
context: lnd
args:
checkout: v0.13.0-beta.rc5
tags: signrpc walletrpc chainrpc invoicesrpc monitoring kvdb_etcd
depends_on:
- bitcoind
- etcd-alice
volumes:
- ./lnd.conf:/root/.lnd/lnd.conf
- lnd-alice:/cfg
ports:
- 5000:5000
command: --tlsextradomain=lnd-alice --db.backend=etcd --db.etcd.host=etcd-alice:2379 --db.etcd.disabletls

lnd-bob:
restart: unless-stopped
build:
context: lnd
args:
checkout: v0.13.0-beta.rc5
tags: signrpc walletrpc chainrpc invoicesrpc monitoring kvdb_etcd
depends_on:
- bitcoind
- etcd-bob
volumes:
- ./lnd.conf:/root/.lnd/lnd.conf
- lnd-bob:/cfg
ports:
- 5001:5000
command: --tlsextradomain=lnd-bob --db.backend=etcd --db.etcd.host=etcd-bob:2379 --db.etcd.disabletls

loadtest:
build: loadtest
depends_on:
- lnd-alice
- lnd-bob
volumes:
- lnd-alice:/lnd-alice
- lnd-bob:/lnd-bob
- ./${LOADTEST_CONFIG_FILE}:/loadtest.yml

volumes:
lnd-alice:
lnd-bob:

10 changes: 5 additions & 5 deletions docker-compose-etcd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ services:

etcd-alice:
restart: unless-stopped
image: 'bitnami/etcd:3.3.10'
image: 'bitnami/etcd:3.4.16'
environment:
- ALLOW_NONE_AUTHENTICATION=yes
- ETCD_LISTEN_CLIENT_URLS=https://0.0.0.0:2379
Expand All @@ -18,7 +18,7 @@ services:

etcd-bob:
restart: unless-stopped
image: 'bitnami/etcd:3.3.10'
image: 'bitnami/etcd:3.4.16'
environment:
- ALLOW_NONE_AUTHENTICATION=yes
- ETCD_LISTEN_CLIENT_URLS=https://0.0.0.0:2379
Expand All @@ -32,7 +32,7 @@ services:
build:
context: lnd
args:
checkout: v0.12.1-beta
checkout: v0.13.0-beta.rc5
tags: signrpc walletrpc chainrpc invoicesrpc monitoring kvdb_etcd
depends_on:
- bitcoind
Expand All @@ -49,7 +49,7 @@ services:
build:
context: lnd
args:
checkout: v0.12.1-beta
checkout: v0.13.0-beta.rc5
tags: signrpc walletrpc chainrpc invoicesrpc monitoring kvdb_etcd
depends_on:
- bitcoind
Expand All @@ -74,4 +74,4 @@ services:
volumes:
lnd-alice:
lnd-bob:

41 changes: 32 additions & 9 deletions loadtest/cmd_setup.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,44 +73,67 @@ func setup(_ *cli.Context) error {
return err
}

log.Infow("Fund sender")
log.Infow("Fund sender and receiver")
senderClient, err := getNodeConnection(&cfg.Sender)
if err != nil {
return err
}
defer senderClient.Close()

addrResp, err := senderClient.NewAddress()
receiverClient, err := getNodeConnection(&cfg.Receiver)
if err != nil {
return err
}
defer receiverClient.Close()

addrSenderResp, err := senderClient.NewAddress()
if err != nil {
return err
}

log.Infow("Generated funding address for sender", "address", addrSenderResp)

addrReceiverResp, err := receiverClient.NewAddress()
if err != nil {
return err
}

log.Infow("Generated funding address for receiver", "address", addrReceiverResp)

senderAddr, err := btcutil.DecodeAddress(addrSenderResp, &chaincfg.RegressionNetParams)
if err != nil {
return err
}
log.Infow("Generated funding address", "address", addrResp)

senderAddr, err := btcutil.DecodeAddress(addrResp, &chaincfg.RegressionNetParams)
receiverAddr, err := btcutil.DecodeAddress(addrReceiverResp, &chaincfg.RegressionNetParams)
if err != nil {
return err
}

_, err = bitcoindConn.GenerateToAddress(1, senderAddr, nil)
if err != nil {
return err
}

log.Infow("Mature coin")
_, err = bitcoindConn.GenerateToAddress(1, receiverAddr, nil)
if err != nil {
return err
}

log.Infow("Mature coins")
_, err = bitcoindConn.GenerateToAddress(105, addr, nil)
if err != nil {
return err
}

log.Infow("Wait for coin to appear in wallet")
log.Infow("Wait for coin to appear in wallets")
if err := senderClient.HasFunds(); err != nil {
return err
}

receiverClient, err := getNodeConnection(&cfg.Receiver)
if err != nil {
if err := receiverClient.HasFunds(); err != nil {
return err
}
defer receiverClient.Close()

infoResp, err := receiverClient.GetInfo()
if err != nil {
Expand Down
12 changes: 11 additions & 1 deletion run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

if [[ $1 == "" ]]
then
echo "usage: run.sh lnd-bbolt | lnd-bbolt-keysend | lnd-etcd | lnd-etcd-cluster | clightning | eclair"
echo "usage: run.sh lnd-bbolt | lnd-bbolt-keysend | lnd-etcd | lnd-etcd-notls | lnd-etcd-notls-keysend | lnd-etcd-cluster | clightning | eclair"
exit 0
fi

Expand All @@ -21,6 +21,16 @@ case $1 in
DOCKER_COMPOSE_FILE=docker-compose-etcd.yml
export LOADTEST_CONFIG_FILE=loadtest-lnd.yml
;;

"lnd-etcd-notls")
DOCKER_COMPOSE_FILE=docker-compose-etcd-notls.yml
export LOADTEST_CONFIG_FILE=loadtest-lnd.yml
;;

"lnd-etcd-notls-keysend")
DOCKER_COMPOSE_FILE=docker-compose-etcd-notls.yml
export LOADTEST_CONFIG_FILE=loadtest-lnd-keysend.yml
;;

"lnd-etcd-cluster")
DOCKER_COMPOSE_FILE=docker-compose-etcd-cluster.yml
Expand Down