plugins/bcli: a new plugin for gathering Bitcoin data

Most is taken from lightningd/bitcoind and adapted. This currently
exposes 5 commands:
- `getchaininfo`, currently called at startup to check the network and
  whether we are on IBD.
- `getrawblockbyheight`, which basically does the `getblockhash` +
  `getblock` trick.
- `getfeerate`
- `sendrawtransaction`
- `getutxout`, used to gather infos about an output and currently used by
  `getfilteredblock` in `lightningd/bitcoind`.
This commit is contained in:
darosior
2020-01-02 21:04:03 +01:00
committed by Rusty Russell
parent 3eb0f56f87
commit 70a79e3998
4 changed files with 767 additions and 4 deletions

View File

@@ -51,6 +51,9 @@ static const errcode_t FUNDING_UNKNOWN_PEER = 306;
static const errcode_t CONNECT_NO_KNOWN_ADDRESS = 400;
static const errcode_t CONNECT_ALL_ADDRESSES_FAILED = 401;
/* bitcoin-cli plugin errors */
#define BCLI_ERROR 400
/* Errors from `invoice` command */
static const errcode_t INVOICE_LABEL_ALREADY_EXISTS = 900;
static const errcode_t INVOICE_PREIMAGE_ALREADY_EXISTS = 901;