npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@outlierventures/arweave-bundler

v0.3.2

Published

[![view on npm](https://img.shields.io/npm/v/@outlierventures/arweave-bundler.svg)](https://www.npmjs.org/package/@outlierventures/arweave-bundler) ![Licence](https://img.shields.io/github/license/OutlierVentures/arweave-bundler)

Downloads

78

Readme

Arweave Bundler

view on npm Licence

A library to simplify publishing single page web apps (SPAs) or other static content to the Permaweb aka Arweave.

It bundles your files together, so you can upload in one transaction, rather than uploading separate files using the using the ANS-104 standard.

It also maps individual file paths to their locations on Arweave via a manifest file so that your dApp works as if it was hosted on a S3 bucket.

Whether you prefer to use GitHub Actions or deploy directly through the CLI, arweave-hundler makes it easy.

The lib uses semantic versioning.

Requirements

  • An Arweave wallet
  • Some $AR (the simplest is to get a small amount through an exchange )

If you don't already have an Arweave wallet you can create one by running:

  pnpm install arweave
  node -e "require('arweave').init({}).wallets.generate().then(JSON.stringify).then(console.log.bind(console))" > wallet.json

GitHub Action

The action has multiple commands: upload, address, set. All commands require the private-key (base64 encoded) and the network to be passed. Optionally you can test the commands without broadcast a transaction by setting dry-run: true

upload

Specify the command upload and the directory to publish to the permaweb the entire directory as an ANS-104 bundle.

- name: upload the directory
  uses: outlierventures/[email protected]
  with:
    command: upload
    directory: build/
    private-key: ${{secrets.ARWEAVE_PRIVATE_KEY}}
    network: arweave.net

If an ant-address is provided the action will update the ArNS with the manifest-id of the bundle published. In order to use this feature is required to have an ArNS name. You can learn more here: https://ar.io/docs/arns/#overview and get an address here: https://arns.app/

- name: upload the directory
  uses: outlierventures/[email protected]
  with:
    command: upload
    directory: build/
    private-key: ${{secrets.ARWEAVE_PRIVATE_KEY}}
    ant-address: 'your-ant-address'
    network: arweave.net

set

Specify the command set to update an ant-address to a given manifest-id

- name: get the public address from the private key
  uses: outlierventures/[email protected]
  with:
    command: address
    private-key: ${{secrets.ARWEAVE_PRIVATE_KEY}}

address

Specify the command address to retrieve the public address from the private-key provided

- name: get the public address from the private key
  uses: outlierventures/[email protected]
  with:
    command: address
    private-key: ${{secrets.ARWEAVE_PRIVATE_KEY}}

Run the CLI

All the Github actions are available to the CLI as well

upload

npx @outlierventures/arweave-bundler@latest upload build/ --private-key ${PRIVATE_KEY}

alternatively you can upload and update the ant-address

 npx @outlierventures/arweave-bundler@latest upload build/ --ant-address your-ant-address --private-key ${PRIVATE_KEY}

set

 npx @outlierventures/arweave-bundler@latest set --ant-address your-ant-address --manifest-id your-manifest-id --private-key ${PRIVATE_KEY}

help

arweave-bundler <command>

Commands:
  arweave-bundler upload <directory>  Upload a directory to Arweave as bundle
  arweave-bundler address             Print the address of the wallet
  arweave-bundler set                 Set Arweave Name Token record to the manifest id

Options:
  --version  Show version number                                       [boolean]
  --help     Show help                                                 [boolean]

Developement requirement

  • Node v20 (LTS)
  • pnpm
  • npx
  • An Arweave private key with some $AR funds

Troubleshooting

  • Create a base64 encoded private key from a JSON file openssl base64 -in wallet.json -A -out base64key.txt
  • Export as string a privateKey
export PRIVATE_KEY=`cat base64key.txt`

Development

Test in local the CLI

rm -rf node_modules
pnpm i --prod
npx . address --private-key $PRIVATE_KEY