{"id":13746531,"url":"https://github.com/harmony-one/harmony","last_synced_at":"2025-05-13T21:09:44.254Z","repository":{"id":37319269,"uuid":"134344706","full_name":"harmony-one/harmony","owner":"harmony-one","description":"The core protocol of harmony","archived":false,"fork":false,"pushed_at":"2025-04-25T19:38:15.000Z","size":30894,"stargazers_count":1466,"open_issues_count":130,"forks_count":295,"subscribers_count":88,"default_branch":"main","last_synced_at":"2025-04-25T20:34:57.631Z","etag":null,"topics":["blockchain","bls","consensus","distributed-ledger-technology","harmony","harmony-protocol","pbft","proof-of-stake","sharding"],"latest_commit_sha":null,"homepage":"https://harmony.one","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"lgpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/harmony-one.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2018-05-22T01:37:50.000Z","updated_at":"2025-03-25T19:12:16.000Z","dependencies_parsed_at":"2022-07-14T07:10:30.395Z","dependency_job_id":"df1c08c7-f5c4-4ca3-92ec-bfa96f2787e3","html_url":"https://github.com/harmony-one/harmony","commit_stats":{"total_commits":6050,"total_committers":107,"mean_commits":56.54205607476636,"dds":0.8,"last_synced_commit":"cdb32b33c47d958ca69766754e4cfe73dbe7c68f"},"previous_names":["simple-rules/harmony-benchmark"],"tags_count":197,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/harmony-one%2Fharmony","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/harmony-one%2Fharmony/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/harmony-one%2Fharmony/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/harmony-one%2Fharmony/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/harmony-one","download_url":"https://codeload.github.com/harmony-one/harmony/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250894468,"owners_count":21504145,"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":["blockchain","bls","consensus","distributed-ledger-technology","harmony","harmony-protocol","pbft","proof-of-stake","sharding"],"created_at":"2024-08-03T06:00:55.051Z","updated_at":"2025-04-28T14:12:24.164Z","avatar_url":"https://github.com/harmony-one.png","language":"Go","funding_links":[],"categories":["Smart Contract Platforms"],"sub_categories":[],"readme":"# Harmony\n\n[![Build Status](https://travis-ci.com/harmony-one/harmony.svg?branch=main)](https://travis-ci.com/harmony-one/harmony)\n![gopherbadger-tag-do-not-edit](https://img.shields.io/badge/Go%20Coverage-45%25-brightgreen.svg?longCache=true\u0026style=flat)\n![Discord](https://img.shields.io/discord/532383335348043777.svg)\n[![Github Action](https://github.com/harmony-one/harmony/actions/workflows/ci.yaml/badge.svg?event=push)](https://github.com/harmony-one/harmony/actions/workflows/ci.yaml)\n[![Go Report Card](https://goreportcard.com/badge/github.com/harmony-one/harmony)](https://goreportcard.com/report/github.com/harmony-one/harmony)\n\n## General Documentation\n\nhttps://docs.harmony.one\n\n## API Guide\n\nhttp://api.hmny.io/\n\n## Requirements\n\n### **Go 1.22.5**\n### **GMP and OpenSSL**\n\nOn macOS:\n```bash\nbrew install gmp\nbrew install openssl\nsudo ln -sf /usr/local/opt/openssl@1.1 /usr/local/opt/openssl\n```\nOn Linux (Ubuntu)\n```bash\nsudo apt install libgmp-dev  libssl-dev  make gcc g++\n```\nOn Linux (Cent OS / Amazon Linux 2)\n```bash\nsudo yum install glibc-static gmp-devel gmp-static openssl-libs openssl-static gcc-c++\n```\n### **Docker** (for testing)\n\nOn macOS:\n```bash\nbrew install --cask docker\nopen /Applications/Docker.app\n```\nOn Linux, reference official documentation [here](https://docs.docker.com/engine/install/).\n### **Bash 4+**\n\nFor macOS, you can reference this [guide](http://tldrdevnotes.com/bash-upgrade-3-4-macos). For Linux, you can reference this [guide](https://fossbytes.com/installing-gnu-bash-4-4-linux-distros/).\n\n## Dev Environment\n\n**Most repos from [harmony-one](https://github.com/harmony-one) assumes the GOPATH convention. More information [here](https://github.com/golang/go/wiki/GOPATH).**\n\n### First Install\nClone and set up all of the repos with the following set of commands:\n\n1. Create the appropriate directories:\n```bash\nmkdir -p $(go env GOPATH)/src/github.com/harmony-one\ncd $(go env GOPATH)/src/github.com/harmony-one\n```\n\u003e If you get 'unknown command' or something along those lines, make sure to install [golang](https://golang.org/doc/install) first.\n\n2. Clone this repo \u0026 dependent repos.\n```bash\ngit clone https://github.com/harmony-one/mcl.git\ngit clone https://github.com/harmony-one/bls.git\ngit clone https://github.com/harmony-one/harmony.git\ncd harmony\n```\n\n3. Build the harmony binary \u0026 dependent libs\n```\ngo mod tidy\nmake\n```\n\u003e Run `bash scripts/install_build_tools.sh` to ensure build tools are of correct versions.\n\u003e If you get 'missing go.sum entry for module providing package \u003cpackage_name\u003e', run `go mod tidy`.\n\n## Dev Docker Image\n\nIncluded in this repo is a Dockerfile that has a full harmony development environment and\ncomes with emacs, vim, ag, tig and other creature comforts. Most importantly, it already has the go environment\nwith our C/C++ based library dependencies (`libbls` and `mcl`) set up correctly for you.\n\nYou can build the docker image for yourself with the following commands:\n```bash\ncd $(go env GOPATH)/src/github.com/harmony-one/harmony\nmake clean\ndocker build -t harmony .\n```\n\u003e If your build machine has an ARM-based chip, like Apple silicon (M1), the image is built for `linux/arm64` by default. To build for `x86_64`, apply the `--platform` arg like so:\n\u003e ```bash\n\u003e docker build --platform linux/amd64 -t harmony .\n\u003e ```\n\u003e Learn more about the `--platform` arg and multi-CPU architecture support, [here](https://docs.docker.com/engine/reference/builder/#automatic-platform-args-in-the-global-scope) and [here](https://docs.docker.com/desktop/multi-arch/).\n\n\n\nThen you can start your docker container with the following command:\n```bash\ndocker run --rm --name harmony -it -v \"$(go env GOPATH)/src/github.com/harmony-one/harmony:/root/go/src/github.com/harmony-one/harmony\" harmony /bin/bash\n```\n\u003e Note that the harmony repo will be shared between your docker container and your host machine. However, everything else in the docker container will be ephemeral.\n\nIf you need to open another shell, just do:\n```bash\ndocker exec -it harmony /bin/bash\n```\n\nLearn more about docker [here](https://docker-curriculum.com/).\n\n## Build\n\nThe `make` command should automatically build the Harmony binary \u0026 all dependent libs.\n\nHowever, if you wish to bypass the Makefile, first export the build flags:\n```bash\nexport CGO_CFLAGS=\"-I$GOPATH/src/github.com/harmony-one/bls/include -I$GOPATH/src/github.com/harmony-one/mcl/include -I/opt/homebrew/opt/openssl@1.1/include\"\nexport CGO_LDFLAGS=\"-L$GOPATH/src/github.com/harmony-one/bls/lib -L/opt/homebrew/opt/openssl@1.1/lib\"\nexport LD_LIBRARY_PATH=$GOPATH/src/github.com/harmony-one/bls/lib:$GOPATH/src/github.com/harmony-one/mcl/lib:/opt/homebrew/opt/openssl@1.1/lib\nexport LIBRARY_PATH=$LD_LIBRARY_PATH\nexport DYLD_FALLBACK_LIBRARY_PATH=$LD_LIBRARY_PATH\nexport GO111MODULE=on\n```\n\nThen you can build all executables with the following command:\n```bash\nbash ./scripts/go_executable_build.sh -S\n```\n\u003e Reference `bash ./scripts/go_executable_build.sh -h` for more build options\n\n## Debugging\n\nOne can start a local network (a.k.a localnet) with your current code using the following command:\n```bash\nmake debug\n```\n\u003e This localnet has 2 shards, with 11 nodes on shard 0 (+1 explorer node) and 10 nodes on shard 0 (+1 explorer node).\n\u003e\n\u003e The shard 0 endpoint will be on the explorer at `http://localhost:9599`. The shard 1 endpoint will be on the explorer at `http://localhost:9598`.\n\u003e\n\u003e You can view the localnet configuration at `/test/configs/local-resharding.txt`. The fields for the config are (space-delimited \u0026 in order) `ip`, `port`, `mode`, `bls_pub_key`, and `shard` (optional).\n\nOne can force kill the local network with the following command:\n```bash\nmake debug-kill\n```\n\u003e You can view all make commands with `make help`\n\n## Testing\n\nTo keep things consistent, we have a docker image to run all tests. **These are the same tests ran on the pull request checks**.\n\nNote that all test Docker containers bind several ports to the host machine for your convenience. The ports are:\n* `9500` - Shard 0 RPC for a validator\n* `9501` - Shard 1 RPC for a validator\n* `9599` - Shard 0 RPC for an explorer\n* `9598` - Shard 1 RPC for an explorer\n* `9799` - Shard 0 Rosetta (for an explorer)\n* `9798` - Shard 1 Rosetta (for an explorer)\n* `9899` - Shard 0 WS for an explorer\n* `9898` - Shard 1 WS for an explorer\n\u003e This allows you to use curl, hmy CLI, postman, rosetta-cli, etc... on your host machine to play with or probe the localnet that was used for the test.\n\n### Go tests\nTo run this test, do:\n```bash\nmake test-go\n```\nThis test runs the go tests along with go lint, go fmt, go imports, go mod, and go generate checks.\n\n### RPC tests\nTo run this test, do:\n```bash\nmake test-rpc\n```\nThis test starts a localnet (within the Docker container), **ensures it reaches a consensus**, and runs a series of tests to ensure correct RPC behavior.\nThis test also acts as a preliminary integration test (more thorough tests are done on the testnets).\n\u003e The tests ran by this command can be found [here](https://github.com/harmony-one/harmony-test/tree/master/localnet).\n\nIf you wish to debug further with the localnet after the tests are done, open a new shell and run:\n```bash\nmake test-rpc-attach\n```\n\u003e This will open a shell in the docker container that is running the Node API tests.\n\u003e\n\u003e Note that the docker container has the [Harmony CLI](https://docs.harmony.one/home/wallets/harmony-cli) on path,\n\u003e therefore you can use that to debug if needed. For example, one could do `hmy blockchain latest-headers` to check\n\u003e the current block height of localnet. Reference the documentation for the CLI [here](https://docs.harmony.one/home/wallets/harmony-cli)\n\u003e for more details \u0026 commands.\n\n### Rosetta tests\nTo run this test, do:\n```bash\nmake test-rosetta\n```\nThis test starts a localnet (within the Docker container), **ensures it reaches a consensus**, and runs the Construction \u0026 Data API checks using the [rosetta-cli](https://github.com/coinbase/rosetta-cli).\nThis test also acts as a preliminary integration test (more thorough tests are done on the testnets).\n\u003e The config for this test can be found [here](https://github.com/harmony-one/harmony-test/blob/master/localnet/configs/localnet_rosetta_test_s0.json) \u0026 [here](https://github.com/harmony-one/harmony-test/blob/master/localnet/configs/localnet_rosetta_test_s1.json)\n\nSimilar to the RPC tests, if you wish to debug further with the localnet after the tests are done, open a new shell and run:\n```bash\nmake test-rosetta-attach\n```\n\n## License\n\nHarmony is licensed under GNU Lesser General Public License v3.0. See [`LICENSE`](LICENSE) file for\nthe terms and conditions.\n\nHarmony includes third-party open-source code. In general, a source subtree\nwith a `LICENSE` or `COPYRIGHT` file is from a third party, and our\nmodifications thereto are licensed under the same third-party open source\nlicense.\n\nAlso please see [our Fiduciary License Agreement](FLA.md) if you are\ncontributing to the project. By your submission of your contribution to us, you\nand we mutually agree to the terms and conditions of the agreement.\n\n## Contributing To Harmony\n\nSee [`CONTRIBUTING`](CONTRIBUTING.md) for details.\n\n## Development Status\n\n### Finished Features\n\n- Fully sharded network with beacon chain and shard chains\n- Sharded P2P network and P2P gossiping\n- FBFT (Fast Byzantine Fault Tolerance) Consensus with BLS multi-signature\n- Consensus view-change protocol\n- Account model and support for Solidity\n- Cross-shard transaction\n- VRF (Verifiable Random Function) and VDF (Verifiable Delay Function)\n- Cross-links\n- EPoS staking mechanism\n- Kademlia routing\n\n### Planned Features\n\n- Resharding\n- Integration with WASM\n- Fast state synchronization\n- Auditable privacy asset using ZK proof\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fharmony-one%2Fharmony","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fharmony-one%2Fharmony","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fharmony-one%2Fharmony/lists"}