Security News
NIST Misses 2024 Deadline to Clear NVD Backlog
NIST has failed to meet its self-imposed deadline of clearing the NVD's backlog by the end of the fiscal year. Meanwhile, CVE's awaiting analysis have increased by 33% since June.
An append-only log on IPFS.
ipfs-log
is a partially ordered linked list of IPFS hashes where each entry in the log points to all known heads (a head is a node that is not referenced by other nodes in the log).
Originally created for, and currently used in, orbit-db - a KV-store and Event Log on IPFS
npm install ipfs-log
See ./examples
for more.
const Log = require('ipfs-log');
Log.create(ipfs, 'A')
.then((log) => {
log.add('one').then((node) => {
console.log('Node:', node.hash, node.payload);
});
})
.catch((err) => console.error(err));
const Log = require('ipfs-log');
All class methods take an ipfs-api
instance as the first parameter. See https://github.com/ipfs/js-ipfs-api for documentation.
const ipfs = require('ipfs-api')();
Create a log. Returns a Promise
that resolves to a Log
instance.
Log.create(ipfs, 'id').then((log) => console.log(log));
See Instance methods on how to use the log instance
Get the IPFS hash of this log. Returns a Promise
that resolves to an IPFS hash
.
Log.getIpfsHash(ipfs, log).then((hash) => console.log(hash));
Create a log from an IPFS hash. Returns a Promise
that resolves to a Log
instance.
Log.fromIpfsHash(ipfs, hash).then((log) => console.log(log));
Create a log from a log snapshot. Returns a Promise
that resolves a Log
instance.
Log.create(ipfs, 'id').then((log) => {
// Add items to the log
});
const snapshot = log.snapshot;
Log.fromSnapshot(ipfs, snapshot).then((log) => console.log(log));
Add a log entry. Returns the added node
.
log.add({ some: 'data' });
log.add('text');
// log1.items ==> [{ some: 'data' }, 'text']
Joins the log with other
log. Fetches history up to 256 items, ie. items that are not in this log but referred to in items in other
.
// log1.items ==> ['A', 'B']
// log2.items ==> ['C', 'D']
log1.join(log2);
// log1.items ==> ['A', 'B', 'C', 'D']
Empties the log.
Returns all items in the log.
const items = log.items;
// items ==> ['A', 'B', 'C']
Returns items in the current batch. Current batch are the items in the log that have been added after the latest sync with another log.
const snapshot = log.snapshot;
// snapshot ==> { id: 'log id', items: ['A', 'B', 'C']}
npm install
npm test
FAQs
Append-only log CRDT on IPFS
The npm package ipfs-log receives a total of 708 weekly downloads. As such, ipfs-log popularity was classified as not popular.
We found that ipfs-log demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 4 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
NIST has failed to meet its self-imposed deadline of clearing the NVD's backlog by the end of the fiscal year. Meanwhile, CVE's awaiting analysis have increased by 33% since June.
Security News
Cloudflare has launched a setup wizard allowing users to easily create and manage a security.txt file for vulnerability disclosure on their websites.
Security News
The Socket Research team breaks down a malicious npm package targeting the legitimate DOMPurify library. It uses obfuscated code to hide that it is exfiltrating browser and crypto wallet data.