Where communities thrive

  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
Repo info
  • Dec 03 04:33
    ndaidong closed #1292
  • Dec 01 16:01
    ameoba32 opened #1295
  • Dec 01 07:28

    amark on master

    toString must be stringy! (compare)

  • Dec 01 05:29
    amark commented #1287
  • Dec 01 05:21
    amark commented #1289
  • Dec 01 05:20
    amark commented #1293
  • Dec 01 05:12
    amark commented #1294
  • Nov 30 08:27
    soulofmischief commented #1294
  • Nov 28 23:07
    ViteOrder opened #1294
  • Nov 24 06:51
    expelledboy synchronize #1276
  • Nov 22 18:04
    BrendanDN commented #1290
  • Nov 22 18:04
    BrendanDN closed #1290
  • Nov 22 18:04
    BrendanDN commented #1290
  • Nov 22 17:59
    BrendanDN commented #1292
  • Nov 22 04:07
    ndaidong commented #1292
  • Nov 21 20:28
    verschmelzen opened #1293
  • Nov 21 19:44
    BrendanDN commented #1292
  • Nov 21 14:50
    ndaidong opened #1292
  • Nov 19 17:41
    estebanrfp commented #1080
  • Nov 18 21:26
    @rogowski banned @jesus:halogen.city

@amark thx. i understand 2 and 3 now.

Related to 1.:

I think i will only leave the variable in cesium.js (yellow) but define it as addUserLocation = gun.get('pin-list' +latitude-range + longitude-range).map().on(...) (pseudo code) but without the blue text. Then the gun.get fills the variable addUserLocation with the blue text from the picture above, right?

