• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

te0d/js-ipfs-cluster-api: A client library for the IPFS Cluster HTTP API, implem ...

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称:

te0d/js-ipfs-cluster-api

开源软件地址:

https://github.com/te0d/js-ipfs-cluster-api

开源编程语言:

JavaScript 100.0%

开源软件介绍:

js-ipfs-cluster-api

A client library for the IPFS Cluster HTTP API, implemented in JavaScript.

UNOFFICIAL AND ALPHA

This is a port of ipfs/js-ipfs-api adapted for the API exposed by ipfs/ipfs-cluster.

Install

This module can be installed through npm directly from the github repository.

npm install https://github.com/te0d/js-ipfs-cluster-api

Dependencies

This module requires ipfs-cluster to be running. It is assumed that the IPFS Cluster API is running on "127.0.0.1:9094".

Usage

To import the module:

var ipfsClusterAPI = require('ipfs-cluster-api')
// connect to ipfs-cluster daemon API server (displayed are default values)
var ipfsCluster = ipfsClusterAPI('localhost', 9094, {protocol: 'http'})

API

The API is currently a work-in-progress. The exposed methods are designed to be similar to ipfs-cluster-ctl provided in ipfs/ipfs-cluster.

ipfsCluster.id([options], [callback])

ipfsCluster.peers.ls([options], [callback])
ipfsCluster.peers.add(addr, [options], [callback]) // e.g. /ip4/1.2.3.4/tcp/1234/<peerid>
ipfsCluster.peers.rm(peerid, [options], [callback])

ipfsCluster.pin.ls([cid], [callback])
ipfsCluster.pin.add(cid, [options], [callback])   // e.g. { "replication_factor": 2 }
ipfsCluster.pin.rm(cid, [options], [callback])

ipfsCluster.status([cid], [callback])
ipfsCluster.sync([cid], [callback])
ipfsCluster.recover(cid, [options], [callback])

ipfsCluster.version([options], [callback])

Maintainer

This is a side project of mine (te0d).

The code is mostly from js-ipfs-api modified to consume the ipfs-cluster API.

Contribute

PRs Accepted.

License

MIT




鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap