Skip to content

Commit

Permalink
update randomDidName creation (#1) (#39)
Browse files Browse the repository at this point in the history
  • Loading branch information
Rithwik0480 authored Sep 21, 2023
1 parent 36396f7 commit 927e839
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/demo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import { encryptMessage } from './utils/encrypt_message'
import { generateRequestCredentialMessage } from './utils/request_credential_message'
import { getChainCredits, addAuthority } from './utils/createAuthorities'
import { createAccount } from './utils/createAccount'
const { NETWORK_ADDRESS, ANCHOR_URI } = process.env
const { NETWORK_ADDRESS, ANCHOR_URI, DID_NAME } = process.env
function getChallenge(): string {
return Cord.Utils.UUID.generate()
}
Expand All @@ -35,6 +35,7 @@ const timeoutId = setTimeout(() => {
async function main() {

const networkAddress = NETWORK_ADDRESS ?? 'wss://sparknet.cord.network'
const didName = DID_NAME ?? `infinite.sentinel`
const anchorUri = ANCHOR_URI ?? '//Sparknet//1//Demo'
Cord.ConfigService.set({ submitTxResolveOn: Cord.Chain.IS_IN_BLOCK })
await Cord.connect(networkAddress)
Expand Down Expand Up @@ -129,8 +130,8 @@ async function main() {

// Step 2: Create a DID name for Issuer
console.log(`\n❄️ DID name Creation `)
const randomDidName = `solar.sailer.${randomUUID().substring(0, 4)}@cord`

const randomDidName = `${didName}.${randomUUID().substring(0, 8)}@cord`
await createDidName(
issuerDid.uri,
authorityAuthorIdentity,
Expand Down

0 comments on commit 927e839

Please sign in to comment.