@@ -6,6 +6,7 @@ import { fromGlobal, toGlobal } from "./mapper/mapper";
6
6
import type { IMapping } from "./mapper/mapper.types" ;
7
7
import axios from "axios" ;
8
8
import { v4 as uuidv4 } from "uuid" ;
9
+ import { logger } from "./logging" ;
9
10
10
11
/**
11
12
* Standalone function to spin up an eVault
@@ -99,7 +100,7 @@ export async function createGroupEVault(
99
100
try {
100
101
// Step 1: Spin up the eVault
101
102
const evault = await spinUpEVault ( registryUrl , provisionerUrl , finalVerificationCode ) ;
102
-
103
+
103
104
// Step 2: Create GroupManifest with exponential backoff
104
105
const manifestId = await createGroupManifestWithRetry (
105
106
registryUrl ,
@@ -138,7 +139,7 @@ async function createGroupManifestWithRetry(
138
139
maxRetries = 10
139
140
) : Promise < string > {
140
141
const now = new Date ( ) . toISOString ( ) ;
141
-
142
+
142
143
const groupManifest : GroupManifest = {
143
144
eName : w3id ,
144
145
name : groupData . name ,
@@ -155,12 +156,12 @@ async function createGroupManifestWithRetry(
155
156
for ( let attempt = 1 ; attempt <= maxRetries ; attempt ++ ) {
156
157
try {
157
158
console . log ( `Attempting to create GroupManifest in eVault (attempt ${ attempt } /${ maxRetries } )` ) ;
158
-
159
+
159
160
const response = await axios . get (
160
161
new URL ( `resolve?w3id=${ w3id } ` , registryUrl ) . toString ( )
161
162
) ;
162
163
const endpoint = new URL ( "/graphql" , response . data . uri ) . toString ( ) ;
163
-
164
+
164
165
const { GraphQLClient } = await import ( "graphql-request" ) ;
165
166
const client = new GraphQLClient ( endpoint ) ;
166
167
@@ -229,7 +230,7 @@ export class Web3Adapter {
229
230
dbPath : string ;
230
231
registryUrl : string ;
231
232
platform : string ;
232
- provisionerUrl ?: string ;
233
+ provisionerUrl ?: string ;
233
234
} ,
234
235
) {
235
236
this . readPaths ( ) ;
@@ -277,6 +278,8 @@ export class Web3Adapter {
277
278
data . id as string ,
278
279
) ;
279
280
281
+ logger . info ( `Handling change for table ${ tableName } with data: ${ JSON . stringify ( data ) } ` )
282
+
280
283
if ( ! this . mapping [ tableName ] ) return
281
284
console . log ( "We get here?" )
282
285
// If we already have a mapping, use that global ID
@@ -375,7 +378,7 @@ export class Web3Adapter {
375
378
provisionerUrl ?: string
376
379
) : Promise < { w3id : string ; uri : string } > {
377
380
const finalProvisionerUrl = provisionerUrl || this . config . provisionerUrl ;
378
-
381
+
379
382
if ( ! finalProvisionerUrl ) {
380
383
throw new Error ( "Provisioner URL is required. Please provide it in config or as parameter." ) ;
381
384
}
@@ -404,7 +407,7 @@ export class Web3Adapter {
404
407
provisionerUrl ?: string
405
408
) : Promise < { w3id : string ; uri : string ; manifestId : string } > {
406
409
const finalProvisionerUrl = provisionerUrl || this . config . provisionerUrl ;
407
-
410
+
408
411
if ( ! finalProvisionerUrl ) {
409
412
throw new Error ( "Provisioner URL is required. Please provide it in config or as parameter." ) ;
410
413
}
0 commit comments