{"id":21177277,"url":"https://github.com/codechain-io/codechain","last_synced_at":"2025-04-06T12:10:37.315Z","repository":{"id":37431138,"uuid":"118557921","full_name":"CodeChain-io/codechain","owner":"CodeChain-io","description":"CodeChain's official implementation in Rust.","archived":false,"fork":false,"pushed_at":"2023-01-07T03:21:06.000Z","size":30048,"stargazers_count":258,"open_issues_count":64,"forks_count":51,"subscribers_count":25,"default_branch":"master","last_synced_at":"2025-03-30T11:07:23.331Z","etag":null,"topics":["asset","blockchain","digital-securities","rust","tokenization"],"latest_commit_sha":null,"homepage":"https://codechain.io/","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/CodeChain-io.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-01-23T04:31:56.000Z","updated_at":"2025-03-17T16:25:44.000Z","dependencies_parsed_at":"2023-02-06T11:01:33.312Z","dependency_job_id":null,"html_url":"https://github.com/CodeChain-io/codechain","commit_stats":null,"previous_names":[],"tags_count":16,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CodeChain-io%2Fcodechain","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CodeChain-io%2Fcodechain/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CodeChain-io%2Fcodechain/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CodeChain-io%2Fcodechain/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/CodeChain-io","download_url":"https://codeload.github.com/CodeChain-io/codechain/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247478324,"owners_count":20945266,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["asset","blockchain","digital-securities","rust","tokenization"],"created_at":"2024-11-20T17:15:23.241Z","updated_at":"2025-04-06T12:10:37.287Z","avatar_url":"https://github.com/CodeChain-io.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"CodeChain [![Build Status](https://travis-ci.org/CodeChain-io/codechain.svg?branch=master)](https://travis-ci.org/CodeChain-io/codechain) [![Gitter: CodeChain](https://img.shields.io/badge/gitter-codechain-4AB495.svg)](https://gitter.im/CodeChain-io/codechain) [![License: AGPL v3](https://img.shields.io/badge/License-AGPL%20v3-blue.svg)](https://www.gnu.org/licenses/agpl-3.0)\n==============\n\nCodeChain is a programmable open source blockchain technology optimal for developing and customizing multi-asset management systems.\n\n## Build\n\nDownload CodeChain code\n\n```sh\ngit clone git@github.com:CodeChain-io/codechain.git\ncd codechain\n```\n\nBuild in release mode\n\n```sh\ncargo build --release\n```\n\nThis will produce an executable in the `./target/release` directory.\n\n## Setup\n\n### Using Docker\n\nCodeChain 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\nneeds to get CodeChain up and running. In order to get the installation package, run the following command after installing Docker:\n\n```sh\ndocker build -f docker/ubuntu/Dockerfile --tag kodebox/codechain:branch_or_tag_name .\n```    \n\nWSL 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,\nit is necessary to enable Hyper-V in BIOS settings.\n\nTo see the Docker images created, run the following:\n```sh\ndocker images\n```\n\nIt will result in something like this:\n```sh\nREPOSITORY               TAG                  IMAGE ID            CREATED              SIZE\nkodebox/codechain        branch_or_tag_name   6f8474d9bc7a        About a minute ago   1.85GB\nubuntu                   14.04                971bb384a50a        6 days ago           188MB\n```\n    \nIf you want to run the first image file, run the following command:\n```sh\ndocker run -it kodebox/codechain:branch_or_tag_name\n```\n\nThis should result in CodeChain running.\n\n#### Making local database and keys persistent\n\nCodeChain 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,\n```sh\ndocker run -it -v codechain-db-vol:/app/codechain/db -v codechain-keys-vol:/app/codechain/keys kodebox/codechain:branch_or_tag_name\n```\none 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`.\n\n```sh\ndocker 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\n```\n\n```sh\ndocker 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\n```\nWith the methods above, node organizers can manage their local persistent data using docker images.\n\n### Building From Source\n\n#### Build Dependencies\nCodeChain requires Rust version 1.40.0 to build. Using [rustup](https://rustup.rs/ \"rustup URL\") is recommended.\n\n- For Linux Systems:\n  - Ubuntu\n\n    \u003e `cmake`, `gcc`, `g++` and `make` are required for installing packages.\n    ```sh\n    $ curl https://sh.rustup.rs -sSf | sh\n    ```\n        \n\n- For Mac Systems:\n  - MacOS 10.13.2 (17C88) tested\n    \u003e `cmake` and `clang` are required for installing packages.\n\n    ```sh\n    $ curl https://sh.rustup.rs -sSf | sh\n    ```\n        \n\n- For Windows Systems:\n  - 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.\n\nPlease make sure that all of the binaries above are included in your `PATH`. These conditions must be fulfilled before building CodeChain from source.\n\n\nDownload CodeChain's source code and go into its directory.\n```sh\ngit clone git@github.com:CodeChain-io/codechain.git\ncd codechain\n```\n\n#### Build as Release Version\n```sh\ncargo build --release\n```\n\nThis will produce an executable in the ./target/release directory.\n\n### Using CodeChain SDK\n\nBefore starting to use the CodeChain SDK, please install node.js by going to this [page](https://nodejs.org/en/).\n\nNext, install the package with the following command:\n\n`npm install codechain-sdk` or `yarn add codechain-sdk`\n\n## Run\n\nTo run CodeChain, just run\n\n```sh\n./target/release/codechain -c solo\n```\nYou can create a block by sending a transaction through [JSON-RPC](https://github.com/CodeChain-io/codechain/blob/master/spec/JSON-RPC.md) or [JavaScript SDK](https://api.codechain.io/).\n\n## Formatting\n\n\nMake sure you run `rustfmt` before creating a PR to the repo. You need to install the nightly-2019-12-19 version of `rustfmt`.\n\n```sh\nrustup toolchain install nightly-2019-12-19\nrustup component add rustfmt --toolchain nightly-2019-12-19\n```\n\nTo run `rustfmt`,\n\n```sh\ncargo +nightly-2019-12-19 fmt\n```\n\n## Linting\n\nYou should run `clippy` also. This is a lint tool for rust. It suggests more efficient/readable code.\nYou can see [the clippy document](https://rust-lang.github.io/rust-clippy/master/index.html) for more information.\nYou need to install the nightly-2019-12-19 version of `clippy`.\n\n### Install\n```sh\nrustup toolchain install nightly-2019-12-19\nrustup component add clippy --toolchain nightly-2019-12-19\n```\n\n### Run\n\n```sh\ncargo +nightly-2019-12-19 clippy --all --all-targets\n```\n\n## Testing\n\nDevelopers 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](https://github.com/CodeChain-io/codechain/wiki/Unit-Tests).\n\n## License\nCodeChain is licensed under the AGPL License - see the [LICENSE](https://github.com/CodeChain-io/codechain/blob/master/LICENSE) file for details\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodechain-io%2Fcodechain","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcodechain-io%2Fcodechain","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodechain-io%2Fcodechain/lists"}