Rust-Yeeroot v1.3.0: YeeCo yeeroot — is a permissionless, secure, high performance and scalable public blockchain platform powered by full sharding technology on PoW consensus written in Rust

icon
Latest Release: v1.3.0

Optimization for synchronous

Source code(tar.gz)
Source code(zip)

yeeroot

standard-readme compliant

Official implementation of the YeeCo Root Chain (Layer 1)

YeeCo is a permissionless, secure, high performance and scalable public blockchain platform powered by full sharding technology on PoW consensus.

? YeeCo Testnet launched! (2020-03-31)

Table of Contents

Description

Yeeco takes advantage of the 4 key mechanisms as follows:

  1. PoW (permissionless and secure)
  2. Full sharding (high performance and scalable)
  3. Multi-mining (resist 1% attack)
  4. CRFG (conditional reward finality gadget, introduce absolute finality on PoW to support lock-free cross shard transactions)

Install

Requirements

  1. Rust
    curl https://sh.rustup.rs -sSf | sh
  2. Openssl
  3. Rust nightly
    rustup toolchain add nightly
  4. rust nightly wasm
    rustup target add wasm32-unknown-unknown
    rustup target add wasm32-unknown-unknown --toolchain nightly
  5. wasm-gc
    cargo install wasm-gc
  6. Rust components: clippy rls docs src rustfmt
    rustup component list # list all the components installed
    rustup component add <name> # install component

Building

$ cd <project_base_dir>/runtime/wasm
$ sh build.sh
$ cd <project_base_dir>
$ cargo build

Usage

Start

  1. Start bootnodes router.

    $ ./yee bootnodes-router --dev-params

    Bootnodes router provides the bootnodes for each shard.

    You can try getting the bootnodes by the following RPC:

    $ curl -X POST --data '{"jsonrpc":"2.0","method":"bootnodes","params":[],"id":1}' localhost:50001 -H 'Content-Type: application/json'
  2. Start the nodes of the 4 shards

    $ ./yee --dev --dev-params --shard-num=0 --base-path=/tmp/yee/shard_0
    $ ./yee --dev --dev-params --shard-num=1 --base-path=/tmp/yee/shard_1
    $ ./yee --dev --dev-params --shard-num=2 --base-path=/tmp/yee/shard_2
    $ ./yee --dev --dev-params --shard-num=3 --base-path=/tmp/yee/shard_3

    Since we start the node without --mine, it will not mine new blocks.

  3. Start switch

    $ ./yee switch --dev-params --mine

    Switch provides proxy rpc of all the 4 shards. You can get the balance of a certain address of any shard by the following RPC:

    $ curl -X POST --data '{"jsonrpc":"2.0","method":"state_getBalance","params":["tyee15c2cc2uj34w5jkfzxe4dndpnngprxe4nytaj9axmzf63ur4f8awq806lv6"],"id":1}' localhost:10033 -H 'Content-Type: application/json'

    Switch can also work as a multi-miner. Since we start the switch with --mine, it will mine on the 4 shards.

Accounts

Test accounts:

Address                                                            Shard num    Private key
tyee1jfakj2rvqym79lmxcmjkraep6tn296deyspd9mkh467u4xgqt3cqkv6lyl    0            0xa8666e483fd6c26dbb6deeec5afae765561ecc94df432f02920fc5d9cd4ae206ead577e5bc11215d4735cee89218e22f2d950a2a4667745ea1b5ea8b26bba5d6
tyee15zphhp8wmtupkf3j8uz5y6eeamkmknfgs6rj0hsyt6m8ntpvndvsmz3h3w    1            0x40e17c894e03256ea7cb671d79bcc88276c3fd6e6a05e9c0a9546c228d1f4955d8f18e85255020c97764251977b77f3b9e18f4d6de7b62522ab29a49cede669f
tyee14t6jxhs885azsd9v4t75cre9t4crv6a89q2vg8472u3tvwm3f94qgr9w77    2            0x708084bc9da56d9d1b201f50830269887ff2ef74e619c6af6ba7cf506068326f7cc9c4d646c531e83507928114ff9ef66350c62dfda3a7c5d2f0d9e0c37e7750
tyee12n2pjuwa5hukpnxjt49q5fal7m5h2ddtxxlju0yepzxty2e2fads5g57yd    3            0xa079ef650520662d08f270c4bc088f0c61abd0224f58243f6d1e6827c3ab234a7a1a0a3b89bbb02f2b10e357fd2a5ddb5050bc528c875a6990874f9dc6496772

