Skip to content

Fukuii API Documentation

Welcome to the Fukuii JSON-RPC API documentation. This directory contains comprehensive documentation for interacting with Fukuii's JSON-RPC interface and planning for Model Context Protocol (MCP) integration.

๐Ÿ“š Documentation Index

Core API Documentation

  1. Interactive API Reference ๐Ÿ†•
  2. Fully browsable OpenAPI specification with Swagger UI
  3. All 83 JSON-RPC endpoints with live examples
  4. Organized by namespace with filtering
  5. Try-it-out functionality for testing endpoints
  6. Use this for: Exploring the API interactively, testing endpoints, integration planning

  7. JSON-RPC API Reference

  8. Complete reference for all JSON-RPC endpoints
  9. Request/response examples for each method
  10. Parameter descriptions and validation rules
  11. Error codes and handling
  12. Best practices for API usage
  13. Use this for: Learning the API, integrating clients, reference lookup

  14. RPC Endpoint Inventory ๐Ÿ†•

  15. Comprehensive catalog of all 97 RPC endpoints
  16. Organized by namespace with safety classifications
  17. MCP coverage analysis
  18. Production readiness indicators
  19. Priority gaps for agent control
  20. Use this for: Complete RPC endpoint reference, MCP planning

  21. JSON-RPC Coverage Analysis

  22. Comprehensive gap analysis vs Ethereum specification
  23. Implementation status by namespace
  24. Missing methods and their priority
  25. EIP support status
  26. Recommendations for completeness
  27. Use this for: Understanding what's implemented, planning enhancements

MCP & Agent Control Documentation

  1. MCP Analysis Summary ๐Ÿ†•
  2. Executive summary of RPC inventory and MCP planning
  3. Key findings and strategic recommendations
  4. Security architecture overview
  5. Implementation timeline and success metrics
  6. Use this for: Understanding MCP strategy, stakeholder communication

  7. MCP Enhancement Plan ๐Ÿ†•

  8. Complete roadmap for agent-controlled node management
  9. 6-phase implementation plan (12-16 weeks)
  10. 45+ new tools, 20+ resources, 15+ prompts
  11. Security considerations and acceptance criteria
  12. Testing strategy and documentation requirements
  13. Use this for: Implementing complete agent control, detailed planning

  14. MCP Integration Guide

  15. Architecture for Model Context Protocol server
  16. Resource and tool definitions
  17. Security considerations and authentication
  18. Implementation roadmap
  19. Deployment strategies
  20. Use this for: Building AI integrations, planning MCP server development

๐ŸŽฏ Quick Start

For Developers

  1. Start Fukuii:

    ./bin/fukuii etc
    

  2. Test the API:

    curl -X POST http://localhost:8546 \
      -H "Content-Type: application/json" \
      -d '{
        "jsonrpc": "2.0",
        "id": 1,
        "method": "eth_blockNumber",
        "params": []
      }'
    

  3. Import Insomnia Workspace:

  4. Open Insomnia
  5. Import the Insomnia workspace from the repository root
  6. Start exploring all 78 endpoints

For AI Integration

See MCP Integration Guide for building AI-powered blockchain tools using the Model Context Protocol.

๐Ÿ“– API Overview

Namespaces

Fukuii organizes JSON-RPC methods into namespaces:

Namespace Endpoints Purpose Production Ready
ETH 52 Core blockchain operations โœ… Yes

| WEB3 | 2 | Utility methods | โœ… Yes | | NET | 9 | Network & peer management | โœ… Yes | | PERSONAL | 8 | Account management | โš ๏ธ Dev only | | DEBUG | 3 | Debugging and analysis | โš ๏ธ Use with caution | | QA | 3 | Testing utilities | โŒ Testing only | | CHECKPOINTING | 2 | ETC checkpointing | โœ… Yes (ETC specific) | | FUKUII | 1 | Custom extensions | โœ… Yes | | TEST | 7 | Test harness | โŒ Testing only | | IELE | 2 | IELE VM support | โš ๏ธ If IELE enabled | | MCP | 7 | Model Context Protocol | โœ… Yes | | RPC | 1 | RPC metadata | โœ… Yes | | TOTAL | 97 | All namespaces | Mixed |

