在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称:orbitdb/ipfs-log开源软件地址:https://github.com/orbitdb/ipfs-log开源编程语言:JavaScript 98.1%开源软件介绍:ipfs-log
Every entry in the log is saved in IPFS and each points to a hash of previous entry(ies) forming a graph. Logs can be forked and joined back together. The module works in Node.js and Browsers.
Table of ContentsBackgroundIPFS Log has a few use cases:
It was originally created for, and currently used in, orbit-db - a distributed peer-to-peer database on IPFS. Requirements
InstallThis project uses npm and nodejs.
UsageSee the API documentation and examples for more details. Quick StartInstall dependencies:
Run a simple program: // For js-ipfs >= 0.38
const Log = require("ipfs-log");
const IdentityProvider = require("orbit-db-identity-provider");
const IPFS = require("ipfs");
const start = async () => {
const identity = await IdentityProvider.createIdentity({ id: "peerid" });
const ipfs = await IPFS.create({ repo: "./path-for-js-ipfs-repo" });
const log = new Log(ipfs, identity);
await log.append({ some: "data" });
await log.append("text");
console.log(log.values.map((e) => e.payload));
};
start();
// [ { some: 'data' }, 'text' ] Node.jsSee examples for details. If your platforms requires ES5-compatible JavaScript, there's a build in BrowserSee examples/browser for details. The distribution package for browsers is located in dist/ipfslog.min.js If your platforms requires ES5-compatible JavaScript, there's a build in APISee API Documentation for full details. TestsRun all tests:
Run tests with js-ipfs only (default):
Run tests with go-ipfs only:
BenchmarkingTo use the benchmark runner: node --expose-gc benchmarks/runner/index.js -r --grep append-stress --stress-limit Infinity This will run the BuildRun the following command before you commit.
This will ensure that dependencies and built files are all based on the current code base. BenchmarksThere's a benchmark suite in benchmarks/ that can be run with:
There's ContributeIf you find a bug or something is broken, let us know! PRs and issues are gladly accepted too. Take a look at the open issues, too, to see if there is anything that you could do or someone else has already done. Here are some things I know I need: TODO
LicenseMIT © 2016-2018 Protocol Labs Inc., 2016-2019 Haja Networks Oy |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论