daviddias / ipfs-merkle-dag

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

IPFS Merkle DAG JavaScript Implementation

JavaScript Implementation of the DAGService, BlockService and Block + DAGNode data structures

Architecture

┌────────────────────┐
│   DAGService       │
└────────────────────┘
           │
           ▼
┌────────────────────┐
│   BlockService     │
└────────────────────┘
           │
     ┌─────┴─────┐
     ▼           ▼
┌─────────┐ ┌────────┐
│IPFS REPO│ │Exchange│
└─────────┘ └────────┘

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.

A DAGNode and a Block are data structures made available by this module.

Usage

$ npm i ipfs-merkle-dag
const ipfsMDAG = require('ipfs-merkle-dag')

// then, to access each of the components
ipfsMDAG.DAGService
ipfsMDAG.DAGNode
ipfsMDAG.BlockService
ipfsMDAG.Block

DAGNode

Block

DAGService

BlockService

##License License

About

License:ISC License


Languages

Language:JavaScript 100.0%