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 (12)
[alias]
cucumber = "test -p duniter-integration-tests --test cucumber_tests --"
...@@ -6,9 +6,6 @@ ...@@ -6,9 +6,6 @@
.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
......
...@@ -22,6 +22,8 @@ workflow: ...@@ -22,6 +22,8 @@ workflow:
fmt_and_clippy: fmt_and_clippy:
extends: .env extends: .env
rules: rules:
- if: $CI_COMMIT_REF_NAME =~ /^wip*$/
when: manual
- if: '$CI_COMMIT_TAG || $CI_COMMIT_BRANCH == "master"' - if: '$CI_COMMIT_TAG || $CI_COMMIT_BRANCH == "master"'
when: never when: never
- if: $CI_PIPELINE_SOURCE == "merge_request_event" - if: $CI_PIPELINE_SOURCE == "merge_request_event"
...@@ -119,6 +121,19 @@ tests_release: ...@@ -119,6 +121,19 @@ tests_release:
- docker tag "$CI_REGISTRY_IMAGE:$IMAGE_TAG" "duniter/duniter-v2s:$IMAGE_TAG" - docker tag "$CI_REGISTRY_IMAGE:$IMAGE_TAG" "duniter/duniter-v2s:$IMAGE_TAG"
- docker push "duniter/duniter-v2s:$IMAGE_TAG" - docker push "duniter/duniter-v2s:$IMAGE_TAG"
deploy_docker_test_image:
extends: .docker-build-app-image
rules:
- if: $CI_COMMIT_REF_NAME =~ /^wip*$/
when: manual
- if: '$CI_COMMIT_TAG || $CI_COMMIT_BRANCH == "master"'
when: never
- if: $CI_MERGE_REQUEST_ID
- when: manual
variables:
DOCKERFILE_PATH: "docker/Dockerfile"
IMAGE_TAG: "test-image-$CI_COMMIT_SHORT_SHA"
deploy_docker_debug: deploy_docker_debug:
extends: .docker-build-app-image extends: .docker-build-app-image
rules: rules:
...@@ -126,5 +141,5 @@ deploy_docker_debug: ...@@ -126,5 +141,5 @@ deploy_docker_debug:
when: never when: never
- if: $CI_COMMIT_BRANCH == "master" - if: $CI_COMMIT_BRANCH == "master"
variables: variables:
DOCKERFILE_PATH: "docker/duniter-debug.Dockerfile" DOCKERFILE_PATH: "docker/Dockerfile"
IMAGE_TAG: "debug-sha-$CI_COMMIT_SHORT_SHA" IMAGE_TAG: "debug-sha-$CI_COMMIT_SHORT_SHA"
...@@ -2,6 +2,38 @@ ...@@ -2,6 +2,38 @@
A rewriting of duniter based on [Substrate](https://www.substrate.io/) framework. A rewriting of duniter based on [Substrate](https://www.substrate.io/) framework.
## Usage
### Docker
The easiest way to use duniter-v2s is to use the docker image.
#### Releases images
For the moment, duniter-v2s does not have a first release yet.
#### Test images
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.
Usage:
```docker
docker run -it -p9944:9944 --name duniter-v2s duniter/duniter-v2s:debug-sha-cc648aaf
```
Then open `https://polkadot.js.org/apps/?rpc=ws%3A%2F%2F127.0.0.1%3A9944` in a browser.
### Docker compose
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).
Other docker-compose files are suggested in the `docker/compose-examples` folder:
- `gtest-local2.docker-compose.yml`: Configured to launch 2 validators on ğdem currency.
## Setup ## Setup
First, complete the [basic setup instructions](./docs/setup.md). First, complete the [basic setup instructions](./docs/setup.md).
......
...@@ -3,7 +3,7 @@ version: "3.5" ...@@ -3,7 +3,7 @@ version: "3.5"
services: services:
duniter-v2s: duniter-v2s:
container_name: duniter-v2s container_name: duniter-v2s
image: duniter-v2s image: duniter/duniter-v2s:debug-sha-cc648aaf
ports: ports:
# telemetry # telemetry
- "127.0.0.1:9615:9615" - "127.0.0.1:9615:9615"
......
...@@ -8,13 +8,15 @@ ...@@ -8,13 +8,15 @@
FROM rust:1-buster as build FROM rust:1-buster as build
WORKDIR /root WORKDIR /root
RUN apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get install -y \
clang
# Copy source tree # Copy source tree
COPY . . COPY . .
RUN test -x build/duniter || \
( \
apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get install -y clang \
)
# build duniter # build duniter
ARG threads=1 ARG threads=1
RUN test -x build/duniter || \ RUN test -x build/duniter || \
...@@ -35,12 +37,15 @@ LABEL maintainer="Gilles Filippini <gilles.filippini@pini.fr>" ...@@ -35,12 +37,15 @@ LABEL maintainer="Gilles Filippini <gilles.filippini@pini.fr>"
LABEL version="0.0.0" LABEL version="0.0.0"
LABEL description="Crypto-currency software (based on Substrate framework) to operate Ğ1 libre currency" LABEL description="Crypto-currency software (based on Substrate framework) to operate Ğ1 libre currency"
# Intall RUN adduser --home /var/lib/duniter duniter
COPY --from=build /root/build/duniter /usr/local/bin/duniter
COPY docker/docker-entrypoint /usr/local/bin/
# Configuration # Configuration
# rpc, rpc-ws, p2p, telemetry # rpc, rpc-ws, p2p, telemetry
EXPOSE 9933 9944 30333 9615 EXPOSE 9933 9944 30333 9615
VOLUME /var/lib/duniter VOLUME /var/lib/duniter
ENTRYPOINT ["docker-entrypoint"] ENTRYPOINT ["docker-entrypoint"]
USER duniter
# Intall
COPY --from=build /root/build/duniter /usr/local/bin/duniter
COPY docker/docker-entrypoint /usr/local/bin/
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
...@@ -28,10 +28,12 @@ case "$DUNITER_CHAIN_NAME" in ...@@ -28,10 +28,12 @@ case "$DUNITER_CHAIN_NAME" in
;; ;;
esac esac
DUNITER_OPTS="${DUNITER_OPTS:---unsafe-ws-external}"
set -- "$@" \ set -- "$@" \
"${chain[@]}" \ "${chain[@]}" \
$(ternary "$DUNITER_DISABLE_PROMETHEUS" --no-prometheus) \ $(ternary "$DUNITER_DISABLE_PROMETHEUS" --no-prometheus) \
--unsafe-ws-external -d /var/lib/duniter -d /var/lib/duniter
echo "Starting duniter with parameters:" "$@" echo "Starting duniter with parameters:" "$@"
exec duniter "$@" exec duniter "$DUNITER_OPTS" "$@"
# 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"]
...@@ -107,6 +107,20 @@ List of possible actions: ...@@ -107,6 +107,20 @@ List of possible actions:
Example: `Monetary mass should be 30.00 ĞD` Example: `Monetary mass should be 30.00 ĞD`
### Run cucumber functionnal tests
To run the cucumber tests, you will need to have the rust toolchain installed locally.
To run all the scenarios (there are many) use the command: `cargo cucumber`
You can filter the `.feature` files to run with the option `i`, for instante:
```
cargo cucumber -i monetary*
```
Will only run `.feature` files that start with `monetary`.
### Contribute to the code that runs the tests ### 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 Cucumber is not magic, we have to write code that interprets the Gherkin text and performs the right
......