Home

Awesome

<h1 align="center"> <img height="90" src="assets/rusk_logo_light.svg#gh-dark-mode-only" alt="Rusk"> <img height="90" src="assets/rusk_logo_dark.svg#gh-light-mode-only" alt="Rusk"> </h1> <p align="center"> The official <img height="11" src="assets/dusk_circular_light.svg#gh-dark-mode-only"><img height="11" src="assets/dusk_circular_dark.svg#gh-light-mode-only"><a href="https://dusk.network/"> Dusk</a> protocol node client and smart contract platform. </p> <p align=center> <a href="https://github.com/dusk-network/rusk/actions/workflows/rusk_ci.yml"> <img src="https://github.com/dusk-network/rusk/actions/workflows/rusk_ci.yml/badge.svg" alt="Rusk CI"></a> &nbsp; <a href="https://github.com/dusk-network/rusk/actions/workflows/explorer_ci.yml"> <img src="https://github.com/dusk-network/rusk/actions/workflows/explorer_ci.yml/badge.svg" alt="explorer CI"></a> &nbsp; <a href="https://github.com/dusk-network/rusk/actions/workflows/webwallet_ci.yml"> <img src="https://github.com/dusk-network/rusk/actions/workflows/webwallet_ci.yml/badge.svg" alt="web-wallet CI"></a> </p>

Unstable : No guarantees can be made regarding the API stability, the project is in development.

How to run a node

For more information on running a node, see our docs:

Prerequisites

Rust Installation

Rusk makes use of the nightly toolchain, make sure it is installed. Furthermore, to build the WASM contracts, wasm-pack is required.

To install and set the nightly toolchain, and install wasm-pack, run:

rustup toolchain install nightly
rustup default nightly
cargo install wasm-pack

Build and Tests

To build rusk from source, Rust, GCC and Clang are required. Once the dependencies are installed, you can simply run the following command to compile everything:

make

To run tests:

make test

That will also compile all the genesis contracts and its associated circuits.

Use

Prerequisites:

# Generate the keys used by the circuits
make keys

# Compile all the genesis contracts
make wasm

# Copy example consensus.keys
mkdir -p ~/.dusk/rusk
cp examples/consensus.keys ~/.dusk/rusk/consensus.keys

Run a single full-node cluster with example state.

# Generate genesis state
cargo r --release -p rusk -- recovery state --init examples/genesis.toml -o /tmp/example.state

# Launch a local ephemeral node
DUSK_CONSENSUS_KEYS_PASS=password cargo r --release -p rusk -- -s /tmp/example.state

Prover Node

The node can be build as a prover only as follows:

cargo r --release --no-default-features --features prover -p rusk

This prover node will be accessible on https://localhost:8080. Apps like the rusk-wallet can be connected to it for quicker and more private local proving.

Contracts compilation

To just compile all the genesis contracts without running the server:

make contracts

To generate a specific genesis contract:

# generate the wasm for `transfer` contract
make wasm for=transfer

See also make help for all the available commands

Docker support

It's also possible to run a local ephemeral node with Docker.

To build the Docker image:

docker build -t rusk .

To run Rusk inside a Docker container:

docker run -p 9000:9000/udp -p 8080:8080/tcp rusk

Port 9000 is used for Kadcast, port 8080 for the HTTP and GraphQL APIs.

License

The Rusk software is licensed under the Mozilla Public License Version 2.0.