Ralph HATOUM - PR INSA Lyon 2023-2024
Projet still under development
This project aims at building and IPFS pinning overlay to ensure data replication and efficient storage use over a set of nodes. Unlike other pinning services such as Filecoin that rely on a cryptocurrency and blockchain to allow nodes to reserve storage space on each other, we aim to implement a bartering system.
This is a guide to launch the protocol locally.
Bartering relies on IPFS. So, we need to have an IPFS client running on your computer. We therefore need to install IPFS. There are several ways to do this, here are two :
- IPFS Desktop App, which will have a GUI
- IPFS Kubo, which is a CLI tool
I advise using the second option (Kubo) as this is what the protocol was built with. Follow the instructions to install it and, once done, verify your installation with the following command :
ipfs version
which should ouput the installed IPFS version if everything went well.
Once this is successfully done, we can run IPFS with the following command :
ipfs daemon
IPFS is now running your machine ! Keep the terminal in which you started this command open. If you want to reuse the same terminal, you can also launch the command and run it in the background :
ipfs daemon &
The protocol relies on a bootstrap system. Basically, whenever a new node connects to the network, it will contact the bootstrap to get a list of peers. We have to launch this bootstrap first. In a new terminal, run the following commands, from the root of this repository :
cd bootstrap-node
go run bootstrap.go 127.0.0.1
You can now run the protocol, again in a new terminal (we need both IPFS and the bootstrap running still ! ). Enter the following command :
go run main.go 127.0.0.1
Your node is now up and running. By default, it will watch and send to the network any file that you create or add in the data/ folder. Try it !
Functions used to interact with the IPFS daemon
Functions related to the bartering process
Functions used to connect and interact with the network's bootstrap node
Daemon to run on the bootstrap node
General funtions used in the node daemon
Functions to make nodes fail - used to test the protocol's behavior
Functions used to interact with other peers in the network
Functions and datatypes used to represent storage requests and deal with them
Functions used to request proof of storage from other peers
All datastructures used declared in a single library to prevent circular dependencies
General functions to perform operations such as printing lists or handling errors