All Projects → CodeChain-io → Codechain

CodeChain-io / Codechain

Licence: agpl-3.0
CodeChain's official implementation in Rust.

Programming Languages

rust
11053 projects

Projects that are alternatives of or similar to Codechain

Wavelet
Write once, run forever. Deploy robust, scalable, decentralized WebAssembly applications on Wavelet.
Stars: ✭ 224 (-8.2%)
Mutual labels:  blockchain
Eclair Mobile
An Android wallet for the Lightning Network
Stars: ✭ 231 (-5.33%)
Mutual labels:  blockchain
Blockchain Application Using Fabric Java Sdk
Create and Deploy a Blockchain Network using Hyperledger Fabric SDK Java
Stars: ✭ 237 (-2.87%)
Mutual labels:  blockchain
Composer Sample Networks
⚠️ ⚠️ ⚠️ Hyperledger Composer has been deprecated ⚠️ ⚠️ ⚠️
Stars: ✭ 226 (-7.38%)
Mutual labels:  blockchain
Electrum Axe
lightweight client for AXE network
Stars: ✭ 231 (-5.33%)
Mutual labels:  blockchain
Awesome Substrate
A curated list of awesome projects and resources related to the Substrate blockchain development framework.
Stars: ✭ 228 (-6.56%)
Mutual labels:  blockchain
Introducing Ethereum And Solidity
Programming examples from the book.
Stars: ✭ 221 (-9.43%)
Mutual labels:  blockchain
Corona Tracker
An easy-to-use PWA to monitor the user's wellness and learn about COVID-19.
Stars: ✭ 240 (-1.64%)
Mutual labels:  blockchain
Akash
a secure, transparent, and peer-to-peer cloud computing network
Stars: ✭ 229 (-6.15%)
Mutual labels:  blockchain
Go Seele
Seele is an open source blockchain project which consists of advanced sharding technology and our innovative anti-asic MPoW consensus algorithm. The ONLY official website is
Stars: ✭ 234 (-4.1%)
Mutual labels:  blockchain
Forest
🌲 Rust Filecoin Node Implementation
Stars: ✭ 225 (-7.79%)
Mutual labels:  blockchain
Remix Project
Remix is a browser-based compiler and IDE that enables users to build Ethereum contracts with Solidity language and to debug transactions.
Stars: ✭ 225 (-7.79%)
Mutual labels:  blockchain
Blockchain Python
A blockchain implementation in Python
Stars: ✭ 233 (-4.51%)
Mutual labels:  blockchain
Gxb Core
GXChain Blockchain implementation
Stars: ✭ 226 (-7.38%)
Mutual labels:  blockchain
Gochain
A basic implementation of Blockchain
Stars: ✭ 238 (-2.46%)
Mutual labels:  blockchain
Zero Chain
A privacy-preserving blockchain on Substrate
Stars: ✭ 224 (-8.2%)
Mutual labels:  blockchain
Rusty Blockparser
Bitcoin Blockchain Parser written in Rust language
Stars: ✭ 226 (-7.38%)
Mutual labels:  blockchain
Awesome Blockchain Kor
<블록체인의 정석>, <하이퍼레저 블록체인 개발> 소스코드 및 참고자료 저장소
Stars: ✭ 243 (-0.41%)
Mutual labels:  blockchain
Merkletreejs
🌱 Construct Merkle Trees and verify proofs in JavaScript.
Stars: ✭ 238 (-2.46%)
Mutual labels:  blockchain
Agregore Browser
A minimal browser for the distributed web
Stars: ✭ 229 (-6.15%)
Mutual labels:  blockchain

CodeChain Build Status Gitter: CodeChain License: AGPL v3

CodeChain is a programmable open source blockchain technology optimal for developing and customizing multi-asset management systems.

Build

Download CodeChain code

git clone [email protected]:CodeChain-io/codechain.git
cd codechain

Build in release mode

cargo build --release

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

Setup

Using Docker

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 kodebox/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 images

It will result in something like this:

REPOSITORY               TAG                  IMAGE ID            CREATED              SIZE
kodebox/codechain        branch_or_tag_name   6f8474d9bc7a        About a minute ago   1.85GB
ubuntu                   14.04                971bb384a50a        6 days ago           188MB

If you want to run the first image file, run the following command:

docker run -it kodebox/codechain:branch_or_tag_name

This should result in CodeChain running.

Making local database and keys persistent

CodeChain depends on the local database and keys commonly stored under the directories keys and db. A Docker container is independent of host environment and other Docker images. Therefore, when running a new Docker container with an image with a new CodeChain version or even with the same image, the database and keys are not persistent. To solve the problem, one can take advantage of the Docker's volume option. With the command below,

docker run -it -v codechain-db-vol:/app/codechain/db -v codechain-keys-vol:/app/codechain/keys kodebox/codechain:branch_or_tag_name

one can mount the volume codechain-db-vol into /app/db and the volume codechain-keys-vol into /app/keys in the container. This command will automatically create volumes if existing volumes with specified names do not exist. Because the default working directory specified in Dockerfile is /app/codechain, the default db and keys path are /app/codechain/db and app/codechian/keys. One can also customize the paths with CodeChain cli arguments base-path, key-path and db-path.

docker run -it -v codechain-db-vol:custom_base_path/db -v codechain-keys-vol:custom_base_path/keys kodebox/codechain:branch_or_tag_name --base-path custom_base_path
docker run -it -v codechain-db-vol:custom_db_path -v codechain-keys-vol:custom_keys_path kodebox/codechain:branch_or_tag_name --db-path custom_db_path --keys-path custom_keys_path

With the methods above, node organizers can manage their local persistent data using docker images.

Building From Source

Build Dependencies

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

  • For Linux Systems:

    • Ubuntu

      cmake, 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

      cmake and clang are 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 [email protected]:CodeChain-io/codechain.git
cd codechain

Build as Release Version

cargo build --release

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

Using CodeChain SDK

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

Run

To run CodeChain, just run

./target/release/codechain -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

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].