Trying out GUN.js, getting a error I don't understand

85 Views Asked by At

I am trying to get started with Gun db, I want to build a completely decentralized database for one of my projects, I have local instances of an nodejs api running on the users machines, now I want to use Gun.js to add decentralized databasing to each instance.

I have this code on "Client 1"

import GUN from 'gun';
const gun = new GUN();
gun.get('bb10a2e7-aa34-4d87-8160-1b1c7356c13a').get('popularMoveis').put('movie 1');

and this on "Client 2"

import GUN from 'gun';
const gun = new GUN();
const popularMovies = gun.get('bb10a2e7-aa34-4d87-8160-1b1c7356c13a').get('popularMoveis');
console.log(popularMovies);

But I get this error "Error: addMembership EHOSTUNREACH at Socket.addMembership (node:dgram:852:11) at Socket. (C:\Users\Talon - Personal\Desktop\Cinnatorr\DatabaseTesting\node_modules\gun\lib\multicast.js:28:18) at Socket.emit (node:events:525:35) at startListening (node:dgram:181:10) at node:dgram:369:7 at process.processTicksAndRejections (node:internal/process/task_queues:83:21) { errno: -4073, code: 'EHOSTUNREACH', syscall: 'addMembership' }"

please advice on what possible issues could be, I am still not 100% sure if a server is a requirement or not, does gun.js work exactly the exactly same in the browser and in nodejs?

0

There are 0 best solutions below