improve readme, add bootstrap node

This commit is contained in:
E M 2026-02-16 15:45:44 +11:00
parent 0777c145ea
commit 5caabc1ddd
No known key found for this signature in database
3 changed files with 16 additions and 7 deletions

View File

@ -86,14 +86,23 @@ Commands: `help`, `start`, `stop`, `upload`, `download`, `quit`.
### uploader / downloader
Standalone programs that demonstrate file sharing between two nodes. On one machine, start the uploader:
Standalone programs that demonstrate file sharing between two nodes.
Optionally generate a file to upload. For example, using `dd` on nix-based systems:
```bash
# generate a 500MB file with random contents
dd if=/dev/urandom of=myfile.txt bs=1048576 count=500
```
On one machine, start the uploader, passing in the path to a file to upload:
```bash
./build/uploader ./myfile.txt
# prints: Run: downloader <SPR> <CID> ./output-file
```
On another (or the same machine), run the downloader with the printed values:
In another terminal, run the downloader with the printed values:
```bash
./build/downloader <SPR> <CID> ./output-file

View File

@ -28,8 +28,8 @@ int main(int argc, char *argv[]) {
.api_port = 8081,
.disc_port = 9091,
.data_dir = "./downloader-data",
.log_level = "INFO",
.bootstrap_node = spr,
.log_level = "TRACE",
.bootstrap_node = "spr:CiUIAhIhA-VlcoiRm02KyIzrcTP-ljFpzTljfBRRKTIvhMIwqBqWEgIDARpJCicAJQgCEiED5WVyiJGbTYrIjOtxM_6WMWnNOWN8FFEpMi-EwjCoGpYQs8n8wQYaCwoJBHTKubmRAnU6GgsKCQR0yrm5kQJ1OipHMEUCIQDwUNsfReB4ty7JFS5WVQ6n1fcko89qVAOfQEHixa03rgIgan2-uFNDT-r4s9TOkLe9YBkCbsRWYCHGGVJ25rLj0QE",
.nat = "none",
};

View File

@ -24,7 +24,7 @@ int main(int argc, char *argv[]) {
.api_port = 8080,
.disc_port = 9090,
.data_dir = "./uploader-data",
.log_level = "INFO",
.log_level = "TRACE",
.bootstrap_node = NULL,
.nat = "none",
};
@ -40,8 +40,8 @@ int main(int argc, char *argv[]) {
char *spr = e_storage_spr(node);
if (spr == NULL) panic("Failed to obtain node's Signed Peer Record (SPR)");
printf("Run: downloader %s %s ./output-file\n", spr, cid);
printf("\nPress Enter to exit\n");
printf("Run: ./build/downloader %s %s ./output-file\n", spr, cid);
printf("\nKeep running while downloading.\n\nPress Enter to exit when finished.\n");
getchar();
printf("Deleting file (this could take a while)...");