Resolving an IPNS Name
How to obtain an IPFS CID from an IPNS name.
The resolution of IPNS names takes place across two different requests, first a request to initiate the IPNS name resolution, and second a request to check the resolution status that returns the results when available. The IPNS resolution requests are used to obtain the IPFS CID a provided IPNS name points to.
Start Resolution
Overview
The IPNS Resolution Initiation Request, a POST
request to the /ipns/resolve
endpoint, is a request used to initiate the IPNS name resolution process. This request is the first of two required for resolving IPNS names, with the Check Resolution Status section of this page describing the second part required for resolving IPNS names.
Sending the Request
Sending a request to the /ipns/resolve
endpoint requires a valid API Key to be provided in the x-api-key
header, and that an IPNS name be provided.
When an IPNS Resolution Initiation Request completes successfully, the returned output will contain a confirmation message that the resolution has been initiated, along with a taskId
to use in the IPNS Resolution Status Request.
In some cases when an IPNS Resolution Initiation Request is completed, a cached CID from a previous resolution request for the given IPNS name will be included.
Check Resolution Status
Overview
The IPNS Resolution Status Request, a GET
request to the /ipns/result
endpoint, is a request used to check the status of an initiated IPNS name resolution, and obtain the resolved IPFS CID when resolution is completed. This request is the second of two required for resolving IPNS names, with the Start Resolution section of this page describing the first part required for initiating the resolution.
Sending the Request
Sending a request to the /ipns/result
endpoint requires a valid API Key to be provided in the x-api-key
header, and that a taskId
from an IPNS Resolution initiation be provided.
When an IPNS Resolution Status Request completes successfully while the IPNS name associated with the provided taskId
is still in progress for resolution, a message will be provided in the output stating such.
When an IPNS Resolution Status Request completes successfully and the IPNS name associated with the provided taskId
has completed resolution, a confirmation message stating completion and the resolved CID will be provided in the output.
Last updated