-
Notifications
You must be signed in to change notification settings - Fork 0
API
prasad-kumkar edited this page May 5, 2025
·
1 revision
The jam.api module provides interfaces for interacting with the Tessera node, including both RPC (Remote Procedure Call) and REST API endpoints.
Tessera supports multiple API interfaces:
- JSON-RPC API: Primary interface for programmatic interaction with the node
- REST API: HTTP-based interface for querying node state and submitting transactions
- WebSocket API: For subscribing to events and real-time updates
- Query current blockchain height
- Get block information by hash or height
- Get transaction information by hash
- Query network status and synchronization progress
- Query current state values
- Generate state proofs
- Retrieve account information
- Submit extrinsics to the network
- Check transaction status and inclusion
- Query transaction fees
- Query validator information
- Submit validator-specific transactions
- Monitor validation performance
The JSON-RPC API exposes methods with the following format:
{
"jsonrpc": "2.0",
"id": 1,
"method": "module_methodName",
"params": [param1, param2, ...]
}
Common method namespaces include:
- jam_: Core node methods
- state_: State query methods
- chain_: Chain information methods
- author_: Methods for authoring blocks and submitting transactions
- system_: Node system information
API services can be configured through the node configuration:
# Configure API endpoints in node setup
node_config = {
"api": {
"http_enabled": True,
"http_port": 9933,
"ws_enabled": True,
"ws_port": 9944,
"cors_origins": ["*"],
"max_connections": 100
}
}
# Initialize node with configuration
node = JamNode(config=node_config)Tessera API endpoints support various authentication mechanisms:
- API keys for programmatic access
- JWT tokens for authenticated sessions
- IP-based access control
These security features can be configured in the node configuration.