Skip to content

Commit

Permalink
Merge pull request #1020 from Setheum-Labs/dev0x
Browse files Browse the repository at this point in the history
Dev0x - Aleph and Blackbox
  • Loading branch information
balqaasem authored Mar 16, 2024
2 parents a04c22c + 032bb8f commit 60e2870
Show file tree
Hide file tree
Showing 131 changed files with 24,323 additions and 55,302 deletions.
5 changes: 3 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,11 @@ lto = true
codegen-units = 1

[workspace.package]
authors = ["Setheum Labs", "Open Web3 Foundation"]
authors = [ "Open Web3 Foundation", "Setheum Labs", "Slixon Technologies"]
edition = "2021"
homepage = "https://setheum.xyz"
repository = "https://github.com/Setheum-Labs/Setheum"
version = "0.9.81-dev"

# The list of dependencies below (which can be both direct and indirect dependencies) are crates
# that are suspected to be CPU-intensive, and that are unlikely to require debugging (as some of
Expand Down Expand Up @@ -202,7 +203,7 @@ orml-xtokens = { path = "orml/xtokens", default-features = false }
wasm-bencher = { git = "https://github.com/open-web3-stack/wasm-bencher", branch = "polkadot-v1.3.0", default-features = false }

# Setheum (WASM)
primitives = { package = "setheum-primitives", path = "blockchain/primitives", default-features = false }
primitives = { package = "setheum-primitives", path = "primitives", default-features = false }
runtime-common = { path = "blockchain/runtime/common", default-features = false }
qingdao-runtime = { path = "blockchain/runtime/qingdao", default-features = false }
setheum-runtime = { path = "blockchain/runtime/setheum", default-features = false }
Expand Down
244 changes: 116 additions & 128 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,128 +1,116 @@
.PHONY: toolchain
toolchain:
./scripts/init.sh

.PHONY: init
init:
make toolchain
make submodule

.PHONY: submodule
submodule:
git submodule update --init --recursive

.PHONY: release
release:
make toolchain
rm -rf target/
cargo build --manifest-path node/Cargo.toml --features with-ethereum-compatibility --release

.PHONY: build
build:
cargo build --manifest-path node/Cargo.toml --features runtime-benchmarks,with-ethereum-compatibility --release

.PHONY: wasm
wasm:
cargo build -p setheum-runtime --features with-ethereum-compatibility --release

.PHONY: genesis
genesis:
make build
./target/release/setheum-node build-spec --chain testnet-new > blockchain/bin/resources/chain_spec_testnet.json
./target/release/setheum-node build-spec --chain mainnet-new > blockchain/bin/resources/chain_spec_mainnet.json
./target/release/setheum-node build-spec --chain testnet-new --raw > blockchain/bin/resources/chain_spec_testnet_raw.json
./target/release/setheum-node build-spec --chain mainnet-new --raw > blockchain/bin/resources/chain_spec_mainnet_raw.json

.PHONY: check
check:
SKIP_WASM_BUILD=1 cargo check

.PHONY: check-all
check-all: check-runtime check-benchmarks

.PHONY: check-runtime
check-runtime:
SKIP_WASM_BUILD= cargo check --features with-ethereum-compatibility --tests --all

.PHONY: clippy
clippy:
SKIP_WASM_BUILD=1 cargo clippy -- -D warnings -A clippy::from-over-into -A clippy::unnecessary-cast -A clippy::identity-op -A clippy::upper-case-acronyms

.PHONY: watch
watch:
SKIP_WASM_BUILD=1 cargo watch -c -x build

.PHONY: test
test:
SKIP_WASM_BUILD=1 cargo test --features with-ethereum-compatibility --all

.PHONY: check-tests
check-tests:
SKIP_WASM_BUILD= cargo check --features with-ethereum-compatibility --tests --all

.PHONY: debug
debug:
cargo build && RUST_LOG=debug RUST_BACKTRACE=1 rust-gdb --args target/debug/setheum-node --dev --tmp -lruntime=debug

.PHONY: run
run:
RUST_BACKTRACE=1 cargo run --manifest-path node/Cargo.toml --features with-ethereum-compatibility -- --dev --tmp

.PHONY: log
log:
RUST_BACKTRACE=1 RUST_LOG=debug cargo run --manifest-path node/Cargo.toml --features with-ethereum-compatibility -- --dev --tmp

.PHONY: noeth
noeth:
RUST_BACKTRACE=1 cargo run -- --dev --tmp

.PHONY: check-benchmarks
check-benchmarks:
SKIP_WASM_BUILD= cargo check --features runtime-benchmarks --no-default-features --target=wasm32-unknown-unknown -p setheum-runtime

.PHONY: test-benchmarking
test-benchmarking:
cargo test --features bench --package module-evm
cargo test --features runtime-benchmarks --features with-ethereum-compatibility --features --all benchmarking

.PHONY: bench
bench:
SKIP_WASM_BUILD=1 cargo test --manifest-path node/Cargo.toml --features runtime-benchmarks,with-ethereum-compatibility benchmarking

.PHONY: benchmark
benchmark:
cargo run --release --features=runtime-benchmarks --features=with-ethereum-compatibility -- benchmark --chain=dev --steps=50 --repeat=20 '--pallet=*' '--extrinsic=*' --execution=wasm --wasm-execution=compiled --heap-pages=4096 --template=.maintain/runtime-weight-template.hbs --output=./runtime/src/weights/

.PHONY: doc
doc:
SKIP_WASM_BUILD=1 cargo doc --open

.PHONY: cargo-update
cargo-update:
cargo update
cargo update --manifest-path node/Cargo.toml
make test

.PHONY: purge
purge: target/debug/setheum-node
target/debug/setheum-node purge-chain --dev -y

.PHONY: restart
restart: purge run

.PHONY: fork
fork:
npm i --prefix fork fork
ifeq (,$(wildcard fork/data))
mkdir fork/data
endif
cp target/release/setheum-node fork/data/binary
cp target/release/wbuild/setheum-runtime/setheum_runtime.compact.wasm fork/data/runtime.wasm
cp blockchain/bin/resources/types.json fork/data/schema.json
cp blockchain/bin/resources/chain_spec_$(chain)_raw.json fork/data/genesis.json
cd fork && npm start && cd ..

.PHONY: generate-tokens
generate-tokens:
cargo test -p setheum-primitives -- --ignored
cd blockchain/predeploy-contracts && yarn && yarn run generate-bytecode
.PHONY: toolchain
toolchain:
./scripts/init.sh

.PHONY: init
init:
make toolchain
make submodule

.PHONY: submodule
submodule:
git submodule update --init --recursive

.PHONY: release
release:
make toolchain
rm -rf target/
cargo build --manifest-path node/Cargo.toml --features with-ethereum-compatibility --release

.PHONY: build
build:
cargo build --manifest-path node/Cargo.toml --features runtime-benchmarks,with-ethereum-compatibility --release

.PHONY: wasm
wasm:
cargo build -p setheum-runtime --features with-ethereum-compatibility --release

.PHONY: genesis
genesis:
make build
./target/release/setheum-node build-spec --chain testnet-new > blockchain/bin/resources/chain_spec_testnet.json
./target/release/setheum-node build-spec --chain mainnet-new > blockchain/bin/resources/chain_spec_mainnet.json
./target/release/setheum-node build-spec --chain testnet-new --raw > blockchain/bin/resources/chain_spec_testnet_raw.json
./target/release/setheum-node build-spec --chain mainnet-new --raw > blockchain/bin/resources/chain_spec_mainnet_raw.json

.PHONY: check
check:
SKIP_WASM_BUILD=1 cargo check

.PHONY: check-all
check-all: check-runtime check-benchmarks

