From b8d3fbc3609cb97b08196620a55ebffd42b6a665 Mon Sep 17 00:00:00 2001 From: librelois <c@elo.tf> Date: Tue, 11 Jan 2022 03:01:10 +0100 Subject: [PATCH] Replace lc-core by duniter --- .devcontainer/devcontainer.json | 19 ++-- .vscode/launch.json | 16 +-- Cargo.lock | 138 ++++++++++++------------- README.md | 34 +++--- docker-compose.yml | 4 +- docs/setup.md | 2 +- integration-tests/Cargo.toml | 6 +- integration-tests/src/common.rs | 2 +- node/Cargo.toml | 8 +- node/src/command.rs | 2 +- node/src/main.rs | 2 +- pallets/certification/Cargo.toml | 2 +- pallets/identity/Cargo.toml | 2 +- pallets/ud-accounts-storage/Cargo.toml | 2 +- pallets/universal-dividend/Cargo.toml | 2 +- runtime/g1/Cargo.toml | 2 +- runtime/gdev/Cargo.toml | 2 +- runtime/gtest/Cargo.toml | 2 +- scripts/docker_run.sh | 2 +- 19 files changed, 124 insertions(+), 125 deletions(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index dc99da2e6..42852f9aa 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -1,5 +1,5 @@ { - "name": "Substrate Node template", + "name": "Duniter node", "context": "..", "settings": { "terminal.integrated.shell.linux": "/bin/bash", @@ -10,16 +10,15 @@ "bungcip.better-toml", "vadimcn.vscode-lldb" ], - "forwardPorts": [ - 3000, - 9944 - ], + "forwardPorts": [3000, 9944], "preCreateCommand": ["cargo build", "cargo check"], - "postStartCommand": "./target/debug/lc-core --dev --ws-external", + "postStartCommand": "./target/debug/duniter --dev --ws-external", "menuActions": [ - {"id": "polkadotjs", - "label": "Open PolkadotJS Apps", - "type": "external-preview", - "args": ["https://polkadot.js.org/apps/?rpc=wss%3A%2F%2F/$HOST/wss"]} + { + "id": "polkadotjs", + "label": "Open PolkadotJS Apps", + "type": "external-preview", + "args": ["https://polkadot.js.org/apps/?rpc=wss%3A%2F%2F/$HOST/wss"] + } ] } diff --git a/.vscode/launch.json b/.vscode/launch.json index fb38ff4d4..23b696a3d 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -7,11 +7,11 @@ { "type": "lldb", "request": "launch", - "name": "Debug unit tests in library 'lc-core'", + "name": "Debug unit tests in library 'duniter'", "cargo": { - "args": ["test", "--no-run", "--lib", "--package=lc-core"], + "args": ["test", "--no-run", "--lib", "--package=duniter"], "filter": { - "name": "lc-core", + "name": "duniter", "kind": "lib" } }, @@ -21,11 +21,11 @@ { "type": "lldb", "request": "launch", - "name": "Debug executable 'lc-core'", + "name": "Debug executable 'duniter'", "cargo": { "args": ["build"], "filter": { - "name": "lc-core", + "name": "duniter", "kind": "bin" } }, @@ -35,11 +35,11 @@ { "type": "lldb", "request": "launch", - "name": "Debug unit tests in executable 'lc-core'", + "name": "Debug unit tests in executable 'duniter'", "cargo": { - "args": ["test", "--no-run", "--bin=lc-core", "--package=lc-core"], + "args": ["test", "--no-run", "--bin=duniter", "--package=duniter"], "filter": { - "name": "lc-core", + "name": "duniter", "kind": "bin" } }, diff --git a/Cargo.lock b/Cargo.lock index 898ea3f7b..f1f7a8910 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1283,6 +1283,75 @@ version = "0.4.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "56899898ce76aaf4a0f24d914c97ea6ed976d42fec6ad33fcbb0a1103e07b2b0" +[[package]] +name = "duniter" +version = "3.0.0" +dependencies = [ + "async-io", + "common-runtime", + "frame-benchmarking", + "frame-benchmarking-cli", + "futures 0.3.16", + "g1-runtime", + "gdev-runtime", + "gtest-runtime", + "jsonrpc-core", + "log", + "maplit", + "pallet-grandpa", + "pallet-transaction-payment-rpc", + "pallet-transaction-payment-rpc-runtime-api", + "sc-basic-authorship", + "sc-chain-spec", + "sc-cli", + "sc-client-api", + "sc-consensus", + "sc-consensus-aura", + "sc-consensus-manual-seal", + "sc-executor", + "sc-finality-grandpa", + "sc-keystore", + "sc-rpc", + "sc-rpc-api", + "sc-service", + "sc-telemetry", + "sc-transaction-pool", + "sc-transaction-pool-api", + "serde_json", + "sp-api", + "sp-block-builder", + "sp-blockchain", + "sp-consensus", + "sp-consensus-aura", + "sp-core", + "sp-finality-grandpa", + "sp-inherents", + "sp-keyring", + "sp-offchain", + "sp-runtime", + "sp-session", + "sp-storage", + "sp-timestamp", + "sp-transaction-pool", + "sp-trie", + "structopt", + "substrate-build-script-utils", + "substrate-frame-rpc-system", +] + +[[package]] +name = "duniter-integration-tests" +version = "3.0.0" +dependencies = [ + "env_logger 0.9.0", + "parity-scale-codec", + "portpicker", + "serde_json", + "sp-keyring", + "subxt", + "tokio", +] + [[package]] name = "dyn-clonable" version = "0.9.0" @@ -2910,75 +2979,6 @@ version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" -[[package]] -name = "lc-core" -version = "3.0.0" -dependencies = [ - "async-io", - "common-runtime", - "frame-benchmarking", - "frame-benchmarking-cli", - "futures 0.3.16", - "g1-runtime", - "gdev-runtime", - "gtest-runtime", - "jsonrpc-core", - "log", - "maplit", - "pallet-grandpa", - "pallet-transaction-payment-rpc", - "pallet-transaction-payment-rpc-runtime-api", - "sc-basic-authorship", - "sc-chain-spec", - "sc-cli", - "sc-client-api", - "sc-consensus", - "sc-consensus-aura", - "sc-consensus-manual-seal", - "sc-executor", - "sc-finality-grandpa", - "sc-keystore", - "sc-rpc", - "sc-rpc-api", - "sc-service", - "sc-telemetry", - "sc-transaction-pool", - "sc-transaction-pool-api", - "serde_json", - "sp-api", - "sp-block-builder", - "sp-blockchain", - "sp-consensus", - "sp-consensus-aura", - "sp-core", - "sp-finality-grandpa", - "sp-inherents", - "sp-keyring", - "sp-offchain", - "sp-runtime", - "sp-session", - "sp-storage", - "sp-timestamp", - "sp-transaction-pool", - "sp-trie", - "structopt", - "substrate-build-script-utils", - "substrate-frame-rpc-system", -] - -[[package]] -name = "lc-core-integration-tests" -version = "3.0.0" -dependencies = [ - "env_logger 0.9.0", - "parity-scale-codec", - "portpicker", - "serde_json", - "sp-keyring", - "subxt", - "tokio", -] - [[package]] name = "libc" version = "0.2.112" diff --git a/README.md b/README.md index 30921ee3b..c05a494a8 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ -# Libre currency based on Substrate framework +# Duniter v2s -A FRAME-based [Substrate](https://www.substrate.io/) libre currency implementation. +A rewriting of duniter based on [Substrate](https://www.substrate.io/) framework. ## Setup @@ -13,7 +13,7 @@ NOTE: You must first follow the instructions in the [Setup] section (#setup). Use the following command to build the node without launching it: ```sh -cargo build --release +cargo build ``` ## Run @@ -21,7 +21,7 @@ cargo build --release Use Rust's native `cargo` command to build and launch the node: ```sh -cargo run --release -- --dev --tmp +cargo run -- --dev --tmp ``` ## Contribute @@ -34,7 +34,7 @@ Once the project has been built, the following command can be used to explore al subcommands: ```sh -./target/release/lc-core -h +./target/release/duniter -h ``` ## Single-Node Development Chain @@ -42,19 +42,19 @@ subcommands: This command will start the single-node development chain with persistent state: ```bash -./target/release/lc-core --dev +./target/debug/duniter --dev ``` Purge the development chain's state: ```bash -./target/release/lc-core purge-chain --dev +./target/debug/duniter purge-chain --dev ``` Start the development chain with detailed logging: ```bash -RUST_LOG=debug RUST_BACKTRACE=1 ./target/release/lc-core -lruntime=debug --dev +RUST_LOG=debug RUST_BACKTRACE=1 ./target/debug/duniter -lruntime=debug --dev ``` ## Connect with Polkadot-JS Apps Front-end @@ -74,15 +74,15 @@ If you want to see the multi-node consensus algorithm in action, refer to ### Purge previous lacal testnet ``` -./target/release/lc-core purge-chain --base-path /tmp/alice --chain local -./target/release/lc-core purge-chain --base-path /tmp/bob --chain local +./target/debug/duniter purge-chain --base-path /tmp/alice --chain local +./target/debug/duniter purge-chain --base-path /tmp/bob --chain local ``` ### Start Alice's node ```bash -./target/release/lc-core \ +./target/debug/duniter \ --base-path /tmp/alice \ --chain local \ --alice \ @@ -96,7 +96,7 @@ If you want to see the multi-node consensus algorithm in action, refer to ### Start Bob's node ```bash -./target/release/lc-core \ +./target/debug/duniter \ --base-path /tmp/bob \ --chain local \ --bob \ @@ -150,7 +150,7 @@ After the node has been [built](#build), refer to the embedded documentation to capabilities and configuration parameters that it exposes: ```shell -./target/release/lc-core --help +./target/debug/duniter --help ``` ### Runtime @@ -210,15 +210,15 @@ Then run the following command to start a single node development chain. ``` This command will firstly compile your code, and then start a local development network. You can -also replace the default command (`cargo build --release && ./target/release/lc-core --dev --ws-external`) +also replace the default command (`cargo build && ./target/debug/duniter --dev --ws-external`) by appending your own. A few useful ones are as follow. ```bash -# Run Substrate node without re-compiling -./scripts/docker_run.sh ./target/release/lc-core --dev --ws-external +# Run duniter node without re-compiling +./scripts/docker_run.sh ./target/debug/duniter --dev --ws-external # Purge the local dev chain -./scripts/docker_run.sh ./target/release/lc-core purge-chain --dev +./scripts/docker_run.sh ./target/debug/duniter purge-chain --dev # Check whether the code is compilable ./scripts/docker_run.sh cargo check diff --git a/docker-compose.yml b/docker-compose.yml index cfc4437bb..5e6ad3cb8 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -2,7 +2,7 @@ version: "3.2" services: dev: - container_name: node-template + container_name: duniter-v2s image: paritytech/ci-linux:974ba3ac-20201006 working_dir: /var/www/node-template ports: @@ -14,4 +14,4 @@ services: - type: bind source: ./.local target: /root/.local - command: bash -c "cargo build --release && ./target/release/node-template --dev --ws-external" + command: bash -c "cargo build && ./target/debug/node-template --dev --ws-external" diff --git a/docs/setup.md b/docs/setup.md index 3a61968a8..d7a6f3be2 100644 --- a/docs/setup.md +++ b/docs/setup.md @@ -3,7 +3,7 @@ title: Installation --- This page will guide you through the steps needed to prepare a computer for development with the -Substrate Node. Since Substrate is built with +Duniter Substrate Node. Since Substrate is built with [the Rust programming language](https://www.rust-lang.org/), the first thing you will need to do is prepare the computer for Rust development - these steps will vary based on the computer's operating system. Once Rust is configured, you will use its toolchains to interact with Rust projects; the diff --git a/integration-tests/Cargo.toml b/integration-tests/Cargo.toml index 70f506b27..525914c4a 100644 --- a/integration-tests/Cargo.toml +++ b/integration-tests/Cargo.toml @@ -1,11 +1,11 @@ [package] authors = ['Axiom-Team Developers <https://axiom-team.fr>'] -description = 'lc-core integration tests.' +description = 'duniter integration tests.' edition = '2018' homepage = 'https://substrate.dev' license = 'AGPL-3.0' -name = 'lc-core-integration-tests' -repository = 'https://git.duniter.org/nodes/rust/lc-core-substrate' +name = 'duniter-integration-tests' +repository = 'https://git.duniter.org/nodes/rust/duniter-substrate' version = '3.0.0' [dev-dependencies] diff --git a/integration-tests/src/common.rs b/integration-tests/src/common.rs index 8bd321c85..efa8e7ce1 100644 --- a/integration-tests/src/common.rs +++ b/integration-tests/src/common.rs @@ -37,7 +37,7 @@ pub async fn spawn_node() -> (Api, Client, Process) { let rpc_port = portpicker::pick_unused_port().expect("No ports free"); let ws_port = portpicker::pick_unused_port().expect("No ports free"); let process = Process( - Command::new("../target/debug/lc-core") + Command::new("../target/debug/duniter") .args([ "--execution=Native", "--no-telemetry", diff --git a/node/Cargo.toml b/node/Cargo.toml index f86eb00c9..199ad31b1 100644 --- a/node/Cargo.toml +++ b/node/Cargo.toml @@ -1,19 +1,19 @@ [package] authors = ['Axiom-Team Developers <https://axiom-team.fr>'] build = 'build.rs' -description = 'A fresh FRAME-based Substrate node, ready for hacking.' +description = 'Crypto-currency software (based on Substrate framework) to operate Äž1 libre currency' edition = '2018' homepage = 'https://substrate.dev' license = 'AGPL-3.0' -name = 'lc-core' -repository = 'https://git.duniter.org/nodes/rust/lc-core-substrate' +name = 'duniter' +repository = 'https://git.duniter.org/nodes/rust/duniter-substrate' version = '3.0.0' [package.metadata.docs.rs] targets = ['x86_64-unknown-linux-gnu'] [[bin]] -name = 'lc-core' +name = 'duniter' [features] runtime-benchmarks = ['gdev-runtime/runtime-benchmarks'] diff --git a/node/src/command.rs b/node/src/command.rs index f506250c4..294886555 100644 --- a/node/src/command.rs +++ b/node/src/command.rs @@ -23,7 +23,7 @@ use sc_cli::{ChainSpec, RuntimeVersion, SubstrateCli}; impl SubstrateCli for Cli { fn impl_name() -> String { - "Substrate Node".into() + "Duniter".into() } fn impl_version() -> String { diff --git a/node/src/main.rs b/node/src/main.rs index 83da51fd4..5cbb934c9 100644 --- a/node/src/main.rs +++ b/node/src/main.rs @@ -14,7 +14,7 @@ // You should have received a copy of the GNU Affero General Public License // along with Substrate-Libre-Currency. If not, see <https://www.gnu.org/licenses/>. -//! lc-core CLI library. +//! duniter CLI library. #![warn(missing_docs)] mod chain_spec; diff --git a/pallets/certification/Cargo.toml b/pallets/certification/Cargo.toml index 51b128621..59964b9ba 100644 --- a/pallets/certification/Cargo.toml +++ b/pallets/certification/Cargo.toml @@ -6,7 +6,7 @@ homepage = 'https://substrate.dev' license = 'AGPL-3.0' name = 'pallet-certification' readme = 'README.md' -repository = 'https://git.duniter.org/nodes/rust/lc-core-substrate' +repository = 'https://git.duniter.org/nodes/rust/duniter-substrate' version = '3.0.0' [features] diff --git a/pallets/identity/Cargo.toml b/pallets/identity/Cargo.toml index df5c683e9..84202ac65 100644 --- a/pallets/identity/Cargo.toml +++ b/pallets/identity/Cargo.toml @@ -6,7 +6,7 @@ homepage = 'https://substrate.dev' license = 'AGPL-3.0' name = 'pallet-identity' readme = 'README.md' -repository = 'https://git.duniter.org/nodes/rust/lc-core-substrate' +repository = 'https://git.duniter.org/nodes/rust/duniter-substrate' version = '3.0.0' [features] diff --git a/pallets/ud-accounts-storage/Cargo.toml b/pallets/ud-accounts-storage/Cargo.toml index 16eabf58b..2d337b8b4 100644 --- a/pallets/ud-accounts-storage/Cargo.toml +++ b/pallets/ud-accounts-storage/Cargo.toml @@ -6,7 +6,7 @@ homepage = 'https://substrate.dev' license = 'AGPL-3.0' name = 'pallet-ud-accounts-storage' readme = 'README.md' -repository = 'https://git.duniter.org/nodes/rust/lc-core-substrate' +repository = 'https://git.duniter.org/nodes/rust/duniter-substrate' version = '3.0.0' [features] diff --git a/pallets/universal-dividend/Cargo.toml b/pallets/universal-dividend/Cargo.toml index d30d51095..59e4e399a 100644 --- a/pallets/universal-dividend/Cargo.toml +++ b/pallets/universal-dividend/Cargo.toml @@ -5,7 +5,7 @@ edition = '2018' homepage = 'https://substrate.dev' license = 'AGPL-3.0' name = 'pallet-universal-dividend' -repository = 'https://git.duniter.org/nodes/rust/lc-core-substrate' +repository = 'https://git.duniter.org/nodes/rust/duniter-substrate' version = '3.0.0' [features] diff --git a/runtime/g1/Cargo.toml b/runtime/g1/Cargo.toml index e16e91137..9cfd06582 100644 --- a/runtime/g1/Cargo.toml +++ b/runtime/g1/Cargo.toml @@ -8,7 +8,7 @@ edition = '2018' homepage = 'https://substrate.dev' license = 'AGPL-3.0' name = 'g1-runtime' -repository = 'https://git.duniter.org/nodes/rust/lc-core-substrate' +repository = 'https://git.duniter.org/nodes/rust/duniter-substrate' version = '3.0.0' [package.metadata.docs.rs] targets = ['x86_64-unknown-linux-gnu'] diff --git a/runtime/gdev/Cargo.toml b/runtime/gdev/Cargo.toml index 29fb2f9aa..ac7ad5828 100644 --- a/runtime/gdev/Cargo.toml +++ b/runtime/gdev/Cargo.toml @@ -8,7 +8,7 @@ edition = '2018' homepage = 'https://substrate.dev' license = 'AGPL-3.0' name = 'gdev-runtime' -repository = 'https://git.duniter.org/nodes/rust/lc-core-substrate' +repository = 'https://git.duniter.org/nodes/rust/duniter-substrate' version = '3.0.0' [package.metadata.docs.rs] targets = ['x86_64-unknown-linux-gnu'] diff --git a/runtime/gtest/Cargo.toml b/runtime/gtest/Cargo.toml index bfaa95755..53cf56620 100644 --- a/runtime/gtest/Cargo.toml +++ b/runtime/gtest/Cargo.toml @@ -8,7 +8,7 @@ edition = '2018' homepage = 'https://substrate.dev' license = 'AGPL-3.0' name = 'gtest-runtime' -repository = 'https://git.duniter.org/nodes/rust/lc-core-substrate' +repository = 'https://git.duniter.org/nodes/rust/duniter-substrate' version = '3.0.0' [package.metadata.docs.rs] targets = ['x86_64-unknown-linux-gnu'] diff --git a/scripts/docker_run.sh b/scripts/docker_run.sh index 53a907178..3a2774476 100644 --- a/scripts/docker_run.sh +++ b/scripts/docker_run.sh @@ -2,7 +2,7 @@ # This script is meant to be run on Unix/Linux based systems set -e -echo "*** Start Substrate node template ***" +echo "*** Start Duniter node ***" cd $(dirname ${BASH_SOURCE[0]})/.. -- GitLab