KO
|
EN
gitlite — search
Search
#python
#ai-agents
#claude-code
#llm
#developer-tools
#claude
#cli
#mcp
#typescript
#mcp-server
#ai-agent
#ai
js-ipfs-merkle-dag
★ 21
Open GitHub ↗
[DEPRECATED]
Download README (.md)
Explore Similar Repositories
hyperemitter
:
Horizontally Scalable EventEmitter powered by a Merkle DAG
merkle-dag
:
Merkle DAG on top of LevelDB
ipfs-hyperlog
:
:link: IPFS Merkle DAG that replicates based on append-only logs and causal linking.
merkle-db
:
High-scalability analytics database built on immutable merkle-trees
hypergraph
:
Yet another Merkle DAG
// repository documentation
Was this content helpful?
★ 0
(0 ratings)
Select Rating:
★
★
★
★
★
Submit Feedback
Recent Feedback
×
Download README
Do you want to download the
README.md
file for
js-ipfs-merkle-dag
?
Download (.md)
# [DEPRECATED] js-ipfs-merkle-dag # DEPRECATED Please use [ipld/js-ipld-dag-pb](https://github.com/ipld/js-ipld-dag-pb) and [ipld/js-ipld-resolver](https://github.com/ipld/js-ipld-resolver) instead [](http://ipn.io) [](http://ipfs.io/) [](http://webchat.freenode.net/?channels=%23ipfs) [](https://coveralls.io/github/ipfs/js-ipfs-merkle-dag?branch=master) [](https://travis-ci.org/ipfs/js-ipfs-merkle-dag) [](https://circleci.com/gh/ipfs/js-ipfs-merkle-dag) [](https://david-dm.org/ipfs/js-ipfs-merkle-dag) [](https://github.com/feross/standard) [](https://github.com/RichardLitt/standard-readme) > JavaScript Implementation of the DAGService and DAGNode data structure ## Table of Contents - [Install](#install) - [Architecture](#architecture) - [Usage](#usage) - [API](#api) - [Contribute](#contribute) - [License](#license) ## Install ```bash $ npm i ipfs-merkle-dag ``` ## Architecture ```markdown ┌────────────────────┐ │ DAGService │ └────────────────────┘ │ ▼ ┌────────────────────┐ │ BlockService │ └────────────────────┘ ``` **DAGService** - The DAGService offers an interface to interact directly with a MerkleDAG object (composed by one or more DAGNodes that are linked), using the BlockService to store and fetch the DAGNodes as it needs them [**BlockService** - The BlockService uses IPFS Repo as the local datastore for blocks and an IPFS Exchange compliant implementation to fetch blocks from the network.](https://github.com/ipfs/js-ipfs-block-service) A DAGNode and DAGLink are data structures made available on this module. ## Usage ```js const ipfsMDAG = require('ipfs-merkle-dag') // then, to access each of the components ipfsMDAG.DAGService ipfsMDAG.DAGNode ipfsMDAG.DAGLink ``` ## API ### DAGNode Class Create a new DAGNode ```JavaScript var node = new ipfsMDAG.DAGNode([<data>, <[links]>]) ``` #### `addNodeLink` > creates a link on node A to node B by using node B to get its multihash #### `addRawLink` > creates a link on node A to node B by using directly node B multihash #### `updateNodeLink` > updates a link on the node. *caution* this method returns a copy of the MerkleDAG node #### `removeNodeLink` > removes a link from the node by name #### `removeNodeLinkByHash` > removes a link from the node by the hash of the linked node #### `copy` > creates a copy of the MerkleDAG Node #### `size` > (property) size of the node, in bytes #### `links` > (property) an array of `DAGLink`s belonging to the node #### `multihash` > returns the multihash (default: sha2-256) #### `marshal` > returns a protobuf serialized version, compatible with go-ipfs MerkleDAG #### `unMarshal` > deserializes a node encoded using protobuf #### `getPBNode` > used internally #### `makeLink` > used internally ### DAGLink Class Create a new DAGLink ```JavaScript var link = new ipfsMDAG.DAGLink(<name>, <size>, <hash>) ``` ### DAGService #### `put` > stores the node #### `putStream` > stores nodes using a writable pull-stream #### `get` > fetches a node by its multihash #### `getStream` > fetches a node as a pull-stream #### `getRecursive` > fetches a node and all of its links (if possible) #### `getRecursiveStream` > fetches a node and all of its links (if possible) as pull-stream #### `remove` > deletes a node ## License MIT © IPFS