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

Fix testnet docker-compose #17

Merged
merged 1 commit into from
Sep 24, 2020
Merged

Conversation

zoedberg
Copy link
Member

closes #14

Copy link
Member

@dr-orlovsky dr-orlovsky left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am bit confused with some changes, which diverge this file from the one we have for the mainnet. Can you pls explain rationale, and probably we will need to update mainnet compose after?

@@ -80,4 +80,4 @@ RUN groupadd -r bitcoin && useradd -r -m -g bitcoin bitcoin \

EXPOSE 8332 8333 18332 18333 18443 18444

ENTRYPOINT ["/bin/bash", "-c", "bitcoind -txindex -datadir=$BITCOIN_DATA"]
ENTRYPOINT ["bitcoind", "-txindex", "-datadir=/var/lib/bitcoind"]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not with env variable?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

because the entrypoint syntax we are using (exec form) doesn't expand env variables (unless you launch the comand with bash, as before).

the shell form of the command would be: ENTRYPOINT bitcoind -txindex -datadir=$BITCOIN_DATA, but this form has several drawbacks so I won't suggest to use that (https://docs.docker.com/engine/reference/builder/#entrypoint)

I had to remove bash -c to allow adding flags to the entrypoint via the command option

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had to remove bash -c to allow adding flags to the entrypoint via the command option

Strange, these options https://github.com/LNP-BP/docker/blob/master/docker-compose/mainnet/docker-compose.yml#L7-L8 were working with shell w/o any problems. I do not think that adding -testnet to them will render them not working...

What I'd like to achieve is not to (a) diverge different docker-compose and Dockerfiles between networks + (b) use ENV variables as much as possible

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll try to explain better:

using this entrypoint: ENTRYPOINT ["/bin/bash", "-c", "bitcoind -txindex -datadir=$BITCOIN_DATA"] the flags passed via the command option in the compose file were not added correctly to the command

using this entrypoint: ENTRYPOINT ["bitcoind", "-txindex", "-datadir=/var/lib/bitcoind"] command options are correctly added to the entrypoint command, but this syntax doesn't allow env variables like $BITCOIN_DATA

it's not adding -testnet that makes command options not working.

another problem was with the list form:

command:
      - "-rpcuser=bitcoin -rpcpassword=bitcoin"

with this form, when I tried to perform a call to bitcoind (from the container itself) it was telling me that the credentials were wrong. When I switched to this form:

command: "-rpcuser=bitcoin -rpcpassword=bitcoin"

the internal calls started to work. So I suppose the options were just ignored, do you have any documentation about the list form being supported by docker-compose?

I agree with your requirements, but being mainnet the default network of pretty much everything, some dockerfiles changes were needed in order to let them work also on testnet.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the detailed explanation. I do not get what happens with this command thing; I clearly can connect to the bitcoind with bitcoin-cli set up with the same user and password...

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

UPD: see my complete logs in the last comments, may be they can help to figure out what's going on

Copy link
Member

@dr-orlovsky dr-orlovsky Sep 24, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, I think I am getting what happens with env variable: it is expanded during Dockerfile build and within the image we don't have it anymore. That's why it is "working" even when no bash is used in ENTRYPOINT. To get it working like a real environment variable we need to use ${BITCOIN_DATA} form, not just $BITCOIN_DATA.

However here BITCOIN_DATA is used for a single purpose: make sure that all paths within Dockerfile are the same, and that tools (like bitcoin-cli) can automatically get that path when started within tcontainer. So we do not need it to expand and you can safely leave it here even when no bash is used.

The -rpcpath compose command is another story, which I will research later.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pls disregard my previous comment, I was wrong: https://docs.docker.com/engine/reference/builder/#cmd

@@ -35,9 +35,9 @@ RUN apt-get update -y \

COPY --from=builder /usr/local/cargo/bin/electrs /usr/local/bin

ENV BITCOIN_DATA=/var/lib/bitcoin
ENV BITCOIN_DATA=/var/lib/bitcoind
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will require changes to all docker-compose files using electrs, including mainnet. Otherwise they will break

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as you can see from this grep, both paths (/var/lib/bitcoin and /var/lib/bitcoind) are used:

