Skip to content
This repository was archived by the owner on Nov 26, 2024. It is now read-only.

Commit bc16251

Browse files
committed
Add suport for bitcoind v18.1
1 parent a5c34fd commit bc16251

File tree

5 files changed

+372
-0
lines changed

5 files changed

+372
-0
lines changed

contrib/run_bitcoind.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
#!/usr/bin/env bash
22
#
33
# Run local regtest `bitcoind` nodes.
4+
#
5+
# shell: alias bt18='bitcoin-cli -rpcconnect=localhost:18149 -rpcuser=user -rpcpassword=password'
46

57
set -euo pipefail
68

@@ -22,6 +24,7 @@ COMMAND
2224
2325
KNOWN_VERSION
2426
- v17 Bitcoin Core v0.17.1
27+
- v18 Bitcoin Core v0.18.1
2528
- v22 Bitcoin Core v22.1
2629
2730
EOF
@@ -40,6 +43,7 @@ main() {
4043
case $cmd in
4144
all)
4245
start "v17"
46+
start "v18"
4347
start "v22"
4448
;;
4549

@@ -50,6 +54,7 @@ main() {
5054
stop)
5155
pkill bitcoind
5256
rm -rf "/tmp/rust-bitcoind-json-rpc-0.17.1/2/regtest/wallets" > /dev/null
57+
rm -rf "/tmp/rust-bitcoind-json-rpc-0.18.1/2/regtest/wallets" > /dev/null
5358
rm -rf "/tmp/rust-bitcoind-json-rpc-22.1/2/regtest/wallets" > /dev/null
5459
;;
5560
*)
@@ -70,6 +75,12 @@ start() {
7075
run_bitcoind "$version" "$version_number" "$version_id"
7176
;;
7277

78+
v18)
79+
local version_number="0.18.1"
80+
local version_id="181"
81+
run_bitcoind "$version" "$version_number" "$version_id"
82+
;;
83+
7384
v22)
7485
local version_number="22.1"
7586
local version_id="221"

src/json/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,5 @@
66
//! latest minor version number for each major release i.e., `v22` means `bitcoind v22.1`.
77
88
pub mod v17;
9+
pub mod v18;
910
pub mod v22;

src/json/v18/mod.rs

