{"id":13608286,"url":"https://github.com/mosaicnetworks/babble","last_synced_at":"2026-01-23T12:02:52.781Z","repository":{"id":41247879,"uuid":"108152410","full_name":"mosaicnetworks/babble","owner":"mosaicnetworks","description":"Distributed Consensus Middleware","archived":false,"fork":false,"pushed_at":"2024-02-27T09:15:51.000Z","size":85108,"stargazers_count":484,"open_issues_count":7,"forks_count":94,"subscribers_count":47,"default_branch":"master","last_synced_at":"2026-01-15T07:06:49.649Z","etag":null,"topics":["consensus-algorithm","hashgraph"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mosaicnetworks.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-10-24T16:14:40.000Z","updated_at":"2025-12-23T20:09:26.000Z","dependencies_parsed_at":"2022-07-14T10:48:32.515Z","dependency_job_id":"a5886833-1ee4-4d8d-b22b-ba9f3b827f3c","html_url":"https://github.com/mosaicnetworks/babble","commit_stats":null,"previous_names":["babbleio/babble"],"tags_count":34,"template":false,"template_full_name":null,"purl":"pkg:github/mosaicnetworks/babble","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mosaicnetworks%2Fbabble","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mosaicnetworks%2Fbabble/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mosaicnetworks%2Fbabble/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mosaicnetworks%2Fbabble/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mosaicnetworks","download_url":"https://codeload.github.com/mosaicnetworks/babble/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mosaicnetworks%2Fbabble/sbom","scorecard":{"id":222315,"data":{"date":"2025-08-11","repo":{"name":"github.com/mosaicnetworks/babble","commit":"ecab6509df8220b75ddc1466d8b5c7a5641727eb"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":1.4,"checks":[{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Code-Review","score":0,"reason":"Found 0/30 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Signed-Releases","score":0,"reason":"Project has not signed or included provenance with any releases.","details":["Warn: release artifact v0.8.5 not signed: https://api.github.com/repos/mosaicnetworks/babble/releases/46006748","Warn: release artifact v0.8.4 not signed: https://api.github.com/repos/mosaicnetworks/babble/releases/35817247","Warn: release artifact v0.8.3 not signed: https://api.github.com/repos/mosaicnetworks/babble/releases/32399212","Warn: release artifact v0.8.2 not signed: https://api.github.com/repos/mosaicnetworks/babble/releases/32122119","Warn: release artifact v0.8.1 not signed: https://api.github.com/repos/mosaicnetworks/babble/releases/27164181","Warn: release artifact v0.8.5 does not have provenance: https://api.github.com/repos/mosaicnetworks/babble/releases/46006748","Warn: release artifact v0.8.4 does not have provenance: https://api.github.com/repos/mosaicnetworks/babble/releases/35817247","Warn: release artifact v0.8.3 does not have provenance: https://api.github.com/repos/mosaicnetworks/babble/releases/32399212","Warn: release artifact v0.8.2 does not have provenance: https://api.github.com/repos/mosaicnetworks/babble/releases/32122119","Warn: release artifact v0.8.1 does not have provenance: https://api.github.com/repos/mosaicnetworks/babble/releases/27164181"],"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: containerImage not pinned by hash: docker/babble/Dockerfile:1: pin your Docker image by updating alpine to alpine@sha256:4bcff63911fcb4448bd4fdacec207030997caf25e9bea4045fa6c8c44de311d1","Warn: containerImage not pinned by hash: docker/dummy/Dockerfile:1: pin your Docker image by updating alpine to alpine@sha256:4bcff63911fcb4448bd4fdacec207030997caf25e9bea4045fa6c8c44de311d1","Warn: containerImage not pinned by hash: docker/glider/Dockerfile:1: pin your Docker image by updating circleci/golang:1.13.0 to circleci/golang:1.13.0@sha256:2b645a610dd61dbdcdc0a77c723278edd3ebe481fc3cc4f8e7b8793390e5de11","Warn: containerImage not pinned by hash: docker/mobile/Dockerfile:3: pin your Docker image by updating openjdk:8 to openjdk:8@sha256:86e863cc57215cfb181bd319736d0baf625fe8f150577f9eb58bd937f5452cb8","Warn: containerImage not pinned by hash: docker/signal/Dockerfile:1: pin your Docker image by updating alpine to alpine@sha256:4bcff63911fcb4448bd4fdacec207030997caf25e9bea4045fa6c8c44de311d1","Warn: containerImage not pinned by hash: docker/watcher/Dockerfile:1: pin your Docker image by updating alpine to alpine@sha256:4bcff63911fcb4448bd4fdacec207030997caf25e9bea4045fa6c8c44de311d1","Warn: goCommand not pinned by hash: docker/glider/Dockerfile:5","Warn: goCommand not pinned by hash: docker/mobile/Dockerfile:94","Warn: goCommand not pinned by hash: docker/mobile/Dockerfile:95","Info:   0 out of   6 containerImage dependencies pinned","Info:   0 out of   3 goCommand dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Vulnerabilities","score":0,"reason":"34 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GO-2022-1098 / GHSA-2chg-86hq-7w38","Warn: Project is vulnerable to: GO-2024-2818 / GHSA-3jgf-r68h-xfqm","Warn: Project is vulnerable to: GO-2024-3189 / GHSA-27vh-h6mc-q6g8","Warn: Project is vulnerable to: GO-2022-0460 / GHSA-cm8f-h6j3-p25c","Warn: Project is vulnerable to: GO-2022-0461 / GHSA-cx94-mrg9-rq4j","Warn: Project is vulnerable to: GO-2022-0462 / GHSA-w45j-f832-hxvh","Warn: Project is vulnerable to: GO-2023-1534 / GHSA-4xgv-j62q-h3rj","Warn: Project is vulnerable to: GO-2023-1535 / GHSA-hxp2-xqf3-v83h","Warn: Project is vulnerable to: GO-2020-0012 / GHSA-ffhg-7mh4-33c4","Warn: Project is vulnerable to: GO-2021-0227 / GHSA-3vm4-22fp-5rfm","Warn: Project is vulnerable to: GO-2022-0968 / GHSA-gwc9-m7rh-j2ww","Warn: Project is vulnerable to: GO-2021-0356 / GHSA-8c26-wmh5-6g9v","Warn: Project is vulnerable to: GO-2024-2961","Warn: Project is vulnerable to: GO-2023-2402 / GHSA-45x7-px36-x8w8","Warn: Project is vulnerable to: GO-2024-3321 / GHSA-v778-237x-gjrc","Warn: Project is vulnerable to: GO-2025-3487 / GHSA-hcg3-q754-cr77","Warn: Project is vulnerable to: GO-2022-0236 / GHSA-h86h-8ppg-mxmh","Warn: Project is vulnerable to: GO-2021-0238 / GHSA-83g2-8m93-v3w7","Warn: Project is vulnerable to: GO-2022-0288","Warn: Project is vulnerable to: GO-2022-0969 / GHSA-69cg-p879-7622","Warn: Project is vulnerable to: GO-2022-1144 / GHSA-xrjj-mj9h-534m","Warn: Project is vulnerable to: GO-2023-1571 / GHSA-vvpx-j8f3-3w6h","Warn: Project is vulnerable to: GO-2023-1988 / GHSA-2wrh-6pvc-2jm9","Warn: Project is vulnerable to: GO-2023-2102 / GHSA-4374-p667-p6c8","Warn: Project is vulnerable to: GHSA-qppj-fm5r-hxr3","Warn: Project is vulnerable to: GO-2024-2687 / GHSA-4v7x-pqxf-cx7m","Warn: Project is vulnerable to: GO-2024-3333","Warn: Project is vulnerable to: GO-2025-3503 / GHSA-qxp5-gwg8-xv66","Warn: Project is vulnerable to: GO-2025-3595 / GHSA-vvgc-356p-c3xw","Warn: Project is vulnerable to: GO-2022-0493 / GHSA-p782-xgp4-8hr8","Warn: Project is vulnerable to: GO-2020-0015 / GHSA-5rcv-m4m3-hfh7","Warn: Project is vulnerable to: GO-2021-0113 / GHSA-ppp9-7jff-5vj2","Warn: Project is vulnerable to: GO-2022-1059 / GHSA-69ch-w2m2-3vjp","Warn: Project is vulnerable to: GO-2020-0036 / GHSA-wxc4-f4m6-wwqv"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-17T02:52:46.932Z","repository_id":41247879,"created_at":"2025-08-17T02:52:46.932Z","updated_at":"2025-08-17T02:52:46.932Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28690612,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-23T11:01:27.039Z","status":"ssl_error","status_checked_at":"2026-01-23T11:00:26.909Z","response_time":59,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["consensus-algorithm","hashgraph"],"created_at":"2024-08-01T19:01:25.985Z","updated_at":"2026-01-23T12:02:52.744Z","avatar_url":"https://github.com/mosaicnetworks.png","language":"Go","funding_links":[],"categories":["Other APIs","Go"],"sub_categories":[],"readme":"# BABBLE\n\n[![GoDoc](https://godoc.org/github.com/mosaicnetworks/babble?status.svg)](https://godoc.org/github.com/mosaicnetworks/babble)\n[![CircleCI](https://circleci.com/gh/mosaicnetworks/babble.svg?style=svg)](https://circleci.com/gh/mosaicnetworks/babble)\n[![Documentation Status](https://readthedocs.org/projects/babbleio/badge/?version=latest)](https://babbleio.readthedocs.io/en/latest/?badge=latest)\n[![Go Report](https://goreportcard.com/badge/github.com/mosaicnetworks/babble)](https://goreportcard.com/report/github.com/mosaicnetworks/babble)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n\n![Babble network](docs/assets/babble-network.png)\n\nBabble is a distributed consensus engine designed to easily plug into any \napplication. It uses peer-to-peer networking and a consensus algorithm to \nguarantee that a group of connected computers process the same commands in the \nsame order.\n\n## Table of Contents\n * [Features](#features)\n * [Consensus](#consensus)\n * [API](#api)\n * [Configuration](#configuration)\n    + [Data Directory](#data-directory)\n    + [Key](#key)\n    + [Peers](#peers)\n    + [Transport](#transport)\n      - [TCP](#tcp)\n      - [WebRTC](#webrtc)\n    + [Store](#store)\n    + [Maintenance Mode](#maintenance-mode)\n    + [Service](#service)\n    + [App Proxy](#app-proxy)\n    + [Fast Sync](#fast-sync)\n    + [Operational Parameters](#operational-parameters)\n * [Install](#install)\n    + [Go](#go)\n    + [Babble and Dependencies](#babble-and-dependencies)\n    + [Other Requirements](#other-requirements)\n    + [Testing](#testing)\n    + [Build From Source](#build-from-source)\n * [Demo](#demo)\n    \n## Features\n\n- **Asynchronous**: Participants have the freedom to process commands at \n                    different times.\n\n- **Leaderless**: No participant plays a special role.\n\n- **Byzantine Fault-Tolerant**: Supports one third of faulty nodes, including \n                                malicious behavior.\n\n- **Finality**: Babble’s output can be used immediately, no need for block \n                confirmations.\n\n- **Dynamic Membership**: Members can join or leave a Babble network without \n                          undermining security.\n\n- **Fast Sync**: Joining nodes can sync directly to the current state of a \n                 network.\n\n- **Accountability**: Auditable history of the consensus algorithm’s output.\n\n- **Language Agnostic**: Integrate with applications written in any programming \n                         language.\n\n- **Mobile**: Bindings for Android and iOS.\n\n- **WebRTC**: Supports WebRTC connections for practical p2p connections.\n\n## Consensus\n\nWe use an adaptation of the Hashgraph consensus algorithm, invented by Leemon\nBaird, to which we added important features. Hashgraph is best described in the\n[white-paper](http://www.swirlds.com/downloads/SWIRLDS-TR-2016-01.pdf) and its\n[accompanying document](http://www.swirlds.com/downloads/SWIRLDS-TR-2016-02.pdf).\nThe original Hashgraph algorithm is protected by \n[patents](http://www.swirlds.com/ip/) in the USA, so anyone intending to use \nthis software in the USA should take this into consideration. For a high level \noverview of the concepts behind Babble, please refer to this \n[document](http://docs.babble.io/en/latest/consensus.html).\n\nBabble's major departure from the original Hashgraph algorithm is the \nintroduction of \n[blocks](http://docs.babble.io/en/latest/blockchain.html), which represent \nself-contained sections of the Hashgraph, and which are instrumental in the \nimplementation of two important new features that were alluded to in Baird's \npaper, but not specified:\n\n- A [dynamic membership](http://docs.babble.io/en/latest/dynamic_membership.html)\n  protocol, which enables peers to join or leave a group on demand.\n\n- A [fast-sync](http://docs.babble.io/en/latest/fastsync.html) protocol which\n  enables joining nodes to fast-forward directly to a point in the hashgraph\n  without downloading the entire history. \n\n## API\n\n![Babble design](docs/_static/babble_design_2.png)\n\nBabble communicates with the App through an `AppProxy` interface, which has two\nimplementations:\n\n- `InmemProxy` : An InmemProxy uses native callback handlers to integrate Babble\n                 as a regular Go dependency.\n\n- `SocketProxy`: A SocketProxy connects to an App via TCP sockets. It enables\n                 the application to run in a separate process or machine, and to\n                 be written in any programming language.\n\nRefer to the [dummy](src/dummy) package for an example that implements both\nproxies.\n\n```go\n// Start from default Babble configuration.\nbabbleConfig := config.NewDefaultConfig()\n\n// Create dummy InmemProxy\ndummy := NewInmemDummyClient(babbleConfig.Logger())\n\n// Set the proxy in the Babble configuration.\nbabbleConfig.Proxy = dummy\n\n// Instantiate Babble.\nbabble := babble.NewBabble(babbleConfig)\n\n// Read in the configuration and initialise the node accordingly.\nif err := babble.Init(); err != nil {\n    babbleConfig.Logger().Error(\"Cannot initialize babble:\", err)\n    os.Exit(1)\n}\n\n// The application can submit transactions to Babble using the proxy's\n// SubmitTx. Babble will broadcast the transactions to other nodes, run them\n// through the consensus algorithm, and eventually call the callback methods\n// implemented in the handler.\ngo func() {\n    dummy.SubmitTx([]byte(\"the test transaction\"))\n}()\n\n// Run the node aynchronously.\nbabble.Run()\n\n// Babble reacts to SIGINT (Ctrl + c) and SIGTERM by calling the leave\n// method to politely leave a Babble network, but it can also be called\n// manually.\ndefer babble.Node.Leave()\n```\n\n## Configuration\n\nBabble configuration is defined in the [config](src/config) package. \n\n### Data Directory\n\nBabble reads configuration files from its data directory which defaults to \n`~/.babble` on Linux. It can be overwritten with `DataDir` in the Config object\nor `--datadir` from the CLI.\n\n### Key\n\nEvery Babble validator requires a cryptographic key-pair to encrypt, sign and \nverify messages. The private key is secret but the public key is used by other \nnodes to verify messages signed with the private key. The encryption scheme used\nby Babble is ECDSA with the secp256k1 curve (like Bitcoin and Ethereum).\n\nTo pass a private key to Babble, either set it directly in the `Config` object, \nor dump it to a `priv_key` file in the data directory. Babble's `keygen` command\nmay be used to generate key-pairs in the appropriate format.\n\n### Peers\n\nBabble needs to know the other peers in the network. This is specified by adding\ntwo JSON files in the data directory.\n\n- `genesis.peers.json` corresponds to the initial validator-set; the one that\nthe hashgraph was started with. If `genesis.peers.json` is not provided, Babble\nwill use `peers.json` as the genesis validator-set.\n\n- `peers.json` corresponds to the set of peers that the node should attempt to \nconnect to upon starting.\n\n`peers.json` and `gensesis.peers.json` are not necessarily equal because\nthe [dynamic membership](http://docs.babble.io/en/latest/dynamic_membership.html)\nprotocol enables new nodes to join or leave a live Babble network dynamically. \nIt is important for a joining node to know the initial validator-set in order to \nreplay and verify the hashgraph up to the point where it joins.\n\nIt is possible to start a Babble network with just a single node, or with a\npredefined validator-set composed of multiple nodes. In the latter case, \nsomeone, or some process, needs to aggregate the public keys and network \naddresses of all participants into a single file (`peers.genesis.json`), and \nensure that everyone has a copy of this file. It is left to the user to derive a\nscheme to produce the configuration files but the docker demo \n[scripts](demo/scripts) are a good place to start.\n\nTo join an existing network, a peer must first obtain the JSON peers files from \nan existing node and place them in the data directory. One way to obtain the\npeers files is to query the `/peers` and `/genesispeers` functions exposed by \nthe HTTP API [service](#service). Please refer to the \n[join script](demo/scripts) in the demo for an example. \nfor an example.\n\n### Transport\n\nImplementations of the [Transport](src/net/transport.go) interface determine \nhow nodes communicate with one-another.\n\n#### TCP\n\nThe TCP transport is suitable when nodes are in the same local network, or\nwhen users are able to configure their connections appropriately to avoid NAT\nissues.\n\nTo use a TCP transport, set the following configuration properties:\n\n- `BinAdddr` or `--listen`: the IP:PORT of the TCP socket that Babble binds to.\n  By default `BindAddr` is `127.0.0.1:1337`, meaning that Babble will bind to \n  the loopback address on the local machine.\n\n- `AdvertiseAddr` or `--advertise`: (optional) The address that is advertised to\n  other nodes. If `BindAddr` is a local address not reachable by other peers, \n  it is necessary to set `AdvertiseAddr` to something else. If `AdvertiseAddr` \n  is not set, it defaults to the `BindAddr`.\n\nFor example, when running a node from a local network behind a NAT, the \n`BindAddr` might be `192.168.1.10` which is not reachable from outside the local\nnetwork. So it is necessary to set `AdvertiseAddr` to the public IP of the \nrouter, and to setup port-forwarding in the NAT.\n\nNote that the advertise address (which defaults to bind address if not set) must\nmatch the address of the peer in the `peers.genesis.json` or `peers.json` files. \n\n#### WebRTC\n\nBecause Babble is a peer-to-peer application, it can run into issues with NATs \nand firewalls. The WebRTC transport addresses the NAT traversal issue, but it \nrequires centralised servers for peers to exchange connection information and \nto provide STUN/TURN services. \n\nTo use a WebRTC transport, use the following configuration properties:\n\n- `WebRTC` or `--webrtc`: tells Babble to use a WebRTC transport.\n\n- `SignalAddr` or `--signal-addr`: address of the WebRTC signaling server.\n\n- `SignalRealm` or `--signal-realm`: routing domain within the signaling server.\n\n- `ICEAddress` or `--ice-addr`: URL of a server providing ICE services such as \n                                STUN and TURN.\n\n- `ICEUsername` or `--ice-username`: Username to authenticate to the ICE server.\n\n- `ICEPassword` or `--ice-password`: Password to authenticate to the ICE server.\n\nUsers of the library can also manipulate the ICE servers configuration directly\nby manually modifying the list returned by `Config.ICEServers()`.\n\nWebRTC requires a signaling mechanism for peers to exchange connection \ninformation. This requires a central server, so when the WebRTC transport is \nused, Babble is not fully p2p anymore. That being said, all the  computation and\ndata at the application layer remains p2p; the signaling server is only used as \na sort of peer-discovery mechanism. We povide the code for a signaling server\n[here](cmd/signal). The [demo](#demo) has a WebRTC option that illustrates the\nusage of WebRTC.\n\nIt is not necessary to specify network addresses in the JSON peer files when \nWebRTC is enabled because this information will be exchanged over the signaling \nserver. Likewise, the `BindAddr` and `AdvertiseAddr` options will be ignored.\n\nThe default `ICEServers` points to a public STUN server hosted by Google \n(`stun:stun.l.google.com:19302`). It does not include a TURN server, so not all \np2p connections will be possible. For a full ICE server, have a look at our \n[Disco server](\"https://github.com/mosaicnetworks/disco).\n\n### Store\n\nWe can choose to run Babble with a database backend or only with an in-memory \ncache. With the `Store` (`--store`) option, Babble will look for a database in \n`datadir/babdger_db` or in the path specified by `DatabaseDir` (`--db`). If the \ndatabase already exists, and the `Bootstrap` (`--boostrap`) option is set, the \nnode will load the database and bootstrap itself to a state consistent with the \ndatabase and it will be able to proceed with the consensus algorithm from there.\nIf the database does not exist yet, or the `Bootstrap` option is not set, a new\none will be created and the node will start from a clean state.\n\n### Maintenance Mode\n\nThe node can also be started in `maintenance-mode` with the homonymous flag. The\nnode is started normally but goes directly into the `Suspended` state, where it \nstill  responds to sync-requests, and service API requests, but does not produce\nor insert new Events in the underlying hashgraph. The `Suspended` state is also \ntriggered automatically when more than `suspend-limit`, multiplied by the number\nof validators, undetermined-events were created since last starting the node. \nThis is a safeguard against runaway conditions when a network does not have a \nstrong  majority and produces undetermined-events ad infinitum.   \n\n### Service\n\nWe can also specify where Babble exposes its HTTP API which provides information\nabout the internals of the hashgraph and data store. This is controlled by the \n`ServiceAddr` (`--service-listen`) option. It can also be disabled altogether \nwith the `NoService` (`--no-service`) option.\n\n### App Proxy\n\nWhen we use Babble as a native Go library, we set the InmemProxy directly in the \nConfig object's `Proxy` field. \n\nInstead, when Babble and the application are connected by a TCP interface, we \nstart Babble as a standalone executable and we specify the endpoints of the\nconnection:\n\n - `--proxy-listen`  : where Babble listens for transactions from the App.\n - `--client-connect` : where the App listens for blocks from Babble\n\n### Fast Sync\n\n`EnableFastSync` (`--fast-sync`) tells Babble to attempt to fast-forward to the\ntip of the hashgraph when joining, instead of downloading and replaying the \nentire hashgraph from start. More on this in \n[fast-sync](http://docs.babble.io/en/latest/fastsync.html). This options \nrequires the Snapshot and Restore handlers to be carefully implemented in the\nAppProxy.\n\n### Operational Parameters\n\n- `LogLevel` (`--log`): Determines the chattiness of the log output.\n\n- `HeartbeatTimeout` (`--heartbeat`): Frequency of the gossip timer when there \n  is something to gossip about.\n\n- `SlowHeartbeatTimeout` (`--slow-heartbeat`): Frequency of the gossip timer \n  when there is nothing to gossip about.\n\n- `MaxPool` (`--max-pool`): Controls how many connections are pooled per target\n  in the gossip routines.\n\n- `TCPTimeout` (`--timeout`): Timeout of gossip RPC connections (also applies\n  for WebRTC connections).\n\n- `JoinTimeout` (`--join_timeout`): Timeout of join requests.\n\n- `SyncLimit` (`--sync-limit`): Max number of hashgraph events to include in a\n   SyncResponse or EagerSyncRequest.\n\n- `CacheSize` (`--cache-size`): Max number of items in the in-memory caches.\n\n- `SuspendLimit` (`--suspend-limit`): Multiplier applied to the number of \n   validators to determine the limit of undetermined events that will cause a \n   node to become suspended.\n\n- `Moniker` (`--moniker`): Friendly name for this node. It takes precedence over\n  the moniker defined in JSON peers files.\n\n- `SignalSkipVerify` (`--signal-skip-verify`): (insecure) Controls whether the\n  signal client verifies the server's certificate chain and hostname when WebRTC\n  is activated.\n\n## Install\n\n### Go\n\nBabble is written in [Golang](https://golang.org/) **1.14**. Hence, the first \nstep is to install **Go version 1.14 or above** which is both the programming \nlanguage and a CLI tool for managing Go code. Go is very opinionated and will \nrequire you to [define a workspace](https://golang.org/doc/code.html#Workspaces)\nwhere all your go code will reside.\n\n### Babble and Dependencies\n\nFetch Babble from github:\n\n```bash\n$ go get github.com/mosaicnetworks/babble\n```\n\nDownload all dependencies and put them in the **vendor** folder.\n\n```bash\n[...]/babble$ make vendor\n```\n\nBabble uses `go mod` to manage dependencies.\n\n### Other Requirements\n\nBash scripts used in this project assume the use of GNU versions of coreutils.\nPlease ensure you have GNU versions of these programs installed:-\n\nexample for macOS:\n\n```bash\n# --with-default-names makes the `sed` and `awk` commands default to gnu sed and gnu awk respectively.\nbrew install gnu-sed gawk --with-default-names\n```\n\n### Testing\n\nBabble has extensive unit-testing.\n\n```bash\n[...]/babble$ make test\n```\n\nIf everything goes well, it should output something along these lines:\n\n```text\n?       github.com/mosaicnetworks/babble/src/babble     [no test files]\nok      github.com/mosaicnetworks/babble/src/common     0.015s\nok      github.com/mosaicnetworks/babble/src/crypto     0.122s\nok      github.com/mosaicnetworks/babble/src/hashgraph  10.270s\n?       github.com/mosaicnetworks/babble/src/mobile     [no test files]\nok      github.com/mosaicnetworks/babble/src/net        0.012s\nok      github.com/mosaicnetworks/babble/src/node       19.171s\nok      github.com/mosaicnetworks/babble/src/peers      0.038s\n?       github.com/mosaicnetworks/babble/src/proxy      [no test files]\nok      github.com/mosaicnetworks/babble/src/dummy        0.013s\nok      github.com/mosaicnetworks/babble/src/proxy/inmem        0.037s\nok      github.com/mosaicnetworks/babble/src/proxy/socket       0.009s\n?       github.com/mosaicnetworks/babble/src/proxy/socket/app   [no test files]\n?       github.com/mosaicnetworks/babble/src/proxy/socket/babble        [no test files]\n?       github.com/mosaicnetworks/babble/src/service    [no test files]\n?       github.com/mosaicnetworks/babble/src/version    [no test files]\n?       github.com/mosaicnetworks/babble/cmd/babble     [no test files]\n?       github.com/mosaicnetworks/babble/cmd/babble/commands    [no test files]\n?       github.com/mosaicnetworks/babble/cmd/dummy      [no test files]\n?       github.com/mosaicnetworks/babble/cmd/dummy/commands     [no test files]\n\n```\n\n### Build From Source\n\nThe easiest way to build binaries is to do so in a hermetic Docker container.\nUse this simple command:\n\n```bash\n[...]/babble$ make dist\n```\n\nThis will launch the build in a Docker container and write all the artifacts in\nthe build/ folder.\n\n```bash\n[...]/babble$ tree build\nbuild/\n├── dist\n│   ├── babble_0.1.0_darwin_386.zip\n│   ├── babble_0.1.0_darwin_amd64.zip\n│   ├── babble_0.1.0_freebsd_386.zip\n│   ├── babble_0.1.0_freebsd_arm.zip\n│   ├── babble_0.1.0_linux_386.zip\n│   ├── babble_0.1.0_linux_amd64.zip\n│   ├── babble_0.1.0_linux_arm.zip\n│   ├── babble_0.1.0_SHA256SUMS\n│   ├── babble_0.1.0_windows_386.zip\n│   └── babble_0.1.0_windows_amd64.zip\n└── pkg\n    ├── darwin_386\n    │   └── babble\n    ├── darwin_amd64\n    │   └── babble\n    ├── freebsd_386\n    │   └── babble\n    ├── freebsd_arm\n    │   └── babble\n    ├── linux_386\n    │   └── babble\n    ├── linux_amd64\n    │   └── babble\n    ├── linux_arm\n    │   └── babble\n    ├── windows_386\n    │   └── babble.exe\n    └── windows_amd64\n        └── babble.exe\n```\n\n## Demo\n\nTo see Babble in action, we have provided a series of scripts to bootstrap a\nlocal test network with the dummy application and the SocketProxy.\n\n**NOTE:**\nThis has been tested on Ubuntu 18.04 and macOS.\n\nMake sure you have [Docker](https://docker.com) installed.\n\nThen, run the testnet:\n\n```bash\n[...]/babble$ cd demo\n[...]/babble/demo$ make\n# or using webrtc\n[...]/babble/demo$ make webrtc=true\n```\n\nOnce the testnet is started, a script is automatically launched to monitor each\nBabble node:\n\n```text\nconsensus_events:180 consensus_transactions:40 events_per_second:0.00 id:1 last_block_index:3 last_consensus_round:17 num_peers:3 round_events:7 rounds_per_second:0.00 state:Babbling sync_rate:1.00 transaction_pool:0 undetermined_events:18\nconsensus_events:180 consensus_transactions:40 events_per_second:0.00 id:3 last_block_index:3 last_consensus_round:17 num_peers:3 round_events:7 rounds_per_second:0.00 state:Babbling sync_rate:1.00 transaction_pool:0 undetermined_events:20\nconsensus_events:180 consensus_transactions:40 events_per_second:0.00 id:2 last_block_index:3 last_consensus_round:17 num_peers:3 round_events:7 rounds_per_second:0.00 state:Babbling sync_rate:1.00 transaction_pool:0 undetermined_events:21\nconsensus_events:180 consensus_transactions:40 events_per_second:0.00 id:0 last_block_index:3 last_consensus_round:17 num_peers:3 round_events:7 rounds_per_second:0.00 state:Babbling sync_rate:1.00 transaction_pool:0 undetermined_events:20\n```\n\nRunning `docker ps -a` will show you that 9 docker containers have been launched:\n\n```bash\n[...]/babble/demo$ docker ps -a\nCONTAINER ID        IMAGE                    COMMAND                  CREATED             STATUS              PORTS                   NAMES\nba80ef275f22        mosaicnetworks/watcher   \"/watch.sh\"              48 seconds ago      Up 7 seconds                                watcher\n4620ed62a67d        mosaicnetworks/dummy     \"dummy '--name=client\"   49 seconds ago      Up 48 seconds       1339/tcp                client4\n847ea77bd7fc        mosaicnetworks/babble    \"babble run --cache_s\"   50 seconds ago      Up 49 seconds       80/tcp, 1337-1338/tcp   node4\n11df03bf9690        mosaicnetworks/dummy     \"dummy '--name=client\"   51 seconds ago      Up 50 seconds       1339/tcp                client3\n00af002747ca        mosaicnetworks/babble    \"babble run --cache_s\"   52 seconds ago      Up 50 seconds       80/tcp, 1337-1338/tcp   node3\nb2011d3d65bb        mosaicnetworks/dummy     \"dummy '--name=client\"   53 seconds ago      Up 51 seconds       1339/tcp                client2\ne953b50bc1db        mosaicnetworks/babble    \"babble run --cache_s\"   53 seconds ago      Up 52 seconds       80/tcp, 1337-1338/tcp   node2\n0c9dd65de193        mosaicnetworks/dummy     \"dummy '--name=client\"   54 seconds ago      Up 53 seconds       1339/tcp                client1\nd1f4e5008d4d        mosaicnetworks/babble    \"babble run --cache_s\"   55 seconds ago      Up 54 seconds       80/tcp, 1337-1338/tcp   node1\n```\n\nIndeed, each replica is composed of a dummy application coupled to a Babble node\nrunning in a different container.\n\nRun the **demo** script to play with the **Dummy App** which is a simple chat\napplication powered by the Babble consensus platform:\n\n```bash\n[...]/babble/demo$ make demo\n```\n\n![Demo](demo/img/demo.png)\n\nFinally, stop the testnet:\n\n```bash\n[...]/babble/demo$ make stop\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmosaicnetworks%2Fbabble","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmosaicnetworks%2Fbabble","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmosaicnetworks%2Fbabble/lists"}