Git Product home page Git Product logo

Comments (2)

mdehoog avatar mdehoog commented on July 28, 2024

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

from node.

0xZangetsudev avatar 0xZangetsudev commented on July 28, 2024
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"

from node.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.