'OrbitDB can't replicate database on different peer

I have forced with problem in my p2p database orbitdb. Everything works fine while I did not move the database to another server.

const ipfsOptions = {
    repo: './ipfs'
}
const ipfs = await IPFS.create(ipfsOptions)
const orbitdb = await OrbitDB.createInstance(ipfs, { directory: './orbitdb' })

try {
    publicDB = await orbitdb.open("/orbitdb/zdpuB2kVAbJEk1aZBeeKcwz2ehfDaMWi3upkD3ZHwb15zesLF/hub")
    console.log(publicDB.get('hello'))
} catch (err) {
    console.log(err)
}

I created an orbit db on another computer and wanted to open from my computer, but it doesn't work, got TimeoutError: request timed out.

TimeoutError: request timed out
    at maybeThrowTimeoutError (D:\Source\iprs-node\node_modules\ipfs-core-utils\cjs\src\with-timeout-option.js:35:15)
    at D:\Source\iprs-node\node_modules\ipfs-core-utils\cjs\src\with-timeout-option.js:78:9
    at runNextTicks (internal/process/task_queues.js:60:5)
    at processTimers (internal/timers.js:497:9)
    at async Object.read (D:\Source\iprs-node\node_modules\orbit-db-io\index.js:59:17)
    at async OrbitDB.open (D:\Source\iprs-node\node_modules\orbit-db\src\OrbitDB.js:452:22)
    at async initOrbit (D:\Source\iprs-node\services\orbitdb\index.js:26:20)
    at async initAll (D:\Source\iprs-node\index.js:9:5) {
  code: 'ERR_TIMEOUT'
}

Does anyone know how to fix it? Or enlighten me, how this works?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source