Managed node on GCP Blockchain Node Engine
When to use this: you want to run the Generator client against GCP Blockchain Node Engine or another managed node provider, authenticating with an API key header.
These scenarios use Ethereum Mainnet and Geth. Ethereum is the only officially supported chain today, but any EVM-compatible chain should work by changing chain.name and pointing the RPC URLs at a compatible node. See the chain config for details.
Topology
The Generator runs on its own VM and connects to GCP Blockchain Node Engine over HTTPS. GCP BNE requires an API key in the x-goog-api-key header. The Generator sends this header on every JSON-RPC and WebSocket request. Data flows out to Hosts over P2P.
Prerequisites
- Docker installed on the VM.
- A GCP Blockchain Node Engine instance provisioned. See the GCP documentation for setup.
- Your GCP API key for the BNE instance.
- Port 9171 open for P2P traffic from Hosts. Port 8080 open for health and metrics if you want to monitor externally.
Compose file
This compose file is drawn from docker-compose-prod.yml in the shinzo-generator-client repo. Replace <YOUR_API_KEY_HERE> with your GCP API key:
networks:
shinzo-net:
driver: bridge
services:
shinzo-generator:
container_name: shinzo-generator
platform: linux/amd64
image: ghcr.io/shinzonetwork/shinzo-generator-client:standard
user: "1001:1001"
restart: unless-stopped
networks:
- shinzo-net
mem_limit: 16g
mem_reservation: 13g
ports:
- "9171:9171"
volumes:
- ~/shinzo-data/defradb:/app/.defra
environment:
- GETH_RPC_URL=https://json-rpc.aouzyll7wj7e9xe4g7t82w88c.blockchainnodeengine.com
- GETH_WS_URL=wss://ws.aouzyll7wj7e9xe4g7t82w88c.blockchainnodeengine.com
- GETH_API_KEY=<YOUR_API_KEY_HERE>
- GETH_API_KEY_TYPE=x-goog-api-key
- INDEXER_START_HEIGHT=0
- DEFRADB_KEYRING_SECRET=pingpong
- GOMEMLIMIT=14GiB
- SNAPSHOT_ENABLED=false
- SCHEMA_AUTH_MODE=none
logging:
options:
max-size: "50m"
max-file: "3"
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8080/health"]
interval: 30s
timeout: 10s
retries: 3
start_period: 60s
What each value means
GETH_RPC_URLandGETH_WS_URL: Your GCP BNE endpoints. Replace the example URLs with your own BNE instance URLs. See geth config.GETH_API_KEY=<YOUR_API_KEY_HERE>: Your GCP API key. Replace this with the actual key from your GCP console. See geth config.GETH_API_KEY_TYPE=x-goog-api-key: The header name GCP BNE expects for authentication. See geth config.INDEXER_START_HEIGHT=0: Start indexing from the chain tip. See indexer config.DEFRADB_KEYRING_SECRET=pingpong: Encryption secret for the DefraDB keyring. Change this to your own secret and keep it consistent across restarts. See defradb config.GOMEMLIMIT=14GiB: Go runtime soft memory limit. Set below the containermem_limitto leave headroom for non-Go memory. See env vars.SNAPSHOT_ENABLED=false: Disable snapshots. Enable if you want the Generator to produce snapshot files for Host bootstrap. See snapshot config.SCHEMA_AUTH_MODE=none: Disable authentication on the/api/v1/schemaendpoints. The code default istoken, which requires keys viaSCHEMA_API_KEYSor every schema request returns 503. The repo'sdocker-compose-prod.ymlsetsnone. See indexer config.
Env file
You can also use an .env file instead of inline environment variables. This mirrors the vars in the compose above:
GETH_RPC_URL=https://json-rpc.aouzyll7wj7e9xe4g7t82w88c.blockchainnodeengine.com
GETH_WS_URL=wss://ws.aouzyll7wj7e9xe4g7t82w88c.blockchainnodeengine.com
GETH_API_KEY=YOUR_API_KEY
GETH_API_KEY_TYPE=x-goog-api-key
INDEXER_START_HEIGHT=0
DEFRADB_KEYRING_SECRET=YOUR_DEFRADB_KEYRING_SECRET
SCHEMA_AUTH_MODE=none
To use it with docker run, mount the .env file with --env-file .env.
Start the Generator
docker compose -f docker-compose.yml up -d
Verify health. The health server listens on port 8080 inside the container but is not published to the host in this compose, so use docker compose exec:
docker compose exec shinzo-generator curl -f http://localhost:8080/health
Registration
Once the Generator is running, register it with the Shinzo Network. See Registration.
Gotchas
- The image tag
ghcr.io/shinzonetwork/shinzo-generator-client:standardin this compose matchesdocker-compose-prod.yml. The repo'sindexer-prod-setup.shpins a versioned tag (ghcr.io/shinzonetwork/shinzo-generator-client:v0.6.5.1-ethereum-mainnet), and the install page usesghcr.io/shinzonetwork/shinzo-generator-client:ethereum-mainnet-latest. Docker pull/run tag strategy is being consolidated in issues #326 and #327; align with whatever those land on rather than mixing tags across deployments. LOG_LEVEL,LOG_SOURCE, andLOG_STACKTRACEappear in the originaldocker-compose-prod.ymlbut are not read by the Generator client, so they are omitted here.SCHEMA_AUTH_MODE=noneis kept because the Generator client does read it. Log level is controlled byLOGGER_DEBUG. See the env vars table for details.- The
GETH_WS_URLin this compose file useswss://(secure WebSocket) because GCP BNE requires TLS on all connections. If you switch to a non-TLS WebSocket provider, usews://instead. GOMEMLIMITis not a Generator client config var. It is a Go runtime soft memory limit, honored by the Go runtime itself. Set it below the container memory limit to control garbage collection under pressure.
Need help
- For onboarding and technical support, join the Shinzo Discord.
- To report a documentation bug or request a feature, open an issue in the docs repo.
- For a technical issue with the Generator client, open an issue in the shinzo-generator-client repo.