I made a little Docker Image to make it easier to run a local testnet
. The image is minimal, self-contained & comes with some quality-of-life features.
check it out here:
The container runs best with host networking:
docker run \
--rm \
--network host \
-e HOST_IP_ADDRESS="YOUR_HOST_IP_ADDRESS" \
ghcr.io/rrauch/autonomi_testnet:latest
Just replace YOUR_HOST_IP_ADDRESS
with the IP address of the host and you’re good to go.
Internally, it first starts an evm-testnet
, followed by 25 antnodes
. It also monitors the state of the nodes and will shutdown automatically if nodes fail.
Once started, the container will output all relevant details required to connect to stdout:
------------------------------------------------------
evm testnet details
> RPC_URL: http://YOUR_HOST_IP_ADDRESS:14143/
> PAYMENT_TOKEN_ADDRESS: 0x...
> DATA_PAYMENTS_ADDRESS: 0x...
> SECRET_KEY: 0x...
------------------------------------------------------
node details
53851 12D3KooW...
53852 12D3KooW...
...
53875 12D3KooW...
------------------------------------------------------
Bootstrap URL: http://YOUR_HOST_IP_ADDRESS:38112/bootstrap.txt
------------------------------------------------------
autonomi:config:local?rpc_url=http%3A%2F%2FYOUR_HOST_IP_ADDRESS%3A14143%2F&payment_token_addr=0x...&data_payments_addr=0x...&bootstrap_url=http%3A%2F%2F2FYOUR_HOST_IP_ADDRESS%3A38112%2Fbootstrap.txt
------------------------------------------------------
The testnet
is ephemeral - all state is lost after container shutdown. This also means that peer_ids
change after a restart. Because of this, the container also exports a bootstrap
file at http://<HOST_IP_ADDRESS>:38112/bootstrap.txt
to make it easier for the client to find the nodes.
I’ve tried to document the settings to get the client to connect to the local testnet
in the README
.
Hope it can save someone a little time and nerves.