Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
O

opendht

> 编程语言
Open source

OpenDHT: a C++17 Distributed Hash Table implementation

1.1K stars0 likes0 views
WebsiteGitHub

About

OpenDHT: a C++17 Distributed Hash Table implementation

OpenDHT

A lightweight C++17 Distributed Hash Table implementation.

OpenDHT provides an easy to use distributed in-memory data store. Every node in the network can read and write values to the store. Values are distributed over the network, with redundancy.

  • Lightweight and scalable, designed for large networks and small devices
  • High resilience to network disruption
  • Public key cryptography layer providing optional data signature and encryption (using GnuTLS)
  • IPv4 and IPv6 support
  • Clean and powerful C++17 map API
  • Bindings for C, Rust & Python 3
  • REST API with optional HTTP client+server with push notification support

Documentation

See the wiki:

How to run a node

You can help contribute to the public network by running a stable node with a public IP address. https://github.com/savoirfairelinux/opendht/wiki/Running-a-node-with-dhtnode

How-to build and install

Build instructions: see BUILD.md

Examples

C++ example

The tools directory includes simple example programs :

  • dhtnode, a command line tool, allowing to run a DHT node and perform operations supported by the library (get, put etc.) with text values.
  • dhtchat, a very simple IM client working over the dht.

Example program launching a DHT node, connecting to the network and performing some basic operations:

…

Python 3 example

Install on Linux, macOS and Windows with:

bash
pip install opendht

Using the simple, blocking API:

python
import opendht as dht

node = dht.DhtRunner()
node.run()

# Join the DHT network through any running node,
# here using a known bootstrap node.
node.bootstrap("bootstrap.jami.net", "4222")

# blocking call (provide callback arguments to make the call non-blocking)
node.put(dht.InfoHash.get("unique_key"), dht.Value(b'some binary data'))

results = node.get(dht.InfoHash.get("unique_key"))
for value in results:
    print(value)

Or using asyncio:

…

Dependencies

Core dependencies:

  • msgpack-c 1.2+, used for data serialization.
  • GnuTLS 3.3+, used for cryptographic operations.
  • Nettle 2.4+, a GnuTLS dependency for crypto.
  • {fmt} 9.0+, for log formatting.

Optional dependencies for the REST API (DHT proxy client/server):

  • (optional) restinio
  • (optional) llhttp
  • (optional) jsoncpp 1.7.4-3+
  • (optional) simdutf

Build environment:

  • Build tested with GCC 9+ (GNU/Linux, Windows with MinGW), Clang/LLVM (GNU/Linux, Android, macOS, iOS).
  • Build tested with Microsoft Visual Studio 2019, 2022

License

Copyright (c) 2014-2026 Savoir-faire Linux Inc.

OpenDHT is released under the MIT License. See LICENSE for details.

Acknowledgements

This project was originally based on https://github.com/jech/dht by Juliusz Chroboczek.

Issues· 0 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

C++

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 17, 2026
Category编程语言
PricingOpen source

> Related tools

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言