Skip to content

Repository files navigation

Namada custom

This repo emits a container image that can run in 4 modes. Running all 4 together in the setup described below results in a Namada node whose syncing can be paused. While syncing is paused, Undexer can reliably index the historical data that would normally be pruned from the chain after 2 epochs, and is thus only available during sync (see anoma/namada#3810).

ModeCommandNetworksRequires init?Description
nodecontrol_node.js⚠️Internal onlyNoManages the Namada node. MUST run in isolated network (no Internet access except through rpc-proxy and sync-proxy). Parses node log; when epoch increments, node messages sync-proxy to pause the sync.
rpc-proxyrpc_proxy.jsInternal, External⚠️YesAllows connections from indexer to node.
sync-proxysync_proxy.jsInternal, External⚠️YesAllows connections from node to peers. By pausing the contained proxy, node sync is paused, so that the indexer can catch up.
node-statusstatus.jsInternal, ExternalNoManages the other three. When indexing has caught up, Undexer tells node-status to resume sync, and node-status tells sync-proxy to restart the proxy.

Note that rpc-proxy and sync-proxy require an init process in the container (docker run --init, or init: true in docker-compose.yml) so that Docker is able to reap the zombie processes that are created when the internal simpleproxy is killed by the managing script.

Here's an example Docker Compose manifest which describes the relations between the containers. Adapt as needed.

volumes:
database:
networks:
database:
external:
internal:
internal: trueservices:
postgres:
image: postgres:16.2-alpinenetworks: [ database ]restart: unless-stoppedports: [ "127.0.0.1:5432:5432" ]environment:
- POSTGRES_PASSWORD=insecure
- POSTGRES_USER=postgres
- POSTGRES_DB=postgreshealthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres -d postgres"]interval: 10stimeout: 5sretries: 5indexer:
entrypoint: /app/undexercommand: indexnetworks: [ external, database ]image: ghcr.io/hackbg/undexer:v4restart: unless-stoppeddepends_on: { postgres: { condition: service_healthy } }environment: { RPC_URL: "http://rpc-proxy:26657" }rpc-proxy:
entrypoint: /srv/rpc_proxy.jsnetworks: [ external, internal ]image: ghcr.io/hackbg/namada-for-undexer:maininit: truerestart: unless-stoppednode:
entrypoint: /srv/control_node.jsnetworks: [ internal ]image: ghcr.io/hackbg/namada-for-undexer:mainrestart: unless-stoppedsync-proxy:
entrypoint: /srv/sync_proxy.jsnetworks: [ external, internal ]image: ghcr.io/hackbg/namada-for-undexer:maininit: truerestart: unless-stoppedenvironment: { REMOTE: "namada-peer.mandragora.io:26656" }

About

⏱️ Pausable Namada node for Undexer v4+. See also: https://github.com/hackbg/undexer

Resources

Stars

0 stars

Watchers

2 watching

Forks

Releases

Packages

Used by

Contributors

Languages