ClawChain RPC client for EvoClaw agents. Connects to Substrate-based blockchain, queries on-chain agent data, submits transactions, and enables agents to participate in on-chain governance and reputation tracking. Use when working with ClawChain L1 blockchain, agent DIDs, token economics, or agent reputation systems.
Connect EvoClaw agents to the ClawChain blockchain for on-chain reputation tracking, token economics, and governance participation.
use clawchain::ClawChainClient;
#[tokio::main]
async fn main() -> anyhow::Result<()> {
// Connect to local node
let client = ClawChainClient::new("ws://127.0.0.1:9944").await?;
// Query agent reputation
let did = "did:claw:1a2b3c4d...";
let reputation = client.get_agent_reputation(did).await?;
println!("Reputation score: {}", reputation);
// Check token balance
let balance = client.get_token_balance(did).await?;
println!("CLAW tokens: {}", balance);
Ok(())
}
ClawChain node running:
clawchain-node --dev --rpc-external --ws-external
Rust dependencies in Cargo.toml:
[dependencies]
clawchain = { path = "/path/to/clawchain-skill" }
┌─────────────────────────────────────────────────┐
│ EvoClaw Edge Agent │
├─────────────────────────────────────────────────┤
│ ┌────────────────────────────────────────┐ │
│ │ ClawChain Skill (this skill) │ │
│ │ └─ Substrate RPC client │ │
│ └────────────────────────────────────────┘ │
└─────────────────────────────────────────────────┘
↓ WebSocket
┌─────────────────────────────────────────────────┐
│ ClawChain Node (Substrate) │
│ ┌───────────────────────────────────────────┐ │
│ │ AgentRegistry Pallet │ │
│ │ ClawToken Pallet │ │
│ │ Governance Pallet │ │
│ └───────────────────────────────────────────┘ │
└─────────────────────────────────────────────────┘
Agent identifiers follow the format: