Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
Carlos Vega
@alterx
@davay42 amazing! So this means LEX reverse sorting is finally working?
Suleiman Zhukov
@SuleimanZhukov
@Omarabuziad @lightningx10 @ilhamgum @draeder @Lexi:matrix.org @bmatusiak @Lexi:matrix.org
Guys, how to solve syncing problem?
Or how to add button that will sync all the data?
Without refreshing the page
Daniel Raeder
@draeder
@SuleimanZhukov one workaround: you could just force a page refresh onload with window.location('https://yourpage.com')
1 reply
VittorioParagallo
@VittorioParagallo
hi everybody, i'm migrating my flutter app from firestore and i got courious/excited about gun. Is there any dart implementation? I saw only dartgun.. but it doesn't seem usable. I already checked the chronology in here..
davay
@davay42
@alterx no, i'm achieving nice performance with plain map() with lightweight virtual scroll. And sort the whole list when the update stream pauses for a small debounce timeout
Carlos Vega
@alterx
This is the way insert Mandalorian GIF
Hopefully someday we'd be able to skip the sorting and defer that to our database. That should boost the performance even further
Just saw the video @davay42 , awesome work! :D
Suleiman Zhukov
@SuleimanZhukov

@lightningx10 @ilhamgum @draeder @Lexi:matrix.org @bmatusiak @rococtz:matrix.org @realdocweird @amark
Guys, I subscribed to some nodes with on(), now how to render them on every change in ReactJS? I'm using useEffect() hook and trying to render the change but doesn't seem to work? This is what I wrote:

const [msg, setMsg] = useState([])

useEffect({
  someFunctionToUpdateMsg()
}, [msg])    // If I write it here, it will be looping through this function permanently.
             // Even if I write setMsg here it doesn't work.

const someFunctionToUpdateMsg = () => {
  someNode
    .map()
    .on(data => {
      const newValue = doingSomeStuff()
      setMsg(newValue)    // Update msg.
    })
}

So, I subscribe on everyone of them with on(), but when I change any of them with setMsg() it doesn't update the UI the DOM?
How to solve this thing?

Chandan Das
@champ5898
I am getting this in console: 1ZBrhLygn', err: 'Unverified data.', $: Gun, #: 'wSTllu9oI', _: ƒ}
What does this means?
Bo
@worldpeaceenginelabs

@amark @spoggy:matrix.org

https://github.com/worldpeaceenginelabs/METAVERSE-GUN

So i have this combination of Iris (Gun) and a CesiumJS globe running https://metaverse-gun.pages.dev/

Now i want to populate the globe with Gun entries.

Need your help here, please.

BACKGROUND:

I found partly the way of how to populate the globe with pins from Gun!

A pin could contain a post /event /mission /brainstorming/ petition /crowdfunding / location / party / product / giveaway /drop or catch up location of whatever, a person, your dog, your car, just name it 😁) !whatever the metaverse dev wants!

So if the user clicks on the globe, it opens up a form with multiple fields to drop a pin with a post on the globe. Which opens on click a card with the form input from the post creator. (form is prefilled with the click/tap coordinates, which works already in my globe i work with)

On the form side, i will use an extended version of form-gun. Which works solo already too. https://github.com/worldpeaceenginelabs/FORM-GUN

But on the globe side, ill want to make the globe updating on Gun updates. Objects get manually added to the globe with this unhandy constructor usually: https://github.com/worldpeaceenginelabs/CLOUD-ATLAS-SVELTE/blob/main/src/Cesium.svelte#L171 (its just Typescript btw)

But i want to automate that part, so the globe acts like a Gun group chat for instance.

Every "chat message" (form input) is shown on the map as a pin. Auto updating as far as i understand Gun???

QUESTIONS:

1.Is the CesiumJS constructor just unhandy and can i translate it into something Gun can distribute? (total coding beginner in general question)

But Gun specific:

