ĞDev3 smiths

@smiths-GDev you now have the duniter/duniter-v2s:sha-f442e6eb docker image with the good bootnodes and the good genesis. I did not tested, but you can :wink:

Here is an example of docker-compose.yml file to start a rpc and a validator node

# This is a docker template for running a gdev5 mirror and smith
# You should write a .env file aside with the environment variables:
#
# --- .env ---
# SERVER_DOMAIN=gdev.example.com
# PEER_ID=12D3KooWL7J8B2pUfgH2xhm8kpB88CiSNsSNHcWJJ6NdNffSg5ty
# VALIDATOR_PEER_ID=12D3KooWNyFo34PSHcg4cNd3d3MRs3dm1w3hQqo3QuFptd3DXW6H
# ------------
#
# The peer id has to be replaced withe the output of the following command
#
# Generate node.key and peer id
# >>> PEER_ID >>>
# docker run --rm -it --entrypoint duniter -v $PWD:/var/lib/duniter/ duniter/duniter-v2s:sha-f442e6eb key generate-node-key --file /var/lib/duniter/node.key
# >>> VALIDATOR_PEER_ID >>>
# docker run --rm -it --entrypoint duniter -v $PWD:/var/lib/duniter/ duniter/duniter-v2s:sha-f442e6eb key generate-node-key --file /var/lib/duniter/node.key
# <<<<<<<<<<<<<<<>>>>>>>>>>

version: "3.4"

services:
  
  # ===== RPC =====
  duniter-rpc:
    image: duniter/duniter-v2s:sha-f442e6eb
    restart: unless-stopped
    ports:
      # telemetry
      - 9615:9615
      # rpc
      - 9933:9933
      # rpc-ws
      - 9944:9944
      # p2p
      - 30333:30333
    volumes:
      - ./duniter-rpc/:/var/lib/duniter/
    environment:
      - DUNITER_CHAIN_NAME=gdev
    command:
      - "--node-key-file=/var/lib/duniter/node.key"
      - "--public-addr"
      - "/dns/${SERVER_DOMAIN?SERVER_DOMAIN should be set}/tcp/30333/p2p/${PEER_ID?PEER_ID should be set}"
      - "--rpc-cors=all"
      - "--pruning=14400"
      - "--name"
      - "hugo-trentesaux-rpc"

  # ===== VALIDATOR =====
  duniter-validator:
    image: duniter/duniter-v2s:sha-f442e6eb
    restart: unless-stopped
    ports:
      # telemetry
      - 9616:9615
      # rpc
      - 9934:9933
      # rpc-ws
      - 9945:9944
      # p2p
      - 30334:30333
    volumes:
      - ./duniter-validator/:/var/lib/duniter/
    environment:
      - DUNITER_CHAIN_NAME=gdev
    command:
      - "--node-key-file=/var/lib/duniter/node.key"
      - "--rpc-cors=all"
      - "--rpc-methods=Unsafe"
      - "--validator"
      - "--pruning=14400"
      - "--name"
      - "hugo-trentesaux-validator"
  • read and apply the documentation at the head of the file
  • note that I did not tested it, there might be errors
  • change the --name option with your name so that we can more easily debug the network
  • depending on your docker installation, there might be access rights issues
  • I do not provide nginx config, there is one in Duniter documentation

You should have everything needed to start a node. Please do not go online yet, you still have to rotate your session keys as mentioned in the documentation (that could be improved).

4 Likes