This also implements a simple JSONRPC server sanity check
And introduces a new tmp_dir() test utility, that i didn't have the courage to split from this commit
So we can have unit tests without a dummy bitcoind thread, as we
currently do for the startup test.
This commit also implements sanity checks for the two existing commands
using this mechanism.
The Bitcoin interface was thought of as being generic, but a caller
couldn't use one different from bitcoind. Make it so they can, and fix
our trait and generics implementations.
8b95b9f449 Make commands module public (edouard)
Pull request description:
It allows the gui to import commands
responses structs.
ACKs for top commit:
darosior:
ACK 8b95b9f449
Tree-SHA512: 3ccfd5acae8e02bf3dd3e14cbb89be86c4dca21bd7699ba633b0cc04a22c5701cc9ce0f4c62442dca8e5a1075bd3666d52b6deaa5241d622f50e9e672c0c5dd0
2609061a69 commands: implement getnewaddress (Antoine Poinsot)
8309c85e30 commands: a module for the implementation of the API (Antoine Poinsot)
4b659bc35a lib: introduce a VERSION constant, the daemon version (Antoine Poinsot)
fd86cfccee lib: introduce a daemon controller for the API (Antoine Poinsot)
Pull request description:
This module contains the implementation of our external API. Like the others, it's very inspired (or grossly copied from) `revaultd`.
This PR implements the `getinfo` and `getnewaddress` commands to showcase the usage of the new `DaemonControl` command.
ACKs for top commit:
darosior:
ACK 2609061a69, adapted from already reviewed `revaultd` code, and largely tested through follow-up #11
Tree-SHA512: 5e30a29807ec854b6d2e8ca0eb340ca45146cd726810875435f4d5959cd5d6f44ceed19439edaf6477e8bf747af3b551edc8d424c4462475a5924f1b8d13c648
dd37255d7b bitcoin: update our tip in the poller (Antoine Poinsot)
6997adc073 daemon: bitcoin: introduce the Bitcoin poller (Antoine Poinsot)
Pull request description:
This introduces the Bitcoin poller, an event loop in a new thread that continuously poll our Bitcoin backend to update our state. This is kept minimal; only introduce the necessary components (Bitcoin interface, DB interface) and as such it only takes care of updating the best tip at the moment.
ACKs for top commit:
darosior:
self-ACK dd37255d7b -- again, it was inspired and adapted from revaultd, where a similar logic was reviewed and well tested. This PR was tested with the following one, #9.
Tree-SHA512: d630659c75f172754ecfb4df7892d55184b20c848eff4a6184fb45669d57aa87de9377740b5c1bccf7829d859aed8d040c84f3040bb95d478dc41fbd7db157bf
9b98b0852d descriptors: a module for users to create our descriptors (Antoine Poinsot)
Pull request description:
Eventually this module will contain the routines to create all the descriptors we support. For now it only contains the one for the inheritance descriptor.
ACKs for top commit:
edouardparis:
ACK 9b98b0852d
Tree-SHA512: 8f51f628d7229ecfa41192278ea4fe1dce1de65e5f9a512f2bd17cc5aab906c7ec275755ca4316e356f9f1e9bc03bad22729120a0d65c7bc6d979151db3e1b16
568078aa5b daemon: remove bitcoind folder (Antoine Poinsot)
Pull request description:
It was mistakenly committed as part of the introduction of the bitcoind module
ACKs for top commit:
darosior:
ACK 568078aa5b -- trivial
Tree-SHA512: 8083e00bbd7bf71431de100c3d9047f69afc8f768b52eed7a39e7b762160d0567e56ccb874a6400d60fab7703cd79b5ea59ed815494b15a7b77dbace707c5644
7c3289fda9 tests: add a functional test framework, adapted from revaultd (Antoine Poinsot)
cea72d8a63 bitcoind: don't try to match bitcoind's error string when loading wallet (Antoine Poinsot)
096ad68c4b bitcoind: correctly check for errors when creating wallet (Antoine Poinsot)
5db59b1c89 git: add a gitignore (Antoine Poinsot)
Pull request description:
This adds a Python functional tests framework, taken and adapted from `revaultd`. Since we don't have a JSONRPC interface yet it only contains a single trivial startup functional test... And 2 bug fixes this trivial test uncovered! :)
CI integration is still TODO, but it's not critical at the moment and i don't have the heart of fighting with it at the moment (we require a non-standard `bitcoind`).
ACKs for top commit:
darosior:
ACK 7c3289fda9 -- mostly adapted from revaultd, and tested with the following PRs rebased on this one.
Tree-SHA512: 95bd8ecfe70b1c7bacd17d10f009ec1bcc0211cb66b9545fa25c70b02a0f12d81e7747fc94c00de62f9aa7de17e7eb95183d8a2ffa659628f40313ef6bc43a1d
512b5b7d12 daemon: gate startup unit test to UNIX only (Antoine Poinsot)
ad32977558 Don't compile daemon and cli binaries on Windows (Antoine Poinsot)
11cc4dc2e6 Cargo: pin rusqlite dependency for MSRV (Antoine Poinsot)
7340c13142 daemon: implement daemonize for UNIX platforms (Antoine Poinsot)
c095346e17 Introduce the Bitcoin network interface along with a bitcoind module (Antoine Poinsot)
8626e05a55 ci: basic GA for unit tests on various platforms (Antoine Poinsot)
b0196ab529 daemon: introduce an SQLite database (Antoine Poinsot)
989a2cf8fd daemon: introduce the DaemonHandle, which for now only creates a datadir (Antoine Poinsot)
1b35196448 daemon: backbone and configuration parsing (Antoine Poinsot)
Pull request description:
This implements the configuration, database backend, bitcoind connection and initialization of the Minisafe daemon.
A lot of code was ported from revaultd and miradord, although the interface (for bitcoind and the database) changed and many things were re-written. This contains some basic unit tests for startup and database initialization. I intend to port the functional test framework from revaultd in a future PR.
ACKs for top commit:
darosior:
ACK 512b5b7d12 -- most of this code was reviewed and tested in `revaultd` and `miradord`. I also manually tested it.
Tree-SHA512: a4c1384798b976d25391513f6455f96b73ed3b07b668ff1cf1f3a77e6bce3b1e2f559df1128dbf47e30a77c4bf30d177176b6400a34e7237a5227053f34b8dd5