ipfs-file-manager/IPFSManager.js

15 lines
298 B
JavaScript

import { create } from 'ipfs';
export default class IPFSManager {
async initIPFS() {
this.node = await create();
console.log('IPFS node is ready');
}
async closeIPFS() {
if (this.node) {
await this.node.stop();
console.log('IPFS node connection closed');
}
}
}