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>
I'm not entirely satisfied with `trycmd`, but it's a start.
If we choose to move to a different crate, or implement our own,
we can keep the example test cases.
Signed-off-by: Alexis Sellier <alexis@radicle.xyz>
Add quickcheck tests for parse_refstr to ensure the correct
behaviour.
This required adding Arbitrary instances for TypeName and ObjectId, as
well as adding a mechanism for generating Invalid ObjectIds.
Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
X-Clacks-Overhead: GNU Terry Pratchett
Added the `parse_refname` function for parsing a reference into its
`TypeName` and `ObjectId`, if possible.
This replaces the `cob_suffix` function in `radicle`.
This change also fixes the `FromStr` instance of `ObjectId` to use
`from_str` instead of `TryFrom` for bytes.
Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
X-Clacks-Overhead: GNU Terry Pratchett
Avoid wasting persistent memory by cleaning up stale routing entries
when the routing table is considered constrained. Limit pruning to
improve resiliency in the face of long intervals between service
downtimes.
Signed-off-by: Slack Coder <slackcoder@server.ky>
Keep the node's understanding of project hosting location current by
updating how Inventory Announcement messages are processed.
The Inventory Announcements contain a node's entire listing of projects.
Replace the routing table information for the announcer with those from the
message.
Signed-off-by: Slack Coder <slackcoder@server.ky>
Address a FIXME in service.process_inventory() by using the announcer's
time instead of the service's.
Signed-off-by: Slack Coder <slackcoder@server.ky>
* Use the existing conventions for passing a signer to functions.
* Allow replacing git refs when updating cobs.
* Fix the parsing of a cob id.
Signed-off-by: Alexis Sellier <alexis@radicle.xyz>
Fix a problem from a recent commit which caused tests in the tests
module not to run.
The list of modules in 'lib.rs' should use the 'tests' module's new
location.
Signed-off-by: Slack Coder <slackcoder@server.ky>
Avoid redundantly emitting Node Announcements about it's publicly
available addresses when it has none.
Signed-off-by: Slack Coder <slackcoder@server.ky>
Include the node's IP address in the Node's announcements. Source it
from the service's configuration which can assumed to be populated with
default values when available.
Signed-off-by: Slack Coder <slackcoder@server.ky>
Try having a number of outbound connections to other Radicle nodes at any
given time. The number has been defined earlier as TARGET_OUTBOUND_PEERS.
All network nodes are treated equally, there is no preference.
Attempts to keep connected happen at set intervals (IDLE_INTERVAL) or when
a node disconnects.
Signed-off-by: Slack Coder <slackcoder@server.ky>