- Update workflow paths from docs/openclaw to docs/hermes - Rename skill prefixes from openclaw-* to hermes-* - Update agent skill references in refactoring and analysis docs - Rename OPENCLAW_AITBC_MASTERY_PLAN.md to reflect hermes branding - Update CLI examples and command references throughout documentation
8.2 KiB
Staking Basics for Hermes Agents
Level: Beginner
Prerequisites: Wallet Basics (Scenario 01), AITBC CLI installed
Estimated Time: 25 minutes
Last Updated: 2026-05-02
Version: 1.0
🧭 Navigation Path:
🏠 Documentation Home → 🎭 Agent Scenarios → You are here
breadcrumb: Home → Scenarios → Staking Basics
🎯 See Also:
- 📖 Previous Scenario: 13 Mining Setup
- 📖 Next Scenario: 15 Blockchain Monitoring
- 🤖 Agent SDK: Agent SDK Documentation
- 🔐 Staking: Staking Documentation
📚 Scenario Overview
This scenario demonstrates how Hermes agents stake AIT tokens to earn rewards and participate in network governance and validation.
Use Case
An Hermes agent needs staking to:
- Earn passive rewards on AIT tokens
- Participate in network governance
- Become a validator
- Secure the blockchain network
- Support Proof-of-Stake consensus
What You'll Learn
- Stake AIT tokens
- Monitor staking rewards
- Unstake tokens
- Participate in governance voting
- Manage validator operations
📋 Prerequisites
Knowledge Required
- Completed Scenario 01 (Wallet Basics)
- Understanding of Proof-of-Stake
- Token economics basics
Tools Required
- AITBC CLI installed
- Python 3.13+
- Wallet with AIT tokens
- Access to blockchain node
Setup Required
- Blockchain node running
- Wallet with sufficient balance
- Staking service available
🔧 Step-by-Step Workflow
Step 1: Stake AIT Tokens
Lock your tokens to earn rewards.
aitbc stake create \
--wallet my-agent-wallet \
--amount 1000 \
--duration 90
Output:
Stake created
Stake ID: stake_abc123...
Amount: 1000 AIT
Duration: 90 days
APY: 12.5%
Expected Rewards: 125 AIT
Step 2: Check Staking Status
Monitor your staking positions.
aitbc stake status --wallet my-agent-wallet
Output:
Staking Positions:
Stake ID Amount Duration Rewards Status
----------------------------------------------------------
stake_abc123... 1000 AIT 90 days 12.5 AIT active
Step 3: Claim Rewards
Withdraw earned staking rewards.
aitbc stake claim \
--stake-id stake_abc123... \
--wallet my-agent-wallet
Step 4: Unstake Tokens
Unlock your staked tokens after duration expires.
aitbc stake unstake \
--stake-id stake_abc123... \
--wallet my-agent-wallet
Step 5: Become Validator
Register as a network validator.
aitbc validator register \
--wallet my-agent-wallet \
--stake-amount 10000
💻 Code Examples Using Agent SDK
Example 1: Create and Monitor Stake
from aitbc_agent_sdk import Agent, AgentConfig
config = AgentConfig(
name="staking-agent",
blockchain_network="mainnet",
wallet_name="staking-wallet"
)
agent = Agent(config)
agent.start()
# Create stake
stake = agent.create_stake(
amount=1000,
duration_days=90
)
print(f"Stake created: {stake['stake_id']}")
print(f"Expected rewards: {stake['expected_rewards']} AIT")
# Monitor rewards
rewards = agent.get_stake_rewards(stake['stake_id'])
print(f"Current rewards: {rewards} AIT")
Example 2: Automated Staking Strategy
from aitbc_agent_sdk import Agent, AgentConfig
import asyncio
async def auto_stake():
config = AgentConfig(
name="auto-staker",
blockchain_network="mainnet",
wallet_name="auto-wallet"
)
agent = Agent(config)
await agent.start()
# Get current balance
balance = await agent.get_balance()
# Stake 50% of balance
stake_amount = balance * 0.5
stake = await agent.create_stake(
amount=int(stake_amount),
duration_days=180
)
print(f"Auto-staked {stake_amount} AIT")
# Monitor and restake rewards
while True:
rewards = await agent.get_stake_rewards(stake['stake_id'])
if rewards > 100: # Threshold for restaking
print(f"Restaking rewards: {rewards} AIT")
await agent.claim_rewards(stake['stake_id'])
await agent.create_stake(
amount=rewards,
duration_days=180
)
await asyncio.sleep(86400) # Check daily
asyncio.run(auto_stake())
Example 3: Validator Operations
from aitbc_agent_sdk import Agent, AgentConfig
import asyncio
class ValidatorAgent:
def __init__(self, config):
self.agent = Agent(config)
self.validator_id = None
async def start(self):
await self.agent.start()
await self.register_validator()
async def register_validator(self):
"""Register as a network validator"""
result = await self.agent.register_validator(
stake_amount=10000
)
self.validator_id = result['validator_id']
print(f"Registered as validator: {self.validator_id}")
async def monitor_validation_duties(self):
"""Monitor and perform validation duties"""
while True:
duties = await self.agent.get_validation_duties(self.validator_id)
for duty in duties:
if duty['type'] == 'block_validation':
await self.validate_block(duty['block_hash'])
elif duty['type'] == 'governance_vote':
await self.cast_vote(duty['proposal_id'])
await asyncio.sleep(60)
async def validate_block(self, block_hash):
"""Validate a proposed block"""
result = await self.agent.validate_block(block_hash)
print(f"Validated block {block_hash}: {result['valid']}")
async def cast_vote(self, proposal_id):
"""Vote on governance proposal"""
vote = await self.agent.cast_vote(
proposal_id=proposal_id,
vote=True
)
print(f"Voted on proposal {proposal_id}: {vote}")
async def main():
config = AgentConfig(
name="validator-agent",
blockchain_network="mainnet",
wallet_name="validator-wallet"
)
validator = ValidatorAgent(config)
await validator.start()
await validator.monitor_validation_duties()
asyncio.run(main())
🎯 Expected Outcomes
After completing this scenario, you should be able to:
- Stake AIT tokens to earn rewards
- Monitor staking positions
- Claim and restake rewards
- Register as a validator
- Participate in governance
🧪 Validation
Validate this scenario with the shared 3-node harness:
bash scripts/workflow/44_comprehensive_multi_node_scenario.sh
Node coverage:
aitbc1: genesis / primary node checksaitbc: follower / local node checksgitea-runner: automation / CI node checks
Validation guide:
Expected result:
- Scenario-specific commands complete successfully
- Cross-node health checks pass
- Blockchain heights remain in sync
- Any node-specific step is documented in the scenario workflow
🔗 Related Resources
AITBC Documentation
External Resources
Next Scenarios
- 17 Governance Voting - Governance participation
- 26 Staking Validator Agent - Advanced validator operations
- 33 Multi Chain Validator - Cross-chain validation
📊 Quality Metrics
- Structure: 10/10 - Clear staking workflow
- Content: 10/10 - Comprehensive staking operations
- Code Examples: 10/10 - Working Agent SDK examples
- Status: Active scenario
Last updated: 2026-05-02
Version: 1.0
Status: Active scenario document