Gossip Syncer
harder

The gossip-syncer subscribes to one or multiple Core Lightning nodes nodes running the gossip-publisher-zmq plugin.

Setup

We will start by setting up the directory structure and continue with the docker container

Create directory

From the project root we create the gossip-syncer directory with the following command.

ln-history@host:~/ln-historymkdir gossip-syncer && cd gossip-syncer

Environment variablesauthentication

Create an .env file and fill in your credentials.

KAFKA_SERVER_IP_ADDRESS=YOUR_SERVER_IP
KAFKA_SERVER_PORT=9092

KAFKA_SSL_PASSWORD=YOUR_KAFKA_SSL_PASSWORD
KAFKA_SASL_PLAIN_USERNAME=YOUR_KAFKA_SALS_USER_NAME
KAFKA_SASL_PLAIN_PASSWORD=YOUR_KAFKA_SASL_PASSWORD

KAFKA_TOPIC_TO_PUSH='gossip'

# Fill in the connection to the zmq-pub socket in this array, one object per node.
ZMQ_SOURCES=[{"host": "127.0.0.1", "port": 5675, "topic": ""}, {"host": "127.0.0.1", "port": 5676, "topic": ""}, {"host": "127.0.0.1", "port": 5677, "topic": ""}]

VALKEY_HOST=YOUR_VALKEY_CACHE_IP_ADDRESS
VALKEY_PORT=6379
VALKEY_PASSWORD=YOUR_VALKEY_CACHE_AUTHENTICATION_PASSWORD

🔐 Important: Never commit .env files containing credentials to version control.

🐳 Docker container

Create the docker-compose.yml and paste the following content into it.

services:
  app:
    image: ghcr.io/ln-history/gossip-syncer:latest
    container_name: gossip-syncer
    restart: always
    ports:
      - '6789:8080' (?)
    environment:
      - KAFKA_SERVER_IP_ADDRESS=${KAFKA_SERVER_IP_ADDRESS}
      - KAFKA_SERVER_PORT=${KAFKA_SERVER_PORT}
      - KAFKA_SSL_PASSWORD=${KAFKA_SSL_PASSWORD}
      - KAFKA_SASL_PLAIN_USERNAME=${KAFKA_SASL_PLAIN_USERNAME}
      - KAFKA_SASL_PLAIN_PASSWORD=${KAFKA_SASL_PLAIN_PASSWORD}
      - KAFKA_TOPIC_TO_PUSH=${KAFKA_TOPIC_TO_PUSH}
      - ZMQ_SOURCES=${ZMQ_SOURCES}
      - VALKEY_HOST=${VALKEY_HOST}
      - VALKEY_PORT=${VALKEY_PORT}
      - VALKEY_PASSWORD=${VALKEY_PASSWORD}
    env_file:
      - .env
    pull_policy: always

Folder structure

Ultimatly the folder structure should look like this:

gossip-syncer/
├── docker-compose.yml      # Docker setup for this service
└── .env                    # Environment variables for the service

Run

We start the container by using docker compose up -d (The flag -d abbreviates deamon, meaning background process).

ln-history@host:~/ln-history/gossip-syncerdocker compose up -d

Verify

See the logs of the docker container.

ln-history@host:~/ln-history/gossip-syncerdocker compose logs -f --tail=100

???