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
Select Git revision

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
Select Git revision
Show changes
Commits on Source (640)
Showing
with 12749 additions and 5763 deletions
[alias]
sanity-gdev = "test -Zgit=shallow-deps -p duniter-live-tests --test sanity_gdev -- --nocapture"
tu = "test -Zgit=shallow-deps --workspace --exclude duniter-end2end-tests --exclude duniter-live-tests --features constant-fees" # Unit tests with constant-fees
tf = "test -Zgit=shallow-deps --workspace --exclude duniter-end2end-tests --exclude duniter-live-tests test_fee" # Custom fee model tests
# `te` and `cucumber` are synonyms
te = "test -p duniter-end2end-tests --test cucumber_tests --features constant-fees --"
cucumber-build = "build -Zgit=shallow-deps --features constant-fees"
cucumber = "test -Zgit=shallow-deps -p duniter-end2end-tests --test cucumber_tests --"
ta = "test -Zgit=shallow-deps --workspace --exclude duniter-live-tests --features constant-fees"
tb = "test -Zgit=shallow-deps --features runtime-benchmarks -p"
rbp = "run -Zgit=shallow-deps --release --features runtime-benchmarks -- benchmark pallet --chain=dev --steps=50 --repeat=20 --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --header=./file_header.txt --output=. --pallet"
xtask = "run -Zgit=shallow-deps --package xtask --"
cucumber-node = "run -Zgit=shallow-deps -- --chain=gdev_dev --execution=Native --sealing=manual --force-authoring --rpc-cors=all --tmp --rpc-port 9944 --alice --features constant-fees"
{ {
"name": "Substrate Node template", "name": "Duniter node",
"context": "..", "context": "..",
"settings": { "settings": {
"terminal.integrated.shell.linux": "/bin/bash", "terminal.integrated.shell.linux": "/bin/bash",
...@@ -10,16 +10,15 @@ ...@@ -10,16 +10,15 @@
"bungcip.better-toml", "bungcip.better-toml",
"vadimcn.vscode-lldb" "vadimcn.vscode-lldb"
], ],
"forwardPorts": [ "forwardPorts": [3000, 9944],
3000,
9944
],
"preCreateCommand": ["cargo build", "cargo check"], "preCreateCommand": ["cargo build", "cargo check"],
"postStartCommand": "./target/debug/node-template --dev --ws-external", "postStartCommand": "./target/debug/duniter --dev --ws-external",
"menuActions": [ "menuActions": [
{"id": "polkadotjs", {
"id": "polkadotjs",
"label": "Open PolkadotJS Apps", "label": "Open PolkadotJS Apps",
"type": "external-preview", "type": "external-preview",
"args": ["https://polkadot.js.org/apps/?rpc=wss%3A%2F%2F/$HOST/wss"]} "args": ["https://polkadot.js.org/apps/?rpc=wss%3A%2F%2F/$HOST/wss"]
}
] ]
} }
.editorconfig
.envrc
.git*
.vscode
docker/Dockerfile
docker-compose.yml
arm-build/
**/target/
build/
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: Build and Push template
on:
push:
branches:
- master
jobs:
build-push-template:
if: ${{ github.repository == 'substrate-developer-hub/substrate-node-template' }}
runs-on: ubuntu-18.04
steps:
- name: Trigger playground inclusion
uses: peter-evans/repository-dispatch@v1
with:
token: ${{ secrets.REPO_ACCESS_TOKEN }}
repository: paritytech/substrate-playground
event-type: template-updated
client-payload: '{"id": "node-template"}'
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
...@@ -6,11 +6,24 @@ ...@@ -6,11 +6,24 @@
.DS_Store .DS_Store
# The cache for docker container dependency
.cargo
# The cache for chain data in container # The cache for chain data in container
.local .local
# direnv cache # direnv cache
.direnv .direnv
# node modules
**/node_modules/**
# build folders
arm-build
build
# Temporary files
tmp
# Local chain spec
*local-spec*.json
# Log files
*.log
# Runner tags:
# - podman: use 'podman' to build multiplatform images
stages:
- schedule
- labels
- quality
- build
- tests
- release
- deploy
- deploy_readme
workflow:
rules:
- changes:
- docker/Dockerfile
- end2end-tests/**/*
- node/**/*
- pallets/**/*
- runtime/**/*
- .gitlab-ci.yml
- Cargo.toml
- Cargo.lock
.is_network_branch: &is_network_branch
if: $CI_PIPELINE_SOURCE != "merge_request_event" && $CI_COMMIT_BRANCH =~ /^(network\/).+/
.is_runtime_branch: &is_runtime_branch
if: $CI_PIPELINE_SOURCE != "merge_request_event" && $CI_COMMIT_BRANCH =~ /^(runtime\/).+/
sanity_tests:
extends: .env
rules:
- if: '$CI_PIPELINE_SOURCE == "schedule" && $SCHEDULE_TOPIC=="sanity-tests"'
- when: never
stage: schedule
script:
- cargo sanity-${CURRENCY}
check_labels:
extends: .env
stage: labels
rules:
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
- when: never
script:
- ./scripts/check_labels.sh $CI_MERGE_REQUEST_LABELS $CI_MERGE_REQUEST_MILESTONE
check_metadata:
extends: .env
stage: tests
rules:
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
- when: never
script:
- ./scripts/check_metadata.sh
.env:
image: paritytech/ci-linux:production
tags:
- kepler
fmt_and_clippy:
extends: .env
rules:
- if: $CI_COMMIT_REF_NAME =~ /^wip*$/
when: manual
- if: '$CI_COMMIT_TAG || $CI_COMMIT_BRANCH == "master"'
when: never
- <<: *is_network_branch
when: never
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
when: always
- when: manual
stage: quality
script:
- cargo fmt -- --version
- cargo fmt -- --check
- cargo clippy -- -V
- cargo clippy -Zgit=shallow-deps --features runtime-benchmarks --all --tests -- -D warnings
run_benchmarks:
extends: .env
stage: tests
rules:
- if: $CI_COMMIT_REF_NAME =~ /^wip*$/
when: manual
- <<: *is_network_branch
when: never
- if: $CI_COMMIT_TAG
when: never
- if: '$CI_MERGE_REQUEST_ID || $CI_COMMIT_BRANCH == "master"'
- when: manual
script:
- cargo build -Zgit=shallow-deps --release --features runtime-benchmarks
- target/release/duniter benchmark storage --chain=dev --mul=2 --state-version=1 --weight-path=./runtime/gdev/src/weights/
- target/release/duniter benchmark overhead --chain=dev --wasm-execution=compiled --warmup=1 --repeat=100 --weight-path=./runtime/gdev/src/weights/
- target/release/duniter benchmark pallet --chain=dev --steps=5 --repeat=2 --pallet="*" --extrinsic="*" --wasm-execution=compiled --output=./runtime/gdev/src/weights/
- cargo build -Zgit=shallow-deps --release --features runtime-benchmarks # Check if autogenerated weights work
gtest_build:
stage: build
extends: .env
rules:
- <<: *is_network_branch
when: never
- if: $CI_COMMIT_REF_NAME =~ /^wip*$/
when: manual
- if: $CI_COMMIT_TAG
when: never
- if: $CI_COMMIT_BRANCH =~ /^(release\/runtime-)[0-9].*/
when: never
- if: '$CI_MERGE_REQUEST_ID || $CI_COMMIT_BRANCH == "master"'
- when: manual
variables:
DEBIAN_FRONTEND: noninteractive
script:
- cargo build -Zgit=shallow-deps --no-default-features --features gtest
build_deb:
stage: deploy
extends: .env
rules:
- if: $CI_COMMIT_REF_NAME =~ /^wip*$/
when: manual
- if: $CI_COMMIT_TAG
when: never
- <<: *is_network_branch
needs: ["build_raw_specs"]
when: always
- if: '$CI_MERGE_REQUEST_ID || $CI_COMMIT_BRANCH == "master"'
- when: manual
variables:
DEBIAN_FRONTEND: noninteractive
script:
- cargo install cargo-deb
- cargo build -Zgit=shallow-deps --release
- cargo deb --no-build -p duniter
artifacts:
paths:
- target/debian/duniter*.deb
build_rpm:
stage: deploy
extends: .env
rules:
- if: $CI_COMMIT_REF_NAME =~ /^wip*$/
when: manual
- if: $CI_COMMIT_TAG
when: never
- <<: *is_network_branch
needs: ["build_raw_specs"]
when: always
- if: '$CI_MERGE_REQUEST_ID || $CI_COMMIT_BRANCH == "master"'
- when: manual
script:
- cargo install cargo-generate-rpm
- cargo build -Zgit=shallow-deps --release
- cargo generate-rpm -p node
artifacts:
paths:
- target/generate-rpm/duniter*.rpm
tests:
stage: tests
extends: .env
rules:
- if: $CI_COMMIT_REF_NAME =~ /^wip*$/
when: manual
- if: $CI_COMMIT_TAG
when: never
- <<: *is_network_branch
when: never
- if: '$CI_MERGE_REQUEST_ID || $CI_COMMIT_BRANCH == "master"'
- when: manual
variables:
DEBIAN_FRONTEND: noninteractive
script:
- export RUST_MIN_STACK=16777216 # 16MB stack size otherwise CI fail during LLVM's Thin LTO (Link Time Optimization) phase
- cargo tu
- cargo tf
- cargo cucumber-build
- cargo cucumber
.network_branch_vars: &define_network_branch_vars
- export NETWORK=$(echo $CI_COMMIT_BRANCH | sed -e "s/network\///g")
- echo "NETWORK = $NETWORK"
- export RUNTIME=$(echo $NETWORK | grep -Po "gdev|gtest|g1")
- echo "RUNTIME = $RUNTIME"
# srtool specific
- export RUNTIME_DIR=runtime/$RUNTIME
- echo "RUNTIME_DIR = $RUNTIME_DIR"
# srtool specific
- export PACKAGE=$RUNTIME-runtime
- echo "PACKAGE = $PACKAGE"
# GitLab milestone : used for both GitLab and Docker releases. Milestone must match source code's runtime version to fetch the git changes for release notes.
- export CLIENT_VERSION=$(cat node/Cargo.toml | grep version | sed "s/version = \"//g" | sed "s/\"//")
- echo $CLIENT_VERSION
- export RUNTIME_VERSION=$(cat runtime/$RUNTIME/src/lib.rs | grep "spec_version:" | sed "s/ *spec_version. //g" | sed "s/,//g")
- echo $RUNTIME_VERSION
- export CLIENT_MILESTONE="client-$CLIENT_VERSION"
- echo $CLIENT_MILESTONE
- export NETWORK_RELEASE="$NETWORK"
- echo $NETWORK_RELEASE
- export DOCKER_TAG="$RUNTIME_VERSION-$CLIENT_VERSION"
# Tags for Docker images
- export IMAGE_NAME="duniter/duniter-v2s-$NETWORK"
- echo $IMAGE_NAME
- export MANIFEST=localhost/manifest-$IMAGE_NAME:$DOCKER_TAG
- echo $MANIFEST
# Files to be pushed in a release
- export RELEASE_FILE_G1_DATA=release/genesis.json
- echo $RELEASE_FILE_G1_DATA
- export RELEASE_FILE_SPEC_CONFIG=release/${RUNTIME}.yaml
- echo $RELEASE_FILE_SPEC_CONFIG
- export RELEASE_FILE_SPEC=release/${RUNTIME}.json
- echo $RELEASE_FILE_SPEC
- export RELEASE_FILE_WASM=release/${RUNTIME}_runtime.compact.compressed.wasm
- echo $RELEASE_FILE_WASM
- export RELEASE_FILE_RAW_SPEC=release/${RUNTIME}-raw.json
- echo $RELEASE_FILE_RAW_SPEC
- export RELEASE_FILE_CLIENT_SPEC=release/gdev_client-specs.yaml
- echo $RELEASE_FILE_CLIENT_SPEC
- export CLIENT_RELEASE_NAME=$RUNTIME-$RUNTIME_VERSION-$CLIENT_VERSION
- echo $CLIENT_RELEASE_NAME
.release_runtime_vars: &define_release_runtime_vars
- echo "RUNTIME = $RUNTIME"
- export RUNTIME_VERSION=$(cat runtime/$RUNTIME/src/lib.rs | grep "spec_version:" | sed "s/ *spec_version. //g" | sed "s/,//g")
- echo $RUNTIME_VERSION
- export RUNTIME_MILESTONE="runtime-$RUNTIME_VERSION"
- echo $RUNTIME_MILESTONE
- export SRTOOL_OUTPUT=$CI_PROJECT_DIR/release/srtool_output_$RUNTIME.json
- echo "SRTOOL_OUTPUT = $SRTOOL_OUTPUT"
- export RELEASE_FILE_WASM=release/${RUNTIME}_runtime.compact.compressed.wasm
- echo $RELEASE_FILE_WASM
# srtool specific
- export RUNTIME_DIR=runtime/$RUNTIME
- echo "RUNTIME_DIR = $RUNTIME_DIR"
# srtool specific
- export PACKAGE=$RUNTIME-runtime
- echo "PACKAGE = $PACKAGE"
trigger_runtime_release:
stage: build
rules:
- <<: *is_runtime_branch
when: manual
variables:
RUNTIME: gdev
script:
- *define_release_runtime_vars
- echo "Vérification de l'absence de la release $RUNTIME_MILESTONE"
- echo "Contrôle de l'URL https://git.duniter.org/api/v4/projects/$CI_PROJECT_ID/releases/$RUNTIME_MILESTONE"
- curl -s https://git.duniter.org/api/v4/projects/$CI_PROJECT_ID/releases/$RUNTIME_MILESTONE --fail 1>/dev/null && (echo "Release déjà présente" && exit 1) || echo "Release absente"
trigger_network_release:
stage: build
rules:
- <<: *is_network_branch
when: manual
script:
- *define_network_branch_vars
- echo "Vérification de l'absence de la release $NETWORK"
- echo "Contrôle de l'URL https://git.duniter.org/api/v4/projects/$CI_PROJECT_ID/releases/$NETWORK"
- curl -s https://git.duniter.org/api/v4/projects/$CI_PROJECT_ID/releases/$NETWORK --fail 1>/dev/null && (echo "Release déjà présente" && exit 1) || echo "Release absente"
trigger_client_release:
stage: build
rules:
- <<: *is_network_branch
when: manual
script:
- *define_network_branch_vars
- echo "Vérification de la présence de la release $NETWORK"
- echo "Contrôle de l'URL https://git.duniter.org/api/v4/projects/$CI_PROJECT_ID/releases/$NETWORK"
- curl -s https://git.duniter.org/api/v4/projects/$CI_PROJECT_ID/releases/$NETWORK --fail 1>/dev/null && echo "Release présente" || (echo "Release absente" && exit 1)
docker_deploy:
stage: release
needs: ["build_raw_specs"]
rules:
- <<: *is_network_branch
- when: never
before_script:
- sh -c "[ -n '$DUNITERTEAM_PASSWD' ] || ( echo No access to environment variable 'DUNITERTEAM_PASSWD'; exit 1 )"
- podman login -u "duniterteam" -p "$DUNITERTEAM_PASSWD" docker.io
script:
- *define_network_branch_vars
- podman manifest rm "$MANIFEST" 2>/dev/null || true
- podman build --layers --platform linux/amd64,linux/arm64 --manifest "$MANIFEST" -f docker/Dockerfile --build-arg chain=$RUNTIME .
- podman manifest push --all "$MANIFEST" "docker://docker.io/$IMAGE_NAME:$DOCKER_TAG"
- podman manifest push --all "$MANIFEST" "docker://docker.io/$IMAGE_NAME:latest"
after_script:
- *define_network_branch_vars
- echo $MANIFEST
- podman manifest rm "$MANIFEST"
tags:
- podman
############## SRTOOL ##############
# The Network Runtime is only built when creating a network release (i.e.: genesis)
build_network_runtime:
stage: build
needs: ["trigger_network_release"]
rules:
- <<: *is_network_branch
image: paritytech/srtool:1.77.0-0.15.0
variables:
SRTOOL_OUTPUT: $CI_PROJECT_DIR/release/network_srtool_output.json
script:
- *define_network_branch_vars
- echo "SRTOOL_OUTPUT = $SRTOOL_OUTPUT"
- mkdir -p $CI_PROJECT_DIR/release
# Copy sources to the expected directory of srtool
- cp -R * /build/
# Build the runtime
- /srtool/build --app --json -cM | tee -a $SRTOOL_OUTPUT
- mv /build/runtime/$RUNTIME/target/srtool/release/wbuild/$RUNTIME-runtime/${RUNTIME}_runtime.compact.compressed.wasm $CI_PROJECT_DIR/release/
artifacts:
expire_in: never
name: "runtime"
paths:
- $CI_PROJECT_DIR/release
tags:
- kepler
build_gdev_runtime:
stage: build
needs: ["trigger_runtime_release"]
rules:
- <<: *is_runtime_branch
image: paritytech/srtool:1.77.0-0.15.0
variables:
RUNTIME: gdev
script:
- *define_release_runtime_vars
- mkdir -p $CI_PROJECT_DIR/release
# Copy sources to the expected directory of srtool
- cp -R * /build/
# Build the runtime
- /srtool/build --app --json -cM | tee -a $SRTOOL_OUTPUT
- mv /build/runtime/$RUNTIME/target/srtool/release/wbuild/$RUNTIME-runtime/${RUNTIME}_runtime.compact.compressed.wasm $CI_PROJECT_DIR/release/
artifacts:
expire_in: never
name: "runtime"
paths:
- $CI_PROJECT_DIR/release
tags:
- kepler
############## SPECS ##############
build_g1-migrator:
stage: build
rules:
- <<: *is_network_branch
trigger:
project: tools/py-g1-migrator
g1_data:
stage: build
needs: ["trigger_network_release", "build_g1-migrator"]
rules:
- <<: *is_network_branch
# following image already has g1-migrator and dependency embedded
image: registry.duniter.org/tools/py-g1-migrator:latest
variables:
LEVELDB_PATH: /dump/duniter_default/data/leveldb
script:
- *define_network_branch_vars
# Duniter 1.8.7 dump
- mkdir /dump
- cd /dump
# Export file constructed using Duniter 1.8.7:
# - bin/duniter sync g1.cgeek.fr --store-txs --nointeractive --mdb 1.8.7
# - mkdir -p /tmp/backup-g1-duniter-1.8.7
# - cp -R $HOME/.config/duniter/1.8.7/data /tmp/backup-g1-duniter-1.8.7
# - tar -cvzf /tmp/backup-g1-duniter-1.8.7.tgz /tmp/backup-g1-duniter-1.8.7
# Then the file is uploaded to dl.cgeek.fr manually
- curl https://dl.cgeek.fr/public/backup-g1-duniter-1.8.7.tgz -o g1-dump.tgz
- tar xvzf g1-dump.tgz
- rm g1-dump.tgz
- mv tmp/backup-g1-duniter-1.8.7 duniter_default
# py-g1-migrator conversion
- cd /py-g1-migrator
# Export genesis file
- ./main.py # ./output/genesis.json
# Expore history files for squid
- ./squid-block.py # ./output/block_hist.json
- ./squid-cert.py # ./output/cert_hist.json
- ./squid-tx.py # ./output/tx_hist.json
# Make the exported file available for next jobs
- mkdir -p $CI_PROJECT_DIR/release/
- cp output/genesis.json $CI_PROJECT_DIR/$RELEASE_FILE_G1_DATA
- cp output/block_hist.json $CI_PROJECT_DIR/release/
- cp output/cert_hist.json $CI_PROJECT_DIR/release/
- cp output/tx_hist.json $CI_PROJECT_DIR/release/
artifacts:
expire_in: never
paths:
- $CI_PROJECT_DIR/release/
tags:
- kepler
build_specs:
stage: build
needs: ["build_network_runtime", "g1_data"]
rules:
- <<: *is_network_branch
extends: .env
variables:
DEBIAN_FRONTEND: noninteractive
script:
- *define_network_branch_vars
- export FEATURES="--features $RUNTIME --no-default-features"
- echo "FEATURES = $FEATURES"
- export WASM_FILE="$CI_PROJECT_DIR/$RELEASE_FILE_WASM"
- echo "WASM_FILE = $WASM_FILE"
- export DUNITER_GENESIS_DATA=$CI_PROJECT_DIR/$RELEASE_FILE_G1_DATA
- echo "DUNITER_GENESIS_DATA = $DUNITER_GENESIS_DATA"
- apt-get update
- apt-get install -y clang cmake protobuf-compiler
# Build the spec file (including the G1 data), e.g.: "release/gdev.json"
- cargo run -Zgit=shallow-deps ${FEATURES} -- build-spec --chain=${RUNTIME}_live > $RELEASE_FILE_SPEC
# Save spec configuration file for release
- cp resources/${RUNTIME}.yaml $RELEASE_FILE_SPEC_CONFIG
artifacts:
expire_in: never
name: "runtime"
paths:
- $CI_PROJECT_DIR/release
tags:
- kepler
build_raw_specs:
stage: build
needs: ["trigger_client_release"]
rules:
- <<: *is_network_branch
image: rust:1-bullseye
script:
- *define_network_branch_vars
- export FEATURES="--features $RUNTIME --no-default-features"
- echo "FEATURES = $FEATURES"
- apt-get update
- apt-get install -y clang cmake protobuf-compiler jq
# Print chainspec to file
- cargo xtask print-spec $NETWORK_RELEASE > ${RUNTIME}-printed.json
# Merge client specs into chainspec file (to update bootnodes for example)
# 1. Download yq to create a json client spec file
- wget https://github.com/mikefarah/yq/releases/download/v4.44.6/yq_linux_arm64 -O yq
- chmod +x ./yq
# 2. YML -> JSON for the client specs
- cat node/specs/${RUNTIME}_client-specs.yaml | ./yq --output-format json > node/specs/${RUNTIME}_client-specs.json
# 3. Merge the client spec file into chainspec file and create the final spec file (e.g. gdev.json)
- jq -s '.[0] * .[1]' node/specs/${RUNTIME}_client-specs.json ${RUNTIME}-printed.json > ${RUNTIME}.json
# Produce raw spec file
- mkdir -p $CI_PROJECT_DIR/release
- cargo run -Zgit=shallow-deps ${FEATURES} -- build-spec --chain=${RUNTIME}.json --disable-default-bootnode --raw > $RELEASE_FILE_RAW_SPEC
artifacts:
expire_in: never
name: "runtime"
paths:
- $CI_PROJECT_DIR/release
tags:
- kepler
############## RELEASE ##############
create_network_release:
stage: release
needs: ["build_specs"]
rules:
- <<: *is_network_branch
image: rust:1-bullseye
variables:
# Used by `release-network` command
SRTOOL_OUTPUT: $CI_PROJECT_DIR/release/network_srtool_output.json
script:
- *define_network_branch_vars
# Release creation
- cargo xtask release-network $NETWORK_RELEASE $CI_COMMIT_BRANCH
# g1-data (initial data)
- cargo xtask create-asset-link $NETWORK_RELEASE g1-data.json https://nodes.pages.duniter.org/-/rust/duniter-v2s/-/jobs/$CI_JOB_ID/artifacts/$RELEASE_FILE_G1_DATA
# gdev.yaml (spec configuration)
- cargo xtask create-asset-link $NETWORK_RELEASE ${RUNTIME}.yaml https://nodes.pages.duniter.org/-/rust/duniter-v2s/-/jobs/$CI_JOB_ID/artifacts/$RELEASE_FILE_SPEC_CONFIG
# initial runtime
- cargo xtask create-asset-link $NETWORK_RELEASE ${RUNTIME}_runtime.compact.compressed.wasm https://nodes.pages.duniter.org/-/rust/duniter-v2s/-/jobs/$CI_JOB_ID/artifacts/$RELEASE_FILE_WASM
# the result: gdev.json (genesis)
- cargo xtask create-asset-link $NETWORK_RELEASE ${RUNTIME}.json https://nodes.pages.duniter.org/-/rust/duniter-v2s/-/jobs/$CI_JOB_ID/artifacts/$RELEASE_FILE_SPEC
artifacts:
expire_in: never
paths:
- $CI_PROJECT_DIR/release/
tags:
- kepler
create_client_release:
stage: release
needs: ["build_raw_specs"]
rules:
- <<: *is_network_branch
image: rust:1-bullseye
script:
- *define_network_branch_vars
# Create the GitLab release page + tag and associate the milestone
- cargo xtask release-client $CLIENT_RELEASE_NAME $CI_COMMIT_BRANCH $CLIENT_MILESTONE
# Add the client assets
- cargo xtask create-asset-link $CLIENT_RELEASE_NAME ${RUNTIME}_client-specs.yaml https://nodes.pages.duniter.org/-/rust/duniter-v2s/-/jobs/$CI_JOB_ID/artifacts/$RELEASE_FILE_CLIENT_SPEC
- cargo xtask create-asset-link $CLIENT_RELEASE_NAME ${RUNTIME}-raw.json https://nodes.pages.duniter.org/-/rust/duniter-v2s/-/jobs/$CI_JOB_ID/artifacts/$RELEASE_FILE_RAW_SPEC
artifacts:
expire_in: never
paths:
- $CI_PROJECT_DIR/release/
tags:
- kepler
create_runtime_release:
stage: release
needs: ["build_gdev_runtime"]
rules:
- <<: *is_runtime_branch
image: rust:1-bullseye
variables:
RUNTIME: gdev
script:
- *define_release_runtime_vars
# Create the GitLab release page + tag and associate the milestone.
# Note: the release name = the release tag = runtime milesone ($RUNTIME_MILESTONE)
- cargo xtask release-runtime $RUNTIME_MILESTONE $RUNTIME $CI_COMMIT_BRANCH $RUNTIME_MILESTONE
- cargo xtask create-asset-link $RUNTIME_MILESTONE ${RUNTIME}_runtime.compact.compressed.wasm https://nodes.pages.duniter.org/-/rust/duniter-v2s/-/jobs/$CI_JOB_ID/artifacts/$RELEASE_FILE_WASM
# In the future: also build gtest and g1 runtimes and atach them
artifacts:
expire_in: never
paths:
- $CI_PROJECT_DIR/release/
tags:
- kepler
--- ---
name: Ask a Question name: Ask a Question
about: Ask a question about this template. about: Ask a question about duniter-v2s.
title: "" title: ""
labels: question labels: question
assignees: "" assignees: ""
......
--- ---
name: Report a Bug name: Report a Bug
about: Report a problem with this template. about: Report a problem with duniter-v2s.
title: "" title: ""
labels: bug labels: bug
assignees: "" assignees: ""
...@@ -8,9 +8,7 @@ assignees: "" ...@@ -8,9 +8,7 @@ assignees: ""
**Description** **Description**
_Tell us what happened. In particular, be specific about any changes you made to this template. _Tell us what happened. Please elaborate, the more information you are able to
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
provide the more equipped we will be to help._ provide the more equipped we will be to help._
**Steps to Reproduce** **Steps to Reproduce**
...@@ -33,7 +31,7 @@ _Describe the environment in which you encountered this bug. Use the list below ...@@ -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._ and add additional information if you think it's relevant._
- Operating system: - Operating system:
- Template version/tag: - Git commit/tag:
- Rust version (run `rustup show`): - Rust version (run `rustup show`):
**Logs, Errors or Screenshots** **Logs, Errors or Screenshots**
......
--- ---
name: Suggest a Feature 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: "" title: ""
labels: enhancement labels: enhancement
assignees: "" assignees: ""
...@@ -9,8 +9,8 @@ assignees: "" ...@@ -9,8 +9,8 @@ assignees: ""
**Motivation** **Motivation**
_Describe the need or frustration that motivated you to make this suggestion. Please note that the _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 goal of this project is to bring the Ğ1 blockchain itself, so please take care when
suggesting features that may be specific to a particular use case._ suggesting features that may not concern the Ğ1 currency._
**Suggested Solution** **Suggested Solution**
......
FROM docker.io/library/ubuntu:20.04
# metadata
ARG VCS_REF
ARG BUILD_DATE
# show backtraces
ENV RUST_BACKTRACE 1
# install tools and dependencies
RUN apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get upgrade -y && \
DEBIAN_FRONTEND=noninteractive apt-get install -y \
libssl1.1 \
ca-certificates \
curl && \
# apt cleanup
apt-get autoremove -y && \
apt-get clean && \
find /var/lib/apt/lists/ -type f -not -name lock -delete; \
# add user
useradd -m -u 1000 -U -s /bin/sh -d /duniter duniter
# add duniter binary to docker image
COPY ./build/duniter /usr/local/bin
USER duniter
# check if executable works in this container
RUN /usr/local/bin/duniter --version
EXPOSE 30333 9944
VOLUME ["/duniter"]
ENTRYPOINT ["/usr/local/bin/duniter"]
[hooks]
pre-commit = "cargo fmt -- --check"
[logging]
verbose = true
...@@ -7,16 +7,16 @@ ...@@ -7,16 +7,16 @@
{ {
"type": "lldb", "type": "lldb",
"request": "launch", "request": "launch",
"name": "Debug unit tests in library 'lc-core'", "name": "Debug unit tests in library 'duniter'",
"cargo": { "cargo": {
"args": [ "args": [
"test", "test",
"--no-run", "--no-run",
"--lib", "--lib",
"--package=lc-core" "--package=duniter"
], ],
"filter": { "filter": {
"name": "lc-core", "name": "duniter",
"kind": "lib" "kind": "lib"
} }
}, },
...@@ -26,13 +26,13 @@ ...@@ -26,13 +26,13 @@
{ {
"type": "lldb", "type": "lldb",
"request": "launch", "request": "launch",
"name": "Debug executable 'lc-core'", "name": "Debug executable 'duniter'",
"cargo": { "cargo": {
"args": [ "args": [
"build" "build"
], ],
"filter": { "filter": {
"name": "lc-core", "name": "duniter",
"kind": "bin" "kind": "bin"
} }
}, },
...@@ -47,16 +47,16 @@ ...@@ -47,16 +47,16 @@
{ {
"type": "lldb", "type": "lldb",
"request": "launch", "request": "launch",
"name": "Debug unit tests in executable 'lc-core'", "name": "Debug unit tests in executable 'duniter'",
"cargo": { "cargo": {
"args": [ "args": [
"test", "test",
"--no-run", "--no-run",
"--bin=lc-core", "--bin=duniter",
"--package=lc-core" "--package=duniter"
], ],
"filter": { "filter": {
"name": "lc-core", "name": "duniter",
"kind": "bin" "kind": "bin"
} }
}, },
...@@ -66,16 +66,16 @@ ...@@ -66,16 +66,16 @@
{ {
"type": "lldb", "type": "lldb",
"request": "launch", "request": "launch",
"name": "Debug unit tests in library 'lc-core-runtime'", "name": "Debug unit tests in library 'gdev-runtime'",
"cargo": { "cargo": {
"args": [ "args": [
"test", "test",
"--no-run", "--no-run",
"--lib", "--lib",
"--package=lc-core-runtime" "--package=gdev-runtime"
], ],
"filter": { "filter": {
"name": "lc-core-runtime", "name": "gdev-runtime",
"kind": "lib" "kind": "lib"
} }
}, },
...@@ -120,25 +120,6 @@ ...@@ -120,25 +120,6 @@
"args": [], "args": [],
"cwd": "${workspaceFolder}" "cwd": "${workspaceFolder}"
}, },
{
"type": "lldb",
"request": "launch",
"name": "Debug unit tests in library 'pallet-ud-accounts-storage'",
"cargo": {
"args": [
"test",
"--no-run",
"--lib",
"--package=pallet-ud-accounts-storage"
],
"filter": {
"name": "pallet-ud-accounts-storage",
"kind": "lib"
}
},
"args": [],
"cwd": "${workspaceFolder}"
},
{ {
"type": "lldb", "type": "lldb",
"request": "launch", "request": "launch",
......
{
"editor.formatOnSave": true,
"editor.rulers": [
100
],
"[json]": {
"editor.defaultFormatter": "vscode.json-language-features"
},
"[yaml]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"lldb.dbgconfig": {
"rustc_path": "${env:HOME}/.rustup/toolchains/nightly-2021-01-13-x86_64-unknown-linux-gnu/lib/rustlib/src/rust",
"port_p2p": 19931,
"port_rpc": 19932,
"port_ws": 19933
},
"rust-analyzer.showUnlinkedFileNotification": false
}
\ No newline at end of file
# Contributing
Before contributing, please make sure that your development environment is properly configured by following this tutorial:
[Setting up your development environment]
Sign-ups on our gitlab are disabled. If you would like to contribute, please ask for an account on [the technical forum].
When contributing to this repository, please first discuss the change you wish to make via issue or
via [the technical forum] before making a change.
Please note we have a specific workflow, please follow it in all your interactions with the project.
## Developer documentation
Please read [Developer documentation] before contributing.
## Workflow
- If there is an unassigned issue about the thing you want to contribute to, assign the issue to yourself.
- Create a branch based on `master` and prefixed with your nickname. Give your branch a short name indicating the subject.
- Create an MR from your branch to `master`. Prefix the title with `Draft: ` until it's ready to be merged.
- If the MR is related to an issue, mention the issue in the description using the `#42` syntax.
- Never push to a branch of another contributor! If the contributor makes a `git rebase` your commit will be lost!
- Before you push your commit:
- Apply formatters (rustfmt and prettier) and linter (clippy)
- Document your code
- Apply the [project's git conventions]
## Merge Process
1. Ensure you rebased your branch on the latest `master` commit to avoid any merge conflicts.
1. Ensure that you respect the [commit naming conventions].
1. Ensure that all automated tests pass with the `cargo test` command.
1. Ensure that the code is well formatted `cargo fmt` and complies with the good practices `cargo clippy`. If you have been working on tests, check everything with `cargo clippy --all --tests`.
1. Update the documentation with details of changes to the interface, this includes new environment variables, exposed ports, useful file locations and container parameters.
1. Push your branch on the gitlab and create a merge request. Briefly explain the purpose of your contribution in the description of the merge request.
1. Mark the MR as ready (or remove the `Draft: ` prefix) only when you think it can be reviewed or merged.
1. Assign a Duniter reviewer so they will review your contribution. If you still have no news after several weeks, ask explicitly for a review, or tag another reviewer or/and talk about your contribution on [the technical forum].
## List of Duniter's reviewers
- @HugoTrentesaux
- @tuxmain
[commit naming conventions]: ./docs/dev/git-conventions.md#naming-commits
[Developer documentation]: ./docs/dev/
[project's git conventions]: ./docs/dev/git-conventions.md
[Setting up your development environment]: ./docs/dev/setup.md
[the technical forum]: https://forum.duniter.org
This diff is collapsed.