Skip to content
A programmable open source blockchain engine
Rust TypeScript Other
Branch: master
Clone or download
sgkim126 Refactor BodyDownloader
There are 5 states for block hashes.
1. listed, but no request sent
2. sent the request
3. received the response
4. drained from the list
5. imported on the chain

Currently, these states are implicit with the combination of targets,
downloading, and downloaded fields.
This patch merges downloading and downloaded fields, and make the states
explicit.
Latest commit 7a0339a Jan 26, 2020
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.github/workflows Upgrade rust toolchains Jan 13, 2020
.travis Fix not to swallow errors Jul 25, 2019
core Bug fix in on_request_commit_message method Feb 14, 2020
discovery Upgrade codechain-crypto to 0.2.0 Feb 12, 2020
docker Use cache when installing libssl-dev in the docker image Jul 2, 2019
foundry Remove the concepts of the regular key Feb 14, 2020
json Remove the concepts of the regular key Feb 14, 2020
key Upgrade codechain-crypto to 0.2.0 Feb 12, 2020
keystore Upgrade codechain-crypto to 0.2.0 Feb 12, 2020
network Upgrade codechain-crypto to 0.2.0 Feb 12, 2020
rpc Remove the concepts of the regular key Feb 14, 2020
scripts Add logstash config May 9, 2018
spec Remove the concepts of the regular key Feb 14, 2020
state Remove the concepts of the regular key Feb 14, 2020
sync Refactor BodyDownloader Feb 16, 2020
test Remove the concepts of the regular key Feb 14, 2020
types Remove the concepts of the regular key Feb 14, 2020
util Export the codechain-merkle module to the merkle-trie package Jan 20, 2020
vm Upgrade codechain-crypto to 0.2.0 Feb 12, 2020
.dockerignore Add files to the .dockerignore Apr 25, 2019
.editorconfig Reformat Github Actions workflows Oct 29, 2019
.gitignore Add .vscode to gitignore file Sep 18, 2018
.mergify.yml Use github actions for lint and unit test tasks Oct 18, 2019
.travis.yml Update .travis.yml to send notifications to the Foundry Gitter room Feb 13, 2020
CHANGELOG.md Log the change of 1.4.0 Jun 17, 2019
CODE_OF_CONDUCT.md Change the team email to hi@codechain.io Apr 23, 2019
CONTRIBUTING.md Create CONTRIBUTING.md Jun 18, 2018
Cargo.lock Add a new field 'validator set root' in the header Feb 13, 2020
Cargo.toml Upgrade codechain-crypto to 0.2.0 Feb 12, 2020
LICENSE Add LICENSE file Feb 4, 2018
README.md Use the Gitter room for Foundry Feb 14, 2020
build.rs Run cargo fmt Dec 21, 2019
clippy.toml Install rust-clippy Dec 2, 2018
docker_push.sh Change name of the "docker_push" script to "docker_push.sh" Jul 24, 2018
logstash.conf Add logstash config May 9, 2018
rust-toolchain Upgrade Rust to 1.40.0 Jan 10, 2020
rustfmt.toml Upgrade rust toolchains Nov 8, 2019

README.md

Foundry Build Status Gitter: Foundry 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

You can’t perform that action at this time.