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 (40)
Showing
with 866 additions and 295 deletions
Dockerfile
docker-compose.yml
target
......@@ -17,3 +17,6 @@
# node modules
**/node_modules/**
# build folder
build
stages:
- quality
- build
- tests
#- build
- deploy
workflow:
rules:
......@@ -21,7 +22,7 @@ workflow:
fmt_and_clippy:
extends: .env
rules:
- if: $CI_COMMIT_TAG
- if: '$CI_COMMIT_TAG || $CI_COMMIT_BRANCH == "master"'
when: never
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
- when: manual
......@@ -32,16 +33,98 @@ fmt_and_clippy:
- cargo clippy -- -V
- cargo clippy --all --tests -- -D warnings
tests:
build_debug:
extends: .env
rules:
- if: $CI_COMMIT_TAG
when: never
- if: '$CI_PIPELINE_SOURCE == "merge_request_event" || $CI_COMMIT_BRANCH == "master"'
- when: manual
stage: build
script:
- cargo clean -p duniter
- cargo build
- mkdir build
- mv target/debug/duniter build/duniter
artifacts:
paths:
- build/
cache:
- key:
files:
- Cargo.lock
paths:
- target/debug
build_release:
extends: .env
rules:
- if: '$CI_COMMIT_TAG || $CI_COMMIT_BRANCH =~ /^release/'
- when: never
stage: build
script:
- cargo build --release
- mkdir build
- mv target/release/duniter build/duniter
artifacts:
paths:
- build/
expire_in: 1 day
tests_debug:
extends: .env
rules:
- if: $CI_COMMIT_REF_NAME =~ /^wip*$/
when: manual
- if: $CI_COMMIT_TAG
when: never
- if: '$CI_MERGE_REQUEST_ID ||$CI_COMMIT_BRANCH == "master" || $CI_COMMIT_BRANCH =~ /^release/'
- if: '$CI_MERGE_REQUEST_ID || $CI_COMMIT_BRANCH == "master"'
- when: manual
stage: tests
variables:
DUNITER_BINARY_PATH: "../build/duniter"
DUNITER_INTEGRATION_TESTS_SPAWN_NODE_DURATION: "20"
script:
- cargo build
- cargo test
dependencies:
- build_debug
tests_release:
extends: .env
rules:
- if: '$CI_COMMIT_TAG || $CI_COMMIT_BRANCH =~ /^release/'
- when: never
stage: tests
variables:
DUNITER_BINARY_PATH: "../build/duniter"
DUNITER_INTEGRATION_TESTS_SPAWN_NODE_DURATION: "10"
script:
- cargo test
dependencies:
- build_release
.docker-build-app-image:
stage: deploy
image: docker:18.06
tags:
- redshift
services:
- docker:18.06-dind
before_script:
- docker info
script:
- docker pull $CI_REGISTRY_IMAGE:$IMAGE_TAG || true
- docker build --cache-from $CI_REGISTRY_IMAGE:$IMAGE_TAG --pull -t "$CI_REGISTRY_IMAGE:$IMAGE_TAG" -f $DOCKERFILE_PATH .
- docker login -u "duniterteam" -p "$DUNITERTEAM_PASSWD"
- docker tag "$CI_REGISTRY_IMAGE:$IMAGE_TAG" "duniter/duniter-v2s:$IMAGE_TAG"
- docker push "duniter/duniter-v2s:$IMAGE_TAG"
deploy_docker_debug:
extends: .docker-build-app-image
rules:
- if: $CI_COMMIT_TAG
when: never
- if: $CI_COMMIT_BRANCH == "master"
variables:
DOCKERFILE_PATH: "docker/duniter-debug.Dockerfile"
IMAGE_TAG: "debug-sha-$CI_COMMIT_SHORT_SHA"
This diff is collapsed.
......@@ -6,11 +6,10 @@ members = [
'node',
'pallets/certification',
'pallets/identity',
'pallets/membership',
'pallets/ud-accounts-storage',
'pallets/universal-dividend',
'runtime/common',
'runtime/gdev',
'runtime/gtest'
'primitives/membership',
]
# The list of dependencies below (which can be both direct and indirect dependencies) are crates
......
......@@ -137,7 +137,7 @@ There are several files in the `node` directory - take special note of the follo
the libraries that this file imports and the names of the functions it invokes. In particular,
there are references to consensus-related topics, such as the
[longest chain rule](https://substrate.dev/docs/en/knowledgebase/advanced/consensus#longest-chain-rule),
the [Aura](https://substrate.dev/docs/en/knowledgebase/advanced/consensus#aura) block authoring
the [Babe](https://substrate.dev/docs/en/knowledgebase/advanced/consensus#babe) block authoring
mechanism and the
[GRANDPA](https://substrate.dev/docs/en/knowledgebase/advanced/consensus#grandpa) finality
gadget.
......
version: "3.2"
services:
dev:
container_name: duniter-v2s
image: paritytech/ci-linux:974ba3ac-20201006
working_dir: /var/www/node-template
ports:
- "9944:9944"
environment:
- CARGO_HOME=/var/www/node-template/.cargo
volumes:
- .:/var/www/node-template
- type: bind
source: ./.local
target: /root/.local
command: bash -c "cargo build && ./target/debug/node-template --dev --ws-external"
# ------------------------------------------------------------------------------
# Build Stage
# ------------------------------------------------------------------------------
# Building for Debian buster because we need the binary to be compatible
# with the image paritytech/ci-linux:production (currently based on
# debian:buster-slim) used by the gitlab CI
FROM rust:1-buster as build
WORKDIR /root
RUN apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get install -y \
clang
# Copy source tree
COPY . .
# build duniter
ARG threads=1
RUN test -x build/duniter || \
( \
CARGO_PROFILE_RELEASE_LTO="true" \
cargo build --release -j $threads && \
mkdir -p build && \
mv target/release/duniter build/ \
)
# ------------------------------------------------------------------------------
# Final Stage
# ------------------------------------------------------------------------------
FROM debian:buster-slim
LABEL maintainer="Gilles Filippini <gilles.filippini@pini.fr>"
LABEL version="0.0.0"
LABEL description="Crypto-currency software (based on Substrate framework) to operate Ğ1 libre currency"
# Intall
COPY --from=build /root/build/duniter /usr/local/bin/duniter
COPY docker/docker-entrypoint /usr/local/bin/
# Configuration
# rpc, rpc-ws, p2p, telemetry
EXPOSE 9933 9944 30333 9615
VOLUME /var/lib/duniter
ENTRYPOINT ["docker-entrypoint"]
version: "3.5"
services:
duniter-v2s:
container_name: duniter-v2s
image: duniter-v2s
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: "dev"
#DUNITER_DISABLE_PROMETHEUS: "false"
volumes:
- data:/var/lib/lc-core
volumes:
data:
#!/bin/bash
function boolean () {
echo "$1" | sed -E 's/^(true|yes|1)$/true/i'
}
function ternary () {
if [ $(boolean "$1") = true ]; then
echo "$2"
else
echo "$3"
fi
}
if [ -n "$DUNITER_INSTANCE_NAME" ]; then
set -- "$@" --name "$DUNITER_INSTANCE_NAME"
fi
DUNITER_DISABLE_PROMETHEUS=$(boolean "${DUNITER_DISABLE_PROMETHEUS:-false}")
DUNITER_CHAIN_NAME="${DUNITER_CHAIN_NAME:-dev}"
case "$DUNITER_CHAIN_NAME" in
dev)
chain=(--dev)
;;
*)
chain=(--chain "$DUNITER_CHAIN_NAME")
;;
esac
set -- "$@" \
"${chain[@]}" \
$(ternary "$DUNITER_DISABLE_PROMETHEUS" --no-prometheus) \
--unsafe-ws-external -d /var/lib/duniter
echo "Starting duniter with parameters:" "$@"
exec duniter "$@"
# Duniter debug node
#
# Requires to run from repository root and to copy the binary in the build folder
# (part of the CI workflow)
FROM docker.io/library/ubuntu:20.04 AS builder
RUN apt-get update && apt-get install -y ca-certificates && update-ca-certificates
FROM debian:buster-slim
LABEL maintainer "elois@duniter.org"
LABEL description="Binary for duniter debug node"
RUN useradd -m -u 1000 -U -s /bin/sh -d /duniter duniter && \
mkdir -p /duniter/.local/share && \
mkdir /data && \
chown -R duniter:duniter /data && \
ln -s /data /duniter/.local/share/duniter && \
rm -rf /usr/bin /usr/sbin
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt
USER duniter
COPY --chown=duniter build/duniter /duniter/duniter
RUN chmod uog+x /duniter/duniter
# 30333 for p2p
# 9933 for RPC call
# 9944 for Websocket
# 9615 for Prometheus (metrics)
EXPOSE 30333 9933 9944 9615
VOLUME ["/data"]
ENTRYPOINT ["/duniter/duniter"]
......@@ -5,7 +5,7 @@ edition = '2018'
homepage = 'https://substrate.dev'
license = 'AGPL-3.0'
name = 'duniter-integration-tests'
repository = 'https://git.duniter.org/nodes/rust/duniter-substrate'
repository = 'https://git.duniter.org/nodes/rust/duniter-v2s'
version = '3.0.0'
[dev-dependencies]
......
# Duniter-v2s integration tests
## cucumber functionnal tests
We use [cucumber] to be able to describe test scenarios in human language.
Cucumber is a specification for running tests in a [BDD] (behavior-driven development) style
workflow.
It assumes involvement of non-technical members on a project and as such provides a human-readable
syntax for the definition of features, via the language [Gherkin]. A typical feature could look
something like this:
```gherkin
Feature: Balance transfer
Scenario: If alice sends 5 ĞD to Dave, Dave will get 5 ĞD
Given alice have 10 ĞD
When alice send 5 ĞD to dave
Then dave should have 5 ĞD
```
### create a new functional test
To create a new test scenario, simply create a new file with a name of your choice in the `/features`
folder and give it the extension `.feature`.
Read in the sections below which users are available and which operations you can write.
If you want to write things that are not yet interpreted, make sure you standardize as much as
possible the way you write actions and assertions, in order to facilitate their future technical
interpretation.
Feel free to add comments to explain your scenario:
```gherkin
Feature: My awesome feature
Scenario: If something like this happens, then we should observe that
Given Something
"""
This is a comment, you can write whatever you want here, this part of the text will not be
interpreted, but it allows you to explain your scenario so that the developers interpret
it correctly.
"""
When Something's happening
Then We should observe that
```
### Test users
6 test users are provided:
- alice
- bob
- charlie
- deve
- eve
- ferdie
### Currency amounts
Amounts must be expressed as an integer of `ĞD` or `UD`, decimal numbers are not supported.
If you need more precision, you can express amounts in cents of ĞD (write `cĞD`), or in thousandths
of UD (write `mUD`).
#### Given
You can give any currency balance to each of the test users, so money will be created ex-nihilo for
that user. Note that this created money is not included in the monetary mass used to revalue the UD
amount.
Usage: `{user} have {amount} {unit}`
Example: `alice have 10 ĞD`
#### When
List of possible actions:
- transfer: `alice send 5 ĞD to bob`
- transfer_ud: `alice send 3 UD to bob`
- transfer_all: `alice sends all her ĞDs to bob`
#### Then
- Check that a user has exactly a specific balance
Usage: `{user} have {amount} {unit}`
Example: `alice should have 10 ĞD`
### Universal dividend creation
#### Then
- Check the current UD amount
Usage: `Current UD amount should be {amount}.{cents} ĞD`
Example: `Current UD amount should be 10.00 ĞD`
- Check the monetary mass
Usage: `Monetary mass should be {amount}.{cents} ĞD`
Example: `Monetary mass should be 30.00 ĞD`
### Contribute to the code that runs the tests
Cucumber is not magic, we have to write code that interprets the Gherkin text and performs the right
actions accordingly.
The rust code that interprets the Gherkin text is in this file:
`integration-tests/tests/cucumber_tests.rs`.
To contribute to this section, read the [Cucumber Rust Book].
To interact with the node, we use exclusively RPC requests, the RPC requests are realized in
functions defined in `integration-tests/tests/common`.
To realize the RPC requests, we use the rust crate [subxt](https://github.com/paritytech/subxt).
#### Upgrade metadata
To work, the integration tests need to have the runtime metadata up to date, here is how to update
them:
```bash
subxt metadata -f bytes > resources/metadata.scale
```
If you don't have subxt, install it: `cargo install subxt-cli`
[BDD]: https://en.wikipedia.org/wiki/Behavior-driven_development
[cucumber]: https://cucumber.io/
[Cucumber Rust Book]: https://cucumber-rs.github.io/cucumber/current/writing/index.html
[Gherkin]: https://cucumber.io/docs/gherkin/reference
......@@ -3,4 +3,4 @@ Feature: Balance transfer
Scenario: If alice sends 5 ĞD to Dave, Dave will get 5 ĞD
Given alice have 10 ĞD
When alice send 5 ĞD to dave
Then dave have 5 ĞD
Then dave should have 5 ĞD
Feature: Balance transfer
Scenario: After 10 blocks, the monetary mass should be 30 ĞD
Then Monetary mass should be 0.00 ĞD
Then Current UD amount should be 10.00 ĞD
When 10 blocks later
Then Monetary mass should be 30.00 ĞD
When 10 blocks later
Then Monetary mass should be 60.00 ĞD
Then Current UD amount should be 10.00 ĞD
......@@ -3,4 +3,4 @@ Feature: Balance transfer all
Scenario: If alice sends all her ĞDs to Dave, Dave will get 10 ĞD
Given alice have 10 ĞD
When alice sends all her ĞDs to dave
Then dave have 10 ĞD
Then dave should have 10 ĞD
......@@ -14,9 +14,36 @@
// 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/>.
use super::node_runtime::runtime_types::gdev_runtime;
use super::node_runtime::runtime_types::pallet_balances;
use super::*;
use sp_keyring::AccountKeyring;
use subxt::PairSigner;
use subxt::{sp_runtime::MultiAddress, PairSigner};
pub async fn set_balance(
api: &Api,
client: &Client,
who: AccountKeyring,
amount: u64,
) -> Result<()> {
let _events = create_block_with_extrinsic(
client,
api.tx()
.sudo()
.sudo(gdev_runtime::Call::Balances(
pallet_balances::pallet::Call::set_balance {
who: MultiAddress::Id(who.to_account_id()),
new_free: amount,
new_reserved: 0,
},
))
.create_signed(&PairSigner::new(SUDO_ACCOUNT.pair()), ())
.await?,
)
.await?;
Ok(())
}
pub async fn transfer(
api: &Api,
......@@ -40,3 +67,48 @@ pub async fn transfer(
Ok(())
}
pub async fn transfer_all(
api: &Api,
client: &Client,
from: AccountKeyring,
to: AccountKeyring,
) -> Result<()> {
let from = PairSigner::new(from.pair());
let to = to.to_account_id();
let _events = create_block_with_extrinsic(
client,
api.tx()
.balances()
.transfer_all(to.clone().into(), false)
.create_signed(&from, ())
.await?,
)
.await?;
Ok(())
}
pub async fn transfer_ud(
api: &Api,
client: &Client,
from: AccountKeyring,
amount: u64,
to: AccountKeyring,
) -> Result<()> {
let from = PairSigner::new(from.pair());
let to = to.to_account_id();
let _events = create_block_with_extrinsic(
client,
api.tx()
.universal_dividend()
.transfer_ud(to.clone().into(), amount)
.create_signed(&from, ())
.await?,
)
.await?;
Ok(())
}
......@@ -41,11 +41,14 @@ impl Drop for Process {
}
pub async fn spawn_node() -> (Api, Client, Process) {
let duniter_binary_path = std::env::var("DUNITER_BINARY_PATH")
.unwrap_or_else(|_| "../target/debug/duniter".to_owned());
let p2p_port = portpicker::pick_unused_port().expect("No ports free");
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/duniter")
Command::new(duniter_binary_path)
.args([
"--execution=Native",
"--no-telemetry",
......@@ -63,7 +66,14 @@ pub async fn spawn_node() -> (Api, Client, Process) {
.spawn()
.expect("failed to spawn node"),
);
std::thread::sleep(std::time::Duration::from_secs(4));
let duration_secs = if let Ok(duration_string) =
std::env::var("DUNITER_INTEGRATION_TESTS_SPAWN_NODE_DURATION")
{
duration_string.parse().unwrap_or(4)
} else {
4
};
std::thread::sleep(std::time::Duration::from_secs(duration_secs));
let client = ClientBuilder::new()
.set_url(format!("ws://127.0.0.1:{}", ws_port))
......@@ -75,7 +85,7 @@ pub async fn spawn_node() -> (Api, Client, Process) {
(api, client, process)
}
/*pub async fn create_empty_block(client: &Client) -> Result<(), subxt::Error> {
pub async fn create_empty_block(client: &Client) -> Result<()> {
// Create an empty block
let _: Value = client
.rpc()
......@@ -87,7 +97,7 @@ pub async fn spawn_node() -> (Api, Client, Process) {
.await?;
Ok(())
}*/
}
pub async fn create_block_with_extrinsic(
client: &Client,
......
......@@ -17,14 +17,11 @@
mod common;
use async_trait::async_trait;
use common::node_runtime::runtime_types::gdev_runtime;
use common::node_runtime::runtime_types::pallet_balances;
use common::*;
use cucumber::{given, then, when, World, WorldInit};
use sp_keyring::AccountKeyring;
use std::convert::Infallible;
use std::str::FromStr;
use subxt::{sp_runtime::MultiAddress, PairSigner};
#[derive(WorldInit)]
pub struct DuniterWorld {
......@@ -54,75 +51,77 @@ impl World for DuniterWorld {
}
}
#[given(regex = r"([a-zA-Z]+) have (\d+) ĞD")]
async fn who_have(world: &mut DuniterWorld, who: String, amount: u64) -> Result<()> {
fn parse_amount(amount: u64, unit: &str) -> (u64, bool) {
match unit {
"ĞD" => (amount * 100, false),
"cĞD" => (amount, false),
"UD" => (amount * 1_000, true),
"mUD" => (amount, true),
_ => unreachable!(),
}
}
#[given(regex = r"([a-zA-Z]+) have (\d+) (ĞD|cĞD|UD|mUD)")]
async fn who_have(world: &mut DuniterWorld, who: String, amount: u64, unit: String) -> Result<()> {
// Parse inputs
let who = AccountKeyring::from_str(&who)
.expect("unknown to")
.to_account_id();
let amount = amount * 100;
let who = AccountKeyring::from_str(&who).expect("unknown to");
let (mut amount, is_ud) = parse_amount(amount, &unit);
// Create {amount} ĞD for {who}
let _events = create_block_with_extrinsic(
&world.client,
world
if is_ud {
let current_ud_amount = world
.api
.tx()
.sudo()
.sudo(gdev_runtime::Call::Balances(
pallet_balances::pallet::Call::set_balance {
who: MultiAddress::Id(who),
new_free: amount,
new_reserved: 0,
},
))
.create_signed(&PairSigner::new(SUDO_ACCOUNT.pair()), ())
.await?,
)
.await?;
.storage()
.universal_dividend()
.current_ud_storage(None)
.await?;
amount = (amount * current_ud_amount) / 1_000;
}
// Create {amount} ĞD for {who}
common::balances::set_balance(&world.api, &world.client, who, amount).await?;
Ok(())
}
#[when(regex = r"([a-zA-Z]+) send (\d+) ĞD to ([a-zA-Z]+)")]
async fn transfer(world: &mut DuniterWorld, from: String, amount: u64, to: String) -> Result<()> {
#[when(regex = r"(\d+) blocks? later")]
async fn n_blocks_later(world: &mut DuniterWorld, n: usize) -> Result<()> {
for _ in 0..n {
common::create_empty_block(&world.client).await?;
}
Ok(())
}
#[when(regex = r"([a-zA-Z]+) send (\d+) (ĞD|cĞD|UD|mUD) to ([a-zA-Z]+)")]
async fn transfer(
world: &mut DuniterWorld,
from: String,
amount: u64,
unit: String,
to: String,
) -> Result<()> {
// Parse inputs
let from = AccountKeyring::from_str(&from).expect("unknown from");
let amount = amount * 100;
let to = AccountKeyring::from_str(&to).expect("unknown to");
let (amount, is_ud) = parse_amount(amount, &unit);
common::balances::transfer(&world.api, &world.client, from, amount, to).await
if is_ud {
common::balances::transfer_ud(&world.api, &world.client, from, amount, to).await
} else {
common::balances::transfer(&world.api, &world.client, from, amount, to).await
}
}
#[when(regex = r"([a-zA-Z]+) sends all (?:his|her) ĞDs? to ([a-zA-Z]+)")]
#[when(regex = r"([a-zA-Z]+) sends all (?:his|her) (?:ĞDs?|DUs?) to ([a-zA-Z]+)")]
async fn send_all_to(world: &mut DuniterWorld, from: String, to: String) -> Result<()> {
// Parse inputs
let from = PairSigner::new(
AccountKeyring::from_str(&from)
.expect("unknown from")
.pair(),
);
let to = AccountKeyring::from_str(&to)
.expect("unknown to")
.to_account_id();
let _events = create_block_with_extrinsic(
&world.client,
world
.api
.tx()
.balances()
.transfer_all(to.clone().into(), false)
.create_signed(&from, ())
.await?,
)
.await?;
let from = AccountKeyring::from_str(&from).expect("unknown from");
let to = AccountKeyring::from_str(&to).expect("unknown to");
Ok(())
common::balances::transfer_all(&world.api, &world.client, from, to).await
}
#[then(regex = r"([a-zA-Z]+) have (\d+) ĞD")]
async fn assert_who_have(world: &mut DuniterWorld, who: String, amount: u64) -> Result<()> {
#[then(regex = r"([a-zA-Z]+) should have (\d+) ĞD")]
async fn should_have(world: &mut DuniterWorld, who: String, amount: u64) -> Result<()> {
// Parse inputs
let who = AccountKeyring::from_str(&who)
.expect("unknown to")
......@@ -134,9 +133,43 @@ async fn assert_who_have(world: &mut DuniterWorld, who: String, amount: u64) ->
Ok(())
}
#[then(regex = r"Current UD amount should be (\d+).(\d+)")]
async fn current_ud_amount_should_be(
world: &mut DuniterWorld,
amount: u64,
cents: u64,
) -> Result<()> {
let expected = (amount * 100) + cents;
let actual = world
.api
.storage()
.universal_dividend()
.current_ud_storage(None)
.await?;
assert_eq!(actual, expected);
Ok(())
}
#[then(regex = r"Monetary mass should be (\d+).(\d+)")]
async fn monetary_mass_should_be(world: &mut DuniterWorld, amount: u64, cents: u64) -> Result<()> {
let expected = (amount * 100) + cents;
let actual = world
.api
.storage()
.universal_dividend()
.monetary_mass_storage(None)
.await?;
assert_eq!(actual, expected);
Ok(())
}
#[tokio::main(flavor = "current_thread")]
async fn main() {
//env_logger::init();
DuniterWorld::run("tests/features").await
DuniterWorld::cucumber()
//.fail_on_skipped()
.max_concurrent_scenarios(4)
.run_and_exit("features")
.await;
}
......@@ -6,7 +6,7 @@ edition = '2018'
homepage = 'https://substrate.dev'
license = 'AGPL-3.0'
name = 'duniter'
repository = 'https://git.duniter.org/nodes/rust/duniter-substrate'
repository = 'https://git.duniter.org/nodes/rust/duniter-v2s'
version = '3.0.0'
[package.metadata.docs.rs]
......@@ -16,7 +16,18 @@ targets = ['x86_64-unknown-linux-gnu']
name = 'duniter'
[features]
runtime-benchmarks = ['gdev-runtime/runtime-benchmarks']
default = ["gdev", "gtest"]
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',
]
[build-dependencies]
substrate-build-script-utils = { git = 'https://github.com/librelois/substrate.git', branch = 'duniter-monthly-2022-01' }
......@@ -28,9 +39,11 @@ sp-keyring = { git = "https://github.com/librelois/substrate.git", branch = "dun
# local dependencies
common-runtime = { path = '../runtime/common' }
g1-runtime = { path = '../runtime/g1' }
gdev-runtime = { path = '../runtime/gdev' }
gtest-runtime = { path = '../runtime/gtest' }
g1-runtime = { path = '../runtime/g1', optional = true }
gdev-runtime = { path = '../runtime/gdev', optional = true }
gtest-runtime = { path = '../runtime/gtest', optional = true }
pallet-certification = { path = '../pallets/certification' }
sp-membership = { path = '../primitives/membership' }
# crates.io dependencies
async-io = "1.3"
......@@ -85,7 +98,8 @@ branch = 'duniter-monthly-2022-01'
git = 'https://github.com/librelois/substrate.git'
branch = 'duniter-monthly-2022-01'
[dependencies.sc-consensus-aura]
[dependencies.babe]
package = "sc-consensus-babe"
git = 'https://github.com/librelois/substrate.git'
branch = 'duniter-monthly-2022-01'
......@@ -93,6 +107,10 @@ branch = 'duniter-monthly-2022-01'
git = 'https://github.com/librelois/substrate.git'
branch = 'duniter-monthly-2022-01'
[dependencies.sc-consensus-uncles]
git = 'https://github.com/librelois/substrate.git'
branch = 'duniter-monthly-2022-01'
[dependencies.sc-executor]
features = ['wasmtime']
git = 'https://github.com/librelois/substrate.git'
......@@ -135,6 +153,10 @@ branch = 'duniter-monthly-2022-01'
git = 'https://github.com/librelois/substrate.git'
branch = 'duniter-monthly-2022-01'
[dependencies.sp-authority-discovery]
git = 'https://github.com/librelois/substrate.git'
branch = 'duniter-monthly-2022-01'
[dependencies.sp-block-builder]
git = 'https://github.com/librelois/substrate.git'
branch = 'duniter-monthly-2022-01'
......@@ -147,7 +169,7 @@ branch = 'duniter-monthly-2022-01'
git = 'https://github.com/librelois/substrate.git'
branch = 'duniter-monthly-2022-01'
[dependencies.sp-consensus-aura]
[dependencies.sp-consensus-babe]
git = 'https://github.com/librelois/substrate.git'
branch = 'duniter-monthly-2022-01'
......