Problems lauching node
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 !
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: https://github.com/base-org/node/blob/8690d2890381087881464b344b64e4ca5ada04b8/docker-compose.yml#L7-L8
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_PORTandCONTAINER_PORT. In the above example, fordb, theHOST_PORTis8001and the container port is5432(postgres default). Networked service-to-service communication uses theCONTAINER_PORT. WhenHOST_PORTis 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: https://github.com/base-org/node/blob/8690d2890381087881464b344b64e4ca5ada04b8/.env.goerli#L14
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"