git grep "/var/lib/bitcoin"
Dockerfile/bitcoind-signet/Dockerfile:VOLUME "/var/lib/bitcoin"
Dockerfile/bitcoind-signet/Dockerfile:ENV BITCOIN_DATA=/var/lib/bitcoin
Dockerfile/bitcoind/Dockerfile:VOLUME "/var/lib/bitcoind"
Dockerfile/bitcoind/Dockerfile:ENV BITCOIN_DATA=/var/lib/bitcoind
Dockerfile/bitcoind/Dockerfile:ENTRYPOINT ["bitcoind", "-txindex", "-datadir=/var/lib/bitcoind"]
Dockerfile/bitcoind/with-wallet/Dockerfile:VOLUME "/var/lib/bitcoind"
Dockerfile/bitcoind/with-wallet/Dockerfile:ENV BITCOIN_DATA=/var/lib/bitcoind
Dockerfile/electrs-signet/Dockerfile:ENV BITCOIN_DATA=/var/lib/bitcoin
Dockerfile/electrs-signet/Dockerfile:VOLUME "/var/lib/bitcoind"
Dockerfile/electrs/Dockerfile:ENV BITCOIN_DATA=/var/lib/bitcoind
Dockerfile/electrs/Dockerfile:VOLUME "/var/lib/bitcoind"
README.md:docker volume create --driver local --opt o=bind --opt type=none --opt device=/var/lib/bitcoin bitcoin 
README.md:      - "blockchain:/var/lib/bitcoind"
README.md:      - "/Volumes/ExternalDrive/bitcoin:/var/lib/bitcoind"
README.md:  -v /Volumes/ExternalDrive/bitcoin:/var/lib/bitcoind \
docker-compose/mainnet/docker-compose.yml:      - bitcoin:/var/lib/bitcoind
docker-compose/mainnet/docker-compose.yml:        target: /var/lib/bitcoin
docker-compose/signet/docker-compose.yml:      - bitcoin:/var/lib/bitcoin
docker-compose/signet/docker-compose.yml:        target: /var/lib/bitcoin
docker-compose/testnet/docker-compose.yml:      - bitcoin:/var/lib/bitcoind
docker-compose/testnet/docker-compose.yml:        target: /var/lib/bitcoind

they all should be the same, so tell me which path do you prefer and I'll update this PR

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, there is inconsistency here, but I was not proofing it not to break other things. This change breaks electrs image for current mainnet compose file and will require to change both mainnet and signet compose files + electrs Dockerfile for signet.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok let's stick with /var/lib/bitcoin so we don't need to change mainnet compose and electrs dockerfile, I'll fix the path in the testnet compose and everywhere I see /var/lib/bitcoind

@@ -47,7 +47,7 @@ RUN groupadd -r electrs && useradd -r -m -g electrs electrs \
&& chmod 700 "$ELECTRS_DATA" \
&& chown -R electrs:electrs "$ELECTRS_DATA"

VOLUME "/var/lib/bitcoin"
VOLUME "/var/lib/bitcoind"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See above

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as above

ENV ELECTRS_DATA=/var/lib/electrs
ENV ELECTRS_CONF=/etc/electrs/electrs.toml
ENV ELECTRS_CONF=/etc/electrs/config.toml
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Once we are using default config there is no need in ENV variable, which is not used anymore.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It could be error-prone to specify the same path in one place with environment variable and in the other place with string literal. I think we need to stick to some one way of doing it...

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see /etc/electrs/config.toml as string literal anywhere except in the ELECTRS_CONF variable assignment

@@ -62,4 +62,4 @@ EXPOSE 4222

STOPSIGNAL SIGINT

ENTRYPOINT ["/bin/bash", "-c", "/usr/local/bin/electrs -vvvv --daemon-dir $BITCOIN_DATA --db-dir $ELECTRS_DATA --conf $ELECTRS_CONF "]
ENTRYPOINT ["/bin/bash", "-c", "/usr/local/bin/electrs -vvvv --daemon-dir $BITCOIN_DATA --db-dir $ELECTRS_DATA"]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we need "/bin/bash", while Bitcoin Core can be launched w/o it?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

when using this image we don't need to add extra flags via the command option, since a way to change most of the configuration options is already provided (via env variables in the form of ELECTRS_)

