To keep behaviour consistently under subcommands, move the `rad node
seeding` behaviour under `rad seed`. When an `<rid>` isn't
provided then the seeded repositories are listed.
Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
X-Clacks-Overhead: GNU Terry Pratchett
To keep behaviour consistently under subcommands, move the `rad node
following` behaviour under `rad follow`. When an `<nid>` isn't
provided then the followed nodes are listed.
This includes filtering by alias, when `--alias` is used.
Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
X-Clacks-Overhead: GNU Terry Pratchett
Split the commands and change the naming.
* Tracking a repo is now called "seeding"
* Tracking a peer is now called "following"
In this commit, we don't change most of the internal code, only the
user-facing part.
The `AliasStore` mechanism was added but not used in the `rad node`
command. Since the launched node itself can display aliases based on
the address book, it would make sense if the `rad node` command could
do this as well.
Use the `Profile`'s `AliasStore` implementation to fallback to an
alias if the tracking store does not contain an alias -- essentially
using the address book instead.
Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
X-Clacks-Overhead: GNU Terry Pratchett
Only return once the connection is established or failed.
It's still not perfect, as several failure scenarios are not handled,
but it's an improvement.
We move the session address to the top-level struct, since it's needed
in a bunch of places. This change is required for the rate-limiting
code that is coming next.
The tracking database can be opened in read-only or read-write
mode. Knowing which is being used is significant in concurrent
scenarios, e.g. it's safer to have a read-only handle on multiple
threads.
Provide static type information by signifying what kind of database
handle is being worked with, read or read-write.
Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
X-Clacks-Overhead: GNU Terry Pratchett
This is a fairly substantial change, which adds a new configuration file
to the user's `$RAD_HOME` that includes node configuration, including
the alias, and also makes node aliases required.
When running `rad auth`, the user is now prompted for an alias, which
defaults to `$USER`.
When running `rad self`, the alias is now shown.
If the user runs radicle without a config file, the defaults are loaded,
and `$USER` is used as the alias.
To allow third party tools read the routing table entries filtered by
rid or nid and if needed in json format.
Signed-off-by: Sebastian Martinez <me@sebastinez.dev>
Allows third party implementations to listen to the event stream of a
node.
In case of a serialization error we exit the event subscription and end
the process.
Signed-off-by: Sebastian Martinez <me@sebastinez.dev>
We implement a new `Element` trait which allows for more complex output
to be drawn, such as vertical and horizontal stacks.
We adapt `Table` to work within this system.
We refresh the output of `rad patch show` to use these new tools.
Previously the alias field was simply a string which could possibly be
empty. Some checks were made to see if this string was empty.
Instead, make the logic more obvious by making the alias field
optional.
Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
X-Clacks-Overhead: GNU Terry Pratchett
This adds a rad node subcommand to the CLI.
The subcommand aims to fulfill the following requirements:
- Checking the node status (rad node status)
- Connecting to the node's control socket (rad node connect)
- Printing out our routing table (rad node routing)
- Printing out our tracking policies (rad node tracking)
The following are yet to be implemented:
- Starting the node (rad node start)
- Stopping the node (rad node stop)
Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
X-Clacks-Overhead: GNU Terry Pratchett