Commit Graph
37 Commits
Author SHA1 Message Date
Alexis Sellier 05d7090326 node: Remove Handle::inventory method 2023-03-15 12:59:49 +01:00
Alexis Sellier caaa7581e6 node: Remove Routing command
Replaced by direct DB access.
2023-03-15 12:59:49 +01:00
Alexis Sellier 9b6ede8fc5 cli: Use tracking DB access for node command 2023-03-15 12:59:49 +01:00
Alexis Sellier 8e5627d28a node: Rename tracked_repo -> repo_policies
I was finding the current naming misleading, as the returned entries
could be for blocked repos/nodes.
2023-03-13 11:41:07 +01:00
Fintan Halpenny 3b015a9325 radicle: accept Scope as track_repo argument
The method `track_repo` only accepted the RID as the argument for
tracking.

Instead, allow passing Scope as an argument for tracking a
repository.

Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
X-Clacks-Overhead: GNU Terry Pratchett
2023-03-08 11:29:34 +00:00
Fintan Halpenny f322305f86 node: wire up connect command
The connect command was unimplemented for both Node and the control
socket.

This wires up the connect functionality in both places.

Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
X-Clacks-Overhead: GNU Terry Pratchett
2023-03-07 15:38:41 +01:00
Fintan Halpenny 1f837c6572 node: implement tracking and routing
The routing function for Node was not implemented and there were no
functions for getting any tracking information.

This implements routing, tracked_repos, and tracked_nodes. To
accomplish this it was necessary to add associated types to the
Handler trait so that implementations could differ in the types they
use for returning this data, i.e. the control socket needs to use a
channel while the Node needs to return serializable data.

Currently, the Node uses a `Vec` but it would be more beneficial to
return an Iterator directly to ensure we are not always hitting the
heap.

To allow for the tracking types to be used across radicle-node (the
crate) and in radicle::node (the module), it was necessary to move
the types to the common place, i.e. radicle::node. At the same time,
new structs were added to make it easier to refer to tracked repos vs
tracked nodes.

Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
X-Clacks-Overhead: GNU Terry Pratchett
2023-03-07 15:38:41 +01:00
Alexis Sellier e69be6051d cli: Give more control over init announcement
Instead of always announcing the inventory, by default we don't.
Users can run `rad push` to trigger an announcement.
2023-03-06 15:38:42 +01:00
Fintan Halpenny c0b92d25fb radicle: remove FetchResult associated type
The Handle trait defines a FetchResult associated type. This type is
always instantiated to be the FetchResult enum in radicle::node.

Remove the associated type to simplify the trait.

Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
X-Clacks-Overhead: GNU Terry Pratchett
2023-02-27 17:17:00 +01:00
Alexis Sellier 3e7761740f node: Rely on inventory announcement in rad init 2023-02-13 09:59:44 +01:00
Alexis Sellier 7087288cfb node: Implement inventory sync command 2023-02-12 20:57:33 +01:00
Alexis Sellier 2ceb39553e node: Remove redundant log 2023-02-07 10:47:35 +01:00
Alexis Sellier 037ff39894 node: Use JSON for control commands 2023-02-07 10:46:12 +01:00
Alexis Sellier a8531eff36 node: Implement seeds control command 2023-02-07 10:46:12 +01:00
Alexis Sellier 45e31a5192 Communicate fetch results through control socket
This allows a CLI to report to the user what fetch requests were
fulfilled, and which ones failed.
2023-02-07 10:46:12 +01:00
Fintan Halpenny 3f48c2c516 Rust 1.67
Rust 1.67 was announced[0]. Update the necessary files for running
1.67 and fix the clippy suggestions for string interpolation.

[0]: https://blog.rust-lang.org/2023/01/26/Rust-1.67.0.html

Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
X-Clacks-Overhead: GNU Terry Pratchett
2023-02-04 19:30:29 +01:00
Alexis Sellier 23cf44f4c7 node: Rename client module to runtime 2023-01-29 17:33:07 +01:00
Alexis Sellier 02be334144 node: Use git-daemon as backend 2023-01-29 17:26:01 +01:00
Alexis Sellier d9e1055067 Improve logging 2023-01-28 23:58:16 +01:00
Alexis Sellier 026dfbde5d node: Improve logging output 2023-01-26 18:15:27 +01:00
Alexis Sellier 963ad3c3d7 Get rad clone working correctly 2023-01-25 11:35:20 +01:00
Alexis Sellier c888f40660 node: Respond to announce-refs control 2023-01-25 10:21:57 +01:00
Alexis Sellier d324eab377 node: Remove control socket at the end 2023-01-25 10:21:57 +01:00
Alexis Sellier fea14ff7b3 Update clone functionality for new replication 2023-01-25 10:21:57 +01:00
Alexis Sellier ec2e7d7ee1 node: Refactor fetch response code
Only user-requested fetches require a response.

Signed-off-by: Alexis Sellier <self@cloudhead.io>
2023-01-25 10:21:57 +01:00
Alexis Sellier b9484b6832 node: Implement graceful shutdown
Signed-off-by: Alexis Sellier <alexis@radicle.xyz>
2023-01-18 17:44:16 +01:00
Alexis Sellier 7b8bb08b08 Consolidate node::Handle traits into one
Signed-off-by: Alexis Sellier <alexis@radicle.xyz>
2022-12-09 10:52:18 +01:00
Alexis Sellier a100f1c683 cli: Implement tracking correctly
The tracking command was tracking a project when it should
have been tracking peers.

We also add the ability to pass an alias when tracking from
the CLI.

Signed-off-by: Alexis Sellier <alexis@radicle.xyz>
2022-12-09 10:52:18 +01:00
Alexis Sellier 308112618f Get around circular-dependency
This was causing an issue in rust-analyzer, and probably would fail
in other ways via cargo. In any case it wasn't a good idea.

Signed-off-by: Alexis Sellier <alexis@radicle.xyz>
2022-11-22 13:41:32 +01:00
Alexis Sellier f05a040be6 Make track functions return correctly
Previously we always returned `true`. Now we return
what the node actually returns.

Signed-off-by: Alexis Sellier <alexis@radicle.xyz>
2022-11-09 13:29:54 +01:00
Alexis Sellier 706fbc6550 Get the node running
Signed-off-by: Alexis Sellier <alexis@radicle.xyz>
2022-10-19 22:39:24 +02:00
Alexis Sellier 85ac8a1d4d Implement routing table persistence
Uses SQLite for persistence.

Signed-off-by: Alexis Sellier <alexis@radicle.xyz>
2022-10-05 12:13:12 +02:00
Alexis Sellier 15f525299e Add commnads to query internal service state
Signed-off-by: Alexis Sellier <alexis@radicle.xyz>
2022-10-04 21:07:57 +02:00
Alexis Sellier 27e39c0df5 Make Id a Copy 2022-09-27 14:13:20 +02:00
Alexis Sellier ca2f766d19 Add Profile::connect
Signed-off-by: Alexis Sellier <alexis@radicle.xyz>
2022-09-26 14:27:56 +02:00
Alexis Sellier c2b599f068 Implement node handle to control node
Signed-off-by: Alexis Sellier <alexis@radicle.xyz>
2022-09-22 12:36:12 +02:00
Alexis Sellier d1ccf1b807 node: Rename folder to radicle-node
Signed-off-by: Alexis Sellier <alexis@radicle.xyz>
2022-09-21 11:38:09 +02:00