version: "3.4"

services:
  duniter-rpc:
    image: duniter/duniter-v2s:sha-142d4763
    restart: unless-stopped
    ports:
      - "9615:9615"
      - "9933:9933"
      - "9944:9944"
      - "30333:30333"
    volumes:
      - ./duniter-rpc/:/var/lib/duniter/
    environment:
      - DUNITER_CHAIN_NAME=gdev
    command:
      - "--execution"
      - "Wasm"
      - "--node-key-file"
      - "/var/lib/duniter/node-key"
      - "--public-addr"
      # SERVER_IP should be replaced by the public IP of 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:sha-142d4763 key generate-node-key --file /var/lib/duniter/node-key.txt
      - "/ip4/SERVER_IP/tcp/30333/p2p/PEER_ID"
      - "--rpc-cors"
      - "all"

  duniter-validator:
    image: duniter/duniter-v2s:sha-142d4763
    restart: unless-stopped
    ports:
      - "9616:9615"
      - "127.0.0.1:9945:9944"
      - "30334:30333"
    volumes:
      - ./duniter-validator/:/var/lib/duniter/
    environment:
      - DUNITER_CHAIN_NAME=gdev
    command:
      - "--execution"
      - "Wasm"
      - "--node-key-file"
      - "/var/lib/duniter/node-key"
      - "--public-addr"
      # SERVER_IP should be replaced by the public IP of your server
      #
      # The PEER_ID should be replaced by the output of this command:
      # docker run --rm -it --entrypoint duniter -v $PWD/duniter-validator/:/var/lib/duniter/ duniter/duniter-v2s:sha-142d4763 key generate-node-key --file /var/lib/duniter/node-key.txt
      - "/ip4/SERVER_IP/tcp/30334/p2p/PEER_ID"
      - "--rpc-methods=Unsafe"
      - "--validator"
      - "--rpc-cors"
      - "all"
