JSON-RPC 方法
Bitcoin RPC 比特币 RPC
示例 RPC
curl https://api.chainup.net/bitcoin/mainnet/<YOUR_API_KEY> \
-X POST \
-H 'content-type: application/json' \
-H "CONSISTENT-HASH: true" \
--data '{"jsonrpc":"2.0","method":"getblockchaininfo","params":[],"id":1}'const axios = require('axios');
let options = {
url: "https://api.chainup.net/bitcoin/mainnet/<YOUR_API_KEY>",
method: "post",
headers:
{
"content-type": "application/json",
"CONSISTENT-HASH": "true"
},
body: JSON.stringify({"jsonrpc":"2.0","method":"getblockchaininfo","params":[],"id":1})
};
axios(options)
.then(response => {
console.log('Post successful: response:', response.data);
})
.catch(error => {
console.error('An error has occurred:', error);
可用的比特币 API 请求方法
"getbestblockhash"
"getblock"
"getblockchaininfo"
"getblockcount"
"getblockfilter"
"getblockfrompeer"
"getblockhash"
"getblockheader"
"getblockstats"
"getchaintips"
"getchaintxstats"
"getdeploymentinfo"
"getdifficulty"
"getmempoolancestors"
"getmempooldescendants"
"getmempoolentry"
"getmempoolinfo"
"getrawmempool"
"gettxout"
"gettxoutproof"
"gettxoutsetinfo"
"gettxspendingprevout"
"preciousblock"
"pruneblockchain"
"savemempool"
"scantxoutset"
"verifychain"
"verifytxoutproof"Last updated