Skip to content

Latest commit

 

History

History
45 lines (32 loc) · 2.13 KB

README.md

File metadata and controls

45 lines (32 loc) · 2.13 KB

Modified go-ethereum for logging

This is a modified go-ethereum client that logs messages sent/received, active peer information as well as information about the maintained peer table.

Run with Docker

Setting up folder structure for logs

Identify a location where you want to store your logging information. Create this directory and make sure to specify it's path in the docker-compose.yaml file as explained in the next section.

Docker Compose

The easiest way to use our modified go-ethereum client is by adapting the docker-compose.yaml file.

  geth: 
    build: ./
    volumes:
      - /data-ssd/ethData/:/data
      - /data-ssd/ethereum/:/jwt 
      - /data-ssd/logs/:/logs_path
    network_mode: host 
    ports:
      - "8545:8545"
      - "8546:8546"
      - "30303:30303"
      - "30303/udp:30303/udp"
    restart: unless-stopped
  1. Replace /data-ssd/ethData/ with the path of the directory where you want the data directory to reside.
  2. Replace /data-ssd/ethereum/ with the path to the jwt.hex file that contains the token generated by the execution client.
  3. Replace /data-ssd/logs/ with the path of the directory where you want all logging information to be stored.
  4. The --network parameter should be modified accordingly so that the execution and beacon nodes are on the same network. Otherwise communication will be impaired.
  5. Ports usually don't have to be changed.

Given a properly configured docker-compose.yaml file it can be started with docker-compose up -d and stopped with docker-compose down, it is possible to see the execution results of a running container by using the docker ps command to get the id of the container and then attaching to the logging functionality with the command docker logs -f image-id

Alternative 1: Run outside Docker

To build the client, run make geth.

To run the client, firstly ensure a jwt secret has been generated and then run ./geth --config config.yaml. The flags are set in the config file.

Secondly, make sure that the LOG_BASEPATH is also changed accordingly inside go-ethereum/loggy/logger.go.