JSON-RPC Endpoint¶
JSON-RPC is the interface applications use to read chain state, submit transactions, and subscribe to events on Bitgold Network. Bitgold exposes a Geth-compatible API, with a small number of network-specific extensions documented in the Bitgold API list.
RPC endpoints¶
Bitgold Mainnet (chain ID 0x26A, 618 in decimal)¶
https://rpc.bitgold.networkhttps://mainnet1.bitgold.networkhttps://mainnet2.bitgold.networkhttps://mainnet3.bitgold.networkhttps://mainnet4.bitgold.networkhttps://mainnet5.bitgold.networkhttps://mainnet6.bitgold.network
Bitgold Testnet (chain ID 0x269, 617 in decimal)¶
https://testnet1.bitgold.networkhttps://testnet2.bitgold.networkhttps://testnet3.bitgold.network
All endpoints support HTTP and WebSocket JSON-RPC. Use the endpoint closest to your infrastructure, and configure a fallback so that a single endpoint outage does not stop your application.
Connecting¶
Add Bitgold to your wallet with the values in Wallet Configuration. From a shell, you can check an endpoint with curl:
curl -X POST https://rpc.bitgold.network \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","method":"eth_chainId","params":[],"id":1}'
The response for mainnet is 0x26a; for testnet it is 0x269.
You can also attach a Geth console to a node:
## mainnet
geth attach https://rpc.bitgold.network
## testnet
geth attach https://testnet1.bitgold.network
JSON-RPC API¶
Bitgold is EVM-compatible and aims to be as compatible as possible with the Go-Ethereum API. It also provides network-specific APIs for fast finality, blob transactions, and other Bitgold features.
Geth (Go-Ethereum) API¶
Bitgold is nearly fully compatible with the Geth APIs. Any exceptions or incompatibilities are explicitly listed. For detailed usage of a specific API, see the Geth JSON-RPC documentation.
Finality¶
Ethereum’s PoS consensus protocol, Gasper, is built on LMD-GHOST and Casper FFG. Bitgold’s consensus protocol, Parlia, is constructed on top of a difficulty-based fork-choice mechanism with FFG, as described in BEP-126. To further increase throughput, validators are allowed to produce multiple consecutive blocks, as described in BEP-341. For the Bitgold-specific finality methods, see the Bitgold Finality API.
Blob¶
Bitgold implements EIP-4844, which supports shard blob transactions, as described in BEP-336. For Bitgold’s blob-related methods, see the Bitgold Blob API.
Other Bitgold APIs¶
Bitgold implements additional APIs beyond the Geth surface. See Bitgold API for the full list.