Switching Between Pools
In the multi-pool configurations
Last updated
Was this helpful?
Was this helpful?
async switchToPool(poolAlias: string, birthindex?: number): Promise<void>const curPool = zkClient.currentPool();
const allPools = zkClient.availabePools();
const newPool = allPools.find(p => p != curPool);
console.log(`Working on ${curPool} pool`);
console.log(`Available pools: ${allPools.join(',')}`);
if (newPool) {
console.log(`Switching to ${newPool} pool...`);
await zkClient.switchToPool(newPool);
console.log(`Welcome to ${zkClient.currentPool()} pool!`);
}