Establishes connection with Moonchain blockchain node and publishes blockchain data to Synternet.
- Go compiler (v1.21).
- Moonchain node with accessible IPC or access to RPC.
- Publishing credentials. Learn more on the Synternet Portal.
make dep
make build
./moonchain-publisher --ipc-path /var/lib/moonchain/geth.ipc --prefix synternet
Environment variables can be passed to docker container. Flags can be passed as executable arguments.
Environment variable | Flag | Description |
---|---|---|
IPC_PATH | ipc-path | Moonchain node IPC path, e.g.: /tmp/geth.ipc |
NATS_URLS | nats-urls | (optional) NATS connection URLs to Synternet brokers, e.g.: nats://e.f.g.h . URL to broker. Default: testnet. |
NATS_NKEY | nats-nkey | NATS user NKEY, e.g.: SU..SI (58 chars). See here. |
NATS_JWT | nats-jwt | NATS user JWT, e.g.: eyJ... . See here. |
PUBLISHER_PREFIX | publisher-prefix | Stream prefix, usually your organisation, e.g.: synternet prefix results in synternet.moonchain.<tx,log-even,header,...> stream subjects. Stream prefix should be same as registered wallet alias. |
PUBLISHER_NAME | publisher-name | (optional) Stream publisher infix, e.g.: foo infix results in prefix.foo.<tx,log-even,header,...> stream subjects. Stream publisher infix should be same as registered publisher alias. Default: moonchain . |
Synternet uses NATS authentication model. NATS has an accounts level with users belonging to those accounts. To publish user level NKEY and JWT have to be used, which are generated from account.
- Acquire account level NKEY (in Synternet a.k.a.
access token
). See here. - Generate user level
NATS_NKEY
,NATS_JWT
from account level NKEY. Can be generated using user generator. - Pass generated
NATS_NKEY
andNATS_JWT
.
docker build -t moonchain-publisher -f docker/Dockerfile .
docker run --rm --env-file=.env -v /tmp/moonchain.ipc:/tmp/ethereum.ipc ghcr.io/synternet/moonchain-publisher:latest