Skip to content

Bolee95/icp-name-service

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

icp-name-service

ICP Name Service is a canister that contains the basic functionality of domain registration, transfer, revoking, history lookup, and reservation of the domain names. The canister has two roles defined with different access to the functionalities. It also implements a possibility like lookup using domain name and reverse lookup, available in existing naming services.

The following are the roles defined in the canister:

  • owner - the owner of the canister
  • user - the user of the canister, can be anyone

Owner

The sole purpose of the owner is to reserve the domains.

User

User can register, transfer and revoke the domains. He can also see the history of the domain.

Pre-requisites

Quickstart

Make sure yu have Node v18 installed. In case you are using nvm, you can run:

nvm use

You are sure you done it correctly if you run and see a proper version:

node --version

The following commands will install the required dependencies and build the project:

npm ci

In order to deploy the canister locally, we need dfx, which can be installed as a dependency of the project:

npm run dfx_install

Next, you want to start the local replica of ICP network:

npm run replica_start

The next step is to create identities for the owner and the user of the canister. You can do that by running:

npm run create_identities

Now you can deploy your canister locally. This will deploy canister using owner identity:

npm run canister_deploy_local

If you ever want to stop the replica:

npm run replica_stop

Interacting with the canister

Most of the interaction can be done via Candid UI generated on canister deployment. It will use a random identity to interact with the canister. This is enough to test the functionality available for the user. Anyway, the interaction via dfx can be also used if there is a need to use user identity created on deployment.

As there is no way to change the identity used when interacting via Candid UI, the owner functionlities must be used via dfx cli. The following is an example of how to reserve a domain:

dfx canister call icpns reserve "(record { name = \"boleee\"; extension = \"icp\"; wallet = principal \"2ibo7-dia\" })" --identity owner

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published