.PHONY: check-runtime
check-runtime:
SKIP_WASM_BUILD= cargo check --features with-ethereum-compatibility --tests --all

.PHONY: clippy
clippy:
SKIP_WASM_BUILD=1 cargo clippy -- -D warnings -A clippy::from-over-into -A clippy::unnecessary-cast -A clippy::identity-op -A clippy::upper-case-acronyms

.PHONY: watch
watch:
SKIP_WASM_BUILD=1 cargo watch -c -x build

.PHONY: test
test:
SKIP_WASM_BUILD=1 cargo test --features with-ethereum-compatibility --all

.PHONY: check-tests
check-tests:
SKIP_WASM_BUILD= cargo check --features with-ethereum-compatibility --tests --all

.PHONY: debug
debug:
cargo build && RUST_LOG=debug RUST_BACKTRACE=1 rust-gdb --args target/debug/setheum-node --dev --tmp -lruntime=debug

.PHONY: run
run:
RUST_BACKTRACE=1 cargo run --manifest-path node/Cargo.toml --features with-ethereum-compatibility -- --dev --tmp

.PHONY: log
log:
RUST_BACKTRACE=1 RUST_LOG=debug cargo run --manifest-path node/Cargo.toml --features with-ethereum-compatibility -- --dev --tmp

.PHONY: noeth
noeth:
RUST_BACKTRACE=1 cargo run -- --dev --tmp

.PHONY: check-benchmarks
check-benchmarks:
SKIP_WASM_BUILD= cargo check --features runtime-benchmarks --no-default-features --target=wasm32-unknown-unknown -p setheum-runtime

.PHONY: test-benchmarking
test-benchmarking:
cargo test --features bench --package module-evm
cargo test --features runtime-benchmarks --features with-ethereum-compatibility --features --all benchmarking

.PHONY: bench
bench:
SKIP_WASM_BUILD=1 cargo test --manifest-path node/Cargo.toml --features runtime-benchmarks,with-ethereum-compatibility benchmarking

.PHONY: benchmark
benchmark:
cargo run --release --features=runtime-benchmarks --features=with-ethereum-compatibility -- benchmark --chain=dev --steps=50 --repeat=20 '--pallet=*' '--extrinsic=*' --execution=wasm --wasm-execution=compiled --heap-pages=4096 --template=.maintain/runtime-weight-template.hbs --output=./runtime/src/weights/

.PHONY: doc
doc:
SKIP_WASM_BUILD=1 cargo doc --open

.PHONY: cargo-update
cargo-update:
cargo update
cargo update --manifest-path node/Cargo.toml
make test

.PHONY: purge
purge: target/debug/setheum-node
target/debug/setheum-node purge-chain --dev -y

.PHONY: restart
restart: purge run

