67 Commits

Author SHA1 Message Date
edouard
b77d331792 fix clippy errors 2022-09-05 18:34:45 +02:00
Antoine Poinsot
3d427713e1
Merge #13: Coin tracking
9d0c68dae34f96a96d318f75cbbb5dbefffdd3d8 commands: add a 'list_coins' command. (Antoine Poinsot)
99a9cbf0f83fda6f98892c23ac89324f04b650ff poller: query derivation index by address from DB (Antoine Poinsot)
3f17e9f0c32db9724b384b9bd58c097653e9d04f database: change interface from update_der_index to increment_der_index (Antoine Poinsot)
e74ea4c2d36d17d0aa05044991d2cfff311d9f37 sqlite: a table for a mapping from address to derivation index. (Antoine Poinsot)
c9ef068fa5cb0ec39a9a88ec581434f6abb84048 poller: update our coins on each poll (Antoine Poinsot)
c6a25adfcdd371a1a2581cc210fb4dc03dfced2d bitcoin: interface for coins discovery and updates (Antoine Poinsot)
05b3af1b5a9faaa54106e11f87e38b391ebff744 database: interface and implementation for coins storage and update (Antoine Poinsot)

Pull request description:

ACKs for top commit:
  edouardparis:
    ACK 9d0c68dae34f96a96d318f75cbbb5dbefffdd3d8

Tree-SHA512: 0087ff04939326ae7affbb4c0defbe5573fc58d15f4b2fb47a71a03880187c4105742cc9eda868c3fe0ee5890931dc57eb3c63b4ef79335f434771d5cc089483
2022-08-25 10:29:50 +02:00
edouard
4e26f18bc2
Merge #19: Gui settings
29e134748df363963092e16dcd288ed6431d7434 Add settings panel to gui (edouard)

Pull request description:

  based on #8

ACKs for top commit:
  edouardparis:
    ACK 29e134748df363963092e16dcd288ed6431d7434

Tree-SHA512: 7a09c00d53ddef091219ffe5bf702795171bc0575b55f4930680a251d712d8cfdf30afd1ad38218c01c8430346fe95625202eb30b8cb9e1190d40806a7e6d226
2022-08-24 17:30:07 +02:00
edouard
29e134748d Add settings panel to gui
Remove context module for a cache module.
2022-08-24 12:00:24 +02:00
edouard
f45b3ecc43
Merge #8: gui: loader and installer
88bfe974d0deea456c03c97cb17495d0b5d9109e Add dashboard view (edouard)
55373eadebe5e69e8832ce140032f2a71a012ee9 github ci: add gui (edouard)
0b24104b4546aedacea6953617825956f1642245 gui: installer and loader (edouard)

Pull request description:

  Wait before merging

ACKs for top commit:
  edouardparis:
    ACK 88bfe974d0deea456c03c97cb17495d0b5d9109e

