diff --git a/README.md b/README.md index 2bbf4ac3..65aec70b 100644 --- a/README.md +++ b/README.md @@ -18,9 +18,11 @@ Setheum's Blockchain Network node Implementation in Rust, ready for hacking :roc
-[![Setheum version](https://img.shields.io/badge/Setheum-1.0.0-brightgreen?logo=Parity%20Substrate)](https://setheum.xyz/) +[![Setheum version](https://img.shields.io/badge/Setheum-1.0.0-blue?logo=Parity%20Substrate)](https://setheum.xyz/) [![Substrate version](https://img.shields.io/badge/Substrate-4.0.0-brightgreen?logo=Parity%20Substrate)](https://substrate.dev/) -[![License](https://img.shields.io/github/license/Setheum-Labs/Setheum?color=green)](https://github.com/Setheum-Labs/Setheum/blob/master/LICENSE) +[![License](https://img.shields.io/github/license/Setheum-Labs/Setheum?color=blue)](https://github.com/Setheum-Labs/Setheum/blob/master/LICENSE) +[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](docs/contributor/CONTRIBUTING.md) +
[![Website](https://img.shields.io/badge/web-gray?logo=web)](https://setheum.xyz) @@ -30,38 +32,53 @@ Setheum's Blockchain Network node Implementation in Rust, ready for hacking :roc
-## Introduction + + +- [1. Introduction](#1-introduction) +- [2. Setheum](#2-Setheum) + - [2.1. aUSD and the Honzon stablecoin protocol](#21-ausd-and-the-honzon-stablecoin-protocol) + - [2.2. Acala Network Economic Model](#22-acala-network-economic-model) +- [3. Building](#3-building) +- [4. Run](#4-run) +- [5. Development](#5-development) +- [6. Bug Bounty :bug:](#6-bug-bounty-bug) + + + +## 1. Introduction + +> NOTE: SETHEUM means `Salam Ethereum`, it also means `The house of gifts` from the name `Seth/Sheeth` meaning `gift` in hebrew and the name of the Prophet Sheeth/Seth in Islam, it also stands for `Secure, Evergreen, Truthful, Heterogeneous, Economically Unbiased Market`. + +### 1.1 Setheum -SETHEUM means `Salam Ethereum`, it also means `The house of gifts` from the name `Seth/Sheeth` meaning `gift` in hebrew and the name of the Prophet Sheeth/Seth in Islam, it also stands for `Secure, Evergreen, Truthful, Heterogeneous, Economically Unbiased Market`. +Founded November 2019,Setheum achieves a high level of equilibrium in the trilemma by leveraging a Directed Acyclic Graph(DAG) to build the blockchain consensus +making it a Blockchain via DAG, achieve instant finality, high throughput and very fast blocktime while preserving network security and having a fairly decentralised network, Setheum is a secure, confidential and interoperable decentralised internet cloud compute and storage blockchain network with EVM and WASM smart contracts, web3 and web 2 Support. The intent of the Setheum Network is to improve upon Web3 and solve the blockchain trilemma with a mixture of approaches and a recipe formed from what we have seen and considered to be some of the best solutions in the field, improving on scalability, security, mass adoption, diversity, -and ethics while preserving decentralisation and democratisation. Setheum intends to be the most scalable blockchain network in the world while providing +and ethics while preserving decentralisation and democratisation. + +etheum intends to be the most scalable blockchain network in the world while providing confidentiality for smart contracts, Cloud Computing and Storage Infrastructure for Web3 based Internet Solutions and Interoperability with both Web2 and other Web3 Networks. The AlephBFT Consensus Engine powers the Setheum Chain to have near instant finality, high throughput and high scalability. -Setheum, founded November 2019, achieves a high level of equilibrium in the trilemma by leveraging a Directed Acyclic Graph(DAG) to build the blockchain consensus -making it a Blockchain via DAG, achieve instant finality, high throughput and very fast blocktime while preserving network security and having a fairly decentralised network, Setheum’s consensus system works to achieve high scalability and high security with an ethical and equitably high level of decentralisation. -Setheum is EVM(Ethereum Virtual Machine) compatible for smart contracts to thrive on its super fast blockchain, the entire chain is upgradable and forkless -enabling forkless upgrades as Setheum is built with the Substrate framework using the Rust programming language. Ethical DeFi Suite powers the Ethical DeFi revolution -on Setheum, being on the fastest public blockchain network in the world and leveraging all the benefits that come with being on Setheum, making it a DeFi optimised blockchain -especially exceptional for DeFi applications and solutions. +### 1.2 EthicalDeFi -Ethical DeFi Suite is the DeFi powerhouse of the Setheum Network, providing all kinds of top notch DeFi protocols including a cutting-edge AMM DEX, modules, +EthicalDeFi Suite is the DeFi powerhouse of the Setheum Network, providing all kinds of top notch DeFi protocols including a cutting-edge AMM DEX, modules, Decentralised Liquid Staking for Setheum SE and ethical zero-interest halal stablecoins that gives us the properties of both Fiat and Crypto with SlickUSD (USSD) and the Setter (SETR) using an Ethical Collateralized Debt Position (ECDP) mechanism that is over-Collateralized and multi-Collateralised and stable without compromising decentralisation or economic stability, offering zero-interest loans of stable cryptocurrencies that has scalable value and trust, setheum provides just that, backed by crypto assets with efficient zero-interest loans. -## Getting Started +## 2. Getting Started This project contains some configuration files to help get started :hammer_and_wrench: -### Initialisation +### 2.1 Build Clone this repository: @@ -77,31 +94,37 @@ curl https://sh.rustup.rs -sSf | sh > If, after installation, running `rustc --version` in the console fails, refer to [it](https://www.rust-lang.org/tools/install) to repair. -You can install developer tools on Ubuntu 20.04 with: +You can install developer tools on Ubuntu with: ```bash -sudo apt install make clang pkg-config libssl-dev build-essential +sudo apt-get install -y git make clang curl pkg-config libssl-dev llvm libudev-dev protobuf-compiler build-essential ``` -You can install the latest Rust toolchain with: +You may need additional dependencies, checkout [substrate.io](https://docs.substrate.io/v3/getting-started/installation) for more info. + +Make sure you have `submodule.recurse` set to true to configure submodules. ```bash -make init +git config --global submodule.recurse true ``` -Make sure you have `submodule.recurse` set to true to configure submodule. +You can install required tools and git hooks: ```bash -git config --global submodule.recurse true +make init ``` -Install required tools and install git hooks: + + +### 2.2. Run -### Start a development node +#### 2.2.1 Start a development node The `make run` command will launch a temporary node and its state will be discarded after you terminate the process. @@ -109,7 +132,7 @@ The `make run` command will launch a temporary node and its state will be discar make run ``` -### Run a persistent single-node chain +#### 2.2.2 Run a persistent single-node chain Use the following command to build the node without launching it: @@ -135,52 +158,73 @@ Start the development chain with detailed logging: RUST_LOG=debug RUST_BACKTRACE=1 ./target/release/setheum-node -lruntime=debug --dev ``` -### Run tests +## 3. Development + +Run type check: + +```bash +make check-all +``` + +Run tests: ```bash make test ``` -### Run benchmarks +Run in debugger: -Run runtime benchmark tests: +```bash +make debug +``` + +Purge old chain data: ```bash -make bench +make purge ``` -Run module benchmark tests: +Purge old chain data and run: ```bash -cargo test -p module-poc --all-features +make restart ``` -Run the module benchmarks and generate the weights file: +Update Cargo: ```bash -./target/release/setheum-node benchmark \ - --chain=dev \ - --steps=50 \ - --repeat=20 \ - --pallet=module_currencies \ - --extrinsic='*' \ - --execution=wasm \ - --wasm-execution=compiled \ - --heap-pages=4096 \ - --output=./modules/currencies/src/weights.rs +make update ``` -### Run in debugger +Update Submodules: ```bash -make debug +make update-submodules +``` + +Update ORML: + +```bash +cd orml && git checkout master && git pull +git add orml +cargo update check-all ``` -## Nodes +Update Predeploy-Contracts: + +```bash +cd highway/predeploy-contracts && git checkout master && git pull +git add predeploy-contracts +cargo update check-all +``` + +__Note:__ All build command from Makefile are designed for local development purposes and hence have `SKIP_WASM_BUILD` enabled to speed up build time and use `--execution native` to only run using native execution mode. + +## 4. Nodes For Docs on running nodes, check [./docs/nodes.md](./docs/nodes.md) -### Embedded docs +### 4.1 Embedded docs Once the project has been built, the following command can be used to explore all parameters and subcommands: @@ -188,7 +232,7 @@ Once the project has been built, the following command can be used to explore al ./target/release/setheum-node -h ``` -### Release builds +### 4.2 Release builds To list all available release builds run: @@ -208,7 +252,7 @@ Then run this command to install appropriate compiler version and produce a bina make release ``` -### On-Chain upgrade builds +### 4.3 On-Chain upgrade builds Build the wasm runtime with: @@ -216,57 +260,70 @@ Build the wasm runtime with: make wasm ``` -## Update - -### Update Cargo +## 5. EVM - Generate Tokens & Predeploy Contracts ```bash -make update +make generate-tokens ``` -### Update ORML +__Note:__ All build commands with `SKIP_WASM_BUILD` are designed for local development purposes and hence have the `SKIP_WASM_BUILD` enabled to speed up build time and use `--execution native` to only run use native execution mode. + +## 6. Benchmark + +### 6.1. Run Benchmark Tests + +Run runtime benchmark tests: ```bash -cd orml && git checkout master && git pull -git add orml -cargo update check-all +make bench ``` -### Update Predeploy-Contracts +Run module benchmark tests: ```bash -cd highway/predeploy-contracts && git checkout master && git pull -git add predeploy-contracts -cargo update check-all +cargo test -p module-poc --all-features ``` -## Generate Tokens & Predeploy Contracts - SetheumEVM (SEVM) +### 6.2. Generate Runtime Module Weights Locally ```bash -make generate-tokens +make benchmark ``` -__Note:__ All build commands with `SKIP_WASM_BUILD` are designed for local development purposes and hence have the `SKIP_WASM_BUILD` enabled to speed up build time and use `--execution native` to only run use native execution mode. +### 6.3. Generate Module weights -## Bench Bot +Run the module benchmarks and generate the weights file: + +```bash +./target/release/setheum-node benchmark \ + --chain=dev \ + --steps=50 \ + --repeat=20 \ + --pallet=module_currencies \ + --extrinsic='*' \ + --execution=wasm \ + --wasm-execution=compiled \ + --heap-pages=4096 \ + --output=./modules/currencies/src/weights.rs +``` + +### 6.4. Bench Bot Bench bot can take care of syncing branch with `master` and generating WeightInfos for module or runtime. -### Generate Module weights +#### 6.4.1. Generate Module Weights -#### Generate Weights on Git with PR +Comment on a PR `/bench module ` i.e.: `/bench module module_prices` -Comment on a PR `/bench runtime module ` i.e.: `serp_prices` +Bench bot will do the benchmarking, generate `weights.rs` file push and changes into your branch. -Bench bot will do the benchmarking, generate `weights.rs` file push changes into your branch. +#### 6.4.2. Generate Runtime Weights -#### Generate Runtime Module Weights Locally +Comment on a PR `/bench runtime module ` i.e.: `/bench runtime module module_prices` -```bash -make benchmark -``` +Bench bot will do the benchmarking, generate `weights.rs` file and push changes into your branch. -## Fork Setheum Chain +## 5. Fork Setheum Chain You can create a fork of a live chain (testnet / mainnet) for development purposes. @@ -284,11 +341,14 @@ cd fork/data ./binary --chain fork.json --alice ``` -## Contributing +## 6. Contributing & Code of Conduct If you would like to contribute, please fork the repository, introduce your changes and submit a pull request. All pull requests are warmly welcome. -## Licenses +In every interaction and contribution, this +project adheres to the [Contributor Covenant Code of Conduct](./CODE_OF_CONDUCT.md). + +## 7. Licenses The code in this repository is licensed as follows: @@ -296,7 +356,7 @@ The code in this repository is licensed as follows: 2. [GPL3](.LICENSES/GPL3.md) 3. [MIT](.LICENSES/MIT.md) -### [Apache-2.0 License](.LICENSES/Apache-2.0.md) / [MIT License](.LICENSES/MIT.md) +### 7.1 [Apache-2.0 License](.LICENSES/Apache-2.0.md) / [MIT License](.LICENSES/MIT.md) All crates under [/highend](./highend) directory are licensed under the terms of the [Apache-2.0 License](.LICENSES/Apache-2.0.md) and or the [MIT License](.LICENSES/MIT.md). @@ -305,7 +365,7 @@ All crates under [/highend](./highend) directory are licensed under the terms of Unless you explicitly state otherwise, any contribution that you submit to this directory shall be dual licensed as above (as defined in the [Apache-2.0 License](.LICENSES/Apache-2.0.md) and or the [MIT License](.LICENSES/MIT.md)), without any additional terms or conditions. -### [GPL-3 License](.LICENSES/GPL3.md) +### 7.2 [GPL-3 License](.LICENSES/GPL3.md) All rest are licensed under either of the following licenses, at your discretion.