ens-ipfs-resolver
v1.0.2
Published
Content resolver for Ethereum name service
Maintainers
Readme
ENS IPFS resolver
This package provides an api and an executable which resolves the content hash of an ENS domain. It uses local Ethereum- and IPFS nodes if available and otherwise defaults to public gateways.
Installation
npm i -g ens-ipfs-resolverAPI
To import and create a resolver object:
const ensIpfsResolver = require('ens-ipfs-resolver')
let resolver = new ensIpfsResolver([options])The default options are:
{
ethPort: 8545,
ipfsPort: 8080
}resolver.ensToUrl(name : string) : Promise
resolver.ensToUrl("raksooo.eth")
.then(console.log)
// output: http://localhost:8080/ipfs/QmWeSMxMWpsrsJdBU6Zqc6DXZEf4WXHkPzBAdmPjmmHUnaresolver.ensToIpfsHash(name : string) : Promise
resolver.ensToIpfsHash("raksooo.eth")
.then(console.log)
// output: QmWeSMxMWpsrsJdBU6Zqc6DXZEf4WXHkPzBAdmPjmmHUnaExecutable
Usage: ensipfs [options] <domain>
Options:
-e, --eth-rpc-port <n>
-i, --ipfs-port <n>
-h, --helpExample
$ ensipfs raksooo.eth
http://localhost:8080/ipfs/QmWeSMxMWpsrsJdBU6Zqc6DXZEf4WXHkPzBAdmPjmmHUna