This is a beginner tutorial for those who do not have a previous experience with Rust ecosystem or need guidance to get familiar with Duniter v2s project. You'll need a development machine with an internet connexion, at least 20 Go of free storage, and an hour or two depending on your computing power.
This walkthrough is based on the following video (french), don't hesitate to make an english voicecover if you feel so.
Else, look at the corresponding section in the [system setup documentation](./setup.md).
Rust recommended installation method is through the rustup script that you can run with:
```bash
curl https://sh.rustup.rs -sSf | sh
```
If you reopen your terminal, it will give you access to the `rustup`, `rustc` and `cargo` commands. You can then install the required Rust toolchains with:
you can go to the root folder and build the substrate client with:
```bash
cargo build
```
This will take about 2 minutes to download dependencies and 12 minutes to build in debug mode. At this point, you only built the substrate client, a kind of "shell" in which lies the runtime. You can build the runtime and run a local blockchain with:
```bash
cargo run ----dev--tmp
```
Which should take about 1 minute. When you see the logs, the blockchain is running and you can connect to it with polkadotjs app: [https://polkadot.js.org/apps/?rpc=ws://127.0.0.1:9944](https://polkadot.js.org/apps/?rpc=ws%3A%2F%2F127.0.0.1%3A9944). You should see blocks being added every 6 seconds. You can use Alice, Bob, etc test accounts to submit extrinsics.
## Autocompletion
When using Duniter commands, you will benefit a lot from commands autocompletion. This can be achieved by following [autocompletion documentation](../user/autocompletion.md) for you shell. If you use bash the commands are:
```bash
# create local dir to store completion script
mkdir-p ~/.local/share/duniter
# build in release mode and export the bash completion file
cargo run --release-- completion --generator bash > ~/.local/share/duniter/completion.bash
# add the following line to your ~/.bashrc to automatically load completion on startup
Building in release mode for the first time is very long and can take up to 20 minutes. You will then benefit from completion using `<Tab>` key and `*`.
## End to end tests using cucumber
Cucumber end2end tests are a good way to dive in Duniter's business procedure. They work by spawning a local blockchain and submitting extrinsics to it. You can build and run the cucumber tests by running:
```bash
cargo cucumber
```
which should take about 4 minutes to build and run the tests. A highly detailed documentation about the end2end tests is available [in the dedicated folder](../../end2end-tests/README.md), you will learn how to read and modify the tests.