From ca3b0287d8860c8fb990b417536635263e337167 Mon Sep 17 00:00:00 2001 From: DarKing Lee Date: Sun, 6 Feb 2022 20:26:53 +0800 Subject: [PATCH] perf: Specification Name --- .devcontainer/devcontainer.json | 2 +- Cargo.lock | 82 +++++++++++------------ Makefile | 4 +- README.md | 49 +++++++++++--- docker-compose.yml | 10 +-- node/Cargo.toml | 6 +- pallets/challenges/Cargo.toml | 2 +- pallets/refresh-reputation/Cargo.toml | 2 +- pallets/refresh-reputation/src/weights.rs | 2 +- pallets/refresh-seeds/Cargo.toml | 2 +- pallets/refresh-seeds/src/weights.rs | 2 +- pallets/reputation/Cargo.toml | 2 +- pallets/seeds/Cargo.toml | 2 +- pallets/support/Cargo.toml | 2 +- pallets/tokens/Cargo.toml | 2 +- pallets/tokens/src/weights.rs | 2 +- pallets/trust/Cargo.toml | 2 +- pallets/trust/src/weights.rs | 2 +- runtime/Cargo.toml | 2 +- runtime/src/lib.rs | 4 +- 20 files changed, 105 insertions(+), 78 deletions(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index e1c3a55..25b0206 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -15,7 +15,7 @@ 9944 ], "preCreateCommand": ["cargo build", "cargo check"], - "postStartCommand": "./target/debug/zerodao-node --dev --ws-external", + "postStartCommand": "./target/debug/ourspace --dev --ws-external", "menuActions": [ {"id": "polkadotjs", "label": "Open PolkadotJS Apps", diff --git a/Cargo.lock b/Cargo.lock index 14c9775..9dfa27d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3825,6 +3825,47 @@ dependencies = [ "sp-std", ] +[[package]] +name = "ourspace" +version = "0.0.1" +dependencies = [ + "frame-benchmarking", + "frame-benchmarking-cli", + "jsonrpc-core", + "pallet-contracts", + "pallet-contracts-rpc", + "pallet-im-online", + "pallet-staking", + "pallet-transaction-payment-rpc", + "sc-basic-authorship", + "sc-cli", + "sc-client-api", + "sc-consensus", + "sc-consensus-babe", + "sc-executor", + "sc-finality-grandpa", + "sc-keystore", + "sc-rpc", + "sc-rpc-api", + "sc-service", + "sc-transaction-pool", + "sp-api", + "sp-authority-discovery", + "sp-block-builder", + "sp-blockchain", + "sp-consensus", + "sp-consensus-babe", + "sp-core", + "sp-finality-grandpa", + "sp-inherents", + "sp-runtime", + "sp-transaction-pool", + "structopt", + "substrate-build-script-utils", + "substrate-frame-rpc-system", + "zerodao", +] + [[package]] name = "owning_ref" version = "0.4.1" @@ -9091,47 +9132,6 @@ dependencies = [ "zd-trust", ] -[[package]] -name = "zerodao-node" -version = "0.0.1" -dependencies = [ - "frame-benchmarking", - "frame-benchmarking-cli", - "jsonrpc-core", - "pallet-contracts", - "pallet-contracts-rpc", - "pallet-im-online", - "pallet-staking", - "pallet-transaction-payment-rpc", - "sc-basic-authorship", - "sc-cli", - "sc-client-api", - "sc-consensus", - "sc-consensus-babe", - "sc-executor", - "sc-finality-grandpa", - "sc-keystore", - "sc-rpc", - "sc-rpc-api", - "sc-service", - "sc-transaction-pool", - "sp-api", - "sp-authority-discovery", - "sp-block-builder", - "sp-blockchain", - "sp-consensus", - "sp-consensus-babe", - "sp-core", - "sp-finality-grandpa", - "sp-inherents", - "sp-runtime", - "sp-transaction-pool", - "structopt", - "substrate-build-script-utils", - "substrate-frame-rpc-system", - "zerodao", -] - [[package]] name = "zeroize" version = "1.4.1" diff --git a/Makefile b/Makefile index de03a4b..05cdb8d 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,6 @@ .PHONY: run-dev run-dev: - ./target/release/zerodao-node --dev --ws-external + ./target/release/ourspace --dev --ws-external .PHONY: build-release build-release: @@ -8,7 +8,7 @@ build-release: .PHONY: purge-dev purge-dev: - ./target/release/zerodao-node purge-chain --dev + ./target/release/ourspace purge-chain --dev .PHONY: init init: diff --git a/README.md b/README.md index 34bbc89..88685a4 100644 --- a/README.md +++ b/README.md @@ -3,8 +3,8 @@
[![Substrate version](https://img.shields.io/badge/Substrate-3.0.0-brightgreen?logo=Parity%20Substrate)](https://substrate.dev/) -[![codecov](https://codecov.io/gh/ZeroDAO/ZeroDAO-node/branch/main/graph/badge.svg)](https://app.codecov.io/gh/ZeroDAO/ZeroDAO-node) -[![License](https://img.shields.io/github/license/ZeroDAO/ZeroDAO-node?color=green)](https://github.com/ZeroDAO/ZeroDAO-node/blob/main/LICENSE) +[![codecov](https://codecov.io/gh/ZeroDAO/ourspace/branch/main/graph/badge.svg)](https://app.codecov.io/gh/ZeroDAO/ourspace) +[![License](https://img.shields.io/github/license/ZeroDAO/ourspace?color=green)](https://github.com/ZeroDAO/ourspace/blob/main/LICENSE)
[![Twitter URL](https://img.shields.io/twitter/url?style=social&url=https%3A%2F%2Ftwitter.com%2Fzerodaonet)](https://twitter.com/zerodaonet) [![Discord](https://img.shields.io/badge/Discord-gray?logo=discord)](https://discord.gg/K56C6jtr) @@ -16,13 +16,13 @@ For technical and guides, please refer to the [ZeroDAO Docs](https://docs.zeroda # 1. Introduction -We define ZeroDAO as a public resource, including a social network, a reputation system. the ZeroDAO social network solves the incentive dilemma that currently exists in blockchain social networks, while incentivizing good behavior makes good behavior disappear. Imagine what Twitter would look like if you could get $1 for posting a tweet. Two-factor theory even concludes that security, salary, fringe benefits, good pay is not Motivators but Hygiene factors. Hygiene factors that do not give positive satisfaction or lead to higher motivation. +We define Ourspace as a public resource, including a social network, a reputation system. the Ourspace social network solves the incentive dilemma that currently exists in blockchain social networks, while incentivizing good behavior makes good behavior disappear. Imagine what Twitter would look like if you could get $1 for posting a tweet. Two-factor theory even concludes that security, salary, fringe benefits, good pay is not Motivators but Hygiene factors. Hygiene factors that do not give positive satisfaction or lead to higher motivation. -ZeroDAO social network solves the incentive dilemma by amplifying social motivation and internalizing external motivation. +Ourspace social network solves the incentive dilemma by amplifying social motivation and internalizing external motivation. -In the ZeroDAO network, we still quantify user contributions and settle them into Tokens, which we call social currency. It is frozen and at some point assigned to users trusted by the owner, it is also social currency and goes on to be shared. The user's social motivation is amplified. We use to shared information, now we share value. +In the Ourspace network, we still quantify user contributions and settle them into Tokens, which we call social currency. It is frozen and at some point assigned to users trusted by the owner, it is also social currency and goes on to be shared. The user's social motivation is amplified. We use to shared information, now we share value. -ZeroDAO social network brought us the reputation system and we proposed the TIR algorithm to compute the graph and obtain the reputation of each user. TIR is difficult to compute but easy to verify on-chain. This feature makes ZeroDAO's reputation system completely decentralized. At the same time, it has strong ability to prevent Sybil Attack to meet the security needs of financial products and on-chain governance. ZeroDAO also brings credit finance, zero-cost payments, and other applications to the blockchain. +Ourspace social network brought us the reputation system and we proposed the TIR algorithm to compute the graph and obtain the reputation of each user. TIR is difficult to compute but easy to verify on-chain. This feature makes Ourspace's reputation system completely decentralized. At the same time, it has strong ability to prevent Sybil Attack to meet the security needs of financial products and on-chain governance. Ourspace also brings credit finance, zero-cost payments, and other applications to the blockchain. ![Web3 Grants](https://github.com/ZeroDAO/www.ourspace.network/blob/main/src/assets/images/w3f.svg) @@ -53,7 +53,7 @@ sudo apt install cmake pkg-config libssl-dev git clang libclang-dev ### More -ZeroDAO is based on Substrate, for more information please go to [Substrate](https://docs.substrate.io/v3/getting-started/overview/). +Ourspace is based on Substrate, for more information please go to [Substrate](https://docs.substrate.io/v3/getting-started/overview/). ## Installation @@ -67,12 +67,39 @@ make init make build-release ``` -# 3. Run +# 3. Dev Network + +## 1. Run as dev ```bash make run-dev ``` +## 2. Run as local + +Start the local blockchain node using the `alice` account by running the following command: + +```bash +./target/release/ourspace \ + --base-path /tmp/alice \ + --chain local \ + --alice \ + --node-key 0000000000000000000000000000000000000000000000000000000000000001 + --validator +``` + +Start a second local blockchain node using the `bob` account by running the following command: + +```bash +./target/release/ourspace \ + --base-path /tmp/bob \ + --chain local \ + --bob \ + --port 30334 \ + --bootnodes /ip4/127.0.0.1/tcp/30333/p2p/12D3KooWEyoppNCUx8Yx66oV9fJnriXwCcXwDDUA2kj6vnc6iDEp + --validator +``` + # 4. Development ## Test All @@ -98,11 +125,11 @@ make purge-dev You can also ```bash -# Run ZeroDAO node without re-compiling -./scripts/docker_run.sh ./target/release/zerodao-node --dev --ws-external +# Run Ourspace node without re-compiling +./scripts/docker_run.sh ./target/release/ourspace --dev --ws-external # Purge the local dev chain -./scripts/docker_run.sh ./target/release/zerodao-node purge-chain --dev +./scripts/docker_run.sh ./target/release/ourspace purge-chain --dev ``` # References diff --git a/docker-compose.yml b/docker-compose.yml index ebe1c05..6134e0f 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -2,16 +2,16 @@ version: "3.2" services: dev: - container_name: zerodao-node + container_name: ourspace image: paritytech/ci-linux:105b919b-20210617 - working_dir: /var/www/zerodao-node + working_dir: /var/www/ourspace ports: - "9944:9944" environment: - - CARGO_HOME=/var/www/zerodao-node/.cargo + - CARGO_HOME=/var/www/ourspace/.cargo volumes: - - .:/var/www/zerodao-node + - .:/var/www/ourspace - type: bind source: ./.local target: /root/.local - command: bash -c "cargo build --release && ./target/release/zerodao-node --dev --ws-external" + command: bash -c "cargo build --release && ./target/release/ourspace --dev --ws-external" diff --git a/node/Cargo.toml b/node/Cargo.toml index e8b4fd5..52efa9d 100644 --- a/node/Cargo.toml +++ b/node/Cargo.toml @@ -5,12 +5,12 @@ description = 'Decentralized social networks and reputation systems.' edition = '2018' homepage = 'https://0p0.org' license = 'Unlicense' -name = 'zerodao-node' -repository = 'https://github.com/ZeroDAO/ZeroDAO-node' +name = 'ourspace' +repository = 'https://github.com/ZeroDAO/ourspace' version = '0.0.1' [[bin]] -name = 'zerodao-node' +name = 'ourspace' [package.metadata.docs.rs] targets = ['x86_64-unknown-linux-gnu'] diff --git a/pallets/challenges/Cargo.toml b/pallets/challenges/Cargo.toml index f0b9e68..082a777 100644 --- a/pallets/challenges/Cargo.toml +++ b/pallets/challenges/Cargo.toml @@ -2,7 +2,7 @@ authors = ["ZeroDAO "] description = 'The challenge logic of the TIR algorithm.' name = 'zd-challenges' -repository = "https://github.com/ZeroDAO/ZeroDAO-node" +repository = "https://github.com/ZeroDAO/ourspace" license = "Apache-2.0" version = "0.0.1" homepage = 'https://zerodao.net' diff --git a/pallets/refresh-reputation/Cargo.toml b/pallets/refresh-reputation/Cargo.toml index 8fd206a..2c10a14 100644 --- a/pallets/refresh-reputation/Cargo.toml +++ b/pallets/refresh-reputation/Cargo.toml @@ -2,7 +2,7 @@ authors = ["ZeroDAO "] description = 'The Refresh Reputation logic of the TIR algorithm.' name = 'zd-refresh-reputation' -repository = "https://github.com/ZeroDAO/ZeroDAO-node" +repository = "https://github.com/ZeroDAO/ourspace" license = "Apache-2.0" version = "0.0.1" homepage = 'https://zerodao.net' diff --git a/pallets/refresh-reputation/src/weights.rs b/pallets/refresh-reputation/src/weights.rs index 62b440b..7ca2184 100644 --- a/pallets/refresh-reputation/src/weights.rs +++ b/pallets/refresh-reputation/src/weights.rs @@ -4,7 +4,7 @@ //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 128 // Executed Command: -// ./target/release/zerodao-node +// ./target/release/ourspace // benchmark // --chain=dev // --execution=wasm diff --git a/pallets/refresh-seeds/Cargo.toml b/pallets/refresh-seeds/Cargo.toml index 120cd79..f92c2bb 100644 --- a/pallets/refresh-seeds/Cargo.toml +++ b/pallets/refresh-seeds/Cargo.toml @@ -2,7 +2,7 @@ authors = ["ZeroDAO "] description = 'The Refresh Seeds logic of the TIR algorithm.' name = 'zd-refresh-seeds' -repository = "https://github.com/ZeroDAO/ZeroDAO-node" +repository = "https://github.com/ZeroDAO/ourspace" license = "Apache-2.0" version = "0.0.1" homepage = 'https://zerodao.net' diff --git a/pallets/refresh-seeds/src/weights.rs b/pallets/refresh-seeds/src/weights.rs index 9d43989..0782897 100644 --- a/pallets/refresh-seeds/src/weights.rs +++ b/pallets/refresh-seeds/src/weights.rs @@ -4,7 +4,7 @@ //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 128 // Executed Command: -// ./target/release/zerodao-node +// ./target/release/ourspace // benchmark // --chain=dev // --execution=wasm diff --git a/pallets/reputation/Cargo.toml b/pallets/reputation/Cargo.toml index 059067a..5522b81 100755 --- a/pallets/reputation/Cargo.toml +++ b/pallets/reputation/Cargo.toml @@ -2,7 +2,7 @@ authors = ["ZeroDAO "] description = 'The core of the Reputation System.' name = 'zd-reputation' -repository = "https://github.com/ZeroDAO/ZeroDAO-node" +repository = "https://github.com/ZeroDAO/ourspace" license = "Apache-2.0" version = "0.0.1" homepage = 'https://zerodao.net' diff --git a/pallets/seeds/Cargo.toml b/pallets/seeds/Cargo.toml index 0e26d32..04d2e88 100644 --- a/pallets/seeds/Cargo.toml +++ b/pallets/seeds/Cargo.toml @@ -2,7 +2,7 @@ authors = ["ZeroDAO "] description = 'The seeds logic of the TIR algorithm.' name = 'zd-seeds' -repository = "https://github.com/ZeroDAO/ZeroDAO-node" +repository = "https://github.com/ZeroDAO/ourspace" license = "Apache-2.0" version = "0.0.1" homepage = 'https://zerodao.net' diff --git a/pallets/support/Cargo.toml b/pallets/support/Cargo.toml index 91982da..18421dc 100644 --- a/pallets/support/Cargo.toml +++ b/pallets/support/Cargo.toml @@ -2,7 +2,7 @@ name = "zd-support" description = "Shared traits including `Renew`, `Reputation`, `Seed` and `Trust`." authors = ["ZeroDAO "] -repository = "https://github.com/ZeroDAO/ZeroDAO-node" +repository = "https://github.com/ZeroDAO/ourspace" license = "Apache-2.0" version = "0.0.1" homepage = 'https://zerodao.net' diff --git a/pallets/tokens/Cargo.toml b/pallets/tokens/Cargo.toml index 67618c8..56f979c 100644 --- a/pallets/tokens/Cargo.toml +++ b/pallets/tokens/Cargo.toml @@ -2,7 +2,7 @@ name = "zd-tokens" description = "Support social finance" authors = ["ZeroDAO "] -repository = "https://github.com/ZeroDAO/ZeroDAO-node" +repository = "https://github.com/ZeroDAO/ourspace" license = "Apache-2.0" version = "0.0.1" homepage = 'https://zerodao.net' diff --git a/pallets/tokens/src/weights.rs b/pallets/tokens/src/weights.rs index 16e0369..2c3a87d 100644 --- a/pallets/tokens/src/weights.rs +++ b/pallets/tokens/src/weights.rs @@ -4,7 +4,7 @@ //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 128 // Executed Command: -// ./target/release/zerodao-node +// ./target/release/ourspace // benchmark // --chain=dev // --execution=wasm diff --git a/pallets/trust/Cargo.toml b/pallets/trust/Cargo.toml index b7edfd4..aed4f33 100644 --- a/pallets/trust/Cargo.toml +++ b/pallets/trust/Cargo.toml @@ -2,7 +2,7 @@ authors = ["ZeroDAO "] description = 'ZeroDAO trust pallet.' name = 'zd-trust' -repository = "https://github.com/ZeroDAO/ZeroDAO-node" +repository = "https://github.com/ZeroDAO/ourspace" license = "Apache-2.0" version = "0.0.1" homepage = 'https://zerodao.net' diff --git a/pallets/trust/src/weights.rs b/pallets/trust/src/weights.rs index 278b5fc..51bd6f1 100644 --- a/pallets/trust/src/weights.rs +++ b/pallets/trust/src/weights.rs @@ -4,7 +4,7 @@ //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 128 // Executed Command: -// ./target/release/zerodao-node +// ./target/release/ourspace // benchmark // --chain=dev // --execution=wasm diff --git a/runtime/Cargo.toml b/runtime/Cargo.toml index c40aa4b..5ba8512 100644 --- a/runtime/Cargo.toml +++ b/runtime/Cargo.toml @@ -4,7 +4,7 @@ edition = '2018' homepage = 'https://0p0.org' license = 'Unlicense' name = 'zerodao' -repository = 'https://github.com/ZeroDAO/ZeroDAO-node' +repository = 'https://github.com/ZeroDAO/ourspace' version = '0.0.1' [package.metadata.docs.rs] diff --git a/runtime/src/lib.rs b/runtime/src/lib.rs index b5c6ef5..7ce131d 100644 --- a/runtime/src/lib.rs +++ b/runtime/src/lib.rs @@ -121,8 +121,8 @@ pub mod opaque { } pub const VERSION: RuntimeVersion = RuntimeVersion { - spec_name: create_runtime_str!("ZeroDAO-node"), - impl_name: create_runtime_str!("ZeroDAO-node"), + spec_name: create_runtime_str!("ourspace"), + impl_name: create_runtime_str!("ourspace"), authoring_version: 1, spec_version: 100, impl_version: 1,