Tree-SHA512: e290118f18634671b10847b00c84dd18b5a1df43522ae3277306e6957015d332d4f86b388e5a7e0c667d7462c47a3baec0c26954b86e7e59b904aaa95c0bd4de
2022-08-23 10:38:03 +02:00
edouard
88bfe974d0 Add dashboard view 2022-08-22 17:19:08 +02:00
edouard
55373eadeb github ci: add gui 2022-08-22 17:19:08 +02:00
edouard
0b24104b45 gui: installer and loader 2022-08-22 17:19:08 +02:00
Antoine Poinsot
9d0c68dae3
commands: add a 'list_coins' command. 2022-08-18 12:01:27 +02:00
Antoine Poinsot
99a9cbf0f8
poller: query derivation index by address from DB 2022-08-18 12:01:26 +02:00
Antoine Poinsot
3f17e9f0c3
database: change interface from update_der_index to increment_der_index
And take care of updating the (addr->index) mapping in the SQLite implementation.
2022-08-18 12:01:26 +02:00
Antoine Poinsot
e74ea4c2d3
sqlite: a table for a mapping from address to derivation index. 2022-08-18 12:01:25 +02:00
Antoine Poinsot
c9ef068fa5
poller: update our coins on each poll
This refactors the entire state update on each poll, to apply database
changes at the very end.
2022-08-18 12:01:25 +02:00
Antoine Poinsot
c6a25adfcd
bitcoin: interface for coins discovery and updates 2022-08-18 12:01:24 +02:00
Antoine Poinsot
05b3af1b5a
database: interface and implementation for coins storage and update 2022-08-18 12:01:24 +02:00
Antoine Poinsot
b548451292
Merge #11: JSONRPC2 server
798bf67e21977ad18ee680a14e23e534f64a3ea5 commands: derive Deserialize for commands results (Antoine Poinsot)
fe5de96312dc8d57f982c060d4b9b045c2194163 Shorten the paths to the dummy datadirs in the unit tests (Antoine Poinsot)
069bca546a23ce1b1714b9564973f13a6f090536 jsonrpc: don't use a Mutex to share the DaemonControl between threads (Antoine Poinsot)
e6fcdd5b095232729cbeef4bd42bf6e57d77ffde jsonrpc: don't umask in unit tests (Antoine Poinsot)
14bd3890dcf6c5dc9fbe25992710c80c9ff107c7 doc: add an API.md documenting the JSONRPC API. (Antoine Poinsot)
eeac67dc0a7724ef4ca9003b7e734f546e62c0ae qa: shut down the daemon via the JSONRPC interface at teardown (Antoine Poinsot)
726209cc0a07d12c71041573313d5b34def30bbd jsonrpc: add a 'stop' command (Antoine Poinsot)
d03c46996798d9e5d68858c4d4631e6b3295f9b3 Introduce a testutils module with a DummyMinisafe for unit tests (Antoine Poinsot)
e510c0a30dd18445d595e403d5cddd8fe04ef1b6 config: separate the Bitcoin and bitcoind-specifc settings (Antoine Poinsot)
ea3595349d0051912ce187ca27de7a6df9b6e7e6 Accept a custom database interface when starting the daemon (Antoine Poinsot)
f365effacd12d0d3fce105dbc59e7ccf5f85488c Accept a custom Bitcoin interface when starting the daemon (Antoine Poinsot)
93098be7dcb82808f6644eee97005c6607eb0cda tests: implement the connection to the daemon's RPC server (Antoine Poinsot)
0d55d6c45599c2a4996f10c5066041369c06d9b1 jsonrpc: a simple JSONRPC2 server (Antoine Poinsot)
dd1b353a36feb04b1af5553e9c71763957996af0 commands: derive serde::Serialize for results (Antoine Poinsot)
86c1d32662e7fda9887da5f799e42cce73228448 bitcoin: name the Bitcoin poller thread (Antoine Poinsot)
6b2e90181484d5dd0ed4ee23b78ab705d98b5c36 bit poller: fix a off logged percentage (Antoine Poinsot)
6ff43fcd9543acb79d6f4c343e102f5029f5480f daemon: log the name of the current thread, too. (Antoine Poinsot)
a067daf16b99a8bdaad1034f2e539c60108a1b4a tests: use a ranged descriptor (Antoine Poinsot)
5228ee370bad72efd98d27e2181fb1ee1c27bae2 tests: remove mistakenly committed file (Antoine Poinsot)

Pull request description:

  On top of #9, this introduces a simple JSONRPC server calling into the exposed commands. I started by reusing code from revaultd, but ended up rewriting it entirely. Compared to it, it t is simpler, smaller and dependency-less.

  In order to sanity check the whole server startup and teardown in unit tests, this took a detour by introducing a `testutils` module with mocked Bitcoin and database interfaces. Those will be useful later.

  This introduces a JSONRPC-specifc command: `stop`, which shuts down the daemon. We add a `doc/API.md` adapted from #1 with documentation for the existing commands.

ACKs for top commit:
  darosior:
    self-ACK 798bf67e21977ad18ee680a14e23e534f64a3ea5 -- tested using following PRs #13 and #17.

