Used to check for browser translation.
用于检测浏览器翻译。
ブラウザの翻訳を検出する

Connect to DID Space on Blocklet Setup

JianChao
2024-04-04 23:26
· edited

Overview#

If you want the application to determine during installation that all data will be stored on a specific DID Space (usually Owner) when starting up, then this tutorial will meet your needs.

By using this method of connecting to DID Spaces, the most typical application is NFT Maker. It connects to DID Spaces in the installation and startup process, obtaining the endpoint of the Owner's DID Space, and then all NFTs generated on the NFT Maker will be stored on this DID Space.

Prerequisite#

  • You already have your own DID Space for debugging. If you don't have one yet, you can refer to for more information.
  • Your application is configured with blocklet.yml#capabilities.didSpace set to requiredOnSetup.

Operation process#

Owner shows DID Space NFT#

When your application is installed, during the first startup process, you will be asked to connect to DID Spaces. Please choose the DID Space you want to use.

image.png

After successful connection, click continue to complete the installation.

image.png

The application reads the user's DID Space endpoint.#

At this point, your application can read the endpoint of DID Space through environment variables while running. Its value is like: BLOCKLET_APP_SPACE_ENDPOINT.


console.log(process.env.BLOCKLET_APP_SPACE_ENDPOINT);
// 输出形如: https://space.team.arcblock.io/app/api/space/zNKhe8jwgNZX2z7ZUfwNddNECxSe3wyg7VtS/app/zNKfEK9actwBeLhfVvc9U1p1CqVWxtivVxo6/object/
Sticker