Roadmap

  1. [Done] PoC-1: Tetris consensus demo (2019-02)

    tetris_demo

  2. [Done] PoC-2: Transfer feature based on Tetris (2019-05)

    gyee

  3. [Done] PoC-3: PoW consensus, static sharding (2019-07)

    Release notes

  4. [Done] PoC-4: Multi-mining, cross-shard transactions (2019-09)

    Release notes

  5. [Done] PoC-5: Dynamic sharding (2019-11)

    Release notes

  6. [Done] PoC-6: Cross chain (interoperate with branch chain) (2019-12)

    Release notes

  7. [Done] PoC-7: Smart contract (on branch chain) (2020-02-14)

    Release notes

  8. [Done] Testnet (2020-03)

    Release notes

  9. [In Progress] Mainnet (2020-06)

Contributing

Feel free to dive in! Open an issue.

Contributors

License

GPL

Comments

  • Error while Building on Ubuntu System
    Error while Building on Ubuntu System

    Feb 16, 2021

    Hey Maybe I am just super stupid and forgot some things, but even better if you can help me instant :D

    Was following the Instructions 1 by 1 but got this Error while building:

    `[email protected]:~/yee/yeeroot-1.3.0/runtime/wasm$ sh build.sh
    warning: the feature `alloc` has been stable since 1.36.0 and no longer requires an attribute to enable
      --> /home/student/yee/yeeroot-1.3.0/core/crfg/primitives/src/lib.rs:20:43
       |
    20 | #![cfg_attr(not(feature = "std"), feature(alloc))]
       |                                           ^^^^^
       |
       = note: `#[warn(stable_features)]` on by default
    
    warning: 1 warning emitted
    
    warning: unused variable: `shard_num`
       --> /home/student/yee/yeeroot-1.3.0/srml/yee-sharding/src/lib.rs:219:58
        |
    219 |                     ScaleOutPhase::Started{observe_util, shard_num} => {
        |                                                          ^^^^^^^^^ help: try ignoring the field: `shard_num: _`
        |
        = note: `#[warn(unused_variables)]` on by default
    
    warning: unused variable: `shard_num`
       --> /home/student/yee/yeeroot-1.3.0/srml/yee-sharding/src/lib.rs:231:62
        |
    231 |                     ScaleOutPhase::NativeReady{observe_util, shard_num} => {
        |                                                              ^^^^^^^^^ help: try ignoring the field: `shard_num: _`
    
    warning: unused variable: `shard_num`
       --> /home/student/yee/yeeroot-1.3.0/srml/yee-sharding/src/lib.rs:244:56
        |
    244 |                     ScaleOutPhase::Ready{observe_util, shard_num} => {
        |                                                        ^^^^^^^^^ help: try ignoring the field: `shard_num: _`
    
    warning: unused variable: `shard_num`
       --> /home/student/yee/yeeroot-1.3.0/srml/yee-sharding/src/lib.rs:266:46
        |
    266 |                     ScaleOutPhase::Committed{shard_num, shard_count} => {
        |                                              ^^^^^^^^^ help: try ignoring the field: `shard_num: _`
    
    warning: unused variable: `shard_count`
       --> /home/student/yee/yeeroot-1.3.0/srml/yee-sharding/src/lib.rs:266:57
        |
    266 |                     ScaleOutPhase::Committed{shard_num, shard_count} => {
        |                                                         ^^^^^^^^^^^ help: try ignoring the field: `shard_count: _`
    
    warning: 5 warnings emitted
    
    warning: unused imports: `Codec`, `MaybeDisplay`, `MaybeSerializeDebug`, `Member`, `SimpleArithmetic`
      --> /home/student/yee/yeeroot-1.3.0/srml/yee-tracker/src/lib.rs:35:3
       |
    35 |         Codec, Decode, Encode,
       |         ^^^^^
    ...
    38 |         Member, SimpleArithmetic,
       |         ^^^^^^  ^^^^^^^^^^^^^^^^
    39 |         MaybeDisplay, MaybeSerializeDebug,
       |         ^^^^^^^^^^^^  ^^^^^^^^^^^^^^^^^^^
       |
       = note: `#[warn(unused_imports)]` on by default
    
    warning: 1 warning emitted
    
    warning: unused import: `StorageValue`
       --> /home/student/yee/yeeroot-1.3.0/srml/yee-sudo/src/lib.rs:129:20
        |
    129 | use srml_support::{StorageValue, Parameter, Dispatchable, decl_module, decl_event, decl_storage, ensure};
        |                    ^^^^^^^^^^^^
        |
        = note: `#[warn(unused_imports)]` on by default
    
    warning: 1 warning emitted
    
       Compiling srml-indices v1.0.0 (https://github.com/yeeco/substrate.git?branch=yee-v1.0#d50272d1)
    warning: unused import: `result`
      --> /home/student/yee/yeeroot-1.3.0/srml/yee-pow/src/lib.rs:52:12
       |
    52 | use rstd::{result, prelude::*};
       |            ^^^^^^
       |
       = note: `#[warn(unused_imports)]` on by default
    
    warning: 1 warning emitted
    
    warning: the item `As` is imported redundantly
       --> /home/student/yee/yeeroot-1.3.0/srml/yee-crfg/src/lib.rs:271:28
        |
    44  | use primitives::traits::{MaybeSerializeDebug, As};
        |                                               -- the item `As` is already imported here
    ...
    271 |         use primitives::traits::{As};
        |                                  ^^
        |
        = note: `#[warn(unused_imports)]` on by default
    
    warning: 1 warning emitted
    
       Compiling yee-srml-relay v0.4.0 (/home/student/yee/yeeroot-1.3.0/srml/yee-relay)
    error[E0282]: type annotations needed
       --> /home/student/.cargo/git/checkouts/substrate-a761d01d47485ffa/d50272d/srml/indices/src/lib.rs:128:7
        |
    128 |         let i = (try_index % enum_set_size).as_();
        |             ^ consider giving `i` a type
    
    error[E0282]: type annotations needed
       --> /home/student/.cargo/git/checkouts/substrate-a761d01d47485ffa/d50272d/srml/indices/src/lib.rs:156:8
        |
    156 |             let item_index = (try_index % enum_set_size).as_();
        |                 ^^^^^^^^^^ consider giving `item_index` a type
    
       Compiling yee-srml-executive v0.4.0 (/home/student/yee/yeeroot-1.3.0/srml/yee-executive)
    error: aborting due to 2 previous errors
    
    For more information about this error, try `rustc --explain E0282`.
    error: could not compile `srml-indices`
    
    To learn more, run the command again with --verbose.
    warning: build failed, waiting for other jobs to finish...
    warning: field is never read: `authority_id`
       --> /home/student/yee/yeeroot-1.3.0/srml/yee-executive/src/lib.rs:507:2
        |
    507 |     authority_id: [u8; 32],
        |     ^^^^^^^^^^^^^^^^^^^^^^
        |
        = note: `#[warn(dead_code)]` on by default
    
    warning: field is never read: `pow_target`
       --> /home/student/yee/yeeroot-1.3.0/srml/yee-executive/src/lib.rs:508:2
        |
    508 |     pow_target: U256,
        |     ^^^^^^^^^^^^^^^^
    
    warning: field is never read: `timestamp`
       --> /home/student/yee/yeeroot-1.3.0/srml/yee-executive/src/lib.rs:509:2
        |
    509 |     timestamp: u64,
        |     ^^^^^^^^^^^^^^
    
    warning: field is never read: `work_proof`
       --> /home/student/yee/yeeroot-1.3.0/srml/yee-executive/src/lib.rs:510:2
        |
    510 |     work_proof: WorkProof,
        |     ^^^^^^^^^^^^^^^^^^^^^
    
    warning: field is never read: `extra_version`
       --> /home/student/yee/yeeroot-1.3.0/srml/yee-executive/src/lib.rs:512:2
        |
    512 |     extra_version: u32,
        |     ^^^^^^^^^^^^^^^^^^
    
    warning: field is never read: `extra`
       --> /home/student/yee/yeeroot-1.3.0/srml/yee-executive/src/lib.rs:513:2
        |
    513 |     extra: PowSealExtra,
        |     ^^^^^^^^^^^^^^^^^^^
    
    warning: 6 warnings emitted
    
    error: build failed
    `
    
    Reply
  • Pxy/transfer spv
    Pxy/transfer spv

    Sep 21, 2019

    for spv

                                                                                                                                                                                                           
    Reply
  • Foreign network block message
    Foreign network block message

    Sep 21, 2019

                                                                                                                                                                                                           
    Reply
  • Dyz/crfg
    Dyz/crfg

    Sep 23, 2019

                                                                                                                                                                                                           
    Reply
  • Poc4 release
    Poc4 release

    Sep 26, 2019

                                                                                                                                                                                                           
    Reply
  • Change address codec
    Change address codec

    Nov 6, 2019

    Change address codec from Ss58 to Bech32

    Reply
  • Validator reward
    Validator reward

    Nov 8, 2019

                                                                                                                                                                                                           
    Reply
  • Validator fee reward
    Validator fee reward

    Nov 11, 2019

                                                                                                                                                                                                           
    Reply
  • Mn/v1.2.1
    Mn/v1.2.1

    Nov 3, 2020

                                                                                                                                                                                                           
    Reply
  • Add mining submitJob rpc skeleton
    Add mining submitJob rpc skeleton

    Sep 3, 2019

                                                                                                                                                                                                           
    Reply
  • add multi-mining
    add multi-mining

    Sep 4, 2019

    add multi-mining

                                                                                                                                                                                                           
    Reply