mirror of
https://github.com/logos-storage/easylibstorage.git
synced 2026-03-29 02:13:07 +00:00
improve readme, add bootstrap node
This commit is contained in:
parent
0777c145ea
commit
5caabc1ddd
13
README.md
13
README.md
@ -86,14 +86,23 @@ Commands: `help`, `start`, `stop`, `upload`, `download`, `quit`.
|
|||||||
|
|
||||||
### uploader / downloader
|
### 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
|
```bash
|
||||||
./build/uploader ./myfile.txt
|
./build/uploader ./myfile.txt
|
||||||
# prints: Run: downloader <SPR> <CID> ./output-file
|
# 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
|
```bash
|
||||||
./build/downloader <SPR> <CID> ./output-file
|
./build/downloader <SPR> <CID> ./output-file
|
||||||
|
|||||||
@ -28,8 +28,8 @@ int main(int argc, char *argv[]) {
|
|||||||
.api_port = 8081,
|
.api_port = 8081,
|
||||||
.disc_port = 9091,
|
.disc_port = 9091,
|
||||||
.data_dir = "./downloader-data",
|
.data_dir = "./downloader-data",
|
||||||
.log_level = "INFO",
|
.log_level = "TRACE",
|
||||||
.bootstrap_node = spr,
|
.bootstrap_node = "spr:CiUIAhIhA-VlcoiRm02KyIzrcTP-ljFpzTljfBRRKTIvhMIwqBqWEgIDARpJCicAJQgCEiED5WVyiJGbTYrIjOtxM_6WMWnNOWN8FFEpMi-EwjCoGpYQs8n8wQYaCwoJBHTKubmRAnU6GgsKCQR0yrm5kQJ1OipHMEUCIQDwUNsfReB4ty7JFS5WVQ6n1fcko89qVAOfQEHixa03rgIgan2-uFNDT-r4s9TOkLe9YBkCbsRWYCHGGVJ25rLj0QE",
|
||||||
.nat = "none",
|
.nat = "none",
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@ -24,7 +24,7 @@ int main(int argc, char *argv[]) {
|
|||||||
.api_port = 8080,
|
.api_port = 8080,
|
||||||
.disc_port = 9090,
|
.disc_port = 9090,
|
||||||
.data_dir = "./uploader-data",
|
.data_dir = "./uploader-data",
|
||||||
.log_level = "INFO",
|
.log_level = "TRACE",
|
||||||
.bootstrap_node = NULL,
|
.bootstrap_node = NULL,
|
||||||
.nat = "none",
|
.nat = "none",
|
||||||
};
|
};
|
||||||
@ -40,8 +40,8 @@ int main(int argc, char *argv[]) {
|
|||||||
char *spr = e_storage_spr(node);
|
char *spr = e_storage_spr(node);
|
||||||
if (spr == NULL) panic("Failed to obtain node's Signed Peer Record (SPR)");
|
if (spr == NULL) panic("Failed to obtain node's Signed Peer Record (SPR)");
|
||||||
|
|
||||||
printf("Run: downloader %s %s ./output-file\n", spr, cid);
|
printf("Run: ./build/downloader %s %s ./output-file\n", spr, cid);
|
||||||
printf("\nPress Enter to exit\n");
|
printf("\nKeep running while downloading.\n\nPress Enter to exit when finished.\n");
|
||||||
getchar();
|
getchar();
|
||||||
|
|
||||||
printf("Deleting file (this could take a while)...");
|
printf("Deleting file (this could take a while)...");
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user