kseo / foundry

A programmable open source blockchain engine

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Foundry Build Status Gitter: CodeChain License: AGPL v3

Foundry is a programmable open source blockchain engine.

Build

Download Foundry code

git clone git@github.com:CodeChain-io/foundry.git
cd foundry

Build in release mode

cargo build --release

This will produce an executable in the ./target/release directory.

Building From Source

Build Dependencies

Foundry requires Rust version 1.40.0 to build. Using rustup is recommended.

  • For Linux Systems:

    • Ubuntu

      gcc, g++ and make are required for installing packages.

      $ curl https://sh.rustup.rs -sSf | sh
  • For Mac Systems:

    • MacOS 10.13.2 (17C88) tested

      clang is 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 Foundry from source.

Download Foundry's source code and go into its directory.

git clone git@github.com:CodeChain-io/foundry.git
cd foundry

Build as Release Version

cargo build --release

This will produce an executable in the ./target/release directory.

Run

To run Foundry, just run

./target/release/foundry -c solo

You can create a block by sending a transaction through JSON-RPC or JavaScript SDK.

Formatting

Make sure you run rustfmt before creating a PR to the repo. You need to install the nightly-2019-12-19 version of rustfmt.

rustup toolchain install nightly-2019-12-19
rustup component add rustfmt --toolchain nightly-2019-12-19

To run rustfmt,

cargo +nightly-2019-12-19 fmt

Linting

You 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-2019-12-19 version of clippy.

Install

rustup toolchain install nightly-2019-12-19
rustup component add clippy --toolchain nightly-2019-12-19

Run

cargo +nightly-2019-12-19 clippy --all --all-targets

Testing

Developers 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.

License

CodeChain is licensed under the AGPL License - see the LICENSE file for details

About

A programmable open source blockchain engine

License:GNU Affero General Public License v3.0


Languages

Language:Rust 75.9%Language:TypeScript 23.8%Language:Shell 0.3%Language:Dockerfile 0.0%