Here is a step by step guide on how to build Conflux from the source code and get a node running.
Install Build Dependencies
Conflux requires Rust 1.42.0 to build,
sqlite to build.
We recommend installing Rust through rustup. If you don't already have
clang, you can install them like this:
Linux:$ curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh$ rustup install 1.42.0
Other dependencies including
cmake (version >= 3.1)and
sqlite (version >= 3.8.3)can be installed with:
Ubuntu 18.04:$ sudo apt-get install clang libsqlite3-dev pkg-config libssl-dev cmake
CentOS 7 / RHEL:$ sudo yum install epel-release$ sudo yum install clang gcc gcc-c++ openssl-devel cmake3 wget# This may fail if you have installed cmake with version 2.8.# You can choose to uninstall cmake first.$ sudo ln -s /usr/bin/cmake3 /usr/bin/cmake# The official sqlite version on CentOS 7 is 3.7.17, so we need to install the latest version from the source code.# The source code have be downloaded from https://www.sqlite.org/download.html$ wget https://www.sqlite.org/2020/sqlite-autoconf-3320100.tar.gz$ tar xfvz sqlite-autoconf-3320100.tar.gz$ cd sqlite-autoconf-3320100$ ./configure$ make$ sudo make install
OSX:$ curl https://sh.rustup.rs -sSf | sh$ rustup install 1.42.0
You might need to install
brewif you need to use it to install
clang:$ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
clangcomes with Xcode command line tools, and can also be installed with homebrew:$ brew install llvm
Make sure you have Visual Studio 2015 with C++ support installed. Next, download and run the
rustupinstaller from https://static.rust-lang.org/rustup/dist/x86_64-pc-windows-msvc/rustup-init.exe, start "VS2015 x64 Native Tools Command Prompt", and use the following command to install and set up the
msvctoolchain:$ rustup default stable-x86_64-pc-windows-msvc
clangcan be installed with LLVM. Pre-built binaries can be downloaded from Download LLVM. Make sure to add LLVM to the system PATH as instructed.
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 Code
After installing the dependencies mentioned above, now you can clone our repository and start building the executable binary:
This produces an executable in the
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 Dependencies
We have a test framework written in Python3 (version>=3.6). Required packages can be installed by running
solc is also required, and be installed as follows:
Ubuntusudo add-apt-repository ppa:ethereum/ethereumsudo apt-get updatesudo apt-get install solc
OSXbrew updatebrew upgradebrew tap ethereum/ethereumbrew install solidity
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.