arweavedb
v1.0.5
Published
Read and write data to the Arweave Blockchain Database
Downloads
8
Readme
ArweaveDB
ArweaveDB is used to write and read the arweave blockchain database.
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);