KardiaChain Docs
  • Introduction
  • Technology
    • Consensus
    • Kardia Virtual Machine (KVM)
    • Kardia Smart Contract Markup Language
    • Peer to Peer (P2P)
    • Onchain AI
    • NF3 Chip
  • For Users
    • KardiaChain Proposer Validator Selection Process
    • Staking
      • Validators
      • Delegators
      • Disciplines and Rewards
        • Disciplines
        • Rewards
    • Transaction Fee
    • Wallets
      • MetaMask Compatible
      • KardiaChain Mobile App Wallet
      • [Deprecated] KardiaChain Web Wallet
        • [Deprecated] KardiaChain Wallet Extension
  • For Developers
    • Tutorials
      • Platform
        • Running KardiaChain node
        • Private KardiaChain Network
        • KAI Integration for Exchanges
      • Smart contract development
        • Dev environment
          • Solidity
          • IDE and tools
            • Remix
            • Hardhat
            • Truffle
        • Contract verification
      • KRC20 Tokens
        • Deploying KRC20 Token
        • KRC20 token verification
      • KRC721 Tokens
        • Deploy KRC721 tokens
      • Building DApp
        • Frontend
        • Data indexing service
    • SDK
      • Web3
      • [Deprecated] KardiaChain JS SDK
      • [Deprecated] KardiaChain Golang SDK
    • RPC
      • JSON RPC API
    • KardiaID Service
      • KardiaID Service Design
      • KardiaID Service API
  • Archived Docs
    • Golang SDK
    • Network
    • KVM
    • System requirement
    • Deployment
      • Configuration
      • Local
      • Public testnet
      • Mainnet
    • KSML
    • Staking Overview
      • Delegation period
      • Consensus
      • Delegator
        • What is a delegator ?
        • Choose validator
        • Directive of delegator
        • Risk
      • Proposer selection procedure
      • Staking rewards and distributions
        • Block reward distributed
        • Fee distributed
      • Slashing and Jail
      • Rewards mechanism
      • Validator
        • What is a validator ?
        • The different states a validator
        • The responsibility of validator
        • The incentive run a validator
        • To become validator
    • KardiaChain Metamask (extension) Wallet
Powered by GitBook
On this page
  • JSON RPC API
  • JavaScript API:
  • JSON-RPC Endpoint:
  • Ratelimit:
  • Go:
  • JSON-RPC Support:
  • Curl Examples Explain:
  • JSON-RPC Methods and Reference:

Was this helpful?

  1. For Developers
  2. RPC

JSON RPC API

PreviousRPCNextKardiaID Service

Last updated 3 years ago

Was this helpful?

Link

JSON RPC API

JavaScript API:

To talk to an KardiaChain node from inside a JavaScript application use the library, which gives a convenient interface for the RPC methods.

JSON-RPC Endpoint:

Client

URL

Local

Mainnet

Ratelimit:

JSON-RPC rate limits after exceeding duration request limit. These rate limits are in place to ensure the reliability.

If you are rate limited, your JSONRPC responses will have HTTP Status code 429

{
  "jsonrpc": "2.0",
  "id": 1,
  "error": {
    "code": -32005,
    "message": "request rate exceeded limit",
    "data": {
      "view_more": "https://docs.kardiachain.io/docs/for-developers/rpc/json-rpc-api#ratelimit",
      "allowed_limit": "15000 requests per 10 minutes",
      "block_time": "60 minutes"
    }
  }
}

Go:

JSON-RPC Support:

Currently, the Go client of Kardia node supports JSON-RPC 2.0 via HTTP.

Additional protocols such as IPC will be supported in the future.

Curl Examples Explain:

The curl options below might return a response where the node complains about the content type. This is because the --data option sets the content type to application/x-www-form-urlencoded . If your node does complain, manually set the header by placing -H "Content-Type: application/json" at the start of the call.

The examples also do not include the URL/IP & port combination which must be the last argument given to curl e.x. 0.0.0.0:8545

JSON-RPC Methods and Reference:

Click on each method below. It will redirect to a github link which will provide the reference code.

Start KardiaChain network . Change the default port (8545) and listing address (0.0.0.0) with:

https://github.com/kardiachain/go-kardia/wiki/Kardia-JSON-RPC-API
Kardia Javascript SDK
[README]
node_nodeInfo
node_peers
node_datadir
kai_blockNumber
kai_getBlockByHash
kai_getBlockHeaderByHash
kai_getBlockByNumber
kai_getBlockHeaderByNumber
kai_getBlockHeaderByHash
kai_kardiaCall
kai_newFilter
kai_newBlockFilter
kai_uninstallFilter
kai_getFilterChanges
kai_getFilterLogs
k
ai_getLogs
kai_validator
kai_validators
kai_gasPrice
kai_getCommit
kai_getValidatorSet
kai_getProof
tx_sendRawTransaction
tx_pendingTransactions
tx_getTransaction
tx_getTransactionReceipt
account_balance
account_nonce
account_nonceAtHeight
account_getCode
account_getStorageAt
http://0.0.0.0:8545
https://rpc.kardiachain.io