Core Features

โœ… Complete Coverage

  • All standard Ethereum JSON-RPC methods
  • Block queries and transactions
  • Account state and balances
  • Contract calls and gas estimation
  • Event logs and filtering
  • Mining operations

๐Ÿ”ง ETC Extensions

  • Raw transaction retrieval
  • Storage root queries
  • Checkpointing system
  • Account transaction history

๐Ÿงช Development Tools

  • Test chain manipulation
  • QA mining utilities
  • Debug peer information
  • Account management (personal namespace)

๐Ÿ” Security Considerations

Production Configuration

For production deployments:

  1. Disable dangerous namespaces:

    fukuii.network.rpc {
      http {
        apis = "eth,web3,net"  # Exclude personal, debug, test, qa
      }
    }
    

  2. Enable authentication:

  3. Use reverse proxy (nginx, Caddy) for auth
  4. Implement API key validation
  5. Use firewall rules for IP whitelisting

  6. Rate limiting:

    fukuii.network.rpc {
      rate-limit {
        enabled = true
        min-request-interval = 100.milliseconds
      }
    }
    

  7. Use HTTPS/TLS:

  8. Never expose RPC over plain HTTP
  9. See TLS Operations Runbook

Method Safety

Safety Level Namespaces Notes
Safe eth (read-only), web3, net Always safe to expose
Restricted eth (write ops) Require authentication
Dangerous personal, debug Never expose publicly
Testing Only test, qa Disable in production

๐Ÿš€ Common Use Cases

1. Query Latest Block

curl -X POST http://localhost:8546 \
  -H "Content-Type: application/json" \
  -d '{
    "jsonrpc": "2.0",
    "id": 1,
    "method": "eth_blockNumber",
    "params": []
  }'

2. Get Account Balance

curl -X POST http://localhost:8546 \
  -H "Content-Type: application/json" \
  -d '{
    "jsonrpc": "2.0",
    "id": 1,
    "method": "eth_getBalance",
    "params": ["0xYourAddress", "latest"]
  }'

3. Call Smart Contract

curl -X POST http://localhost:8546 \
  -H "Content-Type: application/json" \
  -d '{
    "jsonrpc": "2.0",
    "id": 1,
    "method": "eth_call",
    "params": [{
      "to": "0xContractAddress",
      "data": "0xFunctionSignature"
    }, "latest"]
  }'

4. Query Event Logs

curl -X POST http://localhost:8546 \
  -H "Content-Type: application/json" \
  -d '{
    "jsonrpc": "2.0",
    "id": 1,
    "method": "eth_getLogs",
    "params": [{
      "fromBlock": "0x0",
      "toBlock": "latest",
      "address": "0xContractAddress"
    }]
  }'

5. Send Raw Transaction

curl -X POST http://localhost:8546 \
  -H "Content-Type: application/json" \
  -d '{
    "jsonrpc": "2.0",
    "id": 1,
    "method": "eth_sendRawTransaction",
    "params": ["0xSignedTransactionData"]
  }'

๐Ÿ“Š API Performance

Response Times (Typical)

Operation Average 95th Percentile
Block queries <10ms <50ms
Transaction receipts <10ms <30ms
Account balance <5ms <20ms
Contract calls <50ms <200ms
Log queries (1000 blocks) <100ms <500ms
Gas estimation <20ms <100ms

Caching Strategy

Fukuii caches: - โœ… Historical blocks (immutable) - โœ… Transaction receipts (immutable) - โš ๏ธ Latest block (TTL: 30s) - โŒ Pending data (not cached)

๐Ÿ”ง Troubleshooting

Common Issues

1. Connection Refused