- "-rpcuser=bitcoin -rpcpassword=bitcoin"
command: "-rpcuser=bitcoin -rpcpassword=bitcoin -testnet \
-rpcbind=0.0.0.0 -rpcallowip=172.16.0.0/12 \
-rpcallowip=192.168.0.0/16 -rpcallowip=10.0.0.0/8"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We are not using this config in main net, why do we need it here? I expect this may break with docker updates; AFAIR there is no guarantee that docker will always stick to these IP ranges (especially with 172.16)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AFAIK docker always sticks to private addresses, so addresses that are in the ranges 172.16.0.0 – 172.31.255.255, 192.168.0.0 – 192.168.255.255 and 10.0.0.0 – 10.255.255.255. the rpcallowip option is needed in order to allow RPC requests from those IPs (c-lightning would not work without these options)

moreover the command option doesn't work if specified as a list

I've never tried the mainnet dockerization, are you sure it's working?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am absolutely sure that both mainnet and signet Dockerfiles and docker-composes are all working - I spent two days debugging it and now they are running on both mac Macbook and server

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that's strange, c-lightning should not be able to connect to bitcoind without the rpcallowip option.

are you sure you're running the stack from current master?

I should have a mainnet chain somewhere, I'll test the compose in order to confirm your statement (don't trust, verify 😉)

@@ -25,7 +26,7 @@ services:
environment:
ELECTRS_NETWORK: "testnet"
ELECTRS_DAEMON_RPC_ADDR: "bitcoind-testnet:18332"
ELECTRS_ELECTRUM_RPC_ADDR: "electrs-testnet:60001"
ELECTRS_ELECTRUM_RPC_ADDR: "0.0.0.0:60001"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why we change this?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I usually make services running in docker listening on 0.0.0.0 otherwise remote calls would fail in most of the cases.

so I've assumed this applied to electrs too, but I've just checked and it also works with electrs-testnet, so I'll revert this change. sorry for the mistake

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I really like to stick to one way of doing this + it works well with limiting connectivity just to specific docker-compose network (since there could be many other bitcoind etc images running in parallel)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

using 0.0.0.0 is, in my opinion, the best way to stick to if you are searching uniformity. this would not cause any problems even with more instances of bitcoind running in the same network

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But I am right that it will cause issues with many bitcoind mainnet containers running on the same machine?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A docker container represents a machine, many different containers defined in a compose file represent different machines connected to a common private network. So they can all bind a service to the same IP and port (e.g. 0.0.0.0:18332).

Then if you expose ports on the machine running the docker containers you'll need to expose them on different ports (18332:18332 , 18333:18332, 18334:18332, and so on) because they're all going to listen on the same host address (typically localhost).

If you just expose ports on the common private network they can all expose 18332 because, as said before, each container is a different machine

@zoedberg
Copy link
Member Author

I am bit confused with some changes, which diverge this file from the one we have for the mainnet. Can you pls explain rationale, and probably we will need to update mainnet compose after?

I've made the minimum changes in order to get all the services working on testnet (except for LIGHTNING_NETWORK_FLAG value, that was already ok but I've changed it because it's the documented way).

I think that the mainnet compose was already in need of some fixes, but if you think that before my changes it was working, let's have a chat about it

@@ -80,4 +80,4 @@ RUN groupadd -r bitcoin && useradd -r -m -g bitcoin bitcoin \

EXPOSE 8332 8333 18332 18333 18443 18444

ENTRYPOINT ["/bin/bash", "-c", "bitcoind -txindex -datadir=$BITCOIN_DATA"]
ENTRYPOINT ["bitcoind", "-txindex", "-datadir=/var/lib/bitcoind"]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had to remove bash -c to allow adding flags to the entrypoint via the command option

Strange, these options https://github.com/LNP-BP/docker/blob/master/docker-compose/mainnet/docker-compose.yml#L7-L8 were working with shell w/o any problems. I do not think that adding -testnet to them will render them not working...

What I'd like to achieve is not to (a) diverge different docker-compose and Dockerfiles between networks + (b) use ENV variables as much as possible

@@ -35,9 +35,9 @@ RUN apt-get update -y \

COPY --from=builder /usr/local/cargo/bin/electrs /usr/local/bin

ENV BITCOIN_DATA=/var/lib/bitcoin
ENV BITCOIN_DATA=/var/lib/bitcoind
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, there is inconsistency here, but I was not proofing it not to break other things. This change breaks electrs image for current mainnet compose file and will require to change both mainnet and signet compose files + electrs Dockerfile for signet.

ENV ELECTRS_DATA=/var/lib/electrs
ENV ELECTRS_CONF=/etc/electrs/electrs.toml
ENV ELECTRS_CONF=/etc/electrs/config.toml
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It could be error-prone to specify the same path in one place with environment variable and in the other place with string literal. I think we need to stick to some one way of doing it...

