Running a Towns Stream Node in Development
Running a Towns Stream Node from source is easy to do with Go, Docker, and Foundry Ethereum toolkit installed. The following tutorial will show you how to run a Towns Stream Node with a Postgres backend.Requirements
- Docker
- Yarn 1.22
- Go 1.22.2 (see
go.work
file for up-to-date version) - protobuf
- Buf tools (see README.md for installation)
- Anvil -
curl -L https://foundry.paradigm.xyz | bash
Setup
Once you’ve installed Docker, Go, protobuf, Anvil, and buf, you can proceed to setup your environment as follows.Run a Towns Stream Node Locally from Source using VSCode
There’s a VSCode task in tasks.json that is recommended to be used to multiple local stream nodes with attached postgres and local base, river chains, respectively running in different anvil ports. Running~Start Local Dev~
command from the river repo in VSCode will do the following in order:
1
Check dependency versions
2
Upgrade Foundry toolkit
3
Run yarn install
4
Build protobufs
5
Start Base Chain in anvil
6
Start Towns Chain in anvil
7
Configure stream nodes
8
Start stream nodes with and without entitlements (on separate ports)
9
Start xchain binary
10
Start protobuf and typescript package watcher
river_node
process running from localhost and run /status
check to see if the node is running in a healthy manner. The following should be returned if the node is healthy:
/debug/multi
and /debug/multi/json
endpoints which return html and json respectively. These endpoints return latency connecting to node on loopback address as well as grpc, http and rpc provider health.
Run a Towns Stream Node in Info Mode against testnet or mainnet
To run a stream node within the remote testnet or mainnet networks, the node needs to be first registered on Towns Chain. See onboarding instructions here.