Tree-SHA512: 2eb07c29904e1f71f7375aa5729d5f3bfc5649627a92ef6e49dd273f91a8d4c4243b495eb87d09fa44198ef125066161cf6a2c86af14b4135d806c8baca217b2
2022-08-18 12:00:50 +02:00
Antoine Poinsot
798bf67e21
commands: derive Deserialize for commands results 2022-08-17 19:40:00 +02:00
Antoine Poinsot
fe5de96312
Shorten the paths to the dummy datadirs in the unit tests
It failed CI on MacOS because of overflowing SUN_PATH_LEN.
2022-08-17 19:40:00 +02:00
Antoine Poinsot
069bca546a
jsonrpc: don't use a Mutex to share the DaemonControl between threads 2022-08-17 19:39:59 +02:00
Antoine Poinsot
e6fcdd5b09
jsonrpc: don't umask in unit tests
It can interfere with the creation of dummy directories in other threads and cause spurious errors
2022-08-17 19:39:59 +02:00
Antoine Poinsot
14bd3890dc
doc: add an API.md documenting the JSONRPC API.
Co-Authored-By: Edouard Paris <m@edouard.paris>
2022-08-17 19:39:58 +02:00
Antoine Poinsot
eeac67dc0a
qa: shut down the daemon via the JSONRPC interface at teardown 2022-08-17 19:39:58 +02:00
Antoine Poinsot
726209cc0a
jsonrpc: add a 'stop' command
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
2022-08-17 19:39:57 +02:00
Antoine Poinsot
d03c469967
Introduce a testutils module with a DummyMinisafe for unit tests
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.
2022-08-17 19:39:56 +02:00
Antoine Poinsot
e510c0a30d
config: separate the Bitcoin and bitcoind-specifc settings 2022-08-17 19:39:56 +02:00
Antoine Poinsot
ea3595349d
Accept a custom database interface when starting the daemon 2022-08-17 19:39:55 +02:00
Antoine Poinsot
f365effacd
Accept a custom Bitcoin interface when starting the daemon
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.
2022-08-17 19:39:55 +02:00
Antoine Poinsot
93098be7dc
tests: implement the connection to the daemon's RPC server
And add some basic sanity check of the existing commands.
2022-08-17 19:39:54 +02:00
Antoine Poinsot
0d55d6c455
jsonrpc: a simple JSONRPC2 server 2022-08-17 19:39:54 +02:00
Antoine Poinsot
dd1b353a36
commands: derive serde::Serialize for results 2022-08-17 19:39:53 +02:00
Antoine Poinsot
86c1d32662
bitcoin: name the Bitcoin poller thread 2022-08-17 19:39:52 +02:00
Antoine Poinsot
6b2e901814
bit poller: fix a off logged percentage 2022-08-17 19:39:52 +02:00
Antoine Poinsot
6ff43fcd95
daemon: log the name of the current thread, too. 2022-08-17 19:39:51 +02:00
Antoine Poinsot
a067daf16b
tests: use a ranged descriptor 2022-08-17 19:39:51 +02:00
Antoine Poinsot
5228ee370b
tests: remove mistakenly committed file 2022-08-17 19:39:50 +02:00
Antoine Poinsot
20474d4ebf
Merge #12: Make commands module public
8b95b9f449f41b1f158815ec8d8b062069fae155 Make commands module public (edouard)

Pull request description:

  It allows the gui to import commands
  responses structs.

ACKs for top commit:
  darosior:
    ACK 8b95b9f449f41b1f158815ec8d8b062069fae155

Tree-SHA512: 3ccfd5acae8e02bf3dd3e14cbb89be86c4dca21bd7699ba633b0cc04a22c5701cc9ce0f4c62442dca8e5a1075bd3666d52b6deaa5241d622f50e9e672c0c5dd0
2022-08-16 14:54:00 +02:00
edouard
8b95b9f449 Make commands module public
It allows the gui to import commands
responses structs.
2022-08-15 16:40:11 +02:00
Antoine Poinsot
6451506dcb
Merge #9: Introduce the commands module
2609061a69c99e5b5f05b2a105751e5509055d54 commands: implement getnewaddress (Antoine Poinsot)
8309c85e303ece0110ed1f84a5748ecc82f25566 commands: a module for the implementation of the API (Antoine Poinsot)
4b659bc35a0fdf0a853f80bcf836c9b9d0193c5b lib: introduce a VERSION constant, the daemon version (Antoine Poinsot)
fd86cfccee0c43306890829e4be7bd3666380147 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 2609061a69c99e5b5f05b2a105751e5509055d54, adapted from already reviewed `revaultd` code, and largely tested through follow-up #11

