amark on master
ok ack + webrtc Merge branch 'master' of http:/… bump (ok ack + webrtc) @Draeder… (compare)
amark on master
websocket ../index to ./index (… (compare)
heres my code: https://github.com/SuaYoo/gundb-react-express-auth-example/blob/main/server/server.js#L42
in general, would be great to get feedback on what i have so far: https://github.com/SuaYoo/gundb-react-express-auth-example
react + express app with:
user.get('name').put(null)
it not only overwrites the bytes it synchronizes it on the network, other dweb/blockchain can't do this (its a new log entry) and centralized systems have duplicate copies of the data in different systems not connected by a sync protocol.null
are needed to tombstone the data (so they don't resync), the technique most people use is to "start a fresh new piece of paper" so like having the name of the node hold its year/month/day, then each day (or whatever timeframe) starting a new node by copying the previous values over (but not the nulls).Hey there everyone! Hope you are all doing well :)
I am currently looking to build a sveltekit app running on netlify using gun.js as an information store. Unfortunately, something isn't quite clicking for me. I cannot seem to get beyond this specific error: https://deploy-preview-2--laughing-austin-64bcf3.netlify.app/
My first thought was that this had something to do with SSR, so I tried disabling that, and it changed nothing. I tried creating the radata
folder, also no dice.
Apologies if this is a dumb question, but I am just getting my feet underneath me with frontend development/svelte/gun; any tips or tricks would be greatly appreciated!
All of my code can be seen here: thoward27/thor#2
require('gun/gun')
(in memory only) instead? I'm not entirely sure tho. Your app can be hosted on static sites, but WebRTC in browsers :( :( sadly still requires bootstrapping peers, which won't work on Netlify/static hosts.
GUN({rad:false})
and GUN({radisk: false})
, both resulted in the same error as before, failure to create the radata
folder {"errorType":"Error","errorMessage":"EROFS: read-only file system, mkdir 'radata'","trace":["Error: EROFS: read-only file system, mkdir 'radata'"," at Object.mkdirSync (fs.js:921:3)"," at Store (/var/task/.netlify/functions-internal/__render.js:9271:12)"," at Object.next (/var/task/.netlify/functions-internal/__render.js:9310:48)"," at Object.next (/var/task/.netlify/functions-internal/__render.js:9042:15)"," at Function.onto [as on] (/var/task/.netlify/functions-internal/__render.js:5219:17)"," at Function.Gun2.create (/var/task/.netlify/functions-internal/__render.js:5400:20)"," at new Gun2 (/var/task/.netlify/functions-internal/__render.js:5372:23)"," at Gun2 (/var/task/.netlify/functions-internal/__render.js:5370:20)"," at Object.<anonymous> (/var/task/.netlify/functions-internal/__render.js:15563:33)"," at Module._compile (internal/modules/cjs/loader.js:999:30)"]}
added the example to the wiki, thanks!
is there a way to manually add/trigger an error from gun middleware? i'm using bullet-catcher to verify JWTs, but since it fails silently, i cant tell the client to ask for another JWT. hoping for something like this:
if (isValid(msg)) {
to.next(msg)
} else {
// context.err = 'expired token'
// or
// msg.err = 'expired token'
// or...
// context.throwError('expired token)
}
i suppose i can do something like
if (isValid(msg)) {
to.next(msg)
} else {
gun.get(`~${appPubKey}`)
.get('errors')
.get(msg.headers.userPubKey)
.put('invalid token')
}
but that feels...weird? since anyone would be able to read this error? still wrapping my head around gun-space
@amark It sends to a remote server that contains the following code:
import Gun from 'gun';
import "gun/nts";
import "gun/lib/radix";
import "gun/lib/radisk";
import "gun/lib/store";
import "gun/lib/rindexed";
const PORT = 8080;
const HOST = "0.0.0.0";
var http = require('http');
var server = http.createServer();
var gun = Gun({ web: server, axe: false });
server.listen(PORT, HOST, () => {
console.log(`Server listening to localhost:${PORT}/gun`);
});
This is inside a docker container. The routing and ssl on the server is handled by nginx proxy manager (which runs in another docker container). And as we discussed, it is working fine for data that arrive in realtime. The client app is not able to fetch already existing data from this server.
Warning: AXE alpha became super slow & laggy, now in testing only mode!
. So I decided to not import AXE and that got rid of the problem. However, should I import AXE anyways or not? Thanks in advance(By the way, your hair is awesome!)
is there a way to manually add/trigger an error from gun middleware? i'm using bullet-catcher to verify JWTs, but since it fails silently, i cant tell the client to ask for another JWT
@SuaYoo
context.on('in', {'@': msg['#'], err: "error!"})
updated the example here to implement marks suggestion if anyones curious: https://github.com/SuaYoo/gundb-react-express-auth-example/pull/1/files
gun
will try to pull all the NodeJS modules automatically, try dropping the extra import statements, and see if that changes anything? (If not, then try turning AXE back on). If these last checks don't work then I don't know what is going on, and maybe would need to screenshare or something.GUN([peer1, peer2,
etc.hey guys, I have a pretty weird issue with .map()
gun.get('dict').map((data, key) => {
if (data == 1)
return { data, key, status: 1}
else
return {data, key, status: 2}
}).once({ data, key, status } => {
console.log(data, key, status)
})
that's just an example, thing is that pretty often .map() does not call .once(). Any idea why?
map().once((data,key) => { if(data === 1){ ...
are there any issues?