I recently had an opportunity to try Algorand’s BetaNet. Similar to the TestNet, the BetaNet is a place for developers to experiment. Unlike the TestNet where nodes run stable code, the BetaNet runs with features not yet on the live network.
For good instructions from the The Algorand team see official BetaNet docs and get help when needed at the BetaNet forum.
My notes (this post) may help, if you’re setting up a short-lived node for local development or testing.
Ensure the Algorand tools are built for compatibility with BetaNet.
If building source, use the
rel/beta branch. Use
algod -v to
$ algod -v 4295032836 1.1.4.beta [rel/beta] (commit #e8ef805d) go-algorand is licensed with AGPLv3.0 source code available at https://github.com/algorand/go-algorand
I built the tools from souce, so my paths to the betanet config files
differ from the instructions on
algorand.org. In my case, code is
I made a directory
$HOME/betanet.data/ to store configuration.
Here’s how I first set it up:
cp $HOME/gopath/algorand/src/github.com/algorand/go-algorand/installer/genesis/betanet/genesis.json $HOME/betanet.data/ cp $HOME/gopath/algorand/src/github.com/algorand/go-algorand/installer/config.json.example $HOME/betanet.data/config.json
Specifically for BetaNet, manually edit
“<network>.algorand.network” to “<network>.algodev.network”.
As our node syncs with the network, it’s going to save a lot of data to disk. Algorand is fast, so our writes must be fast to stay in sync. Also, we want to avoid a lot of churn on the disk of our development environment. Both of these concerns can be addressed by storing data on a RAM disk rather than physical disk.
Examples in the official docs put data in
$HOME/node/data, so let’s
do the same.
First, setup a RAM disk:
sudo mount -t tmpfs -o size=2g tmpfs ~/node/data/
(Two gig is a pretty arbitrary choice. It appears that
consume about as much space as you allow it.)
Next put the config files into the RAM disk:
cp $HOME/betanet.data/* $HOME/node/data/
$HOME/node/data is set up.
Start Algorand Node
From here we follow the official instructions.
cd $HOME/node goal node start -d data
It can take a little while to sync. Hopefully the RAM disk makes this faster than it would be otherwise.
goal node status to keep an eye on it.
watch -d goal node status -d data
Dont’ be fooled by
Has Synced Since Startup: false. Apparently, it
Stop Algorand Node, Cleanup
To shutdown cleanly, stop
goal node stop -d data`
Save data to more permanent disk, before unmounting RAM disk:
rsync -rv data/* $HOME/betanet.data sudo umount data
Share this post