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
  • pokapow/duniter
  • pini-gh/duniter
  • elberto2008/duniter
  • diaspogift/duniter
  • d0p1/duniter
  • nodes/typescript/duniter
  • aya/duniter
  • tuxmain/duniter
  • thomasbromehead/duniter
  • Bertrandbenj/duniter
  • Tuxicoman/duniter
  • bpresles/duniter
  • ji_emme/duniter
  • tykayn/duniter
  • 1000i100/duniter
  • 666titi999/duniter
  • blavenie/duniter
17 results
Show changes
Commits on Source (19)
Showing
with 389 additions and 1490 deletions
......@@ -24,20 +24,23 @@ workflow:
- server.ts
- yarn.lock
.nvm_env: &nvm_env
.env: &env
image: registry.duniter.org/docker/duniter-ci:v0.0.4
tags:
- redshift
before_script:
- export NVM_DIR="$HOME/.nvm"
- . "$NVM_DIR/nvm.sh"
- nvm install 10.19.0
- nvm use 10.19.0
- nvm install 10
- nvm use 10
- curl https://sh.rustup.rs -sSf | sh -s -- -y
- export PATH="$HOME/.cargo/bin:$PATH"
- export RUSTFLAGS="-D warnings"
- rustup show && rustc --version && cargo --version
.cached_nvm: &cached_nvm
<<: *nvm_env
<<: *env
cache:
untracked: true
paths:
......@@ -49,11 +52,11 @@ workflow:
- redshift
before_script:
- export PATH="$HOME/.cargo/bin:$PATH"
- rustup show
- rustc --version && cargo --version
- rustup show && rustc --version && cargo --version
#pages:
# <<: *nvm_env
# <<: *env
# stage: pages
# cache: {}
# script:
......@@ -76,27 +79,8 @@ workflow:
# - loki
# - dev
tests:rs:
extends: .nvm_env
rules:
- if: $CI_COMMIT_TAG
when: never
- if: $CI_MERGE_REQUEST_ID
when: manual
- when: on_success
stage: tests
script:
- cargo fmt -- --version
- cargo fmt -- --check
- RUSTFLAGS="-D warnings" cargo build
- cargo test --all
# Coverage (doesn't make sense yet)
#- cargo test --doc
#- cargo tarpaulin --ignore-tests -iv --out Xml
#- bash <(curl -s https://codecov.io/bash)
tests:ts:
<<: *nvm_env
tests:
<<: *env
rules:
- if: $CI_COMMIT_TAG
when: never
......@@ -117,15 +101,17 @@ tests:ts:
- coverage.tar.gz
expire_in: 4h
clippy:
extends: .nvm_env
fmt_and_clippy:
extends: .env
rules:
- if: $CI_COMMIT_TAG
when: never
- if: $CI_MERGE_REQUEST_ID
- when: manual
- when: on_success
stage: quality
script:
- cargo fmt -- --version
- cargo fmt -- --check
- cargo clippy -- -V
- cargo clippy --all --tests -- -D warnings --verbose
......@@ -145,7 +131,7 @@ audit_dependencies:
- when: manual
sync_g1:
<<: *nvm_env
<<: *env
<<: *integration_rules
stage: integration
script:
......@@ -153,7 +139,7 @@ sync_g1:
- bash .gitlab/test/check_g1_sync.sh
sync_gtest:
<<: *nvm_env
<<: *env
<<: *integration_rules
stage: integration
script:
......
# Nodejs software
language: node_js
node_js:
- 8.9.2
env:
- CXX=g++-4.8
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- g++-4.8
code_climate:
repo_token: 67f8f00d5cf9e5c46b7644aebee5ac9df9d6ee267014a6f61a7a7b1048357a1c
sudo: false
dist: precise
# Unit Tests (+code coverage)
script: npm run-script test-travis
after_success:
# Send coverage data to Coveralls
- cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js
- rm -Rf ./coverage
deploy:
- provider: npm
email: cem.moreau@gmail.com
skip_cleanup: true
api_key:
secure: gZV7yLxDwwxD4oQXl1hwugmtnWXqP8vojuVGtAGwtMlwJE0n270w6O5xZHDd7DSmOZLftk6/wue/RdhLDsD6J1z3Uxu+VoUWy7aG/sFcGRaBwct+bGqFGkyd+I1mCXFnAZMDwbtgdkQlOCS9PM1BfMEYq49XXqaLaDnwouR+2bI=
on:
tags: true
repo: duniter/duniter
......@@ -5,38 +5,57 @@
### Highlights
- Migration to Nodejs v10
- Beginning of Duniter's oxidation (=Migration to Rust)
- Migration des modules C/C++ `wotb` et `naclb`
- Migration of the cluster that computing the proof of work
### Code
### Security
- Updating or removing dependencies with security vulnerabilities @elois
### Features
- [enh] migrate `naclb` to rust implementation `dup-crypto-rs`
- [enh] migrate `wotb` to rust implementation `dubp-wot`
- #1373: Support for Nodejs v10
- #1372: `scryptb` removal
- [enh] Upgrade TypeScript to 3.4.3
- [enh] Abstracting conf DAL to ConfDAO
- [enh] Remove ArchiveDAO, which is a LokiJS artifact
- [enh] Add to an interface ServerDAO methods that could be used by external modules
- [enh] StatsDAL => replaced by LevelDB indexes
- Migrate pow cluster on Rust @elois
- migrate `naclb` to rust implementation `dup-crypto-rs` @elois
- migrate `wotb` to rust implementation `dubp-wot` @elois
- #1373: Support for Nodejs v10 @c-geek @Moul
- Abstracting conf DAL to ConfDAO @c-geek
- Remove ArchiveDAO, which is a LokiJS artifact @c-geek
- Add to an interface ServerDAO methods that could be used by external modules @c-geek
- StatsDAL => replaced by LevelDB indexes @c-geek
### BMA
### Fixes
- [enh] Document `network/ws2p/heads`
- [fix] In case of wrong network configuration, Duniter could crash on startup
- [fix] `/branches` should not throw if current block does not exist
- In case of wrong network configuration, Duniter could crash on startup @c-geek
- `/branches` should not throw if current block does not exist @c-geek
### Refactoring
- Almost complete rewriting of the prover module @elois
- #1372: `scryptb` removal @c-geek
### CI
- Add dockerisation in Duniter CI
- Add g1 and gt control hash has changed to add `replayable_on`
- Add dockerisation in Duniter CI @elois
- g1 and gt control hash has changed to add `replayable_on` @c-geek
### Documentation
Thanks @c-geek, @librelois, @Moul, @vtexier
- Import of [website documentation](https://duniter.org/en/wiki/duniter/) @elois
- Restructuring the `doc/` directory @elois
- Removal of obsolete documentation @elois
- Document `network/ws2p/heads` @vtexier
Thanks @librelois, @c-geek, @vtexier, @Moul
## v1.7.21: (12th Fev 2020)
- #1394: Former member back in the WoT with only 4 certifiers
@c-geek
## v1.7.20: (28th Jan 2020)
- #1396: CINDEX revert removes certifications
- #1390: Duniter uses a buggy version of TweetNaCl
......@@ -44,24 +63,30 @@ Thanks @c-geek, @librelois, @Moul, @vtexier
@librelois
## v1.7.19: (28th May 2019)
- #1379: prevent expired membership documents to reach the mempool
- #1380: prevent expired certifications to reach the mempool
@c-geek
## v1.7.18: (2nd May 2019)
#### Code
### Code
- [La Ğ1-test est bloquée au bloc n°362834.](https://forum.duniter.org/t/g1-test-dans-les-choux/4192/318)
Thanks @Moul, @c-geek, @jytou
## v1.7.17 (28th April 2019)
#### CI/CD
### CI/CD
- Fix artifactory process: move to a minimalist jinja2 Docker image
- Trigger integration stages pipeline only when code changes
- Set releases:x64 artifacts to expire after six months
#### Code
### Code
- [Duniter v1.7.17 : règle de distance non respectée](https://forum.duniter.org/t/duniter-v1-7-17-regle-de-distance-non-respectee/6057)
- Add `sync-mempool-fwd` command
- Add `dump wot` command
......@@ -70,6 +95,7 @@ Thanks @Moul, @c-geek, @jytou
- !1269: Add more feedback on BMA interface configuration
#### Other
- Upgrade outdated dependencies: morgan, seedrandom, socks-proxy, and tail
- Update README.md
- Add initial CHANGELOG.md for releases from v1.7.15
......@@ -77,6 +103,7 @@ Thanks @Moul, @c-geek, @jytou
Thanks @Moul, @c-geek, @Tuxicoman
## v1.7.16 (6th April 2019)
**Hotfix release for Ğ1**
- [Duniter v1.7.16 : Bug à l’ajout d’une certification d’un non membre dans le bloc à calculer](https://forum.duniter.org/t/duniter-v1-7-16-bug-a-l-ajout-d-une-certification-d-un-non-membre-dans-le-bloc-a-calculer/5952/96)
......@@ -85,13 +112,15 @@ Thanks @Moul, @c-geek, @Tuxicoman
Thanks @Moul, @c-geek, @jytou
## v1.7.15 (4th April 2019)
**Hotfix /tx/history/<pubkey> broken since 1.7 release**
- #1350, !1276: Time of transactions not being saved on SQLite table
- Integration tests for transaction history and transaction history with times filters
- dump-ww: use file copy + semaphore to trigger the copy
- dump-ww: use file copy + semaphore to trigger the copy
Thanks @bpresles, @c-geek
## v1.7.14 (29th March 2019)
- … To be completed
# 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 its creation on [the technical forum].
When contributing to this repository, please first discuss the change you wish to make via issue and
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.
## Workflow
- You must create an issue for each feature you wish to develop, with a precise title and a
description of your feature. Then, assign it to yourself and click on the button
**`Create a merge request`**. GitLab will create a branch dedicated to the issue as well as a
*Work in Progress* merge request of this branch into the main branch (`dev`).
- Please use tags to specify feature domains and concerned modules.
- Never contribute to a branch whose issue has not been assigned to you! If the contributor make a
`git rebase` your commit will be lost !
- Before you push your commit:
- Document your code.
- Write unit tests, and verify that they **all** pass.
- Apply the [project's git conventions]
## Merge Process
1. Ensure you rebased your branch on the latest `dev` commit to avoid any merge conflicts.
2. Ensure that you respect the [commit naming conventions].
3. Ensure that all automated tests pass with the `yarn test` command.
4. Update the documentation with details of changes to the interface, this includes new environment
variables, exposed ports, useful file locations and container parameters.
5. 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.
6. Tag a Duniter reviewer so he will review your contribution. If you still have no news after several weeks, tag another reviewer or/and talk about your contribution on [the technical forum].
## List of Duniter's reviewers
- @librelois
- @Moul
- @c-geek
[Setting up your development environment]: ./doc/dev/setup_env_dev.md
[the technical forum]: https://forum.duniter.org
[project's git conventions]: ./doc/dev/git-conventions.md
[commit naming conventions]: ./doc/dev/git-conventions.md#naming-commits
![Duniter logo](https://git.duniter.org/nodes/typescript/duniter/raw/dev/images/250%C3%97250.png)
# Duniter [![Build Status](https://api.travis-ci.org/duniter/duniter.png)](https://travis-ci.org/duniter/duniter) [![Coverage Status](https://coveralls.io/repos/github/duniter/duniter/badge.svg?branch=master)](https://coveralls.io/github/duniter/duniter?branch=master) [![Dependencies](https://david-dm.org/duniter/duniter.svg)](https://david-dm.org/duniter/duniter)
# Duniter [![build status](https://git.duniter.org/nodes/typescript/duniter/badges/dev/pipeline.svg)](https://git.duniter.org/nodes/typescript/duniter/commits/dev) [![Coverage Status](https://coveralls.io/repos/github/duniter/duniter/badge.svg?branch=master)](https://coveralls.io/github/duniter/duniter?branch=master) [![Dependencies](https://david-dm.org/duniter/duniter.svg)](https://david-dm.org/duniter/duniter)
Duniter (previously uCoin) is a libre software allowing to create a new kind of P2P crypto-currencies based on individuals and Universal Dividend.
......@@ -39,9 +39,8 @@ See [Install a node documentation](https://duniter.org/en/wiki/duniter/install/)
### Contribute
- [Quick-start-guide : start a duniter node with web-ui from source](https://git.duniter.org/nodes/typescript/duniter/blob/dev/doc/quick-start.md)
- [Guide (fr)](https://git.duniter.org/nodes/typescript/duniter/blob/dev/doc/contribute-french.md)
- [Developer guide](https://git.duniter.org/nodes/typescript/duniter/blob/dev/doc/developer-guide.md)
- See [CONTRIBUTING](./CONTRIBUTING.md).
- [Guide (fr)](./doc/dev/contribute-french.md)
### Documentation
......@@ -60,18 +59,23 @@ If you wish to participate/debate on Duniter, you can:
### Developement
Duniter is using modules on different git repositories:
Duniter is currently migrating from [Typescript] to [Rust].
This migration is being done gradually via a [NodeJs]<->[Rust] binding provided by [Neon].
The fact of migrating from code to [Rust] is commonly called "oxidation", so we speak of "Duniter's oxidation".
- [Duniteroxyde](https://git.duniter.org/nodes/typescript/duniteroxyde): Neon binding for rust DUBP libs.
- [Debug](https://github.com/duniter/duniter-debug): debug tool.
The long-term goal is to oxidize Duniter entirely, but it is a long process that will take several years.
Duniter is divided into several git repositories:
- [Duniter](https://git.duniter.org/nodes/typescript/duniter): this repository.
- [Dubp-rs-libs](https://git.duniter.org/libs/dubp-rs-libs): Set of Rust libraries common to Duniter and a possible future Rust client/wallet.
- [Web admin](https://git.duniter.org/nodes/typescript/modules/duniter-ui): web administration interface (optional).
- [GVA](https://git.duniter.org/nodes/typescript/modules/gva-api): Future client API aimed to replace BMA. GVA stands for GraphQL Validation API.
Optional modules:
Optional repositories:
- [Currency monit](https://git.duniter.org/nodes/typescript/modules/duniter-currency-monit): charts to monitor currency and web of trust state.
- [Remuniter](https://github.com/duniter/remuniter): service to remunerate blocks issuers.
- [Wot explorer](https://github.com/c-geek/wotex): Web of Trust explorer.
# References
......@@ -88,3 +92,8 @@ Optional modules:
# License
This software is distributed under [GNU AGPLv3](https://git.duniter.org/nodes/typescript/duniter/blob/dev/LICENSE).
[Neon]: https://neon-bindings.com/
[NodeJs]: https://nodejs.org/en/
[Rust]: https://www.rust-lang.org/
[Typescript]: https://www.typescriptlang.org/
environment:
matrix:
- nodejs_version: "8.9.2"
ADDON_VERSION: "48"
platform:
- x64
install:
- echo %ADDON_VERSION%
- ps: Update-NodeJsInstallation $env:nodejs_version $env:platform
- node -v
- npm install -g npm
- npm install -g nw-gyp node-pre-gyp
- npm install
build: off
# Architecture
```
-------------
| BMA | Duniter Basic Merkled API (HTTP)
-------------
|
Trought
|
-------------
| duniter | The software
-------------
|
|
Implements
|
-----------------
| UCP | Duniter protocol
| ------------- |
| | Ed25519 | | Cryptography features
-----------------
```
More details on each layer:
Layer | Role
----- | ----
Duniter | The software that implements UCP. May implement UCP throught BMA or any other future protocol.
[BMA](./HTTP_API.md) | A communication protocol to exchange HDC and Network messages over HTTP.
[UCP](./Protocol.md) | A protocol defining how to handle Network and HDC messages in order to build a Duniter network.
Ed25519 | Cryptography format providing authentication features.
This diff is collapsed.
# Duniter Database
Duniter exploits an SQLite database to store the blockchain and newcoming data.
You can easily set it up and explore it with the following steps:
1. [Install your node](./install-a-node.md)
2. Launch Duniter and connect it to an existing currency (for example on `duniter.org` port `10901`)
3. Shut down Duniter
4. Use your favorite SQLite browser (for example [Sqliteman](http://sqliteman.yarpen.cz/)) and open the file under `~/.config/duniter/duniter_default/duniter.db`
Explore!
<img src="https://forum.duniter.org/uploads/default/original/2X/f/f4946056f30893f33ad0b516346b02fcc78b77d5.png" width="620" height="500">
# Duniter architecture
Title: Duniter architecture
Order: 1
Date: 2020-05-04
Slug: architecture_fench
Authors: elois
## Deux langages : Rust & Typescript
Historiquement, Duniter était en pur javascript et propulsé par [NodeJs] (avec quelques addons en C/C++).
Entre temps, Duniter a été entièrement réécris en [Typescript].
Le [Typescript] est un langage de typage qui est ensuite "transpilé" en javascript.
Au runtime, c'est toujours du code javascript qui est interprété par [NodeJs], le code [Typescript] "disparait" à la compilation.
Duniter est actuellement en cours de migration du [Typescript] vers le [Rust].
Cette migration se fait progressivement via un binding [NodeJs]<->[Rust] assuré par [Neon].
le fait de migrer du code en [Rust] est communément nommée "oxydation", on parle donc de "l'oxydation de Duniter".
L'objectif à terme est d'oxyder entièrement Duniter, mais c'est un long processus qui va s'étaler sur plusieurs années.
## Deux variantes: server & desktop
La variante "server" est en ligne de commande et la variante "desktop" possède une interface graphique dans une fenêtre.
La variante "server" porte mal son nom car les deux variantes embarquent un serveur Duniter.
## Architecture du dépôt
Dossiers :
- `app/`: Code source Typescript.
- `bin/`: Point d'entrée de l'application. Actuellement c'est un script js, si l'oxydation deviens totale ce sera remplacé par une crate binaire.
- `doc/`: Documentation (en markdown).
- `gui/`: Page d'acceuil et icone pour la variante desktop.
- `images/`: Logo de Duniter dans differentes tailles et différents formats.
- `neon/`: Code pour le binding NodeJs<->Rust
- `release/`: Scripts de build des livrables et resources pour les livrables (systemd, completion bash, etc)
- `rust-libs/`: Code source Rust
- `test/`: Tests automatisés du code javascript
Si l'oxydation de duniter se fait jusqu'au bout, les dossiers `app/`, `neon/` et `test/` disparaitrons.
Les tests d'intégration de chaque crate rust se trouvent dans le sous-dossier tests du dossier de la crate.
[Neon]: https://neon-bindings.com/
[NodeJs]: https://nodejs.org/en/
[Rust]: https://www.rust-lang.org/
[Typescript]: https://www.typescriptlang.org/
# Duniter architecture
Title: Duniter architecture
Order: 1
Date: 2020-05-04
Slug: architecture
Authors: elois
## Two languages : Rust & Typescript
Historically, Duniter was pure javascript and powered by [NodeJs] (with some C/C++ addons).
In the meantime, Duniter has been entirely rewritten in [Typescript].
Typescript] is a typing language which is then "transpiled" into javascript.
At runtime, it is always javascript code that is interpreted by [NodeJs], the [Typescript] code "disappears" at compile time.
Duniter is currently migrating from [Typescript] to [Rust].
This migration is being done gradually via a [NodeJs]<->[Rust] binding provided by [Neon].
The fact of migrating from code to [Rust] is commonly called "oxidation", so we speak of "Duniter's oxidation".
The long-term goal is to oxidize Duniter entirely, but it is a long process that will take several years.
## Two variants: server & desktop
The "server" variant is command line based and the "desktop" variant has a graphical interface in a window.
The "server" variant has a bad name because both variants include a Duniter server.
## Repository architecture
Folders:
- `app/`: Typescript source code.
- `bin/`: Entry point of the application. Currently it's a js script, in the future it will be replaced by a binary crate.
- `doc/`: Documentation (in markdown).
- `gui/`: Home page and icon for the desktop variant.
- `images/`: Duniter logo in different sizes and formats
- `neon/`: Code for binding NodeJs<->Rust
- `release/`: Build scripts of the deliverables and resources for it
- `rust-libs/`: Rust source code
- `test/`: Automated testing of javascript code
If duniter oxidation is completed, the `app/`, `neon/` and `test/` folders will disappear.
The integration tests for each rust crate can be found in the tests subfolder of the crate folder.
[Neon]: https://neon-bindings.com/
[NodeJs]: https://nodejs.org/en/
[Rust]: https://www.rust-lang.org/
[Typescript]: https://www.typescriptlang.org/
# Contribuer au code de Duniter
Le tutoriel le plus récent est ici : [https://duniter.org/fr/contribuer/blockchain-nodejs/tutoriel-dev/](https://duniter.org/fr/contribuer/blockchain-nodejs/tutoriel-dev/)
Son contenu est en grande partie encore valable, même si certaines parties ne sont plus tout à fait exactes, notamment avec la migration en cours vers du Rust.
Un nouveau tutoriel sera rédigé dans les mois a venir, en attendant nous vous recommandons la lecture du tutoriel cité ci-dessus.
......@@ -4,13 +4,12 @@
The summary gives an overview of the rules described below. Reading it will help you to dive into the details.
- branch created from an issue must have your pseudo as prefix
- manually created branches must be named according to the template `type/description`
- Branches must be named according to the template `type/description`
- draft work must be prefixed by "WIP" (work in progress)
- the naming of final commits must comply with the template `[type] scope: action subject`
- one should communicate with developers through dedicated spaces
- integrating a contribution can only be done via a merge with `-no-ff` option and since the following critera are fullfilled
- branch up to date with `dev` branch
- branch up to date with `dev` branch (except hotfixes, see the hotfix section)
- idiomatic code formatting, automated tests passed successfully
- clean commit history, understandable and concise
- contribution approved by a reviewer
......@@ -21,7 +20,7 @@ The summary gives an overview of the rules described below. Reading it will help
Most of the time, you'll use the "create a merge request" button and
Gitlab will name your branch. In that case, please prefix the name of
your branch with your Gitlab username and a slash, for example:
your branch with the branch type, for example:
fix/issue-test
......@@ -42,9 +41,10 @@ Example:
## Branch type
- feature : add a feature, refactoring existing code, or fix a bug in `dev` branch.
- release : create a release
- hotfix : fix in a release branch
- feature : add a feature
- ref : refactoring existing code
- fix : fix a bug in `dev` branch
- hotfix : fix à bug in a stable release
## Naming commits
......@@ -99,6 +99,10 @@ Every time the `dev` branch is updated, you must rebase each of your working bra
4. When you don't have any conflict anymore after `git rebase --continue`, then the rebase succeeded. Then rebase a remaning branch.
To prevent accidental merge commits, we recommend that force the `--ff-only` option on the merge command:
git config --global merge.ff only
## When to push
Ideally, you should push when you are about to shut down your computer, so about once a day.
......@@ -156,3 +160,29 @@ After an interactive rebase, your local git history is different that yours in G
Now is time to go to Gitlab and re-check your commits.
Wait for the Continuous Integration pipeline to finish (it lasts ±20min), and at last when it is done you can remove the "WIP" mention of your Merge Request and mention (with "@name") the lead developers to ask for a code review.
## Workflow
Il y a 3 types de branches permanentes :
- La branche `dev`, c'est la branche par défaut (le tronc), toutes les contributions doivetn être mergées sur cette branche (à l'exception des hotfix).
- La branche `stable`, elle pointe toujours sur le tag le plus récent de la dernière version stable. Elle sert de repère pour la documentation nottament.
- Les branches de hotfix, au format `hotfix/x.y`. Une branche de hotfix pour une version `x.y` n'est créée qu'a partir du moment où il y a un correctif à livrer en production sur cette version `x.y` et que correctif ne peut pas attendre version suivante.
There are 3 types of permanent branches:
- The `dev` branch is the default branch (the trunk), all contributions must be merged to this branch (except hotfixes).
- The `stable` branch, it always points to the most recent tag of the latest stable release. It is used as a reference for documentation, in particular.
- The hotfix branches, in `hotfix/x.y` format. A hotfix branch for an `x.y` release is only created when there is a patch to be released to production on that `x.y` release that cannot wait for the next release.
## Hotfix
Si un bug bloquant se produit en production et nécessite un hotfix, ce dernier doit faire l'objet de 2 tickets et 2 branches :
1. Le ticket original du bug, doit être traité sur une branche `hotfix/issue-number-or-bug-description` puis mergé sur la branche `hotfix/x.y`, où `x.y` désigne la version en production a ce moment là.
2. Un ticket de report doit être créé, il doit citer le ticket original et permet de tracer la correction du bug sur la branche `dev`. Si pour X raison le hotfix n'a pas lieu d'être reporté sur la branche dev, le ticket de repport doit expliquer pourquoi puis être cloturé.
If a blocking bug occurs in production and requires a hotfix, the latter must be the subject of 2 issues and 2 branches :
1. The original issue, must be processed on a `hotfix/issue-number-or-bug-description` branch, then merged to the `hotfix/x.y` branch, where `x.y` is the version in production at that time.
2. A carryover issue must be created, quoting the original issue and tracing the bug fix to the `dev` branch. If for any reason the hotfix does not need to be carried over to the `dev` branch, the carryover issue should explain why and then be closed.
# Setting up your development environment
Title: Setting up your development environment
Order: 1
Date: 2020-05-04
Slug: setup_env_dev
Authors: elois
## Prerequisites
To develop on Duniter, there is currently the following requirement:
- A computer with GNU/Linux or Mac as operating system
- Build essential tools
- git (apt-get install git)
- Nvm
- Rust
- Yarn
And preferably an IDE that supports [Typescript] and [Rust] well.
[Rust]: https://www.rust-lang.org/
[Typescript]: https://www.typescriptlang.org/
### Install Prerequisites
Nvm:
wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | bash
Rust:
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -- -y
Yarn: [installation instructions][yarn]
## Build the project
### Clone de repository
git clone https://git.duniter.org/nodes/typescript/duniter
### Install and use the correct version of nodejs
Check the required node version in the `package.json` file on line 5.
If, for example, version 10 is expected, install and select it with the following command:
nvm install 10 && nvm use 10
### Build the project and play automated tests
**WARNING**: the 1st compilation of the project requires a lot of resources on your machine, and several long minutes, don't do anything else at the same time!
Command to compile :
yarn
**WARNING**: playing automated tests takes a lot of resources on your machine and those for several minutes, don't do anything else at the same time!
Command to play automated tests:
yarn test
If all the tests are successful, the command ends like this:
```bash
777 passing (40s)
19 pending
Done in 43.80s.
```
## Configure your IDE
Personally, I use VsCodium/VsCode, so I give the configuration for this IDE.
### Configure VsCodium/VsCode
VsCodium/VsCode natively contains everything you need for Typescript.
For the Rust part, I strongly recommend the following plugins:
- Better TOML (identifier: `bungcip.better-toml`)
- CodeLLDB (identifier: `vadimcn.vscode-lldb`)
- rust-analyzer (identifier: `matklad.rust-analyzer`)
The recommended ide configuration can be found in `doc/dev/vscode/settings.json`.
#### Debugger configuration
The recommended debugger configuration can be found in `doc/dev/.vscode/launch.json`.
For import it:
cp doc/dev/vscode/launch.json .vscode/launch.json
You can then adapt it according to your preferences for use :)
[Rust]: https://www.rust-lang.org/
[Typescript]: https://www.typescriptlang.org/
[yarn]: https://classic.yarnpkg.com/en/docs/install/
......@@ -11,7 +11,8 @@
"program": "${workspaceFolder}/bin/duniter",
"args": [
"direct_start"
]
],
"runtimeExecutable": "${env:HOME}/.nvm/versions/node/v10.19.0/bin/node"
},
{
"type": "node",
......@@ -19,9 +20,10 @@
"name": "Mocha CURRENT FILE",
"program": "${workspaceFolder}/node_modules/mocha/bin/_mocha",
"args": [
"--opts", "\"\"",
"--opts", "\"\"", "--timeout", "600000",
"${fileDirname}/${fileBasenameNoExtension}.js"
]
],
"runtimeExecutable": "${env:HOME}/.nvm/versions/node/v10.19.0/bin/node"
},
{
"type": "node",
......@@ -30,7 +32,8 @@
"program": "${workspaceFolder}/node_modules/mocha/bin/_mocha",
"args": [
"${workspaceFolder}/test"
]
],
"runtimeExecutable": "${env:HOME}/.nvm/versions/node/v10.19.0/bin/node"
}
]
}
\ No newline at end of file
{
"files.exclude": {
"*.js": true,
"*.d.ts": true,
"*.map": true,
"app/**/*.js": true,
"app/**/*.d.ts": true,
"app/**/*.map": true,
"**/.git": true
}
},
"rust-analyzer.checkOnSave.command": "clippy"
}
\ No newline at end of file
# Developer guide
### Releases
To do releases, there is a script which handle it for us.
All services included GitHub will automatically create a release.
#### Pre-releases
```bash
./release.sh pre 0.40.0a4
```
#### Stable releases
```bash
./release.sh rel 0.40.0
```
Releases are based on tags. This script will tag the commit.
So, you will have to push tags to trigger releases:
```bash
git push --tags
```
# Manual configuration
To add manually configuration parameters to Duniter, use `config` command:
```bash
$ duniter config
```
## Currency
First of all, tell Duniter which currency to be used through command:
```bash
$ duniter config --currency mycurrency
```
Replace `mycurrency` by the name of the currency you want to manage.
> This is **crucial** data. Be careful on the case and **do not change it** thereafter otherwise your node will have incoherent data & behaviors.
## Network parameters
By default, duniter runs on port 8033. You may change it using the --port parameter:
```bash
$ duniter config --port 80
```
(may require root access to launch on port 80)
It is also possible to specify the IPv4 interface:
```bash
$ duniter config -p 8888 --ipv4 127.0.0.1
```
Or IPv6 interface:
```bash
$ duniter config -p 8888 --ipv6 ::1
```
Or both:
```bash
$ duniter config -p 8888 --ipv4 127.0.0.1 --ipv6 ::1
```
Launching Duniter (when completely configured) will results:
```bash
$ duniter start
Duniter server listening on 127.0.0.1 port 8888
Duniter server listening on ::1 port 8888
```
Note too that listening to multiple interfaces doesn't imply mutiple program instances: only *one* is running on multiple interfaces.
## Remote parameters
### Peering informations
Duniter protocol uses peering mecanisms, hence needs any duniter node to be reachable through the network.
As the server may be behind a reverse proxy, or because hosts may change of address, remote informations are likely to be different from listening host and port parameters. duniter software defines 4 remote parameters you need to precise for your duniter instance to be working:
* `--remoteh`
* `--remote4`
* `--remote6`
* `--remotep`
You must define at least `--remote4` and `--remotep` not to have any error. Here is an example:
```bash
$ duniter config --remoteh "some.remote.url" --remotep "8844" --remote4 "11.11.11.11" --remote6 "::1"
```
Note that this is not required and may be removed in the future, as Duniter protocol already include peering mecanisms giving network informations.
### Authentication
Duniter protocol requires your responses to be signed in order to be interpreted. Such a feature is very important to authenticate nodes' messages. To use this feature, just configure Duniter using `--pgpkey` parameter:
```bash
$ duniter config --pgpkey /path/to/private/key
```
Eventually, you might need to give a password, otherwise Duniter will crash:
```bash
$ duniter config --pgppasswd "ultr[A]!%HiGhly-s3cuR3-p4ssw0d"
```
Resulting in:
```bash
$ duniter start
Signed requests with PGP: enabled.
Duniter server listening on 127.0.0.1 port 8888
Duniter server listening on ::1 port 8888
```
# Quick-start-guide : start a duniter node with web-ui from source
## Prerequisite
- [git](https://git-scm.com/downloads)
- [nvm](https://github.com/nvm-sh/nvm#installing-and-updating)
- [yarn](https://classic.yarnpkg.com/en/docs/install/)
- [python 2.7](https://www.python.org/downloads/) (Linux? -> you allready have it)
- [gcc](https://github.com/nodejs/node-gyp#installation)
```bash
# install node gyp fo compile C/C++ dependencies (sqlite and leveldb)
npm i -g node-gyp
```
- [rust](https://www.rust-lang.org/learn/get-started)
```bash
# install cargo for rust
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
```
- [Gitlab](https://git.duniter.org/) account (optional, needed to contribute)
## Install
```bash
git clone https://git.duniter.org/nodes/typescript/duniter.git
cd duniter
rustup update
yarn add duniter-ui
yarn
bin/duniter webstart
```
Connect to your duniter-node admin web-panel on : [http://localhost:9220/](http://localhost:9220/)
## Contribute
- On gitlab, fork https://git.duniter.org/nodes/typescript/duniter on your account repository.
- Change, improve, do what will be usefull.
- Run `yarn test` and if it's ok
- Run `git remote add myFork https://git.duniter.org/<<yourAccount>>/duniter.git` or similar writable git repository.
- Run `git add .` or other command to prepare your commit
- Run `git status` to check what will be in your commit
- Run `git commit -m "explain what you have do/improve"`
- Run `git push myFork`
- On gitlab create a merge-request for your contrib.