diff --git a/README.md b/README.md index 469bed3..7a9a586 100644 --- a/README.md +++ b/README.md @@ -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 ./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 ./output-file diff --git a/examples/downloader.c b/examples/downloader.c index 79482c0..203d20b 100644 --- a/examples/downloader.c +++ b/examples/downloader.c @@ -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", }; diff --git a/examples/uploader.c b/examples/uploader.c index 883cef9..44656a9 100644 --- a/examples/uploader.c +++ b/examples/uploader.c @@ -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)...");