0

I would like to set up private chain which both geth and parity clients running on the same network.

here is a sample repository with docker-compose file:

https://github.com/user48736353001/devnet

After running docker-compose up without any errors,

docker-compose.yml

version: '3'
services:
  geth:
    build: geth
    ports:
      - "8545:8545"
      - "8546:8546"
    expose:
      - '30303'
    restart: always
    networks:
      app_net:
        ipv4_address: 172.16.128.20

  node1:
    build: parity
    ports:
      - '18545:8545'
      - '18546:8546'
    expose:
      - '30300'
    user: 'root'
    networks:
      app_net:
        ipv4_address: 172.16.128.10

networks:
  app_net:
    driver: bridge
    ipam:
     driver: default
     config:
       - subnet: 172.16.128.0/24
  1. login to geth's docker container with docker exec
  2. attach geth with geth attach http://localhost:8545
  3. admin.addPeer("enode://027619e7cc4c94e606ccf1f3bf2b4750f39472c001f7266c681f652c25875312ea447eefdfeb18ea193c4258a948beae66cf71de05aa64ca1fb95bbbbcdc8b1a@172.16.128.10:30303")
  4. however admin.peers command returns empty []

Is there anything wrong with my genesis files? I took most of the initial setting from goerli testnet with different networkID.

0

according to your compose file, the parity peer should be "enode://.....@172.16.128.10:30300

| improve this answer | |
  • sorry it was a typo when i post this. Still not be able to connect in the same network. – kphex Nov 14 '19 at 2:20
  • Port should be ‘30300’, typo also? – Ha ĐANG Nov 14 '19 at 3:06
  • unfortunately yes. Just re-tried again and here are the commands: – kphex Nov 14 '19 at 4:19
  • $ docker exec -it devnet_geth_1 sh / # geth attach localhost:8545 > admin.add admin.addPeer admin.addTrustedPeer > admin.add admin.addPeer admin.addTrustedPeer > admin.addPeer("enode://84612bc106486afa56446aad5bb0b0ad4e4259dc421136174f19fd66542082ae831e3b3f6db63dd0130fef8fc6f771fa70e8111ef8d72a1dea172a2c1887da73@172.16.128.10:30300") true > admin.peers [] – kphex Nov 14 '19 at 4:21
  • But default port of parity might be 30303, not 30300 as your expose – Ha ĐANG Nov 14 '19 at 4:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.