Commit Graph

30 Commits

Author SHA1 Message Date
cloudhead a48081f271
cli: Move node addresses command
To make things a little more consistent, move the `rad self --address`
command to `rad node config --addresses`, since it's more about
externally-facing configuration of the node, rather than your local user
or profile.
2024-02-26 14:23:13 +01:00
cloudhead b5b9a55306
cli: Add `--path` option to `rad node start`
Useful for debugging and running nodes from different locations.
2024-01-31 13:40:13 +01:00
cloudhead f87dfba9cd
Rename `Id` to `RepoId`
Rename the type to make it clearer and consistent with `NodeId`.
2024-01-22 15:51:44 +01:00
Fintan Halpenny e3b3f3c4f4
cli: move seeding behaviour to `rad seed`
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
2024-01-02 15:23:08 +01:00
Fintan Halpenny f6e2de30ca
cli: move following behaviour to `rad follow`
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
2024-01-02 15:23:08 +01:00
cloudhead 13db55014b
cli: Show URL on `rad init` 2023-12-19 14:15:30 +01:00
cloudhead 4605348d68
cli: From "tracking" to "seeding" and "following"
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.
2023-12-06 09:56:57 +01:00
cloudhead 6b04eff34c
radicle: Consolidate databases
Instead of having a routing database, and an addresses database,
consolidate that in a single database called `node.db`.

We also simplify database access, by providing a single type for opening
the database, and use traits to access the various functions.

We create a new `seed::Store` that has seed-related methods split out of
the `address::Store`.

Note that tracking is still in its own database currently, as it isn't
ephemeral state. This makes it easy to delete the new `node.db` without
risk of losing any important information.

To avoid renaming all database methods, we create a `Stores` wrapper
that allows us to access routing, addresses, seeds etc. without type
ambiguity.

This is a breaking change and requires `addresses.db` and `routing.db`
to be deleted.
2023-11-30 13:00:59 +01:00
Fintan Halpenny d9be25a477
cli: Use alias fallback in `rad node`
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
2023-10-30 15:34:56 +01:00
Alexis Sellier af724eeb0d
cli: Add `node config` command
Shows the current (loaded) node configuration.
2023-09-18 11:14:19 +02:00
cloudhead f2e74fdad2
cli: Choose repo visibility on init
This allows a user to choose private or public visibility on `rad init`.
It also improves the output to tell the user what happened due to this
choice.
2023-09-03 17:21:37 +02:00
cloudhead 0c43b05066
cli: Improve `rad node` output 2023-09-01 12:22:50 +02:00
cloudhead 87c38118d1
cli: Add `rad node sessions`
Shows node sessions.
2023-09-01 12:13:45 +02:00
cloudhead fae518bca2
node: Improve `rad node connect` feedback
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.
2023-08-09 12:49:15 +02:00
cloudhead c30f137bb1
cli: Add `--timeout` and `--count` to `node events` 2023-08-04 12:23:58 +02:00
xphoniex 4869fe26e2
Add `-h` flag to binaries
Signed-off-by: xphoniex <dj.2dixx@gmail.com>
2023-07-25 11:58:39 +02:00
Alexis Sellier 18dacbb48c
cli: Start node in background by default
It makes much more sense to start the node in the background, now that
we have commands to interact with it.
2023-07-20 10:40:30 +02:00
Alexis Sellier e593191ae2
cli: Automatically remove control socket
Instead of requiring that `--force` be used manually, we check to make
sure the node is not running, and if so, pass `--force` to the node
process.
2023-07-20 10:39:36 +02:00
Alexis Sellier f73389fc62
cli: Make `rad node connect` work like `--connect`
It was using a different syntax.
2023-07-04 00:26:31 +02:00
Alexis Sellier 613e3e5269
cli: Show logs after `rad node start`
When the node is started, we show the first few log lines.
2023-06-29 18:45:16 +02:00
Alexis Sellier 2e6c9827a9
cli: Show logs in `rad node status` 2023-06-29 18:01:49 +02:00
Alexis Sellier ba9c5997b7
cli: Add `rad node logs` sub-command
Prints the last `n` lines and follows the log.
2023-06-29 14:58:11 +02:00
Sebastian Martinez 76ba25268d
cli: Add routing entries per rid and or nid
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>
2023-05-22 11:58:43 +02:00
Sebastian Martinez 8d8751655f
cli: Add `rad node events` command
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>
2023-05-17 16:55:06 +02:00
xphoniex ac12a4deee
cli: Implement `rad node start` with support for deamonizing
Signed-off-by: xphoniex <dj.2dixx@gmail.com>
2023-04-28 14:19:20 +02:00
xphoniex 414477a316
cli: Unify format of help messages
Signed-off-by: xphoniex <dj.2dixx@gmail.com>
2023-04-10 10:06:45 +02:00
Alexis Sellier bd436d4369
cli: Open tracking DB in read-only mode 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
Fintan Halpenny ed985f6fe0
cli: rad node
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
2023-03-07 15:38:41 +01:00