Bware Docs
  • About Bware Labs Decentralized API
  • API Docs
    • Ethereum API
      • RPC
        • eth_getBlockByNumber method
        • eth_getBalance method
        • eth_blockNumber method
        • eth_syncing method
      • Websocket API
        • eth_syncing method
    • Binance Smart Chain API
      • RPC
        • eth_getTransactionByHash method
        • eth_getBlockByNumber method
        • eth_blockNumber method
        • eth_syncing method
        • eth_getBalance method
        • eth_accounts method
        • eth_gasPrice method
      • Websocket API
        • eth_syncing method
    • Avalanche API
      • X-Chain
      • C-Chain
      • P-Chain
      • Keystore API
      • Health API
      • Admin API
      • Info API
      • Metrics API
    • Moonbeam/Moonriver API
      • RPC
        • eth_getBlockByNumber method
        • eth_getBalance method
        • eth_blockNumber method
        • eth_syncing method
      • Websocket
    • Astar/Shiden APIs
      • RPC
        • eth_getBlockByNumber method
        • eth_getBalance method
        • eth_blockNumber method
        • eth_syncing method
      • Websocket
    • Fantom API
      • RPC
        • eth_getBlockByNumber method
        • eth_getBalance method
        • eth_blockNumber method
        • eth_syncing method
      • Websockets
        • eth_syncing method
    • Polkadot API
      • RPC
        • chain_getBlock
        • chain_getHeader
        • system_chainType
        • state_getMetadata
      • Websockets
        • system_chainType
    • Elrond API
      • REST API
        • Get Block By Hash
        • Get Shard Status
  • Tutorials
    • Using Bware Labs Platform
      • Getting a Bware Labs full endpoint
    • Using Bware Labs Endpoint in PolkadotJs
    • Using Bware Labs Endpoint in Metamask
    • Using a Bware Labs endpoint in code
Powered by GitBook
On this page
  • Deploying a Smart Contract
  • Methods
  • JSON-RPC Endpoints
  • Examples
  • Example Call

Was this helpful?

  1. API Docs
  2. Avalanche API

C-Chain

PreviousX-ChainNextP-Chain

Last updated 3 years ago

Was this helpful?

Deploying a Smart Contract

For a tutorial on deploying a Solidity smart contract on the C-Chain, see

Methods

This API is identical to Geth’s API except that it only supports the following services:

  • web3_

  • net_

  • eth_

  • personal_

  • txpool_

You can interact with these services the same exact way you’d interact with Geth. See the and for a full description of this API.

JSON-RPC Endpoints

To interact with C-Chain (the main EVM instance on Avalanche):

/ext/bc/C/rpc

To interact with other instances of the EVM:

/ext/bc/blockchainID/rpc

Examples

Getting the current client version

Example Call

//Request
curl -X POST --data '{
    "jsonrpc": "2.0",
    "method": "web3_clientVersion",
    "params": [],
    "id": 1
}' -H 'Content-Type: application/json' \
   -H 'cache-control: no-cache' \
https://ava-api-c-chain.bwarelabs.com/<your-endpoint-id>/ext/bc/C/rpc 
   
//Response

{
    "jsonrpc": "2.0",
    "id": 1,
    "result": "Athereum 1.0"
}  

here.
Ethereum Wiki’s JSON-RPC Documentation
Geth’s JSON-RPC Documentation