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 ?
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?
@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?
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.
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!)
@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.
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:
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.
Invalid data: number at fh8q95.order.l6fhbcak.users.l6fhbcak.clockStatus.pausedAt.target
. Where can I find further information about this error etc.
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?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?
@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...