Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
it('replicates logs', async () => {
await waitForPeers(ipfs1, [id2], channel)
for (let i = 1; i <= amount; i++) {
await input1.append('A' + i)
await input2.append('B' + i)
const hash1 = await input1.toMultihash()
const hash2 = await input2.toMultihash()
await ipfs1.pubsub.publish(channel, Buffer.from(hash1))
await ipfs2.pubsub.publish(channel, Buffer.from(hash2))
}
console.log('\nAll messages sent')
const whileProcessingMessages = (timeoutMs) => {
return new Promise((resolve, reject) => {
setTimeout(() => reject(new Error('timeout')), timeoutMs)
const timer = setInterval(() => {