Register Node
The following guide illustrates how to register a new Stream Node instance on Towns Chain. This guide uses Testnet as an example. The Mainnet guide follows from this guide with modifications to contract addresses and rpc url for Towns Chain.
Requirements & Dependencies
- Foundry Toolkit: To install follow this guide.
- Node Operator delegation: address migrated to Towns Chain by DAO (see below).
- Warm wallet access to Node Operator wallet.
- Node URL pointing via DNS to Node FE attached to Node Storage.
- Access to Base over RPC endpoint
- Access to Towns Chain over RPC endpoint
- Sufficient gas on Node Operator wallet on both Base and Towns Chain to register
- Sufficient gas on Node FE wallet on Towns Chain and Base for validation and cross-chain transactions once node is operational.
Node FE’s are stateful and as such require consistent resolution of hostnames to active instance. To avoid unintended bad consequences, it is strongly encouraged to configure DNS for Node URL with exactly 1 A Record per domain name. Put differently, each Node URL should point to at most 1 IP address.
The node operator wallet registered on Base must be bridged to Towns Chain by the DAO prior to proceeding with node registration. Furthermore, the node operator needs warm access to this wallet to perform node operations to register, and update a fleet of node instances.
All contract addresses for testnet and mainnet needed to register nodes can be found in the contracts section.
Registration Outline
The following outlines the logical steps to onboarding a Node FE with attached storage from 0 to 1. Instructions are applicable to testnet and mainnet.
Instructions with specific calling signatures can be found below in the Node FE Registration sections.
Please ensure you have completed Node Operator registration before proceeding with node registration.
Start Stream Node in Info Mode
Register Node in Towns Chain
Register Node in Base
Start Stream Node
Node FE Registration
Once a node operator has registered their operator address on Towns Chain, they can proceed to register their nodes. Nodes are registered individually on Towns Chain and Base.
Node Operator addresses must be registered on Towns Chain before below actions can be undertaken to register a new stream node. DAO will migrate operator address to Towns Chain once sufficient delegations are received.
Once a node is setup, attached to postgres storage, network configured with a public IP, and passing health checks (see System Requirements & Installation), the node is ready to enter the Towns Network and begin accepting stream writes.
Registering a node on Towns Chain, can be accomplished by calling the registerNode(address,string,uint8)
method on the RiverRegistry diamond contract.
Registering a node and operating a stream node in general requires that the node wallet has Eth for the target network (Sepolia Eth for testnet, Eth for mainnet) to pay for gas. On testnet, sepolia eth can be obtained from a faucet. Stream nodes should also have a wallet on Base with Base Eth (mainnet) or Base Sepolia Eth (testnet) to pay for gas when committing cross-chain transactions.
The below steps describe how to register a new node URL in Operational
status using cast
, a command-line tool that is part of Foundry for reading / writing to EVM chains over RPC url’s.
Setting a Node to Operational
status will allow the node to begin accepting stream writes and signal to the network that the node is healthy and ready to be connected to by clients. See all possible node statuses that a node can assume in RegistryStorage.
Setup Variables for Registration
Register Node on Base and Towns Chain
Using cast
let’s register our new node. First let’s check that the Node FE does not already exist. Node FE’s are identified in Towns Registry by their address so let’s check getNode
to ensure the view reverts with NODE_NOT_FOUND
before proceeding.
Assuming the above reverts with NODE_NOT_FOUND
, let’s proceed to register the new node with the Node Operator’s wallet.
getNode(address)
to confirm the node now exists in the network.Check Node Health from Debug Multi Dashboard
To check that your node is included in the network and healthy, you can navigate to:
$NODE_URL/debug/multi
in a browser to see the node’s http1/2, grpc ping status and related health metrics.
As an example, see https://ohare-3.staking.production.figment.io/debug/multi.
Was this page helpful?