This package provides a IPFS client as a NestJS Module.
Because the previous IPFS HTTP module has been depreciated, and the replacement kubo-rpc-client
is utter madness to work with in CommonJS (kubo-rpc-client
is a ESM library, which relies on ipfs-utils
which is a CommonJS library), I decided to manually implement the important endpoints.
That being said, truly ... fu** this ESM/CJS shit. Fu** it.
Here's what's supported:
- add
- get
- cat
- stats/dht
v0.2.0
is using NestJS 9 for legac reasons.
pnpm install nestjs-ipfs-http
This module expects a running IPFS daemon.
ipfs daemon
@Module({
imports: [
IpfsHttpModule.forRootAsync(IpfsHttpModule, {
useFactory: () => {
return {
client: {
host: '127.0.0.1',
port: 5001,
},
}
},
}),
],
})
export class AppModule {}
const isOnline = await ipfsHttpService.client.isOnline()
console.log(isOnline) // true
Refer to test/e2e/ipfs.spec.ts
for more examples.
pnpm run test