Eternity-ipfs: An NPM package to interact with the Eternity API
Eternity-ipfs is a tiny NPM package to interact with Eternity, an API server you can use to store data eternally on Arweave's Blockchain just by providing an IPFS file hash.
This NPM package is a simple alternative to making API calls to Eternity manually using an HTTP client such as Axios or Fetch. It works on both client and server side.
Installation
It's as easy as:
sudo npm install eternity-ipfs
Usage
Eternity running locally or at any available endpoint.
You'll needImport and Init Eternity-ipfs:
const Eternity = Eternity;// OR; // init with the default endpoint (http://localhost:5000)let eternity = ; // Or init with a specific Eternity endpointlet eternity = 'https://eternity.example.com';
Store data eternally on Arweave's Blockchain with an IPFS file hash:
let main = async { let data = await eternity; console; // {"status": "success"}} ;
Get stored data on Arweave's Blockchain using an IPFS file hash:
let main = async { let data = await eternity; console; // {"data": "base64..."}} ;