2.When a user saves a new form in Gun, all globes of all other users will receive that update on Gun, but only the new data gets downloaded, the already downloaded Gun entries I can just safe in local storage, right? (5MB is theoretically around 5 Million pins (form input = max 1byte or 1000 ascii characters)
Or is the size of an record = form input + Gunspecific + SEA?

Is that a possible scenario? Thinking it through for some time now and want to know, does this work out or do i under/over estimate, miss something?

3.Is there a way to filter/limit the download of Gun entries? Like limited to a region where the user is, or limited to the region the user focuses on the globe? (which information we have in the gun entry itself from the click coordinates) Is that a LEX query maybe? (best: instead of all of my users waisting the whole localStorage for all 5 Million pins, i like every user to store only his related, max 5 Million pins)

Suleiman Zhukov
@SuleimanZhukov
@lightningx10 @ilhamgum @draeder @Lexi:matrix.org @bmatusiak @rococtz:matrix.org @realdocweird @amark
Guys, what if I go above 5MB localStorage, what would happen?
I tried it, I have more that 5MB stored now. Nothing seem to be wrong.
Suleiman Zhukov
@SuleimanZhukov
Guys?
davay
@davay42
@SuleimanZhukov with any use of user space the data contains all the pub keys and signatures and 5MB localstorage limit is exceeded quite fast. Then weird thing start happening 😆 Consider using IndexedDb at first place
rococtz
@rococtz:matrix.org
[m]
@SuleimanZhukov: There's really no need to tag people unless you have a question for that specific question. The limit is pretty clear, it's 5MB. Maybe try turning a 50MB file into text and try again
Suleiman Zhukov
@SuleimanZhukov
@davay42 @rococtz:matrix.org Guys, but why it is still working good?
2 replies
Andre
@ahg:it-dengler.de
[m]
I know gun.on("auth", ()=>{} event. Is there a list of internal events? Something like leave to check logout?
Daniel Raeder
@draeder
@ahg:it-dengler.de gun.user().is returns the logged in user's public keys. If the user is not logged in, it returns undefined
4 replies
Andre
@ahg:it-dengler.de
[m]
Would be nice to know if there are more useful "internal" events like auth. Workaround is a logout function which set logout state to vue store variable. That works for me
lightningx10
@lightningx10
Hey @amark just wondering if there's any way to natively integrate using the localForage library?
rococtz
@rococtz:matrix.org
[m]
@lightningx10: local forage is just a wrapper for local storage and for indexed db. Gun supports both. You can use IndexedDB if you like directly
Andre: There something like bye for leaving but that's not reliable. The right way to do it is to have that user update some node every x seconds/minutes saying "I am here, I am here, I am here". If you want to see if someone is online, you check that node's timestamp and make sure it's more recent than whatever seconds/minutes.
Mark Nadal
@amark
@tylerjwatson were you able to talk to @mmalmi about ROD? Definitely need more Rusters testing it out please.
@ahg:it-dengler.de correct, user-from-pair is missing account setup, you need to manually index it to an alias (something like gun.get('~@alias').set(user) I think, tho this is pointless without a password to derive a Proof-of-Work seed), this needs to get cleaned up - PRs welcome.
@abow I'd think RAD is causing some issues, but that'd be at startup when it has to check folder. Do you notice the CPU gets triggered after a certain event?
Could you PR the docker fixes/updates?
@realdocweird :clap: @realdocweird glad you found a fix, could you make a note of that in place you think would be appropriate in docs?
@estebanrfp <3 :)
@ahg:it-dengler.de :clap: @rococtz:matrix.org .
@davay42 :fire: :fire: :fire: I RTed your video on this the other day. :) :) and anyone else: Please make little videos of your projects!
@SuleimanZhukov :clap: @draeder .
@VittorioParagallo unfortunately. Would it bind to Rust tho?
@alterx book keeps every record lexically sorted, so any query will find a closest page - intentionally designing this for the plethora of chat apps to infinity scroll in by just tossing in +new Date for "give me most recent chat" (even if last messages were days old!) and lastSessionDate for "start me at where I was before", then you just take timestamp of lowest or highest chat as you scroll down or up, to continue the pages!
@SuleimanZhukov check out @rococtz:matrix.org examples & snippets, he's React expert here!
:clap: @davay42 :clap: @rococtz:matrix.org correct, your .put(data, ack => console.log(ack.err) will start erring. @lightningx10 GUN should not drop/delete old localStorage data, please report a bug if it does!!!
@champ5898 tried to save data to a user when not logged in yet? Something like that?
@worldpeaceenginelabs :fire: :fire: ! I'm not experienced with Cesium (but seeing their zoomable tiles gets me excited). (2) you need to make sure they're subscribed to the same list, so on page load you could do gun.get('pin-list').map().on(...) but (3) correct, as it grows over time, you'll want to limit that. Instead maybe do gun.get('pin-list-'+ cesium.tileX + cesium.tileY + cesium.tileZ (pseudo code! Check examples/move/index.html or examples/where in GUN for tile tips from Leaflet).
@ahg:it-dengler.de really should be a User event, not a GUN event - trying to fix that in future. leave is synchronous (not async) so no event needed - tho I get what you're saying, you can do your own custom events just by doing gun.on('foo', {data}) :). Oh, bye is for network logic, not User. Heartbeat :+1: .
@lightningx10 :clap: @rococtz:matrix.org .
Thanks @adam_blvck:matrix.org .
1 reply
Tyler Watson
@tylerjwatson
@amark Not yet man, still need to find more time to work on it, I am on struggle street with it atm
Bo
@worldpeaceenginelabs
image.png

@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
) => {
  viewer.entities.add(
    createPulsatingPoint(
      viewer,
      userLocationPointId,
      Cartesian3.fromDegrees(
        userLocation.coords.longitude,
        userLocation.coords.latitude,
        0
      ),
      Color.LIME
    )
  );
};

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.

