Skip to content

Latest commit

 

History

History
30 lines (20 loc) · 2.75 KB

File metadata and controls

30 lines (20 loc) · 2.75 KB

the different ways in which Walytis nodes communicate with each other

Walytis uses the Interplanetary Filesystem (IPFS) and its built-in libp2p peer-to-peer communications engine to allow nodes to communicate with each other.

Used Communication Methods

Walytis nodes communicate with each other in two different ways for different purposes:

Communicative Processes:

Block Creation

  • When a node creates a new block, it encodes all the block's data and metadata into the block data-file, which it publishes on IPFS, which assigns it a unique content identifier (CID), which becomes part of the block's ID.
  • The node then publishes a message containing the block's ID on a pubsub channel which all nodes on the blockchain are subscribed to.
  • When another node receives the pubsub message with the ID of the new block, it extracts the block's CID from the block ID encoded in the message and uses IPFS' file-sharing to retrieve the block's datafile from one of the other nodes.

Quiet Blockchain

See Leaf-Block Broadcasts for more details.

When the pubsub communications channel is quiet because no new blocks are being created, nodes broadcast lists of their leaf-blocks (newest blocks without children) to each other to ensure redundancy in the pubsub messages and enable nodes coming online to get up-to-date with the newest blocks quickly.

Blockchain Joining

See Joining for more details.

Blockchain nodes listen for incoming join requests on an IPFS libp2p-stream-mounting websocket named /x/BLOCKCHAIN_ID:JoinRequest. We'll call this websocket and the part of Walytis which processes incoming communications on the join-request-listener. When a node wants to join a blockchain using an invitation, it extracts the IPFS peer IDs encoded in the invitation. It connects to each peer's join-request-listener, asking to join the blockchain, until one of them responds and transmits, over the same connection, its blockchain appdata.