Skip to content
This repository has been archived by the owner on Jan 29, 2024. It is now read-only.

ergoplatform/ergo-test

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 

Repository files navigation

The blockchain synchronization task

The blockchain consists of blocks. Suppose for this task that the blocks do not carry any useful information and simply increase the total chain score and a node already has a valid genesis block. The block is valid in the following case:

  • block score is a positive number
  • block id is a valid uuid
  • block parent id is an id of last block of the blockchain or there are no last block (for genesis block)

Blockchain is stored by network of nodes that exchange the blocks of best chain with each other. The best is the chain with the highest total score of its blocks. This is your task to implement this logics. For this task we don't generate new blocks by the nodes, but we every node is able to receive newly generated block. A node at startup can have an empty blockchain.

A blockchain node should know the list of all nodes connected to it (both incoming and outgoing connections). Once the node gets the continuation of the best chain, it must validate it and pass to its neighbors. Suppose for this task that the nodes do not exchange peers. They still can receive connection request with information about other node. A node at startup can have an empty connected nodes list.

In this repository one could find the initial classes to start with. Nodes are implemented as Actors in the same Actor System. New blocks are generated by the Application that bootstraps the actors. This is also the Application who send connection requests to each node to enable blockchain data exchange.

The purpose of the task is to synchronize the blocks of best chain between the nodes of the network using messages with a minimum amount of transmitted data. You can not simply transfer the entire blockchain to another node on the network, because usually this is a very large amount of data.

About

Test for development candidates

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages