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

Problems lauching node #79

Closed
0xZangetsudev opened this issue Jul 31, 2023 · 2 comments
Closed

Problems lauching node #79

0xZangetsudev opened this issue Jul 31, 2023 · 2 comments

Comments

@0xZangetsudev
Copy link

Hey everyone, I have followed your instructions in the README, i have my own geth node on ETH listening to port 8545 8546 and 8551 (http / wss / auth) but its the same port as this node, i have tried to change it in docker-compose.yml and in geth-entrypoint and op-node-entrypoint but after I got some problems with the client running indefinitely and saying ''waiting for geth''' because i think i have changed too many ports

Can someone guide me on which port to change (only http/wss or auth/udp/tcp as well etc?) and in which files ? Perhaps if you have the time I would love to understand more about the 'why' of this + what represent the : in the docker compose like ports 7545:8545 ? (why is it two different port)

Thanks !

@mdehoog
Copy link
Contributor

mdehoog commented Aug 1, 2023

If you are experiencing a port conflict with an existing Geth node running on ports 8545 and 8546, you can change the first number on these two lines:

- 8545:8545 # RPC
- 8546:8546 # websocket

The first number is the port on the local machine, and the second number is the port used by the binary running within the docker container. You can read more about this here: https://docs.docker.com/compose/networking/, in particular:

It is important to note the distinction between HOST_PORT and CONTAINER_PORT. In the above example, for db, the HOST_PORT is 8001 and the container port is 5432 (postgres default). Networked service-to-service communication uses the CONTAINER_PORT. When HOST_PORT is defined, the service is accessible outside the swarm as well.

Note that you do not have to change any of the configuration or entrypoint scripts, as the two containers communicate using docker DNS names, for example:

OP_NODE_L2_ENGINE_RPC=http://geth:8551

@mdehoog mdehoog closed this as completed Aug 1, 2023
@0xZangetsudev
Copy link
Author

services:
  geth: # this is Optimism's geth client
    build: .
    ports:
      - 8555:8545       # RPC
      - 8556:8546       # websocket
      - 30304:30304     # P2P TCP (currently unused)
      - 30304:30304/udp # P2P UDP (currently unused)
      - 7301:6060       # metrics
    command: [ "sh", "./geth-entrypoint" ]
    env_file:
      # select your network here:
#      - .env.goerli
      - .env.mainnet
  node:
    build: .
    depends_on:
      - geth
    ports:
      - 7545:8545     # RPC
      - 9222:9222     # P2P TCP
      - 9222:9222/udp # P2P UDP
      - 7300:7300     # metrics
      - 6060:6060     # pprof
    command: [ "sh", "./op-node-entrypoint" ]
    env_file:
      # select your network here:
#      - .env.goerli
      - .env.mainnet

my geth node is running on port 8545 and 8546 but I get :

node-node-1  | t=2023-08-18T05:16:43+0000 lvl=info msg="Initializing Rollup Node"
node-node-1  | t=2023-08-18T05:16:43+0000 lvl=warn msg="Unknown env var"          prefix=OP_NODE env_var="OP_NODE_L2_ENGINE_AUTH_RAW=688f5d737bad920bdfb2fc2f488d6b6209eebda1dae949a8de91398d932c517a"
node-node-1  | t=2023-08-18T05:16:43+0000 lvl=info msg="Rollup Config"            l2_chain_id=8453 l2_network="unknown L2" l1_chain_id=1 l1_network=mainnet l2_start_time=1,686,789,347 l2_block_hash=0xf712aa9241cc24369b143cf6dce85f0902a9731e70d66818a3a5845b296c73dd l2_block_number=0 l1_block_hash=0x5c13d307623a926cd31415036c8b7fa14572f9dac64528e857a470511fc30771 l1_block_number=17,481,768 regolith_time="@ genesis"
node-node-1  | t=2023-08-18T05:16:43+0000 lvl=eror msg="Error initializing the rollup node" err="Post \"http://localhost:8545\": dial tcp 127.0.0.1:8545: connect: connection refused"
node-node-1  | t=2023-08-18T05:16:43+0000 lvl=eror msg="Unable to create the rollup node"   error="Post \"http://localhost:8545\": dial tcp 127.0.0.1:8545: connect: connection refused"
node-node-1  | t=2023-08-18T05:16:43+0000 lvl=crit msg="Application failed"                 message="Post \"http://localhost:8545\": dial tcp 127.0.0.1:8545: connect: connection refused"

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

No branches or pull requests

2 participants