Here you can learn how to get ICNS set up in your environment to prepare for its integration
Navigate to the next steps here:
When talking to ICNS via the SDK, first you need to instantiate an ICNS canister controller, and then you can interact with the three canisters in the ICNS architecture: the registrar, the reverse record, the resolver, and the registry canister.
ICNS has four canister controller classes that can be imported, ICNSRegistrarController
, ICNSRegistryController
, ICNSResolverController
, and ICNSReverseController
.
import {
ICNSRegistrarController,
ICNSRegistryController,
ICNSResolverController,
ICNSReverseController,
} from '@psychedelic/icns-js';
By default these controllers are instantiated as anonymous, meaning that they’re only able to query from the ICNS canister they’re wired to and will return an error if attempting to make update calls.
Making an anonymous controller is done like this:
const anonRegistryController = new ICNSRegistryController();