Lines changed: 165 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,165 @@
1+
// SPDX-License-Identifier: CC0-1.0
2+
3+
//! Structs with standard types.
4+
//!
5+
//! These structs model the types returned by the JSON-RPC API and use stdlib types (or custom
6+
//! types) and are specific to a specific to Bitcoin Core `v0.18.1`.
7+
8+
// == Blockchain ==
9+
// - [x] getbestblockhash
10+
pub use crate::json::v17::GetBestBlockHash;
11+
// - [x] getblock "blockhash" ( verbosity )
12+
pub use crate::json::v17::{GetBlockVerbosityOne, GetBlockVerbosityZero};
13+
// - [x] getblockchaininfo
14+
pub use crate::json::v17::GetBlockchainInfo;
15+
// - [ ] getblockcount
16+
// - [ ] getblockhash height
17+
// - [ ] getblockheader "blockhash" ( verbose )
18+
// - [ ] getblockstats hash_or_height ( stats )
19+
// - [ ] getchaintips
20+
// - [ ] getchaintxstats ( nblocks "blockhash" )
21+
// - [ ] getdifficulty
22+
// - [ ] getmempoolancestors "txid" ( verbose )
23+
// - [ ] getmempooldescendants "txid" ( verbose )
24+
// - [ ] getmempoolentry "txid"
25+
// - [ ] getmempoolinfo
26+
// - [ ] getrawmempool ( verbose )
27+
// - [ ] gettxout "txid" n ( include_mempool )
28+
pub use crate::json::v17::GetTxOut;
29+
// - [ ] gettxoutproof ["txid",...] ( "blockhash" )
30+
// - [ ] gettxoutsetinfo
31+
// - [ ] preciousblock "blockhash"
32+
// - [ ] pruneblockchain height
33+
// - [ ] savemempool
34+
// - [ ] scantxoutset "action" [scanobjects,...]
35+
// - [ ] verifychain ( checklevel nblocks )
36+
// - [ ] verifytxoutproof "proof"
37+
//
38+
// == Control ==
39+
// - [ ] getmemoryinfo ( "mode" )
40+
// - [ ] getrpcinfo
41+
// - [ ] help ( "command" )
42+
// - [ ] logging ( ["include_category",...] ["exclude_category",...] )
43+
// - [ ] stop
44+
// - [ ] uptime
45+
//
46+
// == Generating ==
47+
// - [ ] generate nblocks ( maxtries )
48+
// - [x] generatetoaddress nblocks "address" ( maxtries )
49+
pub use crate::json::v17::GenerateToAddress;
50+
//
51+
// == Mining ==
52+
// - [ ] getblocktemplate "template_request"
53+
// - [ ] getmininginfo
54+
// - [ ] getnetworkhashps ( nblocks height )
55+
// - [ ] prioritisetransaction "txid" ( dummy ) fee_delta
56+
// - [ ] submitblock "hexdata" ( "dummy" )
57+
// - [ ] submitheader "hexdata"
58+
//
59+
// == Network ==
60+
// - [ ] addnode "node" "command"
61+
// - [ ] clearbanned
62+
// - [ ] disconnectnode ( "address" nodeid )
63+
// - [ ] getaddednodeinfo ( "node" )
64+
// - [ ] getconnectioncount
65+
// - [ ] getnettotals
66+
// - [x] getnetworkinfo
67+
pub use crate::json::v17::GetNetworkInfo;
68+
// - [ ] getnodeaddresses ( count )
69+
// - [ ] getpeerinfo
70+
// - [ ] listbanned
71+
// - [ ] ping
72+
// - [ ] setban "subnet" "command" ( bantime absolute )
73+
// - [ ] setnetworkactive state
74+
//
75+
// == Rawtransactions ==
76+
// - [ ] analyzepsbt "psbt"
77+
// - [ ] combinepsbt ["psbt",...]
78+
// - [ ] combinerawtransaction ["hexstring",...]
79+
// - [ ] converttopsbt "hexstring" ( permitsigdata iswitness )
80+
// - [ ] createpsbt [{"txid":"hex","vout":n,"sequence":n},...] [{"address":amount},{"data":"hex"},...] ( locktime replaceable )
81+
// - [ ] createrawtransaction [{"txid":"hex","vout":n,"sequence":n},...] [{"address":amount},{"data":"hex"},...] ( locktime replaceable )
82+
// - [ ] decodepsbt "psbt"
83+
// - [ ] decoderawtransaction "hexstring" ( iswitness )
84+
// - [ ] decodescript "hexstring"
85+
// - [ ] finalizepsbt "psbt" ( extract )
86+
// - [ ] fundrawtransaction "hexstring" ( options iswitness )
87+
// - [ ] getrawtransaction "txid" ( verbose "blockhash" )
88+
// - [ ] joinpsbts ["psbt",...]
89+
// - [ ] sendrawtransaction "hexstring" ( allowhighfees )
90+
// - [ ] signrawtransactionwithkey "hexstring" ["privatekey",...] ( [{"txid":"hex","vout":n,"scriptPubKey":"hex","redeemScript":"hex","witnessScript":"hex","amount":amount},...] "sighashtype" )
91+
// - [ ] testmempoolaccept ["rawtx",...] ( allowhighfees )
92+
// - [ ] utxoupdatepsbt "psbt"
93+
//
94+
// == Util ==
95+
// - [ ] createmultisig nrequired ["key",...] ( "address_type" )
96+
// - [ ] deriveaddresses "descriptor" ( range )
97+
// - [ ] estimatesmartfee conf_target ( "estimate_mode" )
98+
// - [ ] getdescriptorinfo "descriptor"
99+
// - [ ] signmessagewithprivkey "privkey" "message"
100+
// - [ ] validateaddress "address"
101+
// - [ ] verifymessage "address" "signature" "message"
102+
//
103+
// == Wallet ==
104+
// - [ ] abandontransaction "txid"
105+
// - [ ] abortrescan
106+
// - [ ] addmultisigaddress nrequired ["key",...] ( "label" "address_type" )
107+
// - [ ] backupwallet "destination"
108+
// - [ ] bumpfee "txid" ( options )
109+
// - [x] createwallet "wallet_name" ( disable_private_keys blank )
110+
pub use crate::json::v17::CreateWallet;
111+
// - [ ] dumpprivkey "address"
112+
// - [ ] dumpwallet "filename"
113+
// - [ ] encryptwallet "passphrase"
114+
// - [ ] getaddressesbylabel "label"
115+
// - [ ] getaddressinfo "address"
116+
// - [x] getbalance ( "dummy" minconf include_watchonly )
117+
pub use crate::json::v17::GetBalance;
118+
// - [x] getnewaddress ( "label" "address_type" )
119+
pub use crate::json::v17::GetNewAddress;
120+
// - [ ] getrawchangeaddress ( "address_type" )
121+
// - [ ] getreceivedbyaddress "address" ( minconf )
122+
// - [ ] getreceivedbylabel "label" ( minconf )
123+
// - [ ] gettransaction "txid" ( include_watchonly )
124+
// - [ ] getunconfirmedbalance
125+
// - [ ] getwalletinfo
126+
// - [ ] importaddress "address" ( "label" rescan p2sh )
127+
// - [ ] importmulti "requests" ( "options" )
128+
// - [ ] importprivkey "privkey" ( "label" rescan )
129+
// - [ ] importprunedfunds "rawtransaction" "txoutproof"
130+
// - [ ] importpubkey "pubkey" ( "label" rescan )
131+
// - [ ] importwallet "filename"
132+
// - [ ] keypoolrefill ( newsize )
133+
// - [ ] listaddressgroupings
134+
// - [ ] listlabels ( "purpose" )
135+
// - [ ] listlockunspent
136+
// - [ ] listreceivedbyaddress ( minconf include_empty include_watchonly "address_filter" )
137+
// - [ ] listreceivedbylabel ( minconf include_empty include_watchonly )
138+
// - [ ] listsinceblock ( "blockhash" target_confirmations include_watchonly include_removed )
139+
// - [ ] listtransactions ( "label" count skip include_watchonly )
140+
// - [ ] listunspent ( minconf maxconf ["address",...] include_unsafe query_options )
141+
// - [ ] listwalletdir
142+
// - [ ] listwallets
143+
// - [x] loadwallet "filename"
144+
pub use crate::json::v17::LoadWallet;
145+
// - [ ] lockunspent unlock ( [{"txid":"hex","vout":n},...] )
146+
// - [ ] removeprunedfunds "txid"
147+
// - [ ] rescanblockchain ( start_height stop_height )
148+
// - [ ] sendmany "" {"address":amount} ( minconf "comment" ["address",...] replaceable conf_target "estimate_mode" )
149+
// - [ ] sendtoaddress "address" amount ( "comment" "comment_to" subtractfeefromamount replaceable conf_target "estimate_mode" )
150+
pub use crate::json::v17::SendToAddress;
151+
// - [ ] sethdseed ( newkeypool "seed" )
152+
// - [ ] setlabel "address" "label"
153+
// - [ ] settxfee amount
154+
// - [ ] signmessage "address" "message"
155+
// - [ ] signrawtransactionwithwallet "hexstring" ( [{"txid":"hex","vout":n,"scriptPubKey":"hex","redeemScript":"hex","witnessScript":"hex","amount":amount},...] "sighashtype" )
156+
// - [ ] unloadwallet ( "wallet_name" )
157+
// - [ ] walletcreatefundedpsbt [{"txid":"hex","vout":n,"sequence":n},...] [{"address":amount},{"data":"hex"},...] ( locktime options bip32derivs )
158+
// - [ ] walletlock
159+
// - [ ] walletpassphrase "passphrase" timeout
160+
// - [ ] walletpassphrasechange "oldpassphrase" "newpassphrase"
161+
// - [ ] walletprocesspsbt "psbt" ( sign "sighashtype" bip32derivs )
162+
//
163+
// == Zmq ==
164+
// - [ ] getzmqnotifications
165+

src/json/v18/rpc-api.txt

Lines changed: 146 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,146 @@
1+
== Blockchain ==
2+
getbestblockhash
3+
getblock "blockhash" ( verbosity )
4+
getblockchaininfo
5+
getblockcount
6+
getblockhash height
7+
getblockheader "blockhash" ( verbose )
8+
getblockstats hash_or_height ( stats )
9+
getchaintips
10+
getchaintxstats ( nblocks "blockhash" )
11+
getdifficulty
12+
getmempoolancestors "txid" ( verbose )
13+
getmempooldescendants "txid" ( verbose )
14+
getmempoolentry "txid"
15+
getmempoolinfo
16+
getrawmempool ( verbose )
17+
gettxout "txid" n ( include_mempool )
18+
gettxoutproof ["txid",...] ( "blockhash" )
19+
gettxoutsetinfo
20+
preciousblock "blockhash"
21+
pruneblockchain height
22+
savemempool
23+
scantxoutset "action" [scanobjects,...]
24+
verifychain ( checklevel nblocks )
25+
verifytxoutproof "proof"
26+
27+
== Control ==
28+
getmemoryinfo ( "mode" )
29+
getrpcinfo
30+
help ( "command" )
31+
logging ( ["include_category",...] ["exclude_category",...] )
32+
stop
33+
uptime
34+
35+
== Generating ==
36+
generate nblocks ( maxtries )
37+
generatetoaddress nblocks "address" ( maxtries )
38+
39+
== Mining ==
40+
getblocktemplate "template_request"
41+
getmininginfo
42+
getnetworkhashps ( nblocks height )
43+
prioritisetransaction "txid" ( dummy ) fee_delta
44+
submitblock "hexdata" ( "dummy" )
45+
submitheader "hexdata"
46+
47+
== Network ==
48+
addnode "node" "command"
49+
clearbanned
50+
disconnectnode ( "address" nodeid )
51+
getaddednodeinfo ( "node" )
52+
getconnectioncount
53+
getnettotals
54+
getnetworkinfo
55+
getnodeaddresses ( count )
56+
getpeerinfo
57+
listbanned
58+
ping
59+
setban "subnet" "command" ( bantime absolute )
60+
setnetworkactive state
61+
62+
== Rawtransactions ==
63+
analyzepsbt "psbt"
64+
combinepsbt ["psbt",...]
65+
combinerawtransaction ["hexstring",...]
66+
converttopsbt "hexstring" ( permitsigdata iswitness )
67+
createpsbt [{"txid":"hex","vout":n,"sequence":n},...] [{"address":amount},{"data":"hex"},...] ( locktime replaceable )
68+
createrawtransaction [{"txid":"hex","vout":n,"sequence":n},...] [{"address":amount},{"data":"hex"},...] ( locktime replaceable )
69+
decodepsbt "psbt"
70+
decoderawtransaction "hexstring" ( iswitness )
71+
decodescript "hexstring"
72+
finalizepsbt "psbt" ( extract )
73+
fundrawtransaction "hexstring" ( options iswitness )
74+
getrawtransaction "txid" ( verbose "blockhash" )
75+
joinpsbts ["psbt",...]
76+
sendrawtransaction "hexstring" ( allowhighfees )
77+
signrawtransactionwithkey "hexstring" ["privatekey",...] ( [{"txid":"hex","vout":n,"scriptPubKey":"hex","redeemScript":"hex","witnessScript":"hex","amount":amount},...] "sighashtype" )
78+
testmempoolaccept ["rawtx",...] ( allowhighfees )
79+
utxoupdatepsbt "psbt"
80+
81+
== Util ==
82+
createmultisig nrequired ["key",...] ( "address_type" )
83+
deriveaddresses "descriptor" ( range )
84+
estimatesmartfee conf_target ( "estimate_mode" )
85+
getdescriptorinfo "descriptor"
86+
signmessagewithprivkey "privkey" "message"
87+
validateaddress "address"
88+
verifymessage "address" "signature" "message"
89+
90+
== Wallet ==
91+
abandontransaction "txid"
92+
abortrescan
93+
addmultisigaddress nrequired ["key",...] ( "label" "address_type" )
94+
backupwallet "destination"
95+
bumpfee "txid" ( options )
96+
createwallet "wallet_name" ( disable_private_keys blank )
97+
dumpprivkey "address"
98+
dumpwallet "filename"
99+
encryptwallet "passphrase"
100+
getaddressesbylabel "label"
101+
getaddressinfo "address"
102+
getbalance ( "dummy" minconf include_watchonly )
103+
getnewaddress ( "label" "address_type" )
104+
getrawchangeaddress ( "address_type" )
105+
getreceivedbyaddress "address" ( minconf )
106+
getreceivedbylabel "label" ( minconf )
107+
gettransaction "txid" ( include_watchonly )
108+
getunconfirmedbalance
109+
getwalletinfo
110+
importaddress "address" ( "label" rescan p2sh )
111+
importmulti "requests" ( "options" )
112+
importprivkey "privkey" ( "label" rescan )
113+
importprunedfunds "rawtransaction" "txoutproof"
114+
importpubkey "pubkey" ( "label" rescan )
115+
importwallet "filename"
116+
keypoolrefill ( newsize )
117+
listaddressgroupings
118+
listlabels ( "purpose" )
119+
listlockunspent
120+
listreceivedbyaddress ( minconf include_empty include_watchonly "address_filter" )
121+
listreceivedbylabel ( minconf include_empty include_watchonly )
122+
listsinceblock ( "blockhash" target_confirmations include_watchonly include_removed )
123+
listtransactions ( "label" count skip include_watchonly )
124+
listunspent ( minconf maxconf ["address",...] include_unsafe query_options )
125+
listwalletdir
126+
listwallets
127+
loadwallet "filename"
128+
lockunspent unlock ( [{"txid":"hex","vout":n},...] )
129+
removeprunedfunds "txid"
130+
rescanblockchain ( start_height stop_height )
131+
sendmany "" {"address":amount} ( minconf "comment" ["address",...] replaceable conf_target "estimate_mode" )
132+
sendtoaddress "address" amount ( "comment" "comment_to" subtractfeefromamount replaceable conf_target "estimate_mode" )
133+
sethdseed ( newkeypool "seed" )
134+
setlabel "address" "label"
135+
settxfee amount
136+
signmessage "address" "message"
137+
signrawtransactionwithwallet "hexstring" ( [{"txid":"hex","vout":n,"scriptPubKey":"hex","redeemScript":"hex","witnessScript":"hex","amount":amount},...] "sighashtype" )
138+
unloadwallet ( "wallet_name" )
139+
walletcreatefundedpsbt [{"txid":"hex","vout":n,"sequence":n},...] [{"address":amount},{"data":"hex"},...] ( locktime options bip32derivs )
140+
walletlock
141+
walletpassphrase "passphrase" timeout
142+
walletpassphrasechange "oldpassphrase" "newpassphrase"
143+
walletprocesspsbt "psbt" ( sign "sighashtype" bip32derivs )
144+
145+
== Zmq ==
146+
getzmqnotifications

0 commit comments

Comments
 (0)