kademlia | Kademlia DHT implementation in node , ready to be | Stream Processing library

 by   nikhilm JavaScript Version: 0.2.0 License: MIT

kandi X-RAY | kademlia Summary

kandi X-RAY | kademlia Summary

kademlia is a JavaScript library typically used in Data Processing, Stream Processing, Nodejs, NPM applications. kademlia has no bugs, it has no vulnerabilities, it has a Permissive License and it has low support. You can install using 'npm i kademlia' or download it from GitHub, npm.

kademlia
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              kademlia has a low active ecosystem.
              It has 132 star(s) with 25 fork(s). There are 7 watchers for this library.
              OutlinedDot
              It had no major release in the last 12 months.
              There are 11 open issues and 10 have been closed. On average issues are closed in 22 days. There are 2 open pull requests and 0 closed requests.
              It has a neutral sentiment in the developer community.
              The latest version of kademlia is 0.2.0

            kandi-Quality Quality

              kademlia has 0 bugs and 0 code smells.

            kandi-Security Security

              kademlia has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
              kademlia code analysis shows 0 unresolved vulnerabilities.
              There are 0 security hotspots that need review.

            kandi-License License

              kademlia is licensed under the MIT License. This license is Permissive.
              Permissive licenses have the least restrictions, and you can use them in most projects.

            kandi-Reuse Reuse

              kademlia releases are not available. You will need to build from source code and install.
              Deployable package is available in npm.
              Installation instructions are not available. Examples and code snippets are available.

            Top functions reviewed by kandi - BETA

            kandi has reviewed kademlia and discovered the below as its top functions. This is intended to give you an instant insight into kademlia implemented functionality, and help decide if they suit your requirements.
            • finds a list of nodes in order
            • Add contacts from the bucket
            • Add a contact .
            Get all kandi verified functions for this library.

            kademlia Key Features

            No Key Features are available at this moment for kademlia.

            kademlia Examples and Code Snippets

            No Code Snippets are available at this moment for kademlia.

            Community Discussions

            QUESTION

            Put record into DHT
            Asked 2021-Oct-25 at 23:14

            I'm trying to insert a simple /pk record to the IFPS DHT using Rust and rust-libp2p

            Here's my code (Rust 1.55, libp2p-rust 0.39.1):

            ...

            ANSWER

            Answered 2021-Oct-25 at 23:14

            Unfunny story - my example presented in the question is correct - but there is a bug in rust-libp2p which breaks the interoperability with go-libp2p. See https://github.com/libp2p/rust-libp2p/pull/2309 for details

            Source https://stackoverflow.com/questions/69599760

            QUESTION

            How Ethereum protocol works with geth
            Asked 2021-Oct-24 at 09:57

            I am new to Ethereum and generally to blockchain. I learned that Ethereum blockchain works on Kademlia. The distributed hash table and its working was beautiful and nicely explained by Eleuth P2P.

            Now I used geth to connect to the Ethereum Mainnet and it discovered 2 to 3 maximum peers in 5 to 6 minutes.

            Now I know the algorithm but my concern is how the first peer is discovered? Because internet is just a big set of routers and different type of computers (server, computer, etc ) and if you broadcast the discovery like in ARP. The internet will be flooded with these peer discovery broadcast messages and this doesn't seems right. So how initially the connections are made? Also we cannot trust a single network for first time connection because this will make the system server and client based and not decentralised so how the initial connections and peer discovery happens?

            Are the broadcast message like have TTL like to prevent the circular loop like in TCP I guess? But this also seems a horrible idea to me.

            Please explain.

            ...

            ANSWER

            Answered 2021-Oct-24 at 09:57

            In order to get going initially, geth uses a set of bootstrap nodes whose endpoints are recorded in the source code.

            Source: Geth docs

            Here's the list of the bootstrap nodes hardcoded in the Geth source code: https://github.com/ethereum/go-ethereum/blob/v1.10.11/params/bootnodes.go#L23

            The --bootnodes option allows you to overwrite this list with your own. Example from the above linked docs:

            Source https://stackoverflow.com/questions/69694890

            QUESTION

            How does the s/kademlia sibling list work?
            Asked 2021-Sep-16 at 22:04

            i am studying p2p network recently. when i was reading the s/kademlia paper, i found that the sibling broadcast related content is not detailed enough.

            here is my question:

            • how the sibling list works?
            • how can it solve highly unbalanced tree problem?

            it would be grateful if anyone can help me out! thanks!

            ref: s/kademlia paper

            ...

            ANSWER

            Answered 2021-Sep-16 at 19:18

            how the sibling list works?

            It seems like it replaces the refinement of the bucket splitting for unbalanced trees with a a list of the closest known nodes relative to the local node ID. Unlike the bucket splitting approach it uses a different parameter instead of the bucket size K.

            The details don't seem to be spelled out but it seems logical that one simply computes whether a node would be inserted in that list based on the currently furthest node in that list (assuming the maximum size based on the new parameter has been reached) and otherwise spilling it into the main routing table which is still based on buckets.

            how can it solve highly unbalanced tree problem?

            Pretty much the same way that kademlia does with the refined splitting approach (which many implementations fail to consider!), but in a way that's easier to reason about and can be parametrized separately.

            Source https://stackoverflow.com/questions/69186473

            QUESTION

            Find Node Operation in Kadelmia: why does it pick elements from bucket instead of looking through the entire routing table?
            Asked 2021-Mar-28 at 13:28

            The first step of the find node operation is as follows (as described in the paper):

            The lookup initiator starts by picking α nodes from its closest non-empty k-bucket (or, if that bucket has fewer than α entries, it just takes the α closest nodes it knows of).

            Why does it pick the elements directly from the bucket, as opposed to looking for k closest elements across all elements in all buckets? I believe the latter is what happens in step 2 of the algorithm, and can be seen in the visualization here.

            ...

            ANSWER

            Answered 2021-Mar-28 at 13:26

            I guess this is simply under the assumption that α ≤ k. Under that condition you will get the k closest nodes automatically from the closest bucket, or if the bucket contains fewer than α nodes the bracketed condition will apply

            (or, if that bucket has fewer than α entries, it just takes the α closest nodes it knows of)

            Also note that you're looking at the pre-proceedings version of the paper, which does not contain the full kademlia description. You can find the full paper here.

            Source https://stackoverflow.com/questions/66837036

            QUESTION

            What does it mean by Kademlia keys are used to identify nodes as well as data?
            Asked 2020-Jan-09 at 19:56

            Okay, I've been reading articles and the paper about Kademlia recently to implement a simple p2p program that uses kademlia dht algorithm. And those papers are saying, those 160-bit key in a Kademlia Node is used to identify both nodes (Node ID) and the data (which are stored in a form of tuple).

            I'm quite confused on that 'both' part.

            As far as my understanding goes, each node in a Kademlia binary tree uniquely represents a client(IP, port) who each holds a list of files.

            Here is the general flow on my understanding.

            1. Client (.exe) gets booted
            2. Creates a node component
            3. Newly created node joins the network (bootstrapping)
            4. Sends find_node(filehash) to k-closest nodes
              • Let's say hash is generated by hashing file binary named file1.txt
            5. Received nodes each finds the queried filehash in its different hash table
              • Say, a hash map that has a list of files(File Hash, file location)
            6. Step 4,5 repeated until the node is found (meanwhile all associated nodes are updating the buckets)

            Does this flow look all right?

            Additionally, bootstrapping method of Kademlia too confuses me. When the node gets created (user executes the program), It seems like it uses bootstrapping node to fill up the buckets. But then what's bootstrapping node? Is it another process that's always running? What if the bootstrapping node gets turned off?

            Can someone help me better understand the concept?

            Thanks for the help in advance.

            ...

            ANSWER

            Answered 2020-Jan-09 at 19:56

            Does this flow look all right?

            It seems roughly correct, but your wording is not very precise.

            Each node has a routing table by which it organizes the neighbors it knows about and another table in which it organizes the data it is asked to store by others. Nodes have a quasi-random ID that determines their position in the routing keyspace. The hashes of keys for stored data don't precisely match any particular node ID, so the data is stored on the nodes whose ID is closest to the hash, as determined by the distance metric. That's how node IDs and key hashes are used for both.

            When you perform a lookup for data (i.e. find_value) you ask the remote nodes for the k-closest neighbor set they have in their routing table, which will allow you to home in on the k-closest set for a particular target key. The same query also asks the remote node to return any data they have matching that target ID.

            When you perform a find_node on the other hand you're only asking them for the closest neighbors but not for data. This is primarily used for routing table maintenance where you're not looking for any data.

            Those are the abstract operations, if needed an actual implementation could separate the lookup from the data retrieval, i.e. first perform a find_node and then use the result set to perform one or more separate get operations that don't involve additional neighbor lookups (similar to the store operation).

            Since kademlia is UDP-based you can't really serve arbitrary files because those could easily exceed reasonable UDP packet sizes. So in practice kademlia usually just serves as a hash table for small binary values (e.g. contact information, public keys and such). Bulk operations are either performed by other protocols bootstrapped off those values or by additional operations beyond those mentioned in the kademlia paper.

            What the paper describes is only the basic functionality for a routing algorithm and most basic key value storage. It is a spherical cow in a vacuum. Actual implementations usually need additional features or work around security and reliability problems faced on the public internet.

            But then what's bootstrapping node? Is it another process that's always running? What if the bootstrapping node gets turned off?

            That's covered in this question (by example of the bittorrent DHT)

            Source https://stackoverflow.com/questions/59657964

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install kademlia

            You can install using 'npm i kademlia' or download it from GitHub, npm.

            Support

            For any new features, suggestions and bugs create an issue on GitHub. If you have any questions check and ask questions on community page Stack Overflow .
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
            Install
          • npm

            npm i kademlia

          • CLONE
          • HTTPS

            https://github.com/nikhilm/kademlia.git

          • CLI

            gh repo clone nikhilm/kademlia

          • sshUrl

            git@github.com:nikhilm/kademlia.git

          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link

            Consider Popular Stream Processing Libraries

            gulp

            by gulpjs

            webtorrent

            by webtorrent

            aria2

            by aria2

            ZeroNet

            by HelloZeroNet

            qBittorrent

            by qbittorrent

            Try Top Libraries by nikhilm

            uvbook

            by nikhilmC

            qhttpserver

            by nikhilmC

            node-taglib

            by nikhilmC++

            gocco

            by nikhilmGo

            ninja-rs

            by nikhilmRust