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-resolver
API
To import and create a resolver object:
const ensIpfsResolver = let resolver = options
The default options are:
ethPort: 8545 ipfsPort: 8080
resolver.ensToUrl(name : string) : Promise
resolver // output: http://localhost:8080/ipfs/QmWeSMxMWpsrsJdBU6Zqc6DXZEf4WXHkPzBAdmPjmmHUna
resolver.ensToIpfsHash(name : string) : Promise
resolver // output: QmWeSMxMWpsrsJdBU6Zqc6DXZEf4WXHkPzBAdmPjmmHUna
Executable
Usage: ensipfs [options] <domain>
Options:
-e, --eth-rpc-port <n>
-i, --ipfs-port <n>
-h, --help
Example
$ ensipfs raksooo.ethhttp://localhost:8080/ipfs/QmWeSMxMWpsrsJdBU6Zqc6DXZEf4WXHkPzBAdmPjmmHUna