A set of scripts to configure and manage a local Linux/X86_64 algod for fnet.
The Fnet network will be reset periodically. The scripts support automatically resetting the node to follow along with the new network.
The on-network-reset.sh
script can also be utilized to bootstrap some user actions when a new instance of the network is created, such as keyreg online, create applications, fund other addresses, etc.
Note: A dockerized flavor of this repo is available here
-
Prerequisite: Set up algod, e.g. via
apt install -y algorand
. -
Disable automatic updates. For
apt
, you can mark the package as non-upgradable withsudo apt-mark hold algorand
. (If you later want to stop running fnet algod and want to mark it as upgradable again, usesudo apt-mark unhold algorand
) -
Update start.sh and stop.sh if necessary: These assume that systemd is managing the node, and specifically the command
systemctl start algorand
. If this is not the case on your system, update these files. -
Stop algod:
sudo ./stop.sh
-
Run configure:
./configure.sh
- configure local binaries, genesis, config. See below. -
Start algod:
sudo ./start.sh
auto-update.sh
can be used to automate resetting your node along with the network. When this script detects an upstream genesis file change, it will reset the local node data and invoke on-network-reset.sh
.
If you want to enable automatic updating of the binary and genesis, you should register the auto-update.sh
script via cron in order to automate the process:
Important: Use the root account's crontab
sudo crontab -e
Add a line like this to the end. Make sure to change /path/to/update.sh/
with the correct path to the script.
*/10 * * * * /path/to/auto-update.sh
*/10 * * * *
means "run this every 10 minutes". You can customize this interval using a tool like this
stop.sh
and start.sh
to stop and start your node when the network resets
Needs to be run as root
- DELETES network data directory, e.g. /var/lib/algorand/fnet-v1
- configures config.json with DNS Bootstrap ID
- fetches and places genesis.json
- fetches latest fnet nightly binaries (
algod
,goal
) and replaces them in $PATH.
Needs to be run as root
- Compares local
genesis.json
with the latest one from an fnet relay. If they are the same, exit - Stops algod
- Updates genesis and binaries via
configure.sh
(see above) - starts algod again (using systemd)
- runs
on-network-reset.sh
(you can place any network bootstrap commands you want here.)
Configures some common variables. Supports $ALGORAND_DATA.
Use this to override values if necessary
Utilities you can use to manage your node or automate the user bootstrap script.
./utils/catchup.sh
Starts fast catchup.
./utils/get_account_eligibility.sh $account
Gets the specified $account's incentives eligibility.
./utils/get_balance.sh $account
Gets microALGO balance of account $account
through local node
./utils/get_genesis.sh
Fetches latest genesis file from a relay
./utils/is_node_running.sh
Exits successfully if node is running and ready
./utils/is_node_syncing.sh
Exits successfully if node is syncing
update_binary.sh
If required, update algod
and goal
binaries from fnet.algorand.green
. Validates SHA256SUMS.
./utils/wait_for_balance.sh $account $amount
Waits until account $account
has a balance of at least $amount
./utils/wait_node_start.sh
Waits briefly for the node to start.
./utils/wait_sync.sh $timeout
Waits for node to sync, optionally with timeout of $timeout
seconds