So the question is, how can i feed the blue text/code below into a Gun object with gun.put? (all brackets included)

  viewer: Viewer,
  userLocation: GeolocationPosition,
  userLocationCartesian: Cartesian3,
  userLocationPointId: string
) => {

And cool sideffect!!! : Since we feed the objects on the globe from Gun in runtime, we have the hot reloading right from the start! And with @draeder Gunsafe or part of it, we can have hot reloading code in general, on top. Or even independent from / without cesiumjs.


Hey guys, I have a question to open / on. When I'm using
gun.get('test').map().on((data) => console.log(data))
I'll get every entry with deepness of 1 Layer
gun.get('test').map().open((data) => console.log(data))
I would like to get every entry with full deepness.
-> I get only a view entrys (e.g. 3)

That's strange, how do I get the full list of entrys ?

1 reply
@Hr4rjuku: Have you tried load? You need to import it
1 reply
check the docs
Hey @amark or whoever is in charge of the types for Gun, the type for IGun is just wrong, when trying Gun.state.is(node, key), it comes up as a type error, because Gun.state is just a method that returns a number, so there is no is property on it. I feel like the types should just be disabled... But I don't know how without migrating all of my existing typescript code to JS, is there any other way?
Adam Bowman
@lightningx10 just create an instance of Gun and cast it to <any>
1 reply
peers: ["http://localhost:8765/gun"],
localStorage: false,
@amark If i can make the globe run on the classic gun relay, how much work is there to do, to make it run on the gun rust relay?
And what would be the advantage of using a gun rust relay instead of the classic gun relay?

@amark something else btw: i had a really great talk with a friend of mine the other day, and he introduced me to this dictionary which is like a universal language (pictures instead of words)

(arrow on the right to click trough some pages of the book)

My idea: Lets create a universal language / translation app with Gun. (a Gun killer app, maybe named Translate-Gun or Universal Translator something like that)
Which will be basically a picture database with an index (not words, but topic pictograms like in the book), a rating function, and Gun sync of course.

Lets drop all 650 pictograms from the book into Gun as a basic dataset. (I would buy and scan them to files myself, or i just search for new free license ones) And then on top, users could add more, custom pictograms, but these need to get rated first (if they are internationally understandable) before they are allowed by the community to get dropped into the GunDB too.

Cool idea?

1 reply
Mark Nadal

QUICK UPDATE (will catch up later)
Dan just helped me get a brute-force version of the AXE dht into prototyping...
so warning, in coming weeks, your peers might get randomly DDoSed as I fix bugs & quirks.
Already seeing some extremely promising results (and bugs need to fix). I am soooooo excited.
  • I'm tossing in some extra checks for the login system, to see if that'll get fixed too.
    More updates coming later!!!!
yeahhhh!!! 🔥🔥🔥🥳
@lightningx10 just pass gun to window as :any , sometimes its better like that unfortunately
That doesn't actually work what what I'm trying to do, as I'm using the import GUN itself, not the db = GUN('host'), I can't figure out how to import that as any. On the other hand, I found // @ts-ignore, which does the job just fine and allows me to remove it in the future when the TS implementation is better.
@amark @draeder do i maybe missunderstand the capabilities of Gun (loads text and images), but NEED Gunsafe (or part of it) to load code in runtime for my project?
Hello everyone here. I have a problem storing image base64 in React Native “exception in stringify-ing message: subtle digest...”. It works fine on the web. Do you know this error?
6 replies
Carlos Vega
Screen Shot 2022-08-04 at 10.24.52.png
Is this the error some of you have been getting?
Not me
Carlos Vega
After that I'm no longer able to write, seems like it's corrupted. This is with the latest version on npm (0.2020.1237)
4 replies
I encounter it whenever I'm processing something that's too big to put
Here's my snippet for chunking and encrypting. You can then put the encrypted pieces to GunDB, or your a storage place of your desire:
const chunkString = (str, length) => {
    return str.match(new RegExp('.{1,' + length + '}', 'g'));

const largeFile = {
    base64: '', // your base64
    type: '',

// chunk image / file into smaller pieces of ~10kbytes
const file_chunks = chunkString(largeFile.base64, 1024*10);

// create promise array
const encrypt_promises = file_chunks.map(chunk => SEA.encrypt(chunk, user._.sea));

// encrypt promises
const encrypted_chunks = await Promise.all(encrypt_promises);

// write chunks, either to CDN, S3, or GUN (large file so take care in GUN!)
Anyhow, I believe I'm working on a killer app, but not persè a gun-killer app. I'm still drawing out the architecture for robust data protection of gun-server nodes (small businesses or contributors), which offer services for consumption by gun-user nodes (apps)
Daniel Raeder


@amark @draeder do i maybe missunderstand the capabilities of Gun (loads text and images), but NEED Gunsafe (or part of it) to load code in runtime for my project?

Gunsafe stores code in gun, and provides a way to execute it. It really should not be considered "safe" for application use outside personal code snippet storage, retrieval and execution.

6 replies

So imagine this would work with gun, @worldpeaceenginelabs : you have users which are having a normal and general gundb experience with all the nice social features... but then they want someone to generate taylor-made videos or images using AI. So a service-provider can now 'advertise' its AI-image-creation-service through GunDB. Credits are bought through third-party payment channel, but tokens are registered to GunDB. The transactions then all complete, encrypted, and tracked within Gun:

  • User requests prompt / styles / video-prompts
  • Service nodes receives requests, processes according to token-economy and business logic
  • Service nodes put product, target-encrypted, on gun and notifies user
  • User receives notification and downloads digital good

One thing that's missing in this whole thing is lifecycle management, both from a data as from an information management perspective. How can Service-nodes protect their assets and 'service-ledger' so to speak? In my experiments, over the last few weeks, have shown that data can get corrupt sometime, or overwritten.

It's one thing to resolve conflicts when 30 parties are collaborating on a same canvas or document, but it's another thing to be certain from a business perspective, that while serving 10 000 k users daily, with about $3000 daily costs in AWS infrastructure (AI image generation), my private ledger is not fucked with, yet perfectly consistent with the rest of the network in case of trouble from the other nodes
And by "trouble", I mean the odd corrupt error like @alterx is getting. How to keep "one's service-node data" secure, backed-up, and reported on? How to entertain lifecycle and change management within a gun-only ecosystem, or ought one to introduce infrastructure gundb is meant to abolish (SQL for reporting, NoSQL for user-data, 3rd-party data-ingestion for dashboarding and viz)?
This is all enterprise architecture talk, but to go back to @worldpeaceenginelabs , a killer app requires an impeccable enterprise architecture, be it even a decentralised one where everyone can start an enterprise just by going to an url in his/her/* browser.
Do anyone here know who can do merges for webview-crypto and react-native-webview-crypto? They seems are not update to the latest. I have a few fixes for them.
Can anyone point me in the right direction? What should I do with error Invalid data: number at fh8q95.order.l6fhbcak.users.l6fhbcak.clockStatus.pausedAt.target. Where can I find further information about this error etc.
6 replies
Mark Nadal
Who is the person running a pirating site ontop of GUN?
Fess up now, to me, in a twitter DM.
Cause I turn on my DHT tests and my computer literally starts streaming 5MB/s of data from random peers out there
and when I peek at the data, its a whole catalogue if movie titles, descriptions, etc.
TBH, I have no clue how this is happening or working.
The DHT test is already connecting to random machines that should be impossible (it's already found Iris' rust peer, even tho we never coded it to find it, and I haven't even published the code yet! I'm not sure how this is possible.)
I've already seen the test crash multiple random relays.
I apologize, please watch your relays as they might get DDoSed as I'm trying to stabilize network.
And then I'll need everyone to upgrade code, so we're running the same stabilizers.
I guess I'll catch up with chats now instead, seeing some bugs reported.
Give me a bit to read thru & reply.
Mark Nadal
@VittorioParagallo I'm sorry to hear :( . My hope with Rust is that any/all other languages can bind/bridge to it easily, since it is hyped up as a "systems" language. Is that not true? I'd deeply appreciate it if you could share your experience with Rust+Flutter more, cause maybe it'll change my mind that Rust is not as universal as I thought. Anyone want to chime in here? Am I mistaken? + @tylerjwatson (PS, @mmalmi tyler was up for helping test Rust apps also.)
@worldpeaceenginelabs This is a cool idea. Tho I'm not actually sure what is going on with this pictogram app. ++ @adam_blvck:matrix.org 's ideas of scoring.
You want to have a separator between your lat/lon in your GUN get, so that way you don't accidentally mix them up on query. Further... lat/lon probably not what you want, you probably want to use the Z tile index + X/Y tile coordinates from the apps, not lat/lon. Unfortunately don't have time to explain it all.
(tho a neat thing: Is with the upcoming Book replacement in RAD and hopeful integration into AXE/GUN, could probably get "closest" data results from a query. Tho can't do 2 dimensions in 1 go... maybe would have to combine 2 different queries... not sure yet, will be cool to explore in future...).
Please be careful: never run arbitrary JS, it does not matter if it is encrypted or not, you risk security exploits. I am glad @draeder is repeating this. To me, getting access to hardware is easier attack ( + @adam_blvck:matrix.org ) than a lot of other types of attacks. NSA/etc. has all sorts of backdoors, even telecoms, for getting device ID etc. info.
@Hr4rjuku :clap: @Lexi:matrix.org :clap: @rococtz:matrix.org . I think this was a bug someone reported a while back... map().open(cb) is suppose to work (I thought it was) but they mentioned it doesn't. If you do just .open(cb) no map, do you see all items as sub-objects? Note, .open(cb, {depth: 5})may be a good idea - new feature! Tho that bug fix is needed. Anyone want to help?
@lightningx10 :clap: @abow :clap: @Manwe-777 .
@fitouch @adam_blvck:matrix.org webview-crypto-bridge is that slow? :( :( :/ I thought the bridge has access to all the real native cryptography standards, so digest/etc. should all be supported. No? Are you sure you're not in the non-bridge crypto.js shim?
@alterx @adam_blvck:matrix.org RAD is not updated to latest (it needs to be CPU scheduled, fix the enametoolong, etc.) so if you need storage you should probably stay on the older version. The process will start erring and fail to write, but please confirm: Old data / data on disk itself should not be corrupted, right? After a restart it reads?
The Book replacement in RAD is suppose to be the upgrade, and fixes the enametoolong issue which has been killing me for wayyyy too long - but this also requires migration, which I really really really don't want to write. But new RAD w/ Book hasn't been tested enough yet (Jonathan has been busy with real work, etc.). Overall, I'm just really scared about a lot of the storage stuff & upgrades, but current state also leads to errors too, so uuuggh. I feel stuck. Be nice if we could get some company or blockchain team to donate to have Jonathan work more hours, or if anyone else here can help contribute a bunch of testing - @alterx still willing to get on a screencall? You haven't sent me any times, tho lol, I also don't blame you, its tedious work.
@adam_blvck:matrix.org remember: GUN is NOT a globally consistent system, it is a highly available, partition tolerant system. Anything involving money should use a CP system, not AP. You can still do lifecycle/state management with GUN, like @davay42 just demoed with his kickstarter/gofundme example app (video & demo here) https://twitter.com/marknadal/status/1555405053569036288 , but actual money need/has to be transferred outside of the system. Likewise, the app should have a UI like he has, that lets both parties update whether the money was actually sent or not - so GUN can be used to track whether parties agree with each other or not.
1 reply
If both do, then it is probably safe to assume the non-GUN banking side (traditional, ACH, SWIFT, blockchain, whatever) succeeded, for programmatic purposes. But I always discourage people from doing banking on GUN itself, because its offline/local-first which is not how banks/payment systems work.
@fitouch OH WOW, that is wonderful to hear. Can you link me the PR or fork?
@fedox:fedox.pl oh odd, number is valid, that makes wonder if it is NaN since typeof NaN is number ROFL in js. Or Infinity is also a number that is not valid JSON (tho I want it to be valid in GUN. I LOVE infinity). :clap: @fitouch

I really like petite-vue. Easy to use and works fine. Quickly started by gun listener updates the Vue reactivity objects. Changes direct written to gun and synced back by gun.on to Vue store.
Store is used for reactivity in ui.
But at the moment limited to simple data structure (object or table like. No object with collection / table for now). Can't direct follow references.

I read gun could be direct used in svelte as store, but recommended is a separate store object? Also saw svelte can handle promises with "if" blocks. And I can't svelte use direct by script tag at client side.
Examples are code, but don't know how to compile to a static app.

React and alpinejs looks similar to Vue, but which one is better and easier working with gun as backend / storage?

Best would be to work with native gun node objects for easier use of gun references between nodes?

Short tested gun nodes, but with reactivity the Vue proxy around the gun object kills use of get / map methods?
@amark Thanks for your response. Yes when I'm using only .open (without map) it shows every item.

@amark thx. the pictures are used instead of words in a translation or travel dictionary. so even if you in a country which language or even their signs you dont understand, you will have that handy, digital dictionary of pictures, which everybody in the world will understand by showing plus additional hand gestures...

and its lat/long i will use, because its what cesium devs use already and it works out. imagine the 3D globe has a coordinate overlay in 2D. only problem that comes up very seldom is on mountains, but cesium has a workaround integrated, so the position is visualized on top of the mountain at the end.

Is there any way to gun.put the blue code snippet from above plain into gun? i want to try out whats possible... and look for security later...

@draeder is the code execution a gun feature or a gunsafe feature? is it possible to use the execution function from gunsafe solo?
@adam_blvck:matrix.org thx for the inspiration. i will copy paste your text and think it through.
@amark here's my first PR for LEX fix amark/gun#1268
@amark this one is for webview-crypto webview-crypto/webview-crypto#16 but webview-crypto is still slow only when we use user graph or frozen graph. I can tell the difference when storing text, image, etc that takes more than 2 seconds in React Native than web.
Right now I'm using CryptoJS to encrypt the data in public graph for now because it's so fast. I can't have a bad user experience with slow performance. I hope we can improve webview-crypto library.
GUN is still amazing!
Carlos Vega
@amark yeah, I haven't really had the bandwidth yet (I have my full time gig and a side project that we're launching to clients this month)
Also, I'm not using what's on master, i'm just using the latest release on npm. Or does that one already include the changes?
The data can be read, it's just that I could no longer write to that node. It was just dead. Stuck with the data it already had in
Carlos Vega
+1 to @fitouch 's PR to fix LEX in user space @amark :D
I'm having a hardtime figuring out how to implement GUN without using a browser. My goal is to have a bunch of relays/peers communicating but then browserless.
Tried setting up some nodejs apps but they only seem to write to a folder/file called radata and no datasharing happens between peers.