0.1.3 • Published 1 year ago

@artbycity/bundledao-node v0.1.3

Weekly downloads
-
License
AGPL-3.0-only
Repository
gitlab
Last release
1 year ago

BundleDAO Node

This is a JavaScript library written in TypeScript to accept Arweave ANS-104 Binary Bundles signed with a DeSo identity for payment delegation to the Arweave Network. See also BundleDAO Client

Install

$ npm i --save @artbycity/bundledao-node

Run Programmatically

import Arweave from 'arweave'
import BundleDAONode from '@artbycity/bundledao-node'

import arweaveJWK from './arweave-keyfile.json'

const ARWEAVE_PROTOCOL = process.env.ARWEAVE_PROTOCOL || 'http'
const ARWEAVE_HOST = process.env.ARWEAVE_HOST || 'localhost'
const ARWEAVE_PORT = process.env.ARWEAVE_PORT
  ? Number.parseInt(process.env.ARWEAVE_PORT)
  : 1984

const arweave = new Arweave({
  protocol: ARWEAVE_PROTOCOL,
  host: ARWEAVE_HOST,
  port: ARWEAVE_PORT
})

const seedHex = 'my-deso-seed-hex'

const bundleDAONode = new BundleDAONode(seedHex, arweaveJWK, arweave, 'dbpath')

await bundleDAONode.start()

Or with NuxtJS/NextJS/etc Server Middleware

// Same as above

const bundleDAONode = new BundleDAONode(seedHex, arweaveJWK, arweave, 'dbpath')
const callback = bundleDAONode.app.callback()

export default callback

About BundleDAO

BundleDAO on DAODAO