Here you can learn how to get ICNS set up in your environment to prepare for its integration


📕 Guides Index 📕

Navigate to the next steps here:

ICNS-js - Docs

1. Getting Started

2. Connecting to ICNS

3. Talking to ICNS


Talking To ICNS

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.


Instantiating A ICNS Canister Controller

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();

Non-Anonymous Controllers