async _recoverNodeL1Identity () {
    const endpoint = config.get('creatorNodeEndpoint')

    const retryTimeoutMs = 5000 // 5sec
    let isInitialized = false
    let attempt = 0
    while (!isInitialized) {
      this.logInfo(`Attempting to recover node L1 identity for ${endpoint} on ${retryTimeoutMs}ms interval || attempt #${++attempt} ...`)

      try {
        const spID = await this.libs.ethContracts.ServiceProviderFactoryClient.getServiceProviderIdFromEndpoint(
          endpoint
        )

        if (spID !== 0) {
          this.nodeConfig.set('spID', spID)

          isInitialized = true
          // Short circuit earlier instead of waiting for another timeout and loop iteration
          break
        }

        // Swallow any errors during recovery attempt
      } catch (e) {
        this.logError(`RecoverNodeL1Identity Error ${e}`)
      }

      await utils.timeout(retryTimeoutMs, false)
    }

    this.logInfo(`Successfully recovered node L1 identity for endpoint ${endpoint} on attempt #${attempt}. spID =  ${this.nodeConfig.get('spID')}`)
  }
/**
   * Poll L1 SPFactory for spID & set spID config once recovered.
   */
Poll L1 SPFactory for spID & set spID config once recovered.
Poll L1 SPFactory for spID & set spID config once recovered .
async _recoverNodeL1Identity () {
    const endpoint = config.get('creatorNodeEndpoint')
    const retryTimeoutMs = 5000 
    let isInitialized = false
    let attempt = 0
    while (!isInitialized) {
      this.logInfo(`Attempting to recover node L1 identity for ${endpoint} on ${retryTimeoutMs}ms interval || attempt #${++attempt} ...`)
      try {
        const spID = await this.libs.ethContracts.ServiceProviderFactoryClient.getServiceProviderIdFromEndpoint(
          endpoint
        )
        if (spID !== 0) {
          this.nodeConfig.set('spID', spID)
          isInitialized = true
          break
        }
      } catch (e) {
        this.logError(`RecoverNodeL1Identity Error ${e}`)
      }
      await utils.timeout(retryTimeoutMs, false)
    }
    this.logInfo(`Successfully recovered node L1 identity for endpoint ${endpoint} on attempt #${attempt}. spID =  ${this.nodeConfig.get('spID')}`)
  }
async _recoverNodeL1Identity ( ) { const endpoint = config . get ( 'creatorNodeEndpoint' ) const retryTimeoutMs = 5000 let isInitialized = false let attempt = 0 while ( ! isInitialized ) { this . logInfo ( ` ${ endpoint } ${ retryTimeoutMs } ${ ++ attempt } ` ) try { const spID = await this . libs . ethContracts . ServiceProviderFactoryClient . getServiceProviderIdFromEndpoint ( endpoint ) if ( spID !== 0 ) { this . nodeConfig . set ( 'spID' , spID ) isInitialized = true break } } catch ( e ) { this . logError ( ` ${ e } ` ) } await utils . timeout ( retryTimeoutMs , false ) } this . logInfo ( ` ${ endpoint } ${ attempt } ${ this . nodeConfig . get ( 'spID' ) } ` ) }
Poll L1 SPFactory for spID & set spID config once recovered.
Poll L1 SPFactory for spID & set spID config once recovered .
// 5sec // Short circuit earlier instead of waiting for another timeout and loop iteration // Swallow any errors during recovery attempt