website logo
WebsiteGithubDiscordTwitterTelegramSDK
⌘K
Get started
Welcome to peaq
Introduction to peaq
Our mission
Our vision
Learn
Overview of networks
Economics
Tokens & Token Utility
Why Polkadot
Tech stack
Source code
Important links
Security Assessment Reports
Builders
SDK
Get started
Build
Integrate
Get inspired
Grants & Funding
Ecosystem and Community Initiatives
User Interfaces
peaq control
peaq portal
Node operators
Run a node
Tokens & Earn
Agung tokens (Faucet)
Wallets
Docs powered by archbee 

Generate DID

8min

Once connected, you will be able to create a peaq DID by using the...



Function: create(address, name, seed)

Parameters & types:


name REQUIRED <string>: representing the DID name. address <string>: representing the DID address. seed <string>: representing the seed phrase. callback <function>: for error handling.

code example


Note:

If the user has already passed the seed at the time of creating the SDK instance, then it is not necessary to pass it again at the time of creating the DID and address also.

It then creates an instance of the Sdk class from the @peaq-network/sdk library, passing in the baseUrl and seed.

It then calls the sdk.did.create()method with the namewhich returns the generated peaq DID.

Finally, it disconnects from the peaq network using the disconnect() method and returns the DID.

Notes:

if you have no balance in your seed or accout, you can get from our faucet



response object


hash: The hash is a value obtained after the peaq DID is created on the chain, and it is derived from the peaq DID document. The peaq DID document includes the peaq DID name and user public address, among other information.




Did this page help you?
Yes
No
PREVIOUS
Connection
NEXT
Read DID
Docs powered by archbee 
code example