https://github.com/codechain-io/foundry
A programmable open source blockchain engine
https://github.com/codechain-io/foundry
Last synced: 7 months ago
JSON representation
A programmable open source blockchain engine
- Host: GitHub
- URL: https://github.com/codechain-io/foundry
- Owner: CodeChain-io
- License: gpl-3.0
- Created: 2019-12-15T14:17:12.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2023-01-20T22:40:18.000Z (over 2 years ago)
- Last Synced: 2023-03-02T04:16:27.349Z (over 2 years ago)
- Language: Rust
- Homepage:
- Size: 10.8 MB
- Stars: 38
- Watchers: 11
- Forks: 12
- Open Issues: 87
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
Foundry
[](https://travis-ci.com/CodeChain-io/foundry)
[](https://discord.gg/xhpdXm7)
[](https://www.gnu.org/licenses/gpl-3.0)
==============CodeChain Foundry is a blockchain engine based on a composable module system called Mold.
Users can write their own modules in addition to bringing in those written by others
in order 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 the application configurable as possible
and foster an ecosystem of reusable modules, while reusing the underlying consensus engine across all the different kinds of applications.Upon execution of a transaction that is essentially a state transition, the coordinator will be told to execute the transaction 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 those modules will handle the executions of the transactions,
which might also involve communications with other modules.## Build
Download Foundry code
```sh
git clone [email protected]:CodeChain-io/foundry.git
cd foundry
```Build in release mode
```sh
cargo build --release
```This will produce an executable in the `./target/release` directory.
### Building From Source
#### Build Dependencies
Foundry requires Rust version 1.47.0 to build. Using [rustup](https://rustup.rs/ "rustup URL") is recommended.- For Linux Systems:
- Ubuntu> `gcc`, `g++` and `make` are required for installing packages.
```sh
$ curl https://sh.rustup.rs -sSf | sh
```
- For Mac Systems:
- MacOS 10.13.2 (17C88) tested
> `clang` is required for installing packages.```sh
$ curl https://sh.rustup.rs -sSf | sh
```
- For Windows Systems:
- Currently not supported for Windows. If on a Windows system, please install [WSL](https://docs.microsoft.com/en-us/windows/wsl/install-win10) 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.
```sh
git clone [email protected]:CodeChain-io/foundry.git
cd foundry
```#### Build as Release Version
```sh
cargo build --release
```This will produce an executable in the ./target/release directory.
## Formatting
Make sure you run `rustfmt` before creating a PR to the repo. You need to install the nightly-2020-10-20 version of `rustfmt`.
```sh
rustup toolchain install nightly-2020-10-20
rustup component add rustfmt --toolchain nightly-2020-10-20
```To run `rustfmt`,
```sh
cargo +nightly-2020-10-20 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](https://rust-lang.github.io/rust-clippy/master/index.html) for more information.
You need to install the stable version of `clippy`.### Install
```sh
rustup component add clippy
```### Run
```sh
cargo clippy --all --all-targets
```## Testing
Run `cargo test --all` for unit tests.
See `/integration-test/README.md` for integration tests.## License
CodeChain is licensed under the GPL License - see the [LICENSE](https://github.com/CodeChain-io/foundry/blob/master/LICENSE) file for details