
Product
Socket for Jira Is Now Available
Socket for Jira lets teams turn alerts into Jira tickets with manual creation, automated ticketing rules, and two-way sync.
grenache-grape
Advanced tools
Grenache is a micro-framework for connecting microservices. Its simple and optimized for performance.
Internally, Grenache uses Distributed Hash Tables (DHT, known from Bittorrent) for Peer to Peer connections. You can find more details how Grenche internally works at the Main Project Homepage.
Grapes are the backbone of Grenache. They manage the DHT, the base of our virtual network.
// Install global (run binary)
npm install -g grenache-grape
// Install locally to project (programmatic approach)
npm install --save grenache-grape
grape --help
Usage: grape --dp <dht-port> --aph <http-api-port> --bn <nodes> [--b
bind-to-address]
Options:
-b, --bind Listening host [string]
--dp, --dht_port DHT listening port [number] [required]
--dc, --dht_concurrency DHT concurrency [number]
--dht_maxTables DHT max tables [number]
--dht_maxValues DHT max values [number]
--bn, --bootstrap Bootstrap nodes [string] [required]
--aph, --api_port HTTP api port [number] [required]
--dht_peer_maxAge, --dpa Max age for peers in DHT [number]
--cache_maxAge Maximum cache age [number]
--dnl, --dht_nodeLiveness Interval in ms to check for dead nodes [number]
--check_maxPayloadSize Limit for max payload size [number]
--help Show help [boolean]
--version Show version number [boolean]
// Run 3 Grapes
grape -b 127.0.0.1 --dp 20001 --dc 32 --aph 30001 --bn '127.0.0.1:20002,127.0.0.1:20003'
grape --dp 20002 --aph 40001 --dc 32 --bn '127.0.0.1:20001,127.0.0.1:20003'
grape --dp 20003 --aph 50001 --dc 32 --bn '127.0.0.1:20001,127.0.0.1:20002'
const Grape = require('grenache-grape').Grape
const g = new Grape({
// host: '127.0.0.1', // if undefined the Grape binds all interfaces
dht_port: 20001,
dht_bootstrap: [
'127.0.0.1:20002'
],
api_port: 30001
})
g.start()
options <Object> Options for the link
host <String> IP to bind to. If null, Grape binds to all interfacesdht_maxTables <Number> Maximum number of DHT tablesdht_maxValues <Number> Maximum number of DHT valuesdht_port <Number> Port for DHTdht_concurrency <Number> Concurrency for DHTdht_bootstrap: <Array> Bootstrap serversdht_peer_maxAge <Number> maxAge for DHT peersapi_port <Number> Grenache API HTTP PortEmitted when the DHT is fully bootstrapped.
Emitted when the DHT is listening.
Emitted when a potential peer is found.
Emitted when the DHT finds a new node.
Emitted when a peer announces itself in order to be stored in the DHT.
Emitted when a peer announces itself in order to be stored in the DHT.
FAQs
Granache Grape - DHT for micro-services
We found that grenache-grape demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 4 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Product
Socket for Jira lets teams turn alerts into Jira tickets with manual creation, automated ticketing rules, and two-way sync.

Company News
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.

Security News
NIST will stop enriching most CVEs under a new risk-based model, narrowing the NVD's scope as vulnerability submissions continue to surge.