Skip to content

Quickstart

This guide gets you from zero to a running local node with a deployed contract in under 5 minutes.

  • Rust (nightly toolchain)
  • just command runner (cargo install just)
  • jq for JSON parsing
  • curl for RPC calls
Terminal window
# Clone and enter the repo
cd chain
# Build everything
just build
Terminal window
# Generate an ed25519 keypair
just ed25519-keygen > ./target/dev.key.json
# Export for CLI usage
export ASHEN_PRIVATE_KEY=@./target/dev.key.json
# Get your address
ALICE_ADDR=$(jq -r .address ./target/dev.key.json)
echo "Your address: $ALICE_ADDR"
Terminal window
# Initialize the node with funds allocated to your address
just devnet-node init --data-dir ./node-data --alloc "$ALICE_ADDR=13370000000000"
# Run the node (in a separate terminal)
just node

The node will start producing blocks at http://127.0.0.1:3030.

Terminal window
# Check chain status
just ashen status
# Check your account balance
just ashen account --address "$ALICE_ADDR"
# Or via RPC directly
just rpc-status
Terminal window
# Build a contract (e.g., the SFT token)
just contract-build --manifest-path contracts/sft_v1/Cargo.toml
# Deploy it
just example-deploy-sft
Terminal window
# Set your contract address (from deploy output)
CONTRACT=0x...
# View call (read-only)
just ashen contract view \
--idl contracts/sft_v1/sft_v1.idl \
--contract "$CONTRACT" \
--interface SftV1 \
--method total_supply
# State-changing call (simulate first)
just ashen contract call \
--idl contracts/sft_v1/sft_v1.idl \
--contract "$CONTRACT" \
--interface SftV1 \
--method mint \
--args '{"to":"'"$ALICE_ADDR"'","amount":"1"}' \
--simulate-only
TaskCommand
Build workspacejust build
Run local nodejust node
Check statusjust ashen status
Generate keypairjust ed25519-keygen
Build contractjust contract-build --manifest-path <path>
Deploy contractjust contract-deploy --elf <path> --wait
RPC statusjust rpc-status
Account infojust rpc-account <address>

For testing with multiple validators:

Terminal window
# Generate testnet config (3 validators)
just testnet-local-generate
# Run the testnet
just testnet-local-run

This starts 3 validators with an RPC server on port 3030.

VariableDescriptionDefault
NODE_RPC_URLRPC endpointhttp://127.0.0.1:3030
NODE_AUTH_TOKENOptional auth tokennone
ASHEN_PRIVATE_KEYPrivate key (hex or @file.json)required for txs