Error: connect ECONNREFUSED 127.0.0.1:8546

Solution: Ensure Fukuii is running and RPC is enabled:

fukuii.network.rpc {
  http {
    enabled = true
    interface = "127.0.0.1"
    port = 8546
  }
}

2. Method Not Found

{
  "jsonrpc": "2.0",
  "id": 1,
  "error": {
    "code": -32601,
    "message": "Method not found"
  }
}

Solution: Check that the namespace is enabled in configuration:

fukuii.network.rpc {
  http {
    apis = "eth,web3,net,personal"  # Add required namespaces
  }
}

3. Rate Limited

Solution: Adjust rate limiting configuration or implement backoff in client:

async function callWithRetry(method, params, maxRetries = 3) {
  for (let i = 0; i < maxRetries; i++) {
    try {
      return await rpcCall(method, params);
    } catch (error) {
      if (error.code === -32005 && i < maxRetries - 1) {
        await sleep(1000 * (i + 1)); // Exponential backoff
      } else {
        throw error;
      }
    }
  }
}

๐Ÿ“ˆ Monitoring

Health Checks

Fukuii provides built-in health check endpoints:

# Liveness (is server running?)
curl http://localhost:8546/health

# Readiness (is node synced and ready?)
curl http://localhost:8546/readiness

# Detailed health info
curl http://localhost:8546/healthcheck

See Metrics & Monitoring for comprehensive monitoring setup.

Key Metrics to Monitor

  1. Sync Status: eth_syncing
  2. Peer Count: net_peerCount
  3. Latest Block: eth_blockNumber
  4. Gas Price: eth_gasPrice
  5. Chain ID: eth_chainId

๐Ÿค Contributing

Found an issue or want to suggest an improvement? See our Contributing Guide.

Documentation Updates

When updating API documentation:

  1. Update the relevant markdown file
  2. Update the Insomnia workspace (insomnia_workspace.json in repository root) if adding/modifying endpoints
  3. Regenerate the OpenAPI spec by running: python3 scripts/convert_insomnia_to_openapi.py
  4. Update coverage analysis if implementation status changes
  5. Test all examples and code snippets
  6. Submit PR with clear description

Updating the Interactive API Reference

The interactive API reference is automatically generated from the Insomnia workspace:

# 1. Update insomnia_workspace.json with new/modified endpoints
# 2. Run the conversion script
python3 scripts/convert_insomnia_to_openapi.py

# 3. Verify the OpenAPI spec
python3 -c "import json; print(json.load(open('docs/api/openapi.json'))['info']['title'])"

# 4. Build and preview the docs
mkdocs serve
# Visit http://localhost:8000/api/interactive-api-reference/

๐Ÿ“š Additional Resources

Official Documentation

Tools & Libraries

  • JavaScript/TypeScript: ethers.js, web3.js
  • Python: web3.py
  • Go: go-ethereum (geth)
  • Rust: ethers-rs
  • Java: web3j

Community

๐Ÿ“‹ Changelog

2025-12-12

  • โœ… Complete RPC endpoint inventory (97 endpoints cataloged)
  • โœ… MCP analysis and enhancement plan created
  • โœ… Identified MCP coverage gaps (7.2% โ†’ 85% target)
  • โœ… 6-phase roadmap for agent-controlled node management
  • โœ… Security architecture for multi-level access control

2025-11-24

  • โœ… Created comprehensive API documentation
  • โœ… Completed coverage analysis
  • โœ… Added MCP integration guide
  • โœ… Updated Insomnia workspace
  • โœ… Documented all endpoints

Future Plans

  • Implement MCP Enhancement Plan (Phases 1-6)
  • Add 45+ new MCP tools for complete node control
  • Implement multi-level access control for agents
  • Add transaction tracing (debug namespace)
  • Add WebSocket subscription support
  • Implement GraphQL endpoint (optional)

Maintained by: Chippr Robotics LLC
Last Updated: 2025-11-24
License: Apache 2.0