node-walrus is a JavaScript library for interacting with the Walrus blockchain. It provides a simple and intuitive API for developers to build decentralized applications (dApps).
Demo site: https://node-walrus-example.vercel.app/
https://github.com/Wujerry/node-walrus-example
- Auto download Walrus bin
- Api to interact with the Walrus blockchain
- Typescript support
- support vercel
To install Walrus-JS, use npm or yarn or pnpm:
npm install node-walrus
yarn add node-walrus
pnpm add node-walrus
const walrus = require('node-walrus')
const path = require('path')
// path to the walrus client config file
const walrusConfigPath = path.join(__dirname, 'client_config.yaml')
const suiWalletConfigPath = path.join(__dirname, 'sui_config.yaml')
const walrusClient = new walrus.WalrusClient(walrusConfigPath, suiWalletConfigPath)
const walrusInfo = await walrusClient.getInfo()
const res = await walrusClient.storeBlob('/path/to/file', { deletable: false })
const res = await walrusClient.readBlobToPath('blobId', '/path/to/file')
const res = await walrusClient.blobStatus({blobId: 'blobId'})
const res = await walrusClient.blobStatus({file: '/path/to/file'})
const res = await walrusClient.deleteBlob({blobId: 'blobId'})
const res = await walrusClient.listBlobs()