amark / gun

An open source cybersecurity protocol for syncing decentralized graph data.
https://gun.eco/docs
Other
18.05k stars 1.16k forks source link

Nodejs client server test #1223

Open pcfreak30 opened 2 years ago

pcfreak30 commented 2 years ago

PANIC test to check a node js client and server with 1 simple action.

Test not confirmed to be working as IDK how to test it. Copied and modified from load.js. I have attempted do disable radata with require('gun/lib/radix').file['radata'] = true; since there's no option for it as its not needed and causes different behavior.

amark commented 2 years ago

@pcfreak30 Thanks. I ran it, and I don't know why the 2 NodeJS instances are not syncing given that the classic AXE bug has already been addressed. Usually this works out of the box and other NodeJS<->NodeJS sync is still working in PANIC tests that init via browser API calls, so its odd this simpler example is not working, hopefully just something stupid internally in an adapter (since all core code, browser & NodeJS, is shared). Sadly however, debugging this is priority ranked under single-peer AXE relay performance (Browser<-WebRTC->Browser && Browser<->NodeJS<->Browser fallback) which we're testing against the 50M monthly users (check my twitter blogging about these updates, with the ~100K concurrent users/second). Fixing NodeJS<->NodeJS is obviously important to scaling the DHT, but each NodeJS (well, and Rust) needs to individually be maxed out first before testing larger setups.

This issue will stay open. Helpful steps forward would either be: (A) Since you have the PANIC test setup already, debug yourself by adding console.logs into the in/out hooks to see where the messages drop, whether at the API, the transport adapters, or receiving end. This is easy in browser (just pop open network tab) but takes a tad more time (for me, at least) in NodeJS which slows me down, so if you can make progress on it and notify me that might let us figure out the quick fix sooner. (B) Have a larger in-production user-base/use-case than the teams we're currently supporting or able to fund some other devs to help debug if you can't. (C) Help us finish the higher priority task so this then becomes the high priority task.

Obviously (A) is the best/simplest.

draeder commented 2 years ago

@pcfreak30 FYI, to run npm i mocha -g --save, then mocha node-server-client.js... if I remember correctly. Haven't played with PANIC for a couple weeks.