Skip to content

Latest commit

 

History

History
88 lines (59 loc) · 2.76 KB

File metadata and controls

88 lines (59 loc) · 2.76 KB

Building the creditcoin-node from source

Note on development platforms: development is easiest from a unix environment (whether that be linux, macOS, or WSL). It should be possible to develop natively in windows but you'll most likely be on your own.

Build prerequisites

Install the Rust toolchain

You'll need a working Rust installation, if you don't have one already available (NOTE: you'll want to install and manage your Rust toolchain with rustup, not by installing your distro's rust package which will most likely be too old).

For the installation you can refer to these instructions.

Once you have a working rust installation, you'll need to add the wasm32-unknown-unknown target and install the nightly toolchain

rustup update
rustup toolchain install nightly
rustup target add wasm32-unknown-unknown --nightly

Note: So that you don't have to specify the toolchain every build, you can set nightly as your default toolchain while working on creditcoin.

You can also check ./ci/env for the toolchain being used in our CI in case you run into issues with newer version before we notice them.

# set nightly as default for your creditcoin checkout
rustup override set nightly

System build dependencies

You'll need a few system dependencies (some extra dependencies may be required depending on the platform, but all platforms require the following):

  • Clang
  • Protobuf compiler
  • CMake
  • OpenSSL

MacOS setup

macOS comes with a suitable clang installation, so you don't need to worry about it. For installing the remaining dependencies the easiest method is using homebrew.

Assuming you have homebrew installed, you can run the following in the terminal:

brew update
brew install cmake openssl protobuf

Ubuntu/Debian setup

Run the following in the terminal

sudo apt update
# May prompt for location information
sudo apt install -y cmake pkg-config libssl-dev git build-essential clang libclang-dev curl protobuf-compiler

Clone the creditcoin repo

If you haven't already, you'll want to clone the creditcoin repo and cd into the resulting clone:

git clone https://github.com/gluwa/creditcoin
cd creditcoin

Build the creditcoin-node

You should now be able to build the creditcoin-node. It's a normal Rust project, so you can perform a release build (99% of the time you'll want a release build, a debug build is often too slow to be useful).

cargo build --release

Assuming the build completed without errors, you should have a creditcoin-node binary in your target directory. To make sure the binary works, you can try taking a look at the --help:

./target/release/creditcoin-node --help