Marketplace has launched, further enabling blockchain developers! Learn more

Contents

eth_chainId RPC method

The eth_chainId EVM method is only supported on the Avalanche C-Chain.

Parameters:

  1. None

Returns:

  1. Quantity - EIP155 Chain ID.

Code Examples:

To use the eth_chainId EVM method on the Avalanche C-Chain, ensure that the end of your URL includes ext/bc/C/rpc.

require 'ethereum.rb'
client = Ethereum::HttpClient.new('http://sample-endpoint-name.network.quiknode.pro/token-goes-here/')
network = client.net_version
puts network["result"]
Ready to get started? Create a free account