Skip to content

Logos Builder's Workshop

The starting point for building on top of Logos Storage — and hence for this workshop — is the Logos Storage Module. You can find a Nix-based application skeleton here. This workshop requires Nix.

You can read the API documentation and decide what to build. We provide a suggestion here for inspiration.

Idea: Publish and Download over the CLI

We propose building a simple pair of command line applications on top of Storage Module API which allow publishing and downloading a file from the network, respectively.

If you choose to try this out, at the end of the workshop you should have two CLI applications - publisher and downloader. publisher should allow publishing a file to the network, as follows:

Terminal window
./publisher ./path-to-file
SPR: spr:CiUIAhIhAjQOk4ZMeWVeOT1D6DRebpfvtoQQFkCZJd-HjUNWJ0rO
EgIDARpJCicAJQgCEiECNA6Thkx5ZV45PUPoNF5ul--2hBAWQJkl34eNQ1YnS
s4QzsGbzQYaCwoJBM5RHD-RAiOCGgsKCQTOURw_kQIjgipHMEUCIQDt7dKojuo
e9f9w3F7kS9m_XReZUwvQ9MYJ1Ca-p5FlLAIgLH7OzQ3eMLEMUwmbjFF-ROS2
IUO_Lu1r0OfC7oP2O_M
File published.
CID: zDvZRwzm49ZJLzxheYtydzx6AcNVSrf69LriUWjPr1SNLVnaXfj2
Type CTRL+C to exit.

The utility should use the Logos Module API to initialize the module and publish a file. It should then print the node’s Signed Peer Record and the CID of the uploaded file.

The downloader, instead, takes a bootrap node SPR, a CID, and an output path and downloads the file from the network onto a local file:

Terminal window
./downloader <node-spr> <cid> ./output

You can then pass the SPR string printed by the uploader as <node-spr> and the CID as <cid>, and the downloader should be able to download the file.

Local vs. Local Area vs. Wide Area Network

The first step to clear is ensuring that the utilities work on your computer (localhost). To run such local network experiments, you must set your NAT config to none; i.e., your config JSON passed to init during module initialization, should contain:

{
"bootstrap-node": ["<bootstrap-spr>"],
"nat": "none",
...
}

Once you get that working, you can try the Local Area Network. If the router does not block communication across IPs (which you can test with netcat), you should be able to run the publisher on one laptop and the downloader in another and it should work.

Publishing to the wider internet can be trickier as it requires your node to be reachable, and venue routers tend to be very restrictive. You should still be able to download from reachable nodes, however. You should set "nat": "any" and use our public bootstrap nodes:

{
"bootstrap-node": [
"spr:CiUIAhIhA-VlcoiRm02KyIzrcTP-ljFpzTljfBRRKTIvhMIwqBqWEgIDARpJCicAJQgCEiED5WVyiJGbTYrIjOtxM_6WMWnNOWN8FFEpMi-EwjCoGpYQs8n8wQYaCwoJBHTKubmRAnU6GgsKCQR0yrm5kQJ1OipHMEUCIQDwUNsfReB4ty7JFS5WVQ6n1fcko89qVAOfQEHixa03rgIgan2-uFNDT-r4s9TOkLe9YBkCbsRWYCHGGVJ25rLj0QE",
"spr:CiUIAhIhApIj9p6zJDRbw2NoCo-tj98Y760YbppRiEpGIE1yGaMzEgIDARpJCicAJQgCEiECkiP2nrMkNFvDY2gKj62P3xjvrRhumlGISkYgTXIZozMQvcz8wQYaCwoJBAWhF3WRAnVEGgsKCQQFoRd1kQJ1RCpGMEQCIFZB84O_nzPNuViqEGRL1vJTjHBJ-i5ZDgFL5XZxm4HAAiB8rbLHkUdFfWdiOmlencYVn0noSMRHzn4lJYoShuVzlw",
"spr:CiUIAhIhApqRgeWRPSXocTS9RFkQmwTZRG-Cdt7UR2N7POoz606ZEgIDARpJCicAJQgCEiECmpGB5ZE9JehxNL1EWRCbBNlEb4J23tRHY3s86jPrTpkQj8_8wQYaCwoJBAXfEfiRAnVOGgsKCQQF3xH4kQJ1TipGMEQCIGWJMsF57N1iIEQgTH7IrVOgEgv0J2P2v3jvQr5Cjy-RAiAy4aiZ8QtyDvCfl_K_w6SyZ9csFGkRNTpirq_M_QNgKw"
],
"nat": "any"
...
}