Commit Graph

166 Commits

Author SHA1 Message Date
Alexis Sellier d59c422b9d
node: Send special `done` packet to end protocol 2023-02-07 10:47:35 +01:00
Alexis Sellier f5f36191d9
node: Fix some connection-related logic 2023-02-07 10:47:35 +01:00
Alexis Sellier 7bdedd0ffd
node: Fix bug with persistent peer reconnect
We weren't updating the sessions map when a persistent peer
was re-attempted. It would then panic when `connected` was called,
because the state would be `Disconnected`.
2023-02-07 10:47:35 +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 2649e9c6fe
cli: Add `rad-clone` test 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 b542ddcd6c
node: Create shared test environment
We move and combine some of the test code, so that the CLI tests and
node tests use shared code.
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
Slack Coder 98f09130bb
node: Elaborate --help message
Signed-off-by: Slack Coder <slackcoder@server.ky>
2023-02-04 20:03:31 +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 98f7fe1db8
node: Rename `GIT_RESET` env var 2023-01-30 18:23:24 +01:00
Alexis Sellier c1a749e09e
node: Make git-daemon errors more apparent 2023-01-30 14:07:31 +01:00
Alexis Sellier 03b94c81a0
node: Make git daemon listen configurable 2023-01-30 13:47:09 +01:00
Alexis Sellier 498a5c4e4a
node: Handle `fetched` differently if initiated 2023-01-30 13:22:33 +01:00
Alexis Sellier 3aa105afda
node: Return error if remote errors
Instead of simply breaking out of the loop, log and return an error.
2023-01-30 13:15:33 +01:00
Alexis Sellier 0726c553da
node: Run git fetch without any user config 2023-01-30 12:35:08 +01:00
Alexis Sellier a0910f7593
Cleanup old `fetch` code
We only use the old code in the simulator now.
2023-01-30 12:26:29 +01:00
Alexis Sellier be77eebc3d
node: Only try to fetch from connected nodes 2023-01-30 11:20:33 +01:00
Alexis Sellier ac23f45d9b
node: Cleanup working naming 2023-01-29 21:41:16 +01:00
Alexis Sellier 7d5347b74f
node: Document worker a little more 2023-01-29 21:34:40 +01:00
Alexis Sellier b92dc59204
node: Turn off `--atomic` when not supported 2023-01-29 18:22:41 +01:00
Alexis Sellier 33d8c35189
node: Move some code to `Runtime::run` 2023-01-29 17:39:46 +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 deeb160c2d
node: Improve stderr logging for git process 2023-01-27 17:04:20 +01:00
Alexis Sellier be95222fb5
node: Fix bug in upload-pack
We were not properly exiting one of the threads that was copying
data from the stream to the upload-pack process. This is a fix.
2023-01-27 15:09:17 +01:00
Alexis Sellier 026dfbde5d
node: Improve logging output 2023-01-26 18:15:27 +01:00
Alexis Sellier 405c00b91d
Update all dependencies
Also moves `netservices` to `crates.io`
2023-01-25 20:38:54 +01:00
Alexis Sellier 798485dfb1
Remove "log" feature from netservices 2023-01-25 20:12:13 +01:00
Alexis Sellier 30e9d6103c
Cleanup `clone` code
Remove a bunch of different instances of it.
2023-01-25 17:51:49 +01:00
Alexis Sellier cdc3c8a265
node: Try to cleanup socket file on exit
Signed-off-by: Alexis Sellier <self@cloudhead.io>
2023-01-25 17:51:49 +01:00
Alexis Sellier b4f44f39f2
Update `netservices` dependency 2023-01-25 15:35:24 +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 ef950d515a
node: Fully integrate worker fetch into service 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 e6f56ff3bc
Update `io-reactor` dependency 2023-01-25 10:21:57 +01:00
Alexis Sellier 3aff91f9b7
Correctly initialize home in `Profile::init` 2023-01-22 13:39:48 +01:00
Alexis Sellier 8318b07d89
node: Fix spurious test failures
In some circumstances, the nodes are already offline when the objects
are dropped.

Signed-off-by: Alexis Sellier <self@cloudhead.io>
2023-01-19 10:20:23 +01:00
Alexis Sellier 3bc07195f5
Migrate to `localtime` from `nakamoto`
The only thing we needed nakamoto for was `LocalTime`.

Signed-off-by: Alexis Sellier <self@cloudhead.io>
2023-01-18 18:03:11 +01:00
Alexis Sellier d25c47ad0e
node: Get rid of worker response channel 2023-01-18 17:45:46 +01:00
Alexis Sellier 7e55ed346a
node: Update log target to match type name
Signed-off-by: Alexis Sellier <self@cloudhead.io>
2023-01-18 17:45:46 +01:00
Alexis Sellier 067b532154
node: Get replication test to pass
Signed-off-by: Alexis Sellier <self@cloudhead.io>
2023-01-18 17:45:46 +01:00
Alexis Sellier 723cdcf233
node: Update `io-reactor`
Signed-off-by: Alexis Sellier <self@cloudhead.io>
2023-01-18 17:45:46 +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 f33e79f14b
node: Fix redundant announcements
This change makes sure that nodes don't gossip announcements back to
the announcers.

Since the tests were relying on this mechanism to populate the routing
table, we had to change a few more things, such as adding the inventory
to the node's routing table.

Signed-off-by: Alexis Sellier <self@cloudhead.io>
2023-01-18 08:48:33 +01:00