CodeChain is a programmable open source blockchain technology optimal for developing and customizing multi-asset management systems.
Download CodeChain code
git clone git@github.com:CodeChain-io/codechain.git cd codechainBuild in release mode
cargo build --releaseThis will produce an executable in the ./target/release directory.
CodeChain supports the use of Docker to provide an easy and seamless installation process by providing a single package that gives the user everything he/she needs to get CodeChain up and running. In order to get the installation package, run the following command after installing Docker:
docker build -f docker/ubuntu/Dockerfile --tag codechain-io/codechain:branch_or_tag_name .WSL users may find difficulty in using Docker, and thus, it is highly recommended to use Ubuntu, or install Docker for Windows. When using Docker for Windows, it is necessary to enable Hyper-V in BIOS settings.
To see the Docker images created, run the following:
docker imagesIt will result in something like this:
REPOSITORY TAG IMAGE ID CREATED SIZE codechain-io/codechain branch_or_tag_name 6f8474d9bc7a About a minute ago 1.85GB ubuntu 14.04 971bb384a50a 6 days ago 188MBIf you want to run the first image file, run the following command:
docker run -it codechain-io/codechain:branch_or_tag_nameThis should result in CodeChain running.
CodeChain requires Rust version 1.34.0 to build. Using rustup is recommended.
-
For Linux Systems:
-
Ubuntu
gcc,g++andmakeare required for installing packages.$ curl https://sh.rustup.rs -sSf | sh
-
-
For Mac Systems:
-
MacOS 10.13.2 (17C88) tested
clangis required for installing packages.$ curl https://sh.rustup.rs -sSf | sh
-
-
For Windows Systems:
- Currently not supported for Windows. If on a Windows system, please install WSL to continue as Ubuntu.
Please make sure that all of the binaries above are included in your PATH. These conditions must be fulfilled before building CodeChain from source.
Download CodeChain's source code and go into its directory.
git clone git@github.com:CodeChain-io/codechain.git cd codechaincargo build --releaseThis will produce an executable in the ./target/release directory.
Before starting to use the CodeChain SDK, please install node.js by going to this page.
Next, install the package with the following command:
npm install codechain-sdk or yarn add codechain-sdk
To run CodeChain, just run
./target/release/codechain -c soloYou can create a block by sending a parcel through JSON-RPC or JavaScript SDK.
Make sure you run rustfmt before creating a PR to the repo. You need to install the nightly-2018-12-06 version of rustfmt.
rustup toolchain install nightly-2018-12-06 rustup component add rustfmt-preview --toolchain nightly-2018-12-06To run rustfmt,
cargo +nightly-2018-12-06 fmtYou should run clippy also. This is a lint tool for rust. It suggests more efficient/readable code. You can see the clippy document for more information. You need to install the nightly-2018-12-06 version of clippy.
rustup toolchain install nightly-2018-12-06 rustup component add clippy-preview --toolchain nightly-2018-12-06cargo +nightly-2018-12-06 clippy --all --all-targetsDevelopers are strongly encouraged to write unit tests for new code, and to submit new unit tests for old code. Unit tests can be compiled and run with: cargo test --all. For more details, please reference Unit Tests.
Under docs folder, run following command.
make htmlUser manual will be generated at docs/_build/html.
CodeChain is licensed under the AGPL License - see the LICENSE file for details