Bitcoin
Bitcoin mainnet over Bitcoin Core JSON-RPC.
Endpoint
| Default port | 3360 (override per endpoints[] entry) |
| Calling convention | POST / with a JSON-RPC body |
chain-id |
BTC |
| Spec | specs/btc.json |
Supported method families
Bitcoin speaks Bitcoin Core's JSON-RPC, not the Ethereum one.
| Family | Examples |
|---|---|
| Blocks | getblockcount, getblockhash, getblock, getblockheader, getbestblockhash, getblockchaininfo |
| Transactions | getrawtransaction, decoderawtransaction, sendrawtransaction, gettxout |
| Network / node | getnetworkinfo, getmempoolinfo, estimatesmartfee, getmininginfo |
The full method list lives in the spec file linked above.
Run this example
The repo ships a ready-to-run config at config/smartrouter_examples/smartrouter_bitcoin.yml — a single public upstream on PublicNode (bitcoin-rpc.publicnode.com), no API key needed. Bitcoin Core's JSON-RPC has no websocket surface, so run it with --skip-websocket-verification:
Then call it:
# current block height
curl -X POST http://127.0.0.1:3360 \
-H 'Content-Type: application/json' \
-d '{"jsonrpc":"1.0","method":"getblockcount","params":[],"id":1}'
Connect a client
Point at your own upstreams by editing the node-urls in the config — see The config file.