Skip to content
Snippets Groups Projects
Commit bca46fcd authored by Gilles Filippini's avatar Gilles Filippini
Browse files

docker: update docker-compose files

Using websocket address form (tcp/30333/ws) for the RPC node and TCP
form (tcp/30333) for the validator node, because as explained in the
node-template / substrate documentation [1], the default listen
addresses are:
* /ip4/0.0.0.0/tcp/<port> and /ip6/[::]/tcp/<port> when using --validator
* /ip4/0.0.0.0/tcp/<port>/ws and /ip6/[::]/tcp/<port>/ws otherwise.

[1] https://docs.substrate.io/reference/command-line-tools/node-template/

The argument of the '--public-addr' duniter option should not feature the
p2p endpoint part '/p2p/<PEER_ID>'. Duniter adds it automatically.

For example, when using:
  --public-addr /dns/gdev.example.com/tcp/30333/ws
you'll see this in the logs:
  Discovered new external address for our node:
    /dns/gdev.example.com/tcp/30333/ws/p2p/<PEER_ID>

When using:
  --public-addr /dns/gdev.example.com/tcp/30333/ws/p2p/<PEER_ID>
you'll see:
  Discovered new external address for our node:
    /dns/gdev.example.com/tcp/30333/ws/p2p/<PEER_ID>/p2p/<PEER_ID>
which is erroneous obviously.
parent 68c8731c
No related branches found
No related tags found
1 merge request!123docker: auto-generate node key file
# This is a docker template for running a gdev mirror
# You should write a .env file aside with the environment variables:
#
# --- .env ---
# SERVER_DOMAIN=gdev.example.com
# PEER_ID=1234XxxXXxxXxxxXxzbQqEkEpTPxD9S1PtpzkZSYoueyERA5vVtQ
# ------------
#
# The peer id has to be replaced withe the output of the following command
#
# >>> PEER_ID >>>
# docker run --rm -it --entrypoint duniter -v $PWD:/var/lib/duniter/ duniter/duniter-v2s:v0.4.0 key generate-node-key --file /var/lib/duniter/node.key
# <<<<<<<<<<<<<<<
version: "3.4"
version: "3.5"
services:
duniter-rpc:
......@@ -37,8 +25,7 @@ services:
- "/var/lib/duniter/node.key"
- "--public-addr"
# SERVER_DOMAIN should be replaced by a domain name that point on your server
# PEER_ID should be replaced by the output of the command given at the top of this file
- "/dns/${SERVER_DOMAIN?SERVER_DOMAIN should be set}/tcp/30333/p2p/${PEER_ID?PEER_ID should be set}"
- "/dns/${SERVER_DOMAIN?SERVER_DOMAIN should be set}/tcp/30333/ws"
- "--rpc-cors"
- "all"
......
version: "3.4"
version: "3.5"
services:
duniter-rpc:
......@@ -22,10 +22,7 @@ services:
- "--node-key-file=/var/lib/duniter/node.key"
- "--public-addr"
# SERVER_DOMAIN should be replaced by a domain name that point on your server
#
# The PEER_ID should be replaced by the output of this command:
# docker run --rm -it --entrypoint -v $PWD/duniter-rpc/:/var/lib/duniter/ duniter duniter/duniter-v2s:v0.4.0 key generate-node-key --file /var/lib/duniter/node.key
- "/dns/${SERVER_DOMAIN?SERVER_DOMAIN should be set}/tcp/30333/p2p/${PEER_ID?PEER_ID should be set}"
- "/dns/${SERVER_DOMAIN?SERVER_DOMAIN should be set}/tcp/30333/ws"
- "--rpc-cors=all"
duniter-validator:
......@@ -50,10 +47,7 @@ services:
- "--public-addr"
- "--pruning=14400"
# SERVER_DOMAIN should be replaced by a domain name that point on your server
#
# The VALIDATOR_PEER_ID should be replaced by the output of this command:
# docker run --rm -it --entrypoint -v $PWD/duniter-rpc/:/var/lib/duniter/ duniter duniter/duniter-v2s:v0.4.0 key generate-node-key --file /var/lib/duniter/node.key
- "/dns/${SERVER_DOMAIN?SERVER_DOMAIN should be set}/tcp/30333/p2p/${VALIDATOR_PEER_ID?VALIDATOR_PEER_ID should be set}"
- "/dns/${SERVER_DOMAIN?SERVER_DOMAIN should be set}/tcp/30333"
- "--rpc-cors=all"
- "--rpc-methods=Unsafe"
- "--validator"
version: "3.4"
version: "3.5"
services:
duniter-rpc:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment