A javascript dnslink resolution implementation. See ipfs/go-dnslink for more information.
Create a dnslink binding via digitalocean.
An environment variable called DIGITAL_OCEAN_TOKEN
should be set.
$ jsdnslink update commontheory.io /ipfs/QmStyTZJJugmdFub1GBBGhtXpwxghT4EGvBCz8jNSLdBcy
Unable to find dnslink record, creating a new one
DNS record updated
import { update } from 'dnslink';
// async/await
await update('commontheory.io', '/ipfs/QmStyTZJJugmdFub1GBBGhtXpwxghT4EGvBCz8jNSLdBcy');
// promises
update('commontheory.io', '/ipfs/QmStyTZJJugmdFub1GBBGhtXpwxghT4EGvBCz8jNSLdBcy')
.then(() => /* Your logic */);
Get the CID associated with a domain. This evaluates via the DNS, not IPFS.
$ jsdnslink resolve commontheory.io
/ipfs/QmStyTZJJugmdFub1GBBGhtXpwxghT4EGvBCz8jNSLdBcy
import { resolve } from 'dnslink';
// async/await
const cid = await resolve('commontheory.io');
// promises
resolve('commontheory.io')
.then(cid => /* Your logic */);
This package is not maintained by, or affiliated with IPFS or Protocol Labs.