arweavedb
TypeScript icon, indicating that this package has built-in type declarations

1.0.5 • Public • Published

ArweaveDB

ArweaveDB is used to write and read the arweave blockchain database.

Known Vulnerabilities

Arweave uses an unique way of storing it's data, and this package can be used on servers or any other application that interacts with the blockchain.

ArweaveDB uses fs to write files and fast-glob to find blocks by height or by ID.

Installation

npm install arweavedb --save

Initialisation

import { ArweaveDB } from 'arweavedb';
 
const arweaveDB = new ArweaveDB(__dirname);

Getting started

And enjoy

// Add a block
await arweaveDB.addBlock(myBlock);
 
// Add a transaction
await arweaveDB.addTransaction(myTx);
 
// Get a block by ID
const block = await arweaveDB.getBlockById(blockId);
 
// Get a block by height
const block = await arweaveDB.getBlockByHeight(height);
 

Package Sidebar

Install

npm i arweavedb

Weekly Downloads

1

Version

1.0.5

License

GPL-3.0

Unpacked Size

49.3 kB

Total Files

13

Last publish

Collaborators

  • cedriking
  • goldzeus