Skip to content

massbitprotocol/helloworld-rust-project

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

helloworld-rust-project

Task description.

You are going to write a less-constraint blockchain simulation. In the simulation there will be n nodes (n=5 in the demo) talking to each others using libp2p and all nodes will be started with the same code you are going to write. In addition, each node will store pairs of (pokemon_name, pokemon) where pokemon_name is a string and pokemon is an object describing the features of the pokemons. An object can be expressed in json format, for example, as following:

{
  "color": "blue",
  "eye_num": 5,
  "nose_num": 3,
  "mouth_num": 3,
}

For simplicity, the node can store those objects in memory.

You will be also implementing a service to receive a transaction (POST/GET) from end user where POST transaction is to create a new pokemen or update an existing one, and GET transaction with the given name is to return the json object of that pokemon name. You can use json_rpc for this service.

For your productivity, you can try to use handy-library to derive Serialize/Deserialize the json object.

Demo

You will run 5 different nodes in 5 different terminals with different ports. You will do send a POST/GET transaction to one of the nodes and the node will boradcast the transaction to other nodes which will print out the log of the transaction in its stdout.

You will do query

Delivery

  1. Github repo
  2. Instruction to run the demo will be written in the README.md file.

Reference to learn Rust

  1. Rust Design Pattern
  2. Cookin with Rust
  3. Rust with Example
  4. Rust The Book
  5. Rust Tokio
  6. Rust Rayon

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published