Commit graph

72 commits

Author SHA1 Message Date
Roy Lee
a7f971f404 [lbry] rpc: update getrawtransaction to take verbose as boolean 2022-05-24 00:04:19 -07:00
Roy Lee
d35a82412f [lbry] align port settings between lbcd, lbcctl, and lbcwallet 2022-05-24 00:01:46 -07:00
Brannon King
4dd4505706 [lbry] docs: update docs for LBRY
Co-authored-by: Roy Lee <roylee17@gmail.com>
2022-05-24 00:01:46 -07:00
Alex Grintsvayg
5537ebbf0c [lbry] rpc: add GetChainTips rpc command 2022-05-24 00:01:45 -07:00
Roy Lee
096dd3ff75 [lbry] rpcclient: fix http response resource leaking 2022-05-24 00:01:02 -07:00
Roy Lee
fb3ef35189 [lbry] rpcclient: support SkipVerify of TLS certificate. (#39) 2022-05-23 23:53:30 -07:00
Roy Lee
3111601ac9 [lbry] rpcclient: add a blocknotify example using lbcd websocket 2022-05-23 23:53:30 -07:00
Brannon King
e7d8637cc5 [lbry] rpcclient: update defaultMaxFeeRate from 0.1 LBC to 0.5 LBC 2022-05-23 23:53:30 -07:00
Roy Lee
45627c7a6a [lbry] rename btcd to lbcd
Co-authored-by: Brannon King <countprimes@gmail.com>
2022-05-23 23:53:30 -07:00
3nprob
cc7327c194 rpcclient: Add retry with backoffs to HTTP POST requests
Adds behavior similar to the retries of persistent RPC connections
to HTTP request.

* Initial backoff: 500ms
* Linear increase
* Max retries: 10

Room for future improvement:
* Make configurable
* Add jitter
* Tests for retry behavior
2021-11-16 09:08:07 -05:00
JeremyRand
3e2d8464f1
rpcclient: Export symbols needed for custom commands (#1457)
* rpcclient: Export sendCmd and response

This facilitates using custom commands with rpcclient.

See https://github.com/btcsuite/btcd/issues/1083

* rpcclient: Export receiveFuture

This facilitates using custom commands with rpcclient.

See https://github.com/btcsuite/btcd/issues/1083

* rpcclient: Add customcommand example

* rpcclient: remove "Namecoin" from customcommand readme heading
2021-09-02 08:39:55 +02:00
Jake Sylvestre
540786fda6 rpcclient: fix documentation typo 2021-04-13 09:09:20 -04:00
Jake Sylvestre
d08785547a docs: update shields 2021-03-05 07:45:19 -05:00
Jake Sylvestre
2a1aa5129e Add Batch JSON-RPC support (rpc client & server) 2021-02-09 09:47:46 -05:00
10gic
610bb55ae8 rpcclient: add ExtraHeaders in ConnConfig 2020-11-24 14:15:14 -05:00
Armando Ochoa
f070f7f2be rpcclient: fix documentation typos 2020-11-04 09:56:02 -05:00
Anirudha Bose
535f25593d rpcclient: implement createwallet with functional options 2020-10-26 14:54:05 -04:00
Torkel Rogstad
1d75e0a885 rpcclient: add more wallet commands
Implement backupwallet, dumpwallet, loadwallet and unloadwallet.
2020-10-26 09:34:56 -04:00
Anirudha Bose
6519c04a6f rpcclient: implement gettxoutsetinfo command 2020-10-05 10:03:47 -04:00
Henry Fisher
584c382334 rpc: add signrawtransactionwithwallet interface
Adds interface for issuing a signrawtransactionwithwallet command.
Note that this does not add functionality for the btcd rpc server
itself, it simply assumes that the RPC client has this ability and gives
an API for interacting with the RPC client.

rpc: add signrawtransactionwithwallet interface
2020-10-05 09:56:12 -04:00
Anirudha Bose
e9a51e8dcd rpcclient: implement getwalletinfo command 2020-09-25 12:18:06 -04:00
Anirudha Bose
ac3f235eb9 rpcclient: implement getaddressinfo command
Fields such as label, and labelspurpose are not included, since they
are deprecated, and will be removed in Bitcoin Core 0.21.
2020-09-21 09:47:58 -04:00
Elliott Minns
6daaf73544
GetBlockTemplate RPC client implementation (#1629)
* GetBlockTemplate RPC client implementation

* Txid added to the getblocktemplate result

* Omitempty for TxID and improved comment for GetBlockTemplate 'rules' field
2020-09-21 09:42:35 -04:00
Anirudha Bose
c693bd8bc5 rpcclient: add deriveaddresses RPC command 2020-09-14 10:30:47 -04:00
Andrew Tugarinov
5ae1f21cd9 Added ListSinceBlockMinConfWatchOnly method. 2020-09-14 09:48:40 -04:00
Federico Bond
6f49f1f194 btcjson,rpcclient: add support for PSBT commands to rpcclient 2020-09-14 09:37:27 -04:00
Mikael Lindlof
fff96610aa rpc: Add getnodeaddresses JSON-RPC support
Add NodeAddresses function to rpcserverConnManager
interface for fetching known node addresses.
2020-09-14 09:36:05 -04:00
Anirudha Bose
ba3fe57507
rpcclient: support listtransactions RPC with watchonly argument
Co-authored-by: Gert-Jaap Glasbergen <gertjaap@decoscrypto.com>
2020-09-08 09:43:02 -04:00
Anirudha Bose
fffe4a909b rpcclient: Implement importmulti JSON-RPC client command 2020-08-31 15:28:48 -04:00
Mikael Lindlof
b68c50e33c Add getblockfilter JSON-RPC client command
Add type for second getblockfilter param
2020-08-31 10:02:54 -04:00
Anirudha Bose
efae8e9967 Add rpclient implementation of getdescriptorinfo RPC 2020-08-31 09:41:49 -04:00
Anirudha Bose
e2d9cf4b55 rpcclient: Add GetTransactionWatchOnly method 2020-06-29 10:15:10 -04:00
Federico Bond
7b2ff5d180 Add getbalances RPC client command 2020-06-29 10:14:04 -04:00
Torkel Rogstad
e4f59022a3 Add fundrawtransaction RPC call 2020-06-15 09:44:04 -04:00
Mikael Lindlof
73d69f09d0 Add getchaintxstats JSON-RPC client command 2020-06-15 09:42:37 -04:00
Torkel Rogstad
714de3f3c7 rpcclient: serialize nil inputs to empty list 2020-06-08 09:52:46 -04:00
JeremyRand
6d521ff8cd rpcclient: Read first line of cookie instead of trimming space 2020-06-08 09:51:09 -04:00
JeremyRand
e6f163e61e rpcclient: Try user+pass auth before cookie auth 2020-06-08 09:51:09 -04:00
JeremyRand
915788b8e6 rpcclient: Refactor cookie caching 2020-06-08 09:51:09 -04:00
JeremyRand
280845a8a4 rpcclient: Add cookie auth
Based on Hugo Landau's cookie auth implementation for Namecoin's ncdns.

Fixes https://github.com/btcsuite/btcd/issues/1054
2020-06-08 09:51:09 -04:00
Wilmer Paulino
742935e3a9
rpcclient: send legacy GetBlock request for backwards compatibility
Without this, users of this library wouldn't be able to issue GetBlock
requests to nodes which haven't updated to support the latest request
format, namely the use of a single `int` parameter to denote verbosity
instead of two `bool`s.
2020-05-14 18:05:46 -07:00
Henry
d38279ee74
btcjson: change getblock default verbosity to 1
This change makes btcd's getblock command match bitcoind's. Previously
the default verbosity was 0, which caused errors when using the
rpcclient library to connect to a bitcoind node - getblock would
unmarshall incorrectly since it didn't expect a verbosity=1 result when
it did not specify verbosity.
2020-05-14 17:27:59 -07:00
Torkel Rogstad
57d44d022e Try both TX serialization formats 2020-03-27 16:59:23 -04:00
Ivan Kuznetsov
cfcf4fb762 Implement 'getblockstats' JSON-RPC command 2020-03-25 05:51:42 -04:00
Torkel Rogstad
8b1be46463 Add generatetoaddress and estimatesmartfee RPCs 2020-03-17 09:29:41 -04:00
Iskander Sharipov
d9ce6b037f btcjson,rpcclient: use proper Deprecated comment format
This makes godoc and other Go tools understand deprecation notice.

Found using https://go-critic.github.io/overview#deprecatedComment-ref
2020-03-10 11:00:24 -04:00
Jake Sylvestre
c4f39996ac
Refactor GetBlockVerboseTx to reflect correct getblock RPC call… (#1529)
Refactor GetBlockVerboseResult into two separate types: one type for getblock "hash" verbosity=1,
and a second type for getblock "hash" verbosity=2. This is necessary due to how getblock returns
a block's transaction data based on the provided verbosity parameter.

If verbosity=1, then getblock.Tx is an array of a block's transaction ids (txids) as strings.
If verbosity=2, then getblock.Tx is an array of raw transaction data.

Due to differences in how getblock returns data based on the provided verbosity parameter, it's necessary
to have two separate return types based on verbosity. This necessitates a separate unmarshalling function
(represented throughout rpcclient/chain.go as Result.Receive()) to ensure that data is correctly unmarshalled
and returned to the user.
2020-03-09 14:47:11 -04:00
John C. Vernaleo
e9f15eda7e
rpcclient: Add net params to Client (#1467)
* rpcclient: replace futures mainnet with params

Adds a chaincfg.Params to the Client

rpcclient: parse config to assign params

* rpcclient: change address commands to Address

 * Change address future struct to contain a network field, so futures
   can return the correct type for Receive
2020-03-05 16:46:29 -05:00
jalavosus
57cb8e4b11 Refactor FutureGetBlockVerboseResult into two types: FutureGetBlockVerboseResult, and FutureGetBlockVerboseTxResult.
Due to differences in how getblock returns data based on the provided verbosity parameter, it's necessary
to have two separate return types based on verbosity. This necessitates a separate unmarshalling function
(represented throughout rpcclient/chain.go as Result.Receive()) to ensure that data is correctly unmarshalled
and returned to the user.
2020-03-05 06:48:19 -05:00
shuai.qi
46461dc84a btcjson, rpclient: Fix typo 2020-03-04 09:23:11 -05:00