diff --git a/src/client/Web3RegistryClient.ts b/src/client/Web3RegistryClient.ts index 9521cc4..7db24f3 100644 --- a/src/client/Web3RegistryClient.ts +++ b/src/client/Web3RegistryClient.ts @@ -28,15 +28,12 @@ export class Web3RegistryClient { async getPeersFromRegistry(): Promise { let urls: string[] = [] - Object.keys(this.contracts).forEach( - async (chainId) => { - const provider = getProviderUrl(+chainId, this.apiKey) - const nodes = await this.getCleanedUrls(provider, +chainId) - urls = [...urls, ...nodes,] - } - ); - - console.log(urls) + const chainIds = Object.keys(this.contracts); + for (const chainId of chainIds){ + const provider = getProviderUrl(+chainId, this.apiKey) + const nodes = await this.getCleanedUrls(provider, +chainId) + urls = [...urls, ...nodes,] + } return urls } diff --git a/src/client/getRegistry.ts b/src/client/getRegistry.ts index b05c417..cdf8f53 100644 --- a/src/client/getRegistry.ts +++ b/src/client/getRegistry.ts @@ -11,6 +11,7 @@ export async function getRegistry(conf: any, peers: Peers, previsousChainObserve } const registry = new Web3RegistryClient(apiKey, peers); + await registry.connect(+network) for (const chain of previsousChainObserved){ await registry.connect(chain) }