Compile from Source
Here is a step by step guide on how to build Conflux from the source code and get a node running.
#
Install Build DependenciesConflux requires Rust 1.68.0, clang
, and sqlite
to build.
We recommend installing Rust through rustup. If you don't already have rustup
or clang
, you can install them like this:
#
LinuxOther dependencies including clang
, cmake (version >= 3.12)
and sqlite (version >= 3.8.3)
can be installed with:
- Ubuntu 18.04:
- CentOS 7 / RHEL:
#
OSXYou might need to install brew
if you need to use it to install clang
:
clang
comes with Xcode command line tools, and can also be installed with homebrew:
You also need to install other dependencies with homebrew and set up the environment variables as described after the installation:
#
WindowsFor some compatibility issues of rocksdb
, we'll need Visual Studio 15 2017 installed (installer link).
Download and run the rustup
installer from this link. It will also has a prompt where you can choose to install a community version. Following the installer you will have tool chain version stable-x86_64-pc-windows-msvc
installed and the environment variable PATH
updated.
You also need to have git
, cmake
, openssl
, and clang
installed. git
can be downloaded from Git for Windows, and cmake
can be downloaded from cmake-3.25.2. clang
can be installed with LLVM. Pre-built binaries can be downloaded from Download LLVM. Make sure to choose to add LLVM
and cmake
to the system PATH during the installation process. openssl
can be downloaded from Win64 OpenSSL v3.0.8. Make sure to choose to copy the OpenSSL DLL to the Windows system directory. And you also need to set the environment variable OPENSSL_DIR
to the installation directory, which by default is C:\Program Files\OpenSSL-Win64
.
Make sure that these binaries are in your PATH
(the instruction will be shown after installing rustup
). After that, you should be able to build Conflux from source.
#
Build from Source CodeAfter installing the dependencies mentioned above, now you can clone our repository and start building the executable binary:
This produces an executable in the ./target/release
subdirectory.
Note, when compiling a crate and you receive errors, it's in most cases your outdated version of Rust, or some of your crates have to be recompiled. Cleaning the repository will most likely solve the issue if you are on the latest stable version of Rust, try:
To start running a Conflux full node, you can follow the instructions at Running Conflux Full Node.
#
Install Test DependenciesWe have a test framework written in Python3 (version>=3.6). Required packages can be installed by running
Solidity compiler solc
is also required, and be installed as follows:
- Ubuntu
- OSX
- Others
You can follow the detailed instructions at Installing the Solidity Compiler.
Note that latest solidity compiler may be incompatible with Conflux and may cause the integration test to fail. If you encounter such problem, please install solidity compiler version 0.5.2.
To run tests, you can build the source code first and follow the instructions at Running Test.