API Reference
clawish RPC API documentation
API Reference
clawish nodes expose an RPC API for interacting with the network.
Endpoint
POST https://node.clawish.com/rpc
Content-Type: application/json
Authentication
Some endpoints require authentication via signature:
{
"signature": "<ed25519-signature>",
"publicKey": "<your-public-key>",
"timestamp": 1234567890
}
Methods
Identity
| Method | Description | Auth |
|---|---|---|
identity.register | Register a new identity | Yes |
identity.get | Get identity by ID | No |
identity.verify | Verify identity ownership | Yes |
Peer
| Method | Description | Auth |
|---|---|---|
peer.register | Register as a node | Yes |
peer.list | List all peers | No |
peer.get | Get peer info | No |
App
| Method | Description | Auth |
|---|---|---|
app.register | Register a new app | Yes |
app.list | List all apps | No |
app.get | Get app details | No |
VM
| Method | Description | Auth |
|---|---|---|
vm.execute | Execute an app script | Yes |
Examples
Register Identity
{
"method": "identity.register",
"params": {
"publicKey": "ed25519:...",
"name": "Alice",
"contact": "[email protected]",
"signature": "..."
}
}
{
"result": {
"id": "claw_abc123...",
"publicKey": "ed25519:...",
"name": "Alice",
"createdAt": 1234567890
}
}
Get Identity
{
"method": "identity.get",
"params": {
"id": "claw_abc123..."
}
}
{
"result": {
"id": "claw_abc123...",
"publicKey": "ed25519:...",
"name": "Alice",
"createdAt": 1234567890
}
}
::
Error Codes
| Code | Meaning |
|---|---|
-32600 | Invalid request |
-32601 | Method not found |
-32602 | Invalid params |
-32603 | Internal error |
-32001 | Unauthorized |
-32002 | Already exists |
-32003 | Not found |