C-Chain

Deploying a Smart Contract

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

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 Ethereum Wiki’s JSON-RPC Documentation and Geth’s JSON-RPC Documentation for a full description of this API.

JSON-RPC Endpoints

To interact with C-Chain (the main EVM instance on Avalanche):
1
/ext/bc/C/rpc
Copied!
To interact with other instances of the EVM:
1
/ext/bc/blockchainID/rpc
Copied!

Examples

Getting the current client version

Example Call

1
//Request
2
curl -X POST --data '{
3
"jsonrpc": "2.0",
4
"method": "web3_clientVersion",
5
"params": [],
6
"id": 1
7
}' -H 'Content-Type: application/json' \
8
-H 'cache-control: no-cache' \
9
https://ava-api-c-chain.bwarelabs.com/<your-endpoint-id>/ext/bc/C/rpc
10
11
//Response
12
13
{
14
"jsonrpc": "2.0",
15
"id": 1,
16
"result": "Athereum 1.0"
17
}
Copied!
Last modified 4mo ago