This project consists in creating a software system capable of connecting to a P2P overlay network. In particular, it refers to a P2P network of State Channels. A state channel is a channel between two peers capable of maintaining a state until the latter is closed. The state is made up of the balance sheet of the two peers, that needs to be consistent after every exchange of digital currency between them.
To compile the peer and the server, a "start.sh" script file was provided which will run the server. To be able to start a peer you need to go to the peerSource directory and run the following command:
./peer IDPEER IPSERVER CHANNELPORT UPDATEPORT TRANSACTIONPORT
The IDPEER is an integer greater than 0
The system features are listed below:
- Transfer currency from your balance sheet to another peer;
- Open a direct state channel with another peer if and only if there is no path that connects the two peers within the overlay network.
- View your own state channels;
- Close a state channel ensuring the consistency of the balance sheets and the stability of the system.
The system is based on a hybridized decentralized peer-to-peer network design model.
A common hybrid model has a central server that helps peers find each other. It was favored over models with unstructured pure networks or pure structured networks because some functions, such as search, require centralized functionality but benefit from the decentralized aggregation of nodes provided by unstructured networks.
Below there is an example of the management of a transaction by the overlay network that covers different routing cases. Let's assume a transaction of amount 5 by Peer 1 destined for Peer 5.
Andrea Lombardi - @LinkedIn