.PHONY: generate-tokens
generate-tokens:
cargo test -p setheum-primitives -- --ignored
cd blockchain/predeploy-contracts && yarn && yarn run generate-bytecode
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@ Setheum's Blockchain Network node Implementation in Rust, ready for hacking :roc
- [Setheum - Powering The New Internet](#setheum---powering-the-new-internet)
- [1.0. Introduction](#10-introduction)
- [1.1. Setheum Chain](#11-setheum-chain)
- [1.2. Ethical DeFi](#12-ethicaldefi)
- [1.2.1 Edfis - Ethical DeFi Swap](#121-edfis---ethical-defi-swap)
- [1.2.2 The Setter Stablecoin](#122-the-setter-stablecoin)
- [1.2.3 The Slick USD Stablecoin](#123-the-slick-usd-stablecoin)
- [1.2. Ethical DeFi](#12-ethical-defi)
- [1.2.1. Edfis - Ethical DeFi Swap](#121-edfis---ethical-defi-swap)
- [1.2.2. The Setter Stablecoin](#122-the-setter-stablecoin)
- [1.2.3. The Slick USD Stablecoin](#123-the-slick-usd-stablecoin)
- [2.0. Getting Started](#20-getting-started)
- [2.1. Build](#21-build)
- [2.2. Run](#22-run)
Expand Down Expand Up @@ -363,10 +363,10 @@ project adheres to the [Contributor Covenant Code of Conduct](./CODE_OF_CONDUCT.

### 8.1. ToDo List

Note> Before adding/removing a TODO, please carefully read the [TODO.md file](./TODO.md)
Note> Before adding/removing a TODO, please carefully read the [TODO.md file](./docs/TODO.md)

Whenever you write a TODO in any file, please add a reference to it [here](./TODO.md).
Whenever you remove a TODO in any file, please remove its reference from [here](./TODO.md).
Whenever you write a TODO in any file, please add a reference to it [here](./docs/TODO.md).
Whenever you remove a TODO in any file, please remove its reference from [here](./docs/TODO.md).

## 9.0. License

Expand Down
16 changes: 16 additions & 0 deletions blockchain/aggregator/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
[package]
name = "aggregator"
version = "0.6.0"
authors.workspace = true
edition.workspace = true
homepage.workspace = true
repository.workspace = true

[dependencies]
aleph-bft-rmc = { workspace = true }
aleph-bft-types = { workspace = true }
async-trait = { workspace = true }
futures = { workspace = true }
log = { workspace = true }
parity-scale-codec = { workspace = true, features = ["derive"] }
tokio = { workspace = true, features = [ "sync", "macros", "time", "rt-multi-thread" ] }
7 changes: 7 additions & 0 deletions blockchain/aggregator/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Aggregator

## Overview

This crate provides an AlephBFT Block Signature Aggregator

Synchronize with [Aleph Aggregator](https://github.com/Cardinal-Cryptography/aleph-node/tree/main/aggregator)
56 changes: 56 additions & 0 deletions blockchain/aggregator/TODO.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# To-Do List

This list contains all TODOs in the Repo


<!-- TOC -->
- [To-Do List](#to-do-list)
- [1. Guidelines](#1-guidelines)
- [2. Contribution](#2-contribution)
- [3. Lists](#3-lists)
- [4. Tasks](#4-tasks)
<!-- /TOC -->


## 1. Guidelines

Note: Before you write a ToDo in this repo, please read the below guidelines carefully.

Whenever you write a ToDo, you need to follow this standard syntax

```rust
//TODO:[file_name:task_number] - task_details
```

for example:

```rust
//TODO:[TODO.md:0] - Add Todo Guidelines
```

Note > the `//TODO:[filename:task_number] - ` is what we call the `task_prefix`.

Whenever adding/writing a Task/ToDo, you need to describe the task on this list. Whenever you write a TODO in any file, add a reference to it here. Please make sure the task reference here is titled correctly and as detailed as possible\.

Whenever you `complete` a task/TODO from any file, please tick/complete its reference here and make sure you do it in the same `commit` that completes the task.

Whenever a task is cancelled (discontinued or not needed for w/e reason), please note in the details why it is cancelled, make sure you do it in the same `commit` that removes/cancels the TODO, and add this `-C` as a suffix to its `file_name` in the list here, for example:

```rust
//TODO:[TODO.md-C:0] - Add Todo Guidelines
```

## 2. Contribution

You can contribute to this list by completing tasks or by adding tasks(TODOs) that are currently in the repo but not on the list. You can also contribute by updating old tasks to the new Standard.

## 3. Lists

Each package/module/directory has its own `TODO.md`.

## 4. Tasks

These tasks are just for this file specifically.

- [x] [[TODO.md:0] - Add TODO.md File](TODO.md): Add a TODO.md file to organise TODOs in the repo.
- [x] [[TODO.md:1] - Add a `task_title`](/TODO.md/#tasks): Adda `task_title`.
Loading

0 comments on commit 60e2870

Please sign in to comment.