CodeChain Foundry is a blockchain engine based on a composable module system, called Mold. Users can write their own modules and additionally bring those written by others in to construct an arbitrary blockchain application. The reason why we provide such a composable and user-configurable module system is because we want to make as much of an application configurable as possible and foster an ecosystem of reusable modules, while reusing the underlying consensus engine across all the different kinds of applications.
On an execution of a transaction, that is essentially a state transition, the coordinator will be told to do so from the underlying consensus engine. Then the coordinator literally coordinates multiple modules constituting an application by invoking services exported by the modules to the coordinator in an appropriate order passing appropriate arguments. Transactions will be delivered to the responsible modules, and that the modules will handle the executions of the transactions, which might also involve communications with other modules.
Download Foundry code
git clone [email protected]:CodeChain-io/foundry.git
cd foundry
Build in release mode
cargo build --release
This will produce an executable in the ./target/release
directory.
Foundry requires Rust version 1.45.2 to build. Using rustup is recommended.
-
For Linux Systems:
-
Ubuntu
gcc
,g++
andmake
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 [email protected]:CodeChain-io/foundry.git
cd foundry
cargo build --release
This will produce an executable in the ./target/release directory.
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.
Make sure you run rustfmt
before creating a PR to the repo. You need to install the nightly-2020-07-27 version of rustfmt
.
rustup toolchain install nightly-2020-07-27
rustup component add rustfmt --toolchain nightly-2020-07-27
To run rustfmt
,
cargo +nightly-2020-07-27 fmt
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-2020-07-27 version of clippy
.
rustup toolchain install nightly-2020-07-27
rustup component add clippy --toolchain nightly-2020-07-27
cargo +nightly-2020-07-27 clippy --all --all-targets
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.
CodeChain is licensed under the GPL License - see the LICENSE file for details