@@ -92,49 +92,52 @@ const registerName = async ({ client, identity, name }) => {
9292// console.log('done saving vars')
9393// return nameRegistration
9494// }
95-
96- users . forEach ( async ( user ) => {
97- const clientOpts = {
98- dapiAddresses,
99- wallet : {
100- mnemonic : user . mnemonic ,
101- } ,
102- apps : {
103- dpns : {
104- contractId : process . env . NUXT_DPNS_CONTRACT_ID ,
105- } ,
106- primitives : {
107- contractId : process . env . NUXT_PRIMITIVES_CONTRACT_ID_local ,
95+ try {
96+ users . forEach ( async ( user ) => {
97+ const clientOpts = {
98+ dapiAddresses,
99+ wallet : {
100+ mnemonic : user . mnemonic ,
108101 } ,
109- jembe : {
110- contractId : process . env . NUXT_JEMBE_CONTRACT_ID_local ,
102+ apps : {
103+ dpns : {
104+ contractId : process . env . NUXT_DPNS_CONTRACT_ID ,
105+ } ,
106+ // primitives: {
107+ // contractId: process.env.NUXT_PRIMITIVES_CONTRACT_ID_local,
108+ // },
109+ // jembe: {
110+ // contractId: process.env.NUXT_JEMBE_CONTRACT_ID_local,
111+ // },
111112 } ,
112- } ,
113- }
113+ }
114114
115- console . dir ( clientOpts , { depth : 100 } )
115+ console . dir ( clientOpts , { depth : 100 } )
116116
117- const client = new Dash . Client ( clientOpts )
117+ const client = new Dash . Client ( clientOpts )
118118
119- try {
120- client . account = await initWalletAccount ( client )
119+ try {
120+ client . account = await initWalletAccount ( client )
121121
122- const identity = await createIdentity ( client )
122+ const identity = await createIdentity ( client )
123123
124- const nameRegistration = await registerName ( {
125- client,
126- identity,
127- name : `${ user . label } .dash` ,
128- } )
124+ const nameRegistration = await registerName ( {
125+ client,
126+ identity,
127+ name : `${ user . label } .dash` ,
128+ } )
129129
130- console . log ( 'nameRegistration :>> ' , nameRegistration )
130+ console . log ( 'nameRegistration :>> ' , nameRegistration )
131131
132- // await saveNameVars({ identity, nameRegistration })
133- } catch ( e ) {
134- console . error ( 'Something went wrong:\n' , e )
135- console . dir ( e , { depth : 100 } )
136- console . dir ( e . metadata , { depth : 100 } )
137- } finally {
138- client . disconnect ( )
139- }
140- } )
132+ // await saveNameVars({ identity, nameRegistration })
133+ } catch ( e ) {
134+ console . error ( 'Something went wrong:\n' , e )
135+ console . dir ( e , { depth : 100 } )
136+ console . dir ( e . metadata , { depth : 100 } )
137+ } finally {
138+ client . disconnect ( )
139+ }
140+ } )
141+ } catch ( e ) {
142+ console . log ( 'Error message:' , e ) ;
143+ }
0 commit comments