- "-rpcuser=bitcoin -rpcpassword=bitcoin"
command: "-rpcuser=bitcoin -rpcpassword=bitcoin -testnet \
-rpcbind=0.0.0.0 -rpcallowip=172.16.0.0/12 \
-rpcallowip=192.168.0.0/16 -rpcallowip=10.0.0.0/8"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am absolutely sure that both mainnet and signet Dockerfiles and docker-composes are all working - I spent two days debugging it and now they are running on both mac Macbook and server

@@ -25,7 +26,7 @@ services:
environment:
ELECTRS_NETWORK: "testnet"
ELECTRS_DAEMON_RPC_ADDR: "bitcoind-testnet:18332"
ELECTRS_ELECTRUM_RPC_ADDR: "electrs-testnet:60001"
ELECTRS_ELECTRUM_RPC_ADDR: "0.0.0.0:60001"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I really like to stick to one way of doing this + it works well with limiting connectivity just to specific docker-compose network (since there could be many other bitcoind etc images running in parallel)

@dr-orlovsky
Copy link
Member

dr-orlovsky commented Sep 23, 2020

Here is my setup: using the latest master from GitHub and running compose files:

orlovsky@pandora:/usr/local/src/docker$ git status
On branch master
Your branch is up to date with 'origin/master'.

nothing to commit, working tree clean
orlovsky@pandora:/usr/local/src/docker$ git fetch origin
orlovsky@pandora:/usr/local/src/docker$ cd docker-compose/mainnet/
orlovsky@pandora:/usr/local/src/docker/docker-compose/mainnet$ docker-compose ps
       Name                     Command               State                                             Ports                                           
--------------------------------------------------------------------------------------------------------------------------------------------------------
bitcoind-mainnet     /bin/bash -c bitcoind -txi ...   Up      18332/tcp, 18333/tcp, 18443/tcp, 18444/tcp, 0.0.0.0:8332->8332/tcp, 0.0.0.0:8333->8333/tcp
electrs-mainnet      /bin/bash -c /usr/local/bi ...   Up      4222/tcp, 4223/tcp, 0.0.0.0:4224->4224/tcp, 0.0.0.0:50001->50001/tcp, 60001/tcp, 60002/tcp
elementsd-liquidv1   /usr/local/bin/entrypoint  ...   Up      0.0.0.0:7041->7041/tcp, 0.0.0.0:7042->7042/tcp                                            
lightningd-mainnet   /bin/bash -c lightningd $L ...   Up      0.0.0.0:9735->9735/tcp, 9835/tcp                                                          
orlovsky@pandora:/usr/local/src/docker/docker-compose/mainnet$ cd ../signet/
orlovsky@pandora:/usr/local/src/docker/docker-compose/signet$ docker-compose ps
      Name                     Command               State                         Ports                       
---------------------------------------------------------------------------------------------------------------
bitcoind-signet     /bin/bash -c bitcoind -txi ...   Up      0.0.0.0:38332->38332/tcp, 0.0.0.0:38333->38333/tcp
electrs-signet      /bin/bash -c /usr/local/bi ...   Up      0.0.0.0:34224->34224/tcp, 0.0.0.0:60601->60601/tcp
lightningd-signet   /bin/bash -c lightningd $L ...   Up      0.0.0.0:39735->9735/tcp, 9835/tcp                 
orlovsky@pandora:/usr/local/src/docker/docker-compose/signet$ docker ps
CONTAINER ID        IMAGE                                 COMMAND                  CREATED             STATUS              PORTS                                                                              NAMES
f24b49cb205d        lnpbp/electrs:latest                  "/bin/bash -c '/usr/…"   4 days ago          Up 7 minutes        0.0.0.0:4224->4224/tcp, 4222-4223/tcp, 60001-60002/tcp, 0.0.0.0:50001->50001/tcp   electrs-mainnet
f16344761f57        lnpbp/lightningd:signet               "/bin/bash -c 'light…"   4 days ago          Up 7 minutes        9835/tcp, 0.0.0.0:39735->9735/tcp                                                  lightningd-signet
a60d8762888c        lnpbp/elementsd:latest                "/usr/local/bin/entr…"   4 days ago          Up 7 minutes        0.0.0.0:7041-7042->7041-7042/tcp                                                   elementsd-liquidv1
fdfb02846fcf        lnpbp/electrs:signet                  "/bin/bash -c '/usr/…"   4 days ago          Up 7 minutes        0.0.0.0:34224->34224/tcp, 0.0.0.0:60601->60601/tcp                                 electrs-signet
55afc1bc405e        lnpbp/bitcoind:signet                 "/bin/bash -c 'bitco…"   4 days ago          Up 7 minutes        0.0.0.0:38332-38333->38332-38333/tcp                                               bitcoind-signet
9d05b63cc9eb        lnpbp/lightningd:latest               "/bin/bash -c 'light…"   4 days ago          Up 28 seconds       0.0.0.0:9735->9735/tcp, 9835/tcp                                                   lightningd-mainnet
0526b717a1c9        lnpbp/bitcoind:latest                 "/bin/bash -c 'bitco…"   4 days ago          Up 7 minutes        18332-18333/tcp, 0.0.0.0:8332-8333->8332-8333/tcp, 18443-18444/tcp                 bitcoind-mainnet
orlovsky@pandora:/usr/local/src/docker/docker-compose/signet$ cat ~/.bash_aliases 
#!/bin/bash

