Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • nodes/rust/duniter-v2s
  • llaq/lc-core-substrate
  • pini-gh/duniter-v2s
  • vincentux/duniter-v2s
  • mildred/duniter-v2s
  • d0p1/duniter-v2s
  • bgallois/duniter-v2s
  • Nicolas80/duniter-v2s
8 results
Show changes
Commits on Source (72)
Showing
with 1150 additions and 443 deletions
......@@ -4,4 +4,5 @@
.vscode
docker/Dockerfile
docker-compose.yml
target
arm-build/
**/target/
This project is tracked on our hosted gitlab server at:
https://git.duniter.org/nodes/rust/duniter-v2s
The current github repository is a simple clone taken up to date at each push on the main gitlab repository.
All contributions should be performed on the main gitlab repository.
Pull requests and issues must be created on the main gitlab repository.
Please note that all issues must be opened at https://git.duniter.org/nodes/rust/duniter-v2s/issues/new?issue
If you open issue here, it will be closed.
Thank you for your understanding.
This project is tracked on our hosted gitlab server at: https://git.duniter.org/nodes/rust/duniter-v2s
The current github repository is a simple clone taken up to date at each push on the main gitlab repository.
All contributions should be performed on the main gitlab repository.
Pull requests proposed on github will be closed.
Thank you for your understanding.
# Initial disclaimer
This project is tracked on our hosted gitlab server at:
https://git.duniter.org/nodes/rust/duniter-v2s
The current github repository is a simple clone taken up to date at each push on the main gitlab repository.
All contributions should be performed on the main gitlab repository.
Pull requests and issues must be created on the main gitlab repository.
# Original README.md
name: Check Set-Up & Build
# Controls when the action will run.
on:
# Triggers the workflow on push or pull request events but only for the master branch
push:
branches: [ master ]
pull_request:
branches: [ master ]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
check:
# The type of runner that the job will run on
runs-on: ubuntu-20.04
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
- name: Set-Up
run: sudo apt install -y cmake pkg-config libssl-dev git build-essential clang libclang-dev curl
- name: Install Rustup
run: |
curl https://sh.rustup.rs -sSf | sh -s -- -y
source ~/.cargo/env
rustup default stable
rustup update nightly
rustup update stable
rustup target add wasm32-unknown-unknown --toolchain nightly
- name: Check Build
run: |
SKIP_WASM_BUILD=1 cargo check --release
- name: Check Build for Benchmarking
run: >
pushd node &&
cargo check --features=runtime-benchmarks --release
......@@ -15,7 +15,8 @@
# node modules
**/node_modules/**
# build folder
# build folders
arm-build
build
# Temporary files
......
......@@ -8,6 +8,7 @@ workflow:
rules:
- changes:
- docker/Dockerfile
- end2end-tests/**/*
- node/**/*
- pallets/**/*
- runtime/**/*
......@@ -94,7 +95,7 @@ build_debug_with_cache:
build_release:
extends: .env
rules:
- if: "$CI_COMMIT_TAG || $CI_COMMIT_BRANCH =~ /^release/"
- if: "$CI_COMMIT_TAG && $CI_COMMIT_TAG =~ /^v*/"
- when: never
stage: build
script:
......@@ -109,6 +110,8 @@ build_release:
build_release_manual:
extends: .env
rules:
- if: $CI_COMMIT_TAG
when: never
- when: manual
stage: build
allow_failure: true
......@@ -151,7 +154,7 @@ tests_debug:
tests_release:
extends: .env
rules:
- if: "$CI_COMMIT_TAG || $CI_COMMIT_BRANCH =~ /^release/"
- if: "$CI_COMMIT_TAG && $CI_COMMIT_TAG =~ /^v*/"
- when: never
stage: tests
variables:
......@@ -219,9 +222,27 @@ deploy_docker_debug_sha:
deploy_docker_release_sha:
extends: .docker-build-app-image
rules:
- if: $CI_COMMIT_TAG
when: never
- when: manual
allow_failure: true
variables:
DOCKERFILE_PATH: "docker/Dockerfile"
IMAGE_TAG: "sha-$CI_COMMIT_SHORT_SHA"
dependencies:
- build_release_manual
deploy_docker_release_tag:
extends: .docker-build-app-image
rules:
- if: "$CI_COMMIT_TAG && $CI_COMMIT_TAG =~ /^v*/"
- when: never
variables:
DOCKERFILE_PATH: "docker/Dockerfile"
IMAGE_TAG: "$CI_COMMIT_TAG"
after_script:
- docker login -u "duniterteam" -p "$DUNITERTEAM_PASSWD"
- docker tag "duniter/duniter-v2s:$IMAGE_TAG" "duniter/duniter-v2s:latest"
- docker push "duniter/duniter-v2s:latest"
dependencies:
- build_release
---
name: Ask a Question
about: Ask a question about this template.
about: Ask a question about duniter-v2s.
title: ""
labels: question
assignees: ""
......
---
name: Report a Bug
about: Report a problem with this template.
about: Report a problem with duniter-v2s.
title: ""
labels: bug
assignees: ""
......@@ -8,9 +8,7 @@ assignees: ""
**Description**
_Tell us what happened. In particular, be specific about any changes you made to this template.
Ideally, provide a link to your project's GitHub repository. Please note that we are not able to
support all conceivable changes to this template project, but the more information you are able to
_Tell us what happened. Please elaborate, the more information you are able to
provide the more equipped we will be to help._
**Steps to Reproduce**
......@@ -33,7 +31,7 @@ _Describe the environment in which you encountered this bug. Use the list below
and add additional information if you think it's relevant._
- Operating system:
- Template version/tag:
- Git commit/tag:
- Rust version (run `rustup show`):
**Logs, Errors or Screenshots**
......
---
name: Suggest a Feature
about: Suggest a new feature or an improvement to an existing feature for this template.
about: Suggest a new feature or an improvement to an existing feature for duniter-v2s.
title: ""
labels: enhancement
assignees: ""
......@@ -9,8 +9,8 @@ assignees: ""
**Motivation**
_Describe the need or frustration that motivated you to make this suggestion. Please note that the
goal of this project is to provide a general-purpose template project, so please take care when
suggesting features that may be specific to a particular use case._
goal of this project is to bring the Ğ1 blockchain itself, so please take care when
suggesting features that may not concern the Ğ1 currency._
**Suggested Solution**
......
{
"editor.formatOnSave": true,
"editor.rulers": [100],
"[typescript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"editor.rulers": [
100
],
"[json]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[javascript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[yaml]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
......@@ -19,4 +15,4 @@
"port_rpc": 19932,
"port_ws": 19933
}
}
}
\ No newline at end of file
......@@ -31,7 +31,9 @@ Please read [Developer documentation] before contribute.
2. Ensure that you respect the [commit naming conventions].
3. Ensure that all automated tests pass with the `npm test` command.
3. Ensure that all automated tests pass with the `cargo test` command.
3. Ensure that the code is well formated `cargo fmt` and comply with the good practices `cargo clippy`. If you have been working on tests, check everything with `cargo clippy --all --tests`.
4. Update the documentation with details of changes to the interface, this includes new environment
variables, exposed ports, useful file locations and container parameters.
......
This diff is collapsed.
......@@ -7,7 +7,7 @@ homepage = 'https://substrate.dev'
license = 'AGPL-3.0'
name = 'duniter'
repository = 'https://git.duniter.org/nodes/rust/duniter-v2s'
version = '3.0.0'
version = '0.1.0'
[package.metadata.docs.rs]
targets = ['x86_64-unknown-linux-gnu']
......@@ -23,12 +23,18 @@ g1 = ["g1-runtime"]
gdev = ["gdev-runtime"]
gtest = ["gtest-runtime"]
runtime-benchmarks = [
'g1-runtime',
'g1-runtime/runtime-benchmarks',
'gdev-runtime',
'gdev-runtime/runtime-benchmarks',
'gtest-runtime',
'gtest-runtime/runtime-benchmarks',
'g1-runtime',
'g1-runtime/runtime-benchmarks',
'gdev-runtime',
'gdev-runtime/runtime-benchmarks',
'gtest-runtime',
'gtest-runtime/runtime-benchmarks',
]
try-runtime = [
"g1-runtime/try-runtime",
"gdev-runtime/try-runtime",
"gtest-runtime/try-runtime",
"try-runtime-cli"
]
[build-dependencies]
......@@ -39,8 +45,14 @@ substrate-build-script-utils = { git = 'https://github.com/librelois/substrate.g
[dev-dependencies]
rusty-hook = "^0.11.2"
[dependencies]
# Dependencies for specific targets
[target.'cfg(any(target_arch="x86_64", target_arch="aarch64"))'.dependencies]
sc-cli = { git = "https://github.com/librelois/substrate.git", branch = "duniter-monthly-2022-02", features = ["wasmtime"] }
sc-service = { git = "https://github.com/librelois/substrate.git", branch = "duniter-monthly-2022-02", features = ["wasmtime"] }
sp-trie = { git = "https://github.com/librelois/substrate.git", branch = "duniter-monthly-2022-02", features = ["memory-tracker"] }
[dependencies]
# local dependencies
common-runtime = { path = 'runtime/common' }
g1-runtime = { path = 'runtime/g1', optional = true }
......@@ -52,6 +64,7 @@ sp-membership = { path = 'primitives/membership' }
# crates.io dependencies
async-io = "1.3"
clap = { version = "3.0", features = ["derive"] }
clap_complete = { version = "3" }
futures = { version = "0.3.1", features = ["compat"] }
hex = "0.4.3"
jsonrpc-core = '18.0.0'
......@@ -103,26 +116,27 @@ sp-timestamp = { git = "https://github.com/librelois/substrate.git", branch = "d
sp-transaction-pool = { git = "https://github.com/librelois/substrate.git", branch = "duniter-monthly-2022-02" }
sp-trie = { git = "https://github.com/librelois/substrate.git", branch = "duniter-monthly-2022-02" }
substrate-frame-rpc-system = { git = "https://github.com/librelois/substrate.git", branch = "duniter-monthly-2022-02" }
try-runtime-cli = { git = "https://github.com/librelois/substrate.git", branch = "duniter-monthly-2022-02", optional = true }
[workspace]
resolver = "2"
members = [
'end2end-tests',
'end2end-tests',
'pallets/certification',
'pallets/duniter-test-parameters',
'pallets/duniter-test-parameters/macro',
'pallets/duniter-wot',
'pallets/identity',
'pallets/membership',
'pallets/authority-members',
'pallets/membership',
'pallets/authority-members',
'pallets/ud-accounts-storage',
'pallets/universal-dividend',
'pallets/upgrade-origin',
'pallets/upgrade-origin',
'primitives/membership',
'runtime/common',
'runtime/gdev',
'xtask',
'xtask',
]
# The list of dependencies below (which can be both direct and indirect dependencies) are crates
......
# Duniter v2s
A rewriting of duniter based on [Substrate](https://www.substrate.io/) framework.
A rewriting of [Duniter](https://duniter.org) based on [Substrate](https://www.substrate.io/) framework.
## Usage
duniter-v2s is under active development, only a test network called "ĞDev" is deployed.
### Docker
## Use
The easiest way to use duniter-v2s is to use the docker image.
### Join ĞDev network
#### Releases images
The easiest way is to use the docker image.
For the moment, duniter-v2s does not have a first release yet.
Minimal command to deploy a **temporary** mirror peer:
#### Test images
```docker
docker run -it -p9944:9944 -e DUNITER_CHAIN_NAME=gdev duniter/duniter-v2s:v0.1.0 --tmp --execution=Wasm
```
To go further, read [How to deploy a permanent mirror node on ĞDev network](./docs/user/rpc.md).
### Create your local blockchain
It can be useful to deploy your local blockchain, for instance to have a controled environement
to develop/test an application that interact with the blockchain.
```docker
docker run -it -p9944:9944 duniter/duniter-v2s:v0.1.0 --tmp
```
Or use the `docker-compose.yml` at the root of this repository.
#### Control when your local blockchain should produce blocks
By default, your local blockchain produce a new block every 6 seconds, which is not practical in some cases.
You can decide when to produce blocks with the cli option `--sealing`, , there are 2 possible modes:
* `--sealing=instant`: produce a block immediately upon receiving a transaction into the transaction pool
* `--sealing=manual`: produce a block upon receiving an RPC request (method `engine_createBlock`).
### Autocompletion
See [autocompletion](./docs/user/autocompletion.md).
## Test
### Test a specific commit
At each commit on master, an image with the tag `debug-sha-********` is published, where `********`
corresponds to the first 8 hash characters of the commit.
......@@ -25,20 +57,25 @@ docker run -it -p9944:9944 --name duniter-v2s duniter/duniter-v2s:debug-sha-b836
Then open `https://polkadot.js.org/apps/?rpc=ws%3A%2F%2F127.0.0.1%3A9944` in a browser.
### Docker compose
Enable detailed logging:
This repository contains a docker-compose file at the root of the repository, it is configured to
be able to launch a development node on the ğdev currency (single-node currency).
```docker
docker run -it -p9944:9944 --name duniter-v2s \
-e RUST_LOG=debug \
-e RUST_BACKTRACE=1 \
-lruntime=debug \
duniter/duniter-v2s:debug-sha-b836f1a6
```
Other docker-compose files are suggested in the `docker/compose-examples` folder:
## Contribute
- `gtest-local2.docker-compose.yml`: Configured to launch 2 validators on ğdem currency.
Before any contribution, please read carefully the [CONTRIBUTING](./CONTRIBUTING.md) file and our [git conventions](./docs/dev/git-conventions.md).
## Setup
### Setup your dev environment
First, complete the [basic setup instructions](./docs/dev/setup.md).
## Build
### Build
NOTE: You must first follow the instructions in the [Setup] section (#setup).
......@@ -48,7 +85,7 @@ Use the following command to build the node without launching it:
cargo build
```
## Run
### Run
Use Rust's native `cargo` command to build and launch the node:
......@@ -56,32 +93,17 @@ Use Rust's native `cargo` command to build and launch the node:
cargo run -- --dev --tmp
```
## Contribute
Before any contribution, please read carefully the [CONTRIBUTING](./CONTRIBUTING.md) file and our [git conventions](./docs/dev/git-conventions.md).
## Embedded Docs
Once the project has been built, the following command can be used to explore all parameters and
subcommands:
```sh
./target/release/duniter -h
```
This will deploy a local blockchain with test accounts (Alice, Bob, etc) in the genesis.
## Single-Node Development Chain
This command will start the single-node development chain with persistent state:
```bash
./target/debug/duniter --dev
./target/debug/duniter --dev --tmp
```
Purge the development chain's state:
```bash
./target/debug/duniter purge-chain --dev
```
Then open `https://polkadot.js.org/apps/?rpc=ws%3A%2F%2F127.0.0.1%3A9944` in a browser.
Start the development chain with detailed logging:
......@@ -89,17 +111,12 @@ Start the development chain with detailed logging:
RUST_LOG=debug RUST_BACKTRACE=1 ./target/debug/duniter -lruntime=debug --dev
```
## Connect with Polkadot-JS Apps Front-end
Once the node template is running locally, you can connect it with **Polkadot-JS Apps** front-end
to interact with your chain. [Click here](https://polkadot.js.org/apps/#/explorer?rpc=ws://localhost:9944) connecting the Apps to your local node template.
## Multi-Node Local Testnet
If you want to see the multi-node consensus algorithm in action, refer to
[our Start a Private Network tutorial](https://substrate.dev/docs/en/tutorials/start-a-private-network/).
### Purge previous lacal testnet
### Purge previous local testnet
```
./target/debug/duniter purge-chain --base-path /tmp/alice --chain local
......@@ -225,29 +242,3 @@ A FRAME pallet is compromised of a number of blockchain primitives:
- Errors: When a dispatchable fails, it returns an error.
- Config: The `Config` configuration interface is used to define the types and parameters upon
which a FRAME pallet depends.
## Run in Docker
First, install [Docker](https://docs.docker.com/get-docker/) and
[Docker Compose](https://docs.docker.com/compose/install/).
Then run the following command to start a single node development chain.
```bash
./scripts/docker_run.sh
```
This command will firstly compile your code, and then start a local development network. You can
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 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/debug/duniter purge-chain --dev
# Check whether the code is compilable
./scripts/docker_run.sh cargo check
```
......@@ -3,22 +3,22 @@ version: "3.5"
services:
duniter-v2s:
container_name: duniter-v2s
image: duniter/duniter-v2s:debug-latest
image: duniter/duniter-v2s:v0.1.0
ports:
# telemetry
- "127.0.0.1:9615:9615"
- 9615:9615
# rpc
- "127.0.0.1:9933:9933"
- 9933:9933
# rpc-ws
- "127.0.0.1:9944:9944"
- 9944:9944
# p2p
- "30333:30333"
- 30333:30333
environment:
DUNITER_INSTANCE_NAME: "my_instance"
DUNITER_INSTANCE_NAME: "duniter_local"
DUNITER_CHAIN_NAME: "dev"
#DUNITER_DISABLE_PROMETHEUS: "false"
volumes:
- data:/var/lib/duniter
- duniter-local-data:/var/lib/duniter
volumes:
data:
duniter-local-data:
version: "3.5"
services:
duniter-1:
container_name: duniter-1
image: duniter/duniter-v2s:local
ports:
# telemetry
- "127.0.0.1:9615:9615"
# rpc
- "127.0.0.1:9933:9933"
# rpc-ws
- "127.0.0.1:9944:9944"
# p2p
- "30333:30333"
environment:
DUNITER_INSTANCE_NAME: "my_instance"
DUNITER_CHAIN_NAME: "local"
#DUNITER_DISABLE_PROMETHEUS: "false"
command: ["--alice", "--node-key", "0000000000000000000000000000000000000000000000000000000000000001"]
volumes:
- data:/var/lib/lc-core
networks:
app_net:
ipv4_address: 172.16.238.10
duniter-2:
container_name: duniter-2
image: duniter/duniter-v2s:local
ports:
# telemetry
- "127.0.0.1:9616:9615"
# rpc
- "127.0.0.1:9934:9933"
# rpc-ws
- "127.0.0.1:9945:9944"
# p2p
- "30334:30333"
environment:
DUNITER_INSTANCE_NAME: "my_instance"
DUNITER_CHAIN_NAME: "local"
#DUNITER_DISABLE_PROMETHEUS: "false"
command: ["--bob", "--bootnodes", "/ip4/172.16.238.10/tcp/30333/p2p/12D3KooWEyoppNCUx8Yx66oV9fJnriXwCcXwDDUA2kj6vnc6iDEp"]
volumes:
- data2:/var/lib/lc-core
networks:
app_net:
ipv4_address: 172.16.238.11
volumes:
data:
data2:
networks:
app_net:
driver: bridge
ipam:
driver: default
config:
- subnet: 172.16.238.0/24
version: "3.4"
services:
db:
image: postgres:12
restart: always
volumes:
- /var/lib/postgresql/data
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
duniter-1:
image: duniter/duniter-v2s:debug-sha-b836f1a6
restart: unless-stopped
ports:
- "9944:9944"
indexer:
image: subsquid/hydra-indexer:5
restart: unless-stopped
environment:
- WORKERS_NUMBER=1
- DB_NAME=indexer
- DB_HOST=db
- DB_USER=postgres
- DB_PASS=postgres
- DB_PORT=5432
- REDIS_URI=redis://redis:6379/0
- FORCE_HEIGHT=true
- BLOCK_HEIGHT=0 # starting block height
- WS_PROVIDER_ENDPOINT_URI=ws://duniter-1:9944/
depends_on:
- db
- redis
command: >
sh -c "yarn db:bootstrap && yarn start:prod"
indexer-gateway:
image: subsquid/hydra-indexer-gateway:5
restart: unless-stopped
depends_on:
- redis
- db
- indexer-status-service
- indexer
ports:
- "4010:8080"
environment:
- DEV_MODE=true
- DB_NAME=indexer
- DB_HOST=db
- DB_USER=postgres
- DB_PASS=postgres
- DB_PORT=5432
- HYDRA_INDEXER_STATUS_SERVICE=http://indexer-status-service:8081/status
indexer-status-service:
image: subsquid/hydra-indexer-status-service:5
restart: unless-stopped
depends_on:
- redis
environment:
REDIS_URI: redis://redis:6379/0
PORT: 8081
redis:
image: redis:6.0-alpine
restart: always
ports:
- "6379"
version: "3.4"
services:
duniter-rpc:
image: duniter/duniter-v2s:v0.1.0
restart: unless-stopped
ports:
# telemetry
- 127.0.0.1:9615:9615
# rpc
- 127.0.0.1:9933:9933
# rpc-ws
- 127.0.0.1:9944:9944
# p2p
- 30333:30333
volumes:
- ./node.key:/etc/duniter/node.key
- duniter-rpc-data:/var/lib/duniter/
environment:
- DUNITER_CHAIN_NAME=gdev
command:
- "--execution"
- "Wasm"
- "--node-key-file"
- "/var/lib/duniter/node.key"
- "--public-addr"
# SERVER_DOMAIN should be replaced by a domain name that point on your server
#
# The PEER_ID should be replaced by the output of this command:
# docker run --rm -it --entrypoint duniter -v $PWD:/var/lib/duniter/ duniter/duniter-v2s:v0.1.0 key generate-node-key --file /var/lib/duniter/node.key
- "/dns/${SERVER_DOMAIN?SERVER_DOMAIN should be set}/tcp/30333/p2p/${PEER_ID?PEER_ID should be set}"
- "--rpc-cors"
- "all"
volumes:
duniter-rpc-data: