setup
Run your own agent
AgentCron is single-tenant by design. To use it for real, fork the repo, plug in your own keypair + Anthropic key, and run the agent locally. Your keys never leave your machine.
01this dashboard's agent
signed transactions you see come from this wallet
02run it yourself
3 minutes from clone to live agent
1
clone the repo
git clone https://github.com/JkrishnaD/agent-corn cd agent-corn npm install
2
generate an agent keypair
Make a fresh keypair just for the agent. Don't reuse your main wallet.
solana-keygen new --outfile ~/.config/solana/agent-cron.json solana-keygen pubkey ~/.config/solana/agent-cron.json # copy that pubkey, fund it on devnet: solana airdrop 2 <PUBKEY> --url devnet
3
export the secret as base58
The agent reads SOLANA_PRIVATE_KEY as a base58 string.
# one-liner: read JSON array, encode bs58
node -e "const fs=require('fs');const bs58=require('bs58');console.log(bs58.default.encode(Buffer.from(JSON.parse(fs.readFileSync(process.env.HOME+'/.config/solana/agent-cron.json')))))"4
configure .env
Copy the template, fill in 3 keys.
cp .env.example .env
# Solana SOLANA_NETWORK=devnet HELIUS_API_KEY=<your helius key> HELIUS_RPC_URL=https://devnet.helius-rpc.com/?api-key=<your helius key> SOLANA_PRIVATE_KEY=<base58 of your agent keypair from step 3> # LLM ANTHROPIC_API_KEY=sk-ant-... # MagicBlock router (devnet, public — no key needed) MAGICBLOCK_RPC_URL=https://devnet.magicblock.app # Pre-deployed program (devnet) AGENT_CRON_PROGRAM_ID=CJ2uqxr4XVD22a66hcpat524KUkAPTeZMmgM15tRFugC # Web NEXT_PUBLIC_AGENT_API_URL=http://localhost:4000 NEXT_PUBLIC_AGENT_WS_URL=ws://localhost:4000
5
verify reachability
The smoke scripts confirm RPC, MagicBlock router, and the program lifecycle work end-to-end.
cd agent npx tsx src/scripts/smoke-magicblock.ts # 11 checks npx tsx src/scripts/smoke-program.ts # init → delegate → 3 ER ticks → commit
6
run the stack
# terminal 1 cd agent && npm run dev # terminal 2 cd web && npm run dev # open http://localhost:3000/dashboard
03trust model
who sees what
stays on your machine
- SOLANA_PRIVATE_KEY (agent keypair)
- ANTHROPIC_API_KEY
- HELIUS_API_KEY
- full LLM reasoning text + rule prompts
on chain (public)
- AgentContext PDA per rule
- execution counter, fired count, last confidence
- sha256 of prompt + each rationale
- tx signatures (transfer/swap)
Reasoning text never lands on chain. Anyone can re-hash your stored rationale to verify it matches what was recorded — agent can't retro-edit decisions.
04known limits
hackathon scope, not architecture
- —Rules in memory only — agent restart loses rules. JSON-file persistence is trivial to add.
- —Single-tenant: one agent keypair owns all PDAs. Multi-user needs keypair-per-rule auth.
- —Monitor is RPC-poll (5s). Helius webhooks pluggable — interface is in monitor.ts.
- —Only `transfer` action wired in dashboard. `swap` and `custom` work via direct POST /rules.