Hr4rjuku
@Hr4rjuku

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
BUT
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
rococtz
@rococtz:matrix.org
[m]
@Hr4rjuku: Have you tried load? You need to import it
1 reply
check the docs
lightningx10
@lightningx10
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
@abow
@lightningx10 just create an instance of Gun and cast it to <any>
1 reply
<any>Gun({
peers: ["http://localhost:8765/gun"],
localStorage: false,
});
Bo
@worldpeaceenginelabs
@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?
Bo
@worldpeaceenginelabs

@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)
https://www.bic-media.com/mobile/mobileWidget-jqm1.4.html?buyButton=no&clickTeaser=no&download=no&ePubScrolling=no&flipBook=no&fullscreen=yes&links=no&metadata=no&noMobilePreCover=no&optimizeSize=no&resizable=yes&showMenu=no&search=no&showExtraDownloadButton=no&showExtraFacebookButton=no&showExtraFullScreenButton=no&showExtraShopButton=no&showFullScreenButton=no&showLanguageButton=no&showTAFButton=no&tellafriend=no&isbn=978-3-12-514156-8

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
@amark

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.
BUT IT IS BECOMING ALIVE.
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!!!!
Bo
@worldpeaceenginelabs
yeahhhh!!! 🔥🔥🔥🥳
Manwë
@Manwe-777
@lightningx10 just pass gun to window as :any , sometimes its better like that unfortunately
lightningx10
@lightningx10
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.
Bo
@worldpeaceenginelabs
@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?
fitouch
@fitouch
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
@alterx
Screen Shot 2022-08-04 at 10.24.52.png
Is this the error some of you have been getting?
fitouch
@fitouch
Not me
Carlos Vega
@alterx
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
@amark
ADAM BLVCK
@adam_blvck:matrix.org
[m]
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!)
ADAM BLVCK
@adam_blvck:matrix.org
[m]
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
@draeder

@worldpeaceenginelabs

@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