UNPKG

@yipsec/kdns

Version:
1 lines 20 kB
{"list":[{"title":"module:kdns/bucket","link":"<a href=\"module-kdns_bucket.html\">kdns/bucket</a>","description":"<p>A column of the routing table holding up to K contacts</p>"},{"title":"module:kdns/bucket~Bucket","link":"<a href=\"module-kdns_bucket-Bucket.html\">Bucket</a>"},{"title":"module:kdns/bucket~Bucket#getClosestToKey","link":"<a href=\"module-kdns_bucket-Bucket.html#getClosestToKey\">getClosestToKey</a>","description":"<p>Returns an array of contacts in the bucket that are closest to the given\nkey</p>"},{"title":"module:kdns/bucket~Bucket#head","link":"<a href=\"module-kdns_bucket-Bucket.html#head\">head</a>"},{"title":"module:kdns/bucket~Bucket#indexOf","link":"<a href=\"module-kdns_bucket-Bucket.html#indexOf\">indexOf</a>","description":"<p>Returns the index of the given node id</p>"},{"title":"module:kdns/bucket~Bucket#length","link":"<a href=\"module-kdns_bucket-Bucket.html#length\">length</a>"},{"title":"module:kdns/bucket~Bucket#set","link":"<a href=\"module-kdns_bucket-Bucket.html#set\">set</a>","description":"<p>Sets the contact to the node ID in the bucket if it is not full; if the\nbucket already contains the contact, move it to the tail - otherwise we\nplace it at the head</p>"},{"title":"module:kdns/bucket~Bucket#tail","link":"<a href=\"module-kdns_bucket-Bucket.html#tail\">tail</a>"},{"title":"module:kdns/constants","link":"<a href=\"module-kdns_constants.html\">kdns/constants</a>"},{"title":"module:kdns/constants~ALPHA","link":"<a href=\"module-kdns_constants.html#~ALPHA\">ALPHA</a>","description":"<p>Degree of parallelism</p>"},{"title":"module:kdns/constants~B","link":"<a href=\"module-kdns_constants.html#~B\">B</a>","description":"<p>Number of bits for nodeID creation</p>"},{"title":"module:kdns/constants~K","link":"<a href=\"module-kdns_constants.html#~K\">K</a>","description":"<p>Number of contacts held in a bucket</p>"},{"title":"module:kdns/constants~MAX_UNIMPROVED_REFRESHES","link":"<a href=\"module-kdns_constants.html#~MAX_UNIMPROVED_REFRESHES\">MAX_UNIMPROVED_REFRESHES</a>","description":"<p>Quit refreshing no improvement</p>"},{"title":"module:kdns/constants~T_EXPIRE","link":"<a href=\"module-kdns_constants.html#~T_EXPIRE\">T_EXPIRE</a>","description":"<p>Interval for expiring local data entries</p>"},{"title":"module:kdns/constants~T_REFRESH","link":"<a href=\"module-kdns_constants.html#~T_REFRESH\">T_REFRESH</a>","description":"<p>Interval for performing router refresh</p>"},{"title":"module:kdns/constants~T_REPLICATE","link":"<a href=\"module-kdns_constants.html#~T_REPLICATE\">T_REPLICATE</a>","description":"<p>Interval for replicating local data</p>"},{"title":"module:kdns/constants~T_REPUBLISH","link":"<a href=\"module-kdns_constants.html#~T_REPUBLISH\">T_REPUBLISH</a>","description":"<p>Interval for republishing data</p>"},{"title":"module:kdns/contacts","link":"<a href=\"module-kdns_contacts.html\">kdns/contacts</a>","description":"<p>Interfaces for managing transport and implementation specific\naddress information.</p>"},{"title":"module:kdns/contacts~Contact","link":"<a href=\"module-kdns_contacts-Contact.html\">Contact</a>","description":"<p>An object containing implementation-dependant address data\nand a fingerprint.</p>"},{"title":"module:kdns/contacts~ContactList","link":"<a href=\"module-kdns_contacts-ContactList.html\">ContactList</a>","description":"<p>State machine used for sorting through {@link Contact}s during\na {@link Node#iterativeFindNode} lookup.</p>"},{"title":"module:kdns/contacts~ContactList#active","link":"<a href=\"module-kdns_contacts-ContactList.html#active\">active</a>"},{"title":"module:kdns/contacts~ContactList#add","link":"<a href=\"module-kdns_contacts-ContactList.html#add\">add</a>","description":"<p>Adds the given contacts to the list</p>"},{"title":"module:kdns/contacts~ContactList#closest","link":"<a href=\"module-kdns_contacts-ContactList.html#closest\">closest</a>"},{"title":"module:kdns/contacts~ContactList#contacted","link":"<a href=\"module-kdns_contacts-ContactList.html#contacted\">contacted</a>","description":"<p>Marks the supplied contact as contacted</p>"},{"title":"module:kdns/contacts~ContactList#responded","link":"<a href=\"module-kdns_contacts-ContactList.html#responded\">responded</a>","description":"<p>Marks the supplied contact as active</p>"},{"title":"module:kdns/contacts~ContactList#uncontacted","link":"<a href=\"module-kdns_contacts-ContactList.html#uncontacted\">uncontacted</a>"},{"title":"module:kdns/keys","link":"<a href=\"module-kdns_keys.html\">kdns/keys</a>","description":"<p>Utilities for handling routing keys, validation, distance computation,\nand cryptography.</p>"},{"title":"module:kdns/keys.compareKeyBuffers","link":"<a href=\"module-kdns_keys.html#.compareKeyBuffers\">compareKeyBuffers</a>","description":"<p>Compare two buffers for sorting</p>"},{"title":"module:kdns/keys.getBucketIndex","link":"<a href=\"module-kdns_keys.html#.getBucketIndex\">getBucketIndex</a>","description":"<p>Calculate the index of the bucket that key would belong to</p>"},{"title":"module:kdns/keys.getDistance","link":"<a href=\"module-kdns_keys.html#.getDistance\">getDistance</a>","description":"<p>Calculate the distance between two keys</p>"},{"title":"module:kdns/keys.getPowerOfTwoBufferForIndex","link":"<a href=\"module-kdns_keys.html#.getPowerOfTwoBufferForIndex\">getPowerOfTwoBufferForIndex</a>","description":"<p>Returns a buffer with a power-of-two value given a bucket index</p>"},{"title":"module:kdns/keys.getRandomBufferInBucketRange","link":"<a href=\"module-kdns_keys.html#.getRandomBufferInBucketRange\">getRandomBufferInBucketRange</a>","description":"<p>Generate a random number within the bucket's range</p>"},{"title":"module:kdns/keys.getRandomKeyBuffer","link":"<a href=\"module-kdns_keys.html#.getRandomKeyBuffer\">getRandomKeyBuffer</a>","description":"<p>Returns a random valid key/identity as a buffer</p>"},{"title":"module:kdns/keys.getRandomKeyString","link":"<a href=\"module-kdns_keys.html#.getRandomKeyString\">getRandomKeyString</a>","description":"<p>Returns a random valid key/identity as a string</p>"},{"title":"module:kdns/keys.hash160","link":"<a href=\"module-kdns_keys.html#.hash160\">hash160</a>","description":"<p>Returns the RMD-160 hash of the input</p>"},{"title":"module:kdns/keys.hash256","link":"<a href=\"module-kdns_keys.html#.hash256\">hash256</a>","description":"<p>Returns the SHA-256 hash of the input</p>"},{"title":"module:kdns/keys.isHexaString","link":"<a href=\"module-kdns_keys.html#.isHexaString\">isHexaString</a>","description":"<p>Tests if a string is valid hex</p>"},{"title":"module:kdns/keys.keyBufferIsValid","link":"<a href=\"module-kdns_keys.html#.keyBufferIsValid\">keyBufferIsValid</a>","description":"<p>Determines if the given buffer key is valid</p>"},{"title":"module:kdns/keys.keyStringIsValid","link":"<a href=\"module-kdns_keys.html#.keyStringIsValid\">keyStringIsValid</a>","description":"<p>Determines if the given string key is valid</p>"},{"title":"module:kdns/keys.toBinaryStringFromBuffer","link":"<a href=\"module-kdns_keys.html#.toBinaryStringFromBuffer\">toBinaryStringFromBuffer</a>","description":"<p>Converts a buffer to a string representation of binary</p>"},{"title":"module:kdns/node","link":"<a href=\"module-kdns_node.html\">kdns/node</a>"},{"title":"module:kdns/node~ExpirationStream","link":"<a href=\"module-kdns_node.html#~ExpirationStream\">ExpirationStream</a>","description":"<p>Reads objects from a {@link module:kdns/node~ReadableStore} and if an\nitem should be expired, requests deletion.</p>"},{"title":"module:kdns/node~Node","link":"<a href=\"module-kdns_node-Node.html\">Node</a>","description":"<p>Kademlia protocol implementation. Creates an interface for orchestrating\na Kademlia network and extending it.</p>"},{"title":"module:kdns/node~Node#event:message_queued","link":"<a href=\"module-kdns_node-Node.html#event:message_queued\">message_queued</a>","description":"<p>RPC message is queued for you to send. This is implementation\nspecific based on how you want to handle networking. This event\ncontains all the data necessary for you to handle transport.</p>"},{"title":"module:kdns/node~Node#event:storage_delete","link":"<a href=\"module-kdns_node-Node.html#event:storage_delete\">storage_delete</a>","description":"<p>Indicates that you may delete the item stored by the key. This is\ntriggered most likely by the expiration routine.</p>"},{"title":"module:kdns/node~Node#event:storage_expire","link":"<a href=\"module-kdns_node-Node.html#event:storage_expire\">storage_expire</a>","description":"<p>Expiration routine has started. A writable stream is provided. Only\nitems requiring expiration will be requested for deletion.</p>"},{"title":"module:kdns/node~Node#event:storage_replicate","link":"<a href=\"module-kdns_node-Node.html#event:storage_replicate\">storage_replicate</a>","description":"<p>Replication routine has started. A writable stream is provided. Only\nitems requiring replication will be replicated.</p>"},{"title":"module:kdns/node~Node#expire","link":"<a href=\"module-kdns_node-Node.html#expire\">expire</a>","description":"<p>Items expire T_EXPIRE seconds after the original publication. All items\nare assigned an expiration time which is &quot;exponentially inversely\nproportional to the number of nodes between the current node and the node\nwhose ID is closest to the key&quot;, where this number is &quot;inferred from the\nbucket structure of the current node&quot;.</p>"},{"title":"module:kdns/node~Node#iterativeFindNode","link":"<a href=\"module-kdns_node-Node.html#iterativeFindNode\">iterativeFindNode</a>","description":"<p>Basic kademlia lookup operation that builds a set of K contacts closest\nto the given key</p>"},{"title":"module:kdns/node~Node#iterativeFindValue","link":"<a href=\"module-kdns_node-Node.html#iterativeFindValue\">iterativeFindValue</a>","description":"<p>Kademlia search operation that is conducted as a node lookup and builds\na list of K closest contacts. If at any time during the lookup the value\nis returned, the search is abandoned. If no value is found, the K closest\ncontacts are returned. Upon success, we must store the value at the\nnearest node seen during the search that did not return the value.</p>"},{"title":"module:kdns/node~Node#iterativeStore","link":"<a href=\"module-kdns_node-Node.html#iterativeStore\">iterativeStore</a>","description":"<p>Performs a lookup to collect K contacts nearest to the given key,\nsending a STORE message to each of them. Note that if there is a\nprotocol/validation error, you will not receive it as a rejection.\nBe sure to also check that stored &gt; 0 as part of error handling here.</p>"},{"title":"module:kdns/node~Node#join","link":"<a href=\"module-kdns_node-Node.html#join\">join</a>","description":"<p>Inserts the given contact into the routing table and uses it to perform\na {@link Node#iterativeFindNode} for this node's identity,\nthen refreshes all buckets further than it's closest neighbor, which will\nbe in the occupied bucket with the lowest index</p>"},{"title":"module:kdns/node~Node#ping","link":"<a href=\"module-kdns_node-Node.html#ping\">ping</a>","description":"<p>Sends a PING message to the supplied contact, resolves with latency.</p>"},{"title":"module:kdns/node~Node#refresh","link":"<a href=\"module-kdns_node-Node.html#refresh\">refresh</a>","description":"<p>If no node lookups have been performed in any given bucket's range for\nT_REFRESH, the node selects a random number in that range and does a\nrefresh, an iterativeFindNode using that number as key.</p>"},{"title":"module:kdns/node~Node#replicate","link":"<a href=\"module-kdns_node-Node.html#replicate\">replicate</a>","description":"<p>Performs a scan of the storage adapter and performs\nrepublishing/replication of items stored. Items that we did not publish\nourselves get republished every T_REPLICATE. Items we did publish get\nrepublished every T_REPUBLISH.</p>"},{"title":"module:kdns/node~NodeOptions","link":"<a href=\"module-kdns_node.html#~NodeOptions\">NodeOptions</a>","description":"<p>Overridable options passed to {@link Node}.</p>"},{"title":"module:kdns/node~ReadableStore","link":"<a href=\"module-kdns_node.html#~ReadableStore\">ReadableStore</a>","description":"<p>Stream consumed by {@link module:kdns/node~ReplicatorStream} and\n{@link module:kdns/node~ReplicatorStream}.</p>"},{"title":"module:kdns/node~ReplicatorStream","link":"<a href=\"module-kdns_node.html#~ReplicatorStream\">ReplicatorStream</a>","description":"<p>Reads objects from a {@link module:kdns/node~ReadableStore} and if an\nitem should be replicated, performs an iterative store operation.</p>"},{"title":"module:kdns/node~StoredItem","link":"<a href=\"module-kdns_node.html#~StoredItem\">StoredItem</a>","description":"<p>Format of a storage entry.</p>"},{"title":"module:kdns/node~knuthShuffle","link":"<a href=\"module-kdns_node.html#~knuthShuffle\">knuthShuffle</a>","description":"<p>Shuffles an array in place.</p>"},{"title":"module:kdns/node~preventConvoy","link":"<a href=\"module-kdns_node.html#~preventConvoy\">preventConvoy</a>","description":"<p>Wraps the supplied function in a pseudo-random length timeout to help\nprevent convoy effects. These occur when a number of processes need to use\na resource in turn. There is a tendency for such bursts of activity to\ndrift towards synchronization, which can be disasterous. In Kademlia all\nnodes are requird to republish their contents every hour (T_REPLICATE). A\nconvoy effect might lead to this being synchronized across the network,\nwhich would appear to users as the network dying every hour. The default\ntimeout will be between 0 and 30 minutes unless specified.</p>"},{"title":"module:kdns/protocol","link":"<a href=\"module-kdns_protocol.html\">kdns/protocol</a>","description":"<p>Kademlia RPC handlers and protocol logic.</p>"},{"title":"module:kdns/protocol~HandlerResponse","link":"<a href=\"module-kdns_protocol.html#~HandlerResponse\">HandlerResponse</a>","description":"<p>The final argument passed to any protocol handler is a callback function.</p>"},{"title":"module:kdns/protocol~Protocol","link":"<a href=\"module-kdns_protocol-Protocol.html\">Protocol</a>"},{"title":"module:kdns/protocol~Protocol#FIND_NODE","link":"<a href=\"module-kdns_protocol-Protocol.html#FIND_NODE\">FIND_NODE</a>","description":"<p>The FIND_NODE RPC includes a 160-bit key. The recipient of the RPC returns\nup to K contacts that it knows to be closest to the key. The recipient\nmust return K contacts if at all possible. It may only return fewer than K\nif it is returning all of the contacts that it has knowledge of.</p>"},{"title":"module:kdns/protocol~Protocol#FIND_VALUE","link":"<a href=\"module-kdns_protocol-Protocol.html#FIND_VALUE\">FIND_VALUE</a>","description":"<p>A FIND_VALUE RPC includes a B=160-bit key. If a corresponding value is\npresent on the recipient, the associated data is returned. Otherwise the\nRPC is equivalent to a FIND_NODE and a set of K contacts is returned.</p>"},{"title":"module:kdns/protocol~Protocol#PING","link":"<a href=\"module-kdns_protocol-Protocol.html#PING\">PING</a>","description":"<p>This RPC involves one node sending a PING message to another, which\npresumably replies with a PONG. This has a two-fold effect: the\nrecipient of the PING must update the bucket corresponding to the\nsender; and, if there is a reply, the sender must update the bucket\nappropriate to the recipient.</p>"},{"title":"module:kdns/protocol~Protocol#STORE","link":"<a href=\"module-kdns_protocol-Protocol.html#STORE\">STORE</a>","description":"<p>The sender of the STORE RPC provides a key and a block of data and\nrequires that the recipient store the data and make it available for\nlater retrieval by that key.</p>"},{"title":"module:kdns/protocol~Protocol#event:storage_get","link":"<a href=\"module-kdns_protocol-Protocol.html#event:storage_get\">storage_get</a>"},{"title":"module:kdns/protocol~Protocol#event:storage_put","link":"<a href=\"module-kdns_protocol-Protocol.html#event:storage_put\">storage_put</a>"},{"title":"module:kdns/protocol~Protocol#events","link":"<a href=\"module-kdns_protocol-Protocol.html#events\">events</a>","description":"<p>Exposes events arising from handling protocol messages. Some of these\nevents may require handling if they pass a {@link Protocol~HandlerResponse}</p>"},{"title":"module:kdns/protocol~Protocol#router","link":"<a href=\"module-kdns_protocol-Protocol.html#router\">router</a>"},{"title":"module:kdns/router","link":"<a href=\"module-kdns_router.html\">kdns/router</a>"},{"title":"module:kdns/router~Router","link":"<a href=\"module-kdns_router-Router.html\">Router</a>","description":"<p>Kademlia routing table consisting of {@link module:kdns/constants~B} total\n{@link module:kdns/bucket~Bucket}s - each holding up to {@link module:kdns/constants~K}\ntotal {@link module:kdns/contacts~Contact}s.</p>"},{"title":"module:kdns/router~Router#addContactByNodeId","link":"<a href=\"module-kdns_router-Router.html#addContactByNodeId\">addContactByNodeId</a>","description":"<p>Adds the contact to the routing table in the proper bucket position,\nreturning the [bucketIndex, bucket, contactIndex, contact]; if the\nreturned contactIndex is -1, it indicates the bucket is full and the\ncontact was not added; kademlia implementations should PING the contact\nat bucket.head to determine if it should be dropped before calling this\nmethod again.</p>"},{"title":"module:kdns/router~Router#event:contact_added","link":"<a href=\"module-kdns_router-Router.html#event:contact_added\">contact_added</a>","description":"<p>Contact is inserted into the routing table</p>"},{"title":"module:kdns/router~Router#event:contact_deleted","link":"<a href=\"module-kdns_router-Router.html#event:contact_deleted\">contact_deleted</a>","description":"<p>Contact is evicted from the routing table</p>"},{"title":"module:kdns/router~Router#events","link":"<a href=\"module-kdns_router-Router.html#events\">events</a>","description":"<p>Exposes events arising from handling protocol messages. Some of these\nevents may require handling if they pass a {@link Protocol~HandlerResponse}</p>"},{"title":"module:kdns/router~Router#getClosestBucket","link":"<a href=\"module-kdns_router-Router.html#getClosestBucket\">getClosestBucket</a>","description":"<p>Returns the [index, bucket] of the occupied bucket with the lowest index</p>"},{"title":"module:kdns/router~Router#getClosestContactsToKey","link":"<a href=\"module-kdns_router-Router.html#getClosestContactsToKey\">getClosestContactsToKey</a>","description":"<p>Returns a array of N contacts closest to the supplied key</p>"},{"title":"module:kdns/router~Router#getContactByNodeId","link":"<a href=\"module-kdns_router-Router.html#getContactByNodeId\">getContactByNodeId</a>","description":"<p>Returns the contact object associated with the given node id</p>"},{"title":"module:kdns/router~Router#identity","link":"<a href=\"module-kdns_router-Router.html#identity\">identity</a>","description":"<p>Exposes events arising from handling protocol messages. Some of these\nevents may require handling if they pass a {@link Protocol~HandlerResponse}</p>"},{"title":"module:kdns/router~Router#indexOf","link":"<a href=\"module-kdns_router-Router.html#indexOf\">indexOf</a>","description":"<p>Returns the bucket index of the given node id</p>"},{"title":"module:kdns/router~Router#length","link":"<a href=\"module-kdns_router-Router.html#length\">length</a>","description":"<p>The total buckets in the routing table</p>"},{"title":"module:kdns/router~Router#removeContactByNodeId","link":"<a href=\"module-kdns_router-Router.html#removeContactByNodeId\">removeContactByNodeId</a>","description":"<p>Removes the contact from the routing table given a node id</p>"},{"title":"module:kdns/router~Router#size","link":"<a href=\"module-kdns_router-Router.html#size\">size</a>","description":"<p>The total contacts in the routing table</p>"}]}