Tree-SHA512: 5e30a29807ec854b6d2e8ca0eb340ca45146cd726810875435f4d5959cd5d6f44ceed19439edaf6477e8bf747af3b551edc8d424c4462475a5924f1b8d13c648
2022-08-11 13:25:52 +02:00
Antoine Poinsot
2609061a69
commands: implement getnewaddress 2022-08-06 10:53:47 +02:00
Antoine Poinsot
8309c85e30
commands: a module for the implementation of the API 2022-08-06 10:53:47 +02:00
Antoine Poinsot
4b659bc35a
lib: introduce a VERSION constant, the daemon version 2022-08-06 10:53:46 +02:00
Antoine Poinsot
fd86cfccee
lib: introduce a daemon controller for the API
This also finalizes the shutdown implementation
2022-08-06 10:53:46 +02:00
Antoine Poinsot
06b009a479
Merge #6: Bitcoin interface poller
dd37255d7b03051aa8924127112ff8fac6c38ff7 bitcoin: update our tip in the poller (Antoine Poinsot)
6997adc073981c3c786ab7e1244330fcc1d7afc7 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 dd37255d7b03051aa8924127112ff8fac6c38ff7 -- 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
2022-07-30 15:21:10 +02:00
Antoine Poinsot
b7314c8d74
Merge #7: Descriptors creation
9b98b0852d1d34496493f3b26219593f549f0ac4 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 9b98b0852d1d34496493f3b26219593f549f0ac4

Tree-SHA512: 8f51f628d7229ecfa41192278ea4fe1dce1de65e5f9a512f2bd17cc5aab906c7ec275755ca4316e356f9f1e9bc03bad22729120a0d65c7bc6d979151db3e1b16
2022-07-29 14:43:20 +02:00
Antoine Poinsot
9b98b0852d
descriptors: a module for users to create our descriptors 2022-07-29 12:16:50 +02:00
Antoine Poinsot
dd37255d7b
bitcoin: update our tip in the poller
This introduces the DB connection in the poller thread
2022-07-27 12:30:53 +02:00
Antoine Poinsot
6997adc073
daemon: bitcoin: introduce the Bitcoin poller 2022-07-27 12:30:52 +02:00
Antoine Poinsot
1f35885087
Merge #5: daemon: remove bitcoind folder
568078aa5bee793e3bbfddedfd42f51daa8aa9ec 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 568078aa5bee793e3bbfddedfd42f51daa8aa9ec -- trivial

Tree-SHA512: 8083e00bbd7bf71431de100c3d9047f69afc8f768b52eed7a39e7b762160d0567e56ccb874a6400d60fab7703cd79b5ea59ed815494b15a7b77dbace707c5644
2022-07-27 11:40:35 +02:00
Antoine Poinsot
55a79b7751
Merge #3: Functional tests framework
7c3289fda95aa79ca62258f14b7afb28548f5541 tests: add a functional test framework, adapted from revaultd (Antoine Poinsot)
cea72d8a63a247c8bcba39ecd487731d045d75eb bitcoind: don't try to match bitcoind's error string when loading wallet (Antoine Poinsot)
096ad68c4bd1b0332835fdbacb5d540a71646217 bitcoind: correctly check for errors when creating wallet (Antoine Poinsot)
5db59b1c892b82f2778949d2a51093507165b2c0 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 7c3289fda95aa79ca62258f14b7afb28548f5541 -- mostly adapted from revaultd, and tested with the following PRs rebased on this one.

Tree-SHA512: 95bd8ecfe70b1c7bacd17d10f009ec1bcc0211cb66b9545fa25c70b02a0f12d81e7747fc94c00de62f9aa7de17e7eb95183d8a2ffa659628f40313ef6bc43a1d
2022-07-27 11:39:56 +02:00
Antoine Poinsot
1bace64e75
Merge #4: fix crate name: minisafe
0d79a31eb2e757be4b5faf93aaa13ad6a9448acd fix crate name: minisafe (edouard)

Pull request description:

ACKs for top commit:
  darosior:
    Github utACK 0d79a31eb2e757be4b5faf93aaa13ad6a9448acd

Tree-SHA512: 72d9a87c261adaafca9796c4c9fcce7de6dc4109bc14b6a19137df86e5aa583fe1b12896fe54bd9b82d41fb8729279ed26256258432c3505df5376664cf74867
2022-07-26 15:39:21 +02:00