This repository contains a small toolkit for Thru Alphanet. It follows the official Thru documentation and helps you run a practical single-account workflow for setup, build, deploy, counter interactions, token initialization, name service setup, and proxy reachability checks.
setup: configure the CLI, install the Thru toolchain and C SDK, create or reuse a local key alias, create an on-chain account, and request faucet fundshealth-check: verify RPC connectivity before running a longer flowtest-proxies: run RPC health checks through each proxy listed inconfig/proxies.txtbuild: compile the sample C counter programdeploy: deploy the sample counter programcounter-create: derive a counter account, request a state proof, and create counter statecounter-inc: increment the last created countertoken-init: create a token mint and token accountnameservice-init: create a root registrar or subdomain flow and append a record
This project intentionally does not support:
- raw private key ingestion from flat files
- proxy rotation for account activity
- multi-account batching meant to disguise or vary behavior
The intended model is one locally managed thru-cli key alias, such as default, plus optional proxy testing for connectivity only.
Each on-chain activity uses a small run-specific suffix for seeds, labels, or names. This prevents repeated testnet runs from colliding with existing program, token, counter, or domain accounts. The variation is for idempotence and easier testing, not for disguise.
config/: example configuration filesscripts/: executable automation scriptscounter-program/: sample C counter program used by the workflowstate/: generated runtime state fileslogs/: generated run logs
- Copy the configuration templates:
cp config/app.env.example config/app.env
cp config/keys.env.example config/keys.env
cp config/account.txt.example config/account.txt
cp config/proxy.txt.example config/proxy.txt
cp config/proxies.txt.example config/proxies.txt- Put your local
thru-clialias inconfig/account.txt, or letsetupask for it on first run.
Example:
default-
Optionally place one proxy URL in
config/proxy.txt. -
If you want to test multiple proxies, add one proxy URL per line to
config/proxies.txt. -
Review
config/app.envand, if needed,config/keys.env.
You can use either just or direct script execution.
just setup
just health-check
just test-proxies
just build
just deploy
just counter-create
just counter-inc
just token-init
just nameservice-init./scripts/setup.sh
./scripts/health-check.sh
./scripts/test-proxies.sh
./scripts/build.sh
./scripts/deploy.sh
./scripts/counter-create.sh
./scripts/counter-inc.sh
./scripts/token-init.sh
./scripts/nameservice-init.shconfig/account.txtshould contain one local key alias such asdefault, not a raw private key.config/proxy.txtis used for a single proxy during a normal run.config/proxies.txtis used only for proxy reachability testing.config/keys.envis optional and can override role-specific values.- For nameservice test values, use
__RUN_TAG__inNAMESERVICE_RECORD_VALUE_TEMPLATEif you want a per-run suffix.
- The network scripts request faucet funds before each on-chain activity.
- The network scripts run an RPC health check before each on-chain activity.
- Network commands use retries. You can tune them with
NETWORK_RETRY_ATTEMPTS,NETWORK_RETRY_SLEEP,RPC_HEALTHCHECK_ATTEMPTS, andRPC_HEALTHCHECK_SLEEPinconfig/app.env. - A random delay between 30 and 60 seconds is enabled by default for network activity. Set
ACTIVITY_DELAY_ENABLED=0if you want faster local iteration. - Resume behavior is enabled by default for deploy and initialization steps. Set
FORCE_RUN=1inconfig/app.envwhen you intentionally want a fresh run.
Successful runs update these files:
state/account.envstate/program.envstate/counter.envstate/token.envstate/nameservice.envstate/current.envstate/current.txtstate/last-action.envstate/history.tsv
Proxy testing also writes:
state/proxy-results.tsvstate/proxy-test.env
Per-run logs are stored in logs/.
- The local alias is managed by
thru-cli. - You can read the private key for backup with
thru-cli keys get <alias>. - You can restore a key on another machine with
thru-cli keys add <alias> <64_hex_private_key>. - Do not commit or publish private keys, local config files, or generated runtime state.