alias bitcoin-cli='docker exec bitcoind-mainnet bitcoin-cli -rpcpassword=bitcoin -rpcuser=bitcoin'
alias lightning-cli='docker exec lightningd-mainnet lightning-cli --mainnet --lightning-dir /var/lib/lightningd'
alias liquid-cli='docker exec elementsd-liquidv1 elements-cli -chain=liquidv1 -rpccookiefile=/var/lib/elementsd/liquidv1/.cookie'
alias signet-cli='docker exec bitcoind-signet bitcoin-cli --signet -rpcpassword=bitcoin -rpcuser=bitcoin'
alias sightning-cli='docker exec lightningd-signet lightning-cli --signet --lightning-dir /var/lib/lightningd'

orlovsky@pandora:/usr/local/src/docker/docker-compose/signet$ lightning-cli getinfo
{
   "id": "0341ec8fb266ebcacde1a2b68bfa59fd22fcce36cc04f3e6685234f0d09e6f5b73",
   "alias": "ANGRYGLEE",
   "color": "0341ec",
   "num_peers": 0,
   "num_pending_channels": 0,
   "num_active_channels": 0,
   "num_inactive_channels": 0,
   "address": [],
   "binding": [
      {
         "type": "ipv6",
         "address": "::",
         "port": 9735
      },
      {
         "type": "ipv4",
         "address": "0.0.0.0",
         "port": 9735
      }
   ],
   "version": "v0.9.1",
   "blockheight": 649653,
   "network": "bitcoin",
   "msatoshi_fees_collected": 0,
   "fees_collected_msat": "0msat",
   "lightning-dir": "/var/lib/lightningd/bitcoin"
}
orlovsky@pandora:/usr/local/src/docker/docker-compose/signet$ sightning-cli getinfo
{
   "id": "03787bddbba4bbae8133a164fa6db5de0f267e9bffe96695bc1e1c47a7b8e3d4ff",
   "alias": "ORANGESEAGULL",
   "color": "03787b",
   "num_peers": 1,
   "num_pending_channels": 0,
   "num_active_channels": 1,
   "num_inactive_channels": 0,
   "address": [],
   "binding": [
      {
         "type": "ipv6",
         "address": "::",
         "port": 9735
      },
      {
         "type": "ipv4",
         "address": "0.0.0.0",
         "port": 9735
      }
   ],
   "version": "v0.9.1-modded",
   "blockheight": 4529,
   "network": "signet",
   "msatoshi_fees_collected": 0,
   "fees_collected_msat": "0msat",
   "lightning-dir": "/var/lib/lightningd/signet"
}
orlovsky@pandora:/usr/local/src/docker/docker-compose/signet$ sightning-cli listpeers
{
   "peers": [
      {
         "id": "03b52d411e1f301e379df62d9730f93da77b5165b92d54e7a6498b71e1caf240ee",
         "connected": true,
         "netaddr": [
            "[::ffff:84.227.80.57]:62296"
         ],
         "features": "02aaa2",
         "channels": [
            {
               "state": "CHANNELD_NORMAL",
               "scratch_txid": "3dba4def82c9faa58a51306db1dd139e2af13c26cd984d8ce8b9a90da6744ee8",
               "owner": "channeld",
               "short_channel_id": "3939x1x0",
               "direction": 0,
               "channel_id": "fd2e4a4f2369fa342deb069810f1ee2b88d859d3f382a55738fa8453b5b11c4f",
               "funding_txid": "4f1cb1b55384fa3857a582f3d359d8882beef1109806eb2d34fa69234f4a2efd",
               "close_to_addr": "tb1qkyt3rwngtt2gy9exmytv0udczq4uzu2kmhdrmm",
               "close_to": "0014b11711ba685ad4821726d916c7f1b8102bc17156",
               "private": false,
               "features": [
                  "option_static_remotekey"
               ],
               "funding_allocation_msat": {
                  "03787bddbba4bbae8133a164fa6db5de0f267e9bffe96695bc1e1c47a7b8e3d4ff": 0,
                  "03b52d411e1f301e379df62d9730f93da77b5165b92d54e7a6498b71e1caf240ee": 1000000000
               },
               "funding_msat": {
                  "03787bddbba4bbae8133a164fa6db5de0f267e9bffe96695bc1e1c47a7b8e3d4ff": "0msat",
                  "03b52d411e1f301e379df62d9730f93da77b5165b92d54e7a6498b71e1caf240ee": "1000000000msat"
               },
               "msatoshi_to_us": 0,
               "to_us_msat": "0msat",
               "msatoshi_to_us_min": 0,
               "min_to_us_msat": "0msat",
               "msatoshi_to_us_max": 0,
               "max_to_us_msat": "0msat",
               "msatoshi_total": 1000000000,
               "total_msat": "1000000000msat",
               "dust_limit_satoshis": 546,
               "dust_limit_msat": "546000msat",
               "max_htlc_value_in_flight_msat": 18446744073709551615,
               "max_total_htlc_in_msat": "18446744073709551615msat",
               "their_channel_reserve_satoshis": 10000,
               "their_reserve_msat": "10000000msat",
               "our_channel_reserve_satoshis": 10000,
               "our_reserve_msat": "10000000msat",
               "spendable_msatoshi": 0,
               "spendable_msat": "0msat",
               "receivable_msatoshi": 989460000,
               "receivable_msat": "989460000msat",
               "htlc_minimum_msat": 0,
               "minimum_htlc_in_msat": "0msat",
               "their_to_self_delay": 6,
               "our_to_self_delay": 6,
               "max_accepted_htlcs": 483,
               "status": [
                  "CHANNELD_NORMAL:Reconnected, and reestablished.",
                  "CHANNELD_NORMAL:Funding transaction locked. Channel announced."
               ],
               "in_payments_offered": 0,
               "in_msatoshi_offered": 0,
               "in_offered_msat": "0msat",
               "in_payments_fulfilled": 0,
               "in_msatoshi_fulfilled": 0,
               "in_fulfilled_msat": "0msat",
               "out_payments_offered": 0,
               "out_msatoshi_offered": 0,
               "out_offered_msat": "0msat",
               "out_payments_fulfilled": 0,
               "out_msatoshi_fulfilled": 0,
               "out_fulfilled_msat": "0msat",
               "htlcs": []
            }
         ]
      }
   ]
}

@dr-orlovsky
Copy link
Member

@zoedberg What I propose is to minimize changes in this commit such that we need no changes to mainnet/signet or Docker container republication, then agree onto design principles in #19 and do the rest of changes as a part of #20

@zoedberg
Copy link
Member Author

Here is my setup: using the latest master from GitHub and running compose files:

Sorry for insisting, but I believe you're not running what you think. I'm pretty sure it can't work correctly with the code in master.

A git fetch is not enough to make sure that you're running the latest code. A more thorough test would include rebuilding and restarting the whole stack, so please go to /usr/local/src/docker/docker-compose/mainnet and then run:

docker-compose build
docker-compose down
docker-compose up

@dr-orlovsky dr-orlovsky merged commit 6448aec into LNP-BP:master Sep 24, 2020
@dr-orlovsky
Copy link
Member

Sorry Zoe, I read through the docs and in most cases here you were right. I did my own take on docker refactoring with this PR and I will update your testnet work to match the new builds: https://github.com/LNP-BP/docker/pull/21/files

@zoedberg
Copy link
Member Author

Don't worry, I'm happy that we now agree :) I'll soon add info/suggestions to #19 so we can reach the desired design

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add testnet docker-compose
2 participants