diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index dc99da2e6b18a1f99333f400aa407cf53ff09313..42852f9aa221e78d4f3054d6e665c99e315b333c 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 fb38ff4d492459187a40a61c84366fc2645eaffd..23b696a3d50a152fb38f1405c89a5f1183a0f3cb 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 898ea3f7bd8726589f03e571a8311dde0c0026b7..f1f7a8910cb2214d1bf4b9d17fc030e033431c5d 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 30921ee3b2ae0720c43e642cf78a169c34f8571c..c05a494a8b14eae851036fa73a91cbbdc44d8caa 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 cfc4437bbae413c925dbc64d3b1d21ec30f24b4d..5e6ad3cb8977de5a992e583ae94ad8f99dbfabd1 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 3a61968a8326c93c4c1eae1828c1f496f9070fc1..d7a6f3be26296185a5e84f5ef8153053729f31dc 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 70f506b27e190fa3f7b1cd32af8e5d3086885e0a..525914c4a9025949324a009b48c4d5a85bc20a75 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 8bd321c85f34ebd6b0ddd3311d4649faec0c7ae7..efa8e7ce12dd6422309872f6c780f80586219169 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 f86eb00c9b2423cfa6710b58496e6ceb69741a41..199ad31b104e2452bd5d3b493f528e8faf48f04e 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 f506250c49005f0654c7d942ddcc447f3e7e9b32..2948865552d72a4d165391d29814ffd83ba3681b 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 83da51fd4e853733176e6709c81281903c0e04d3..5cbb934c999ece22ec811c4807d1a88a4d705689 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 51b128621c225990646d02021344e4eafe75f5f7..59964b9ba053d1a53bf8c85fad12dfc5458782a6 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 df5c683e981b7ad359053a2e0f97c98cd1b37e03..84202ac65ad74fcfa839fe10c1f10d36f18f67dd 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 16eabf58b9bf7a0a90f507d99a132a4b1f5fe025..2d337b8b4dbad9907d441647e4ebf93f811e7a01 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 d30d51095fe467b5089f354f971cd1111e82acef..59e4e399a01e60d76ab9e94d469b374a3e57a013 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 e16e911376bc62e9fa18aab04f3e7a0169d8c6ab..9cfd0658289d264cb091af4fcea692e806054284 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 29fb2f9aa189d56602312809df704d940416932b..ac7ad582847bb8d3fb3c2ba938e879507093d888 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 bfaa9575507966af9a76494df6427d027c51bde5..53cf5662050024e7245ea303d2c4fa7b17872344 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 53a907178d7cec46b9a8a062b6f5743b05611672..3a277447662a7f2bc3a800e3ac8afd9dc2e09597 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]})/..