Quickstart
Overview
Section titled “Overview”This guide gets you from zero to a running local node with a deployed contract in under 5 minutes.
Prerequisites
Section titled “Prerequisites”- Rust (nightly toolchain)
- just command runner (
cargo install just) - jq for JSON parsing
- curl for RPC calls
1. Build the Project
Section titled “1. Build the Project”# Clone and enter the repocd chain
# Build everythingjust build2. Generate a Key
Section titled “2. Generate a Key”# Generate an ed25519 keypairjust ed25519-keygen > ./target/dev.key.json
# Export for CLI usageexport ASHEN_PRIVATE_KEY=@./target/dev.key.json
# Get your addressALICE_ADDR=$(jq -r .address ./target/dev.key.json)echo "Your address: $ALICE_ADDR"3. Initialize and Run a Local Node
Section titled “3. Initialize and Run a Local Node”# Initialize the node with funds allocated to your addressjust devnet-node init --data-dir ./node-data --alloc "$ALICE_ADDR=13370000000000"
# Run the node (in a separate terminal)just nodeThe node will start producing blocks at http://127.0.0.1:3030.
4. Verify the Node is Running
Section titled “4. Verify the Node is Running”# Check chain statusjust ashen status
# Check your account balancejust ashen account --address "$ALICE_ADDR"
# Or via RPC directlyjust rpc-status5. Deploy a Contract
Section titled “5. Deploy a Contract”# Build a contract (e.g., the SFT token)just contract-build --manifest-path contracts/sft_v1/Cargo.toml
# Deploy itjust example-deploy-sft6. Interact with the Contract
Section titled “6. Interact with the Contract”# 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-onlyQuick Reference
Section titled “Quick Reference”| Task | Command |
|---|---|
| Build workspace | just build |
| Run local node | just node |
| Check status | just ashen status |
| Generate keypair | just ed25519-keygen |
| Build contract | just contract-build --manifest-path <path> |
| Deploy contract | just contract-deploy --elf <path> --wait |
| RPC status | just rpc-status |
| Account info | just rpc-account <address> |
Running a Multi-Node Testnet
Section titled “Running a Multi-Node Testnet”For testing with multiple validators:
# Generate testnet config (3 validators)just testnet-local-generate
# Run the testnetjust testnet-local-runThis starts 3 validators with an RPC server on port 3030.
Environment Variables
Section titled “Environment Variables”| Variable | Description | Default |
|---|---|---|
NODE_RPC_URL | RPC endpoint | http://127.0.0.1:3030 |
NODE_AUTH_TOKEN | Optional auth token | none |
ASHEN_PRIVATE_KEY | Private key (hex or @file.json) | required for txs |
Next Steps
Section titled “Next Steps”- Using the CLI - Full
ashenCLI documentation - Writing Contracts - Build smart contracts with the Zig SDK
- Architecture - Understand how the chain works