Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 01:18
    amark commented #1311
  • 00:58
    amark edited #1311
  • Feb 08 17:36
    worldpeaceenginelabs commented #1311
  • Feb 08 17:09
    worldpeaceenginelabs commented #1311
  • Feb 08 16:26
    worldpeaceenginelabs commented #1311
  • Feb 08 16:16
    worldpeaceenginelabs commented #1311
  • Feb 08 11:08
    worldpeaceenginelabs commented #1311
  • Feb 08 10:55
    worldpeaceenginelabs commented #1311
  • Feb 07 12:28
    worldpeaceenginelabs commented #1311
  • Feb 07 12:18
    atjn commented #1305
  • Feb 07 04:27
    worldpeaceenginelabs commented #1311
  • Feb 07 02:29
    worldpeaceenginelabs commented #1311
  • Feb 07 02:21
    worldpeaceenginelabs commented #1311
  • Feb 07 02:20
    worldpeaceenginelabs commented #1311
  • Feb 07 02:15
    worldpeaceenginelabs commented #1311
  • Feb 07 02:13
    worldpeaceenginelabs opened #1311
  • Feb 06 22:39
    rex4539 commented #1299
  • Feb 04 17:12
    wayjake commented #1307
  • Feb 04 16:56
    wayjake commented #1307
Daniel Raeder
@draeder
@Omarabuziad I don't use react, so I can't help there
18 replies
Manwë
@Manwe-777
@Omarabuziad have you tried creating a global object outside React to use Gun? something like
// This outside React, at index.jsx
window.gunData = {};

// This elsewhere, try to not use useEffect !
gun.get("emails").on( (data)=>{
  // key could be some id inside data, or just replace the entire object
  window.gunData[key] = data;
})
1 reply
Bo
@worldpeaceenginelabs
has anybody experience with Gun and Bun? Sounds to me like they could go together good https://bun.sh/ https://youtu.be/FMhScnY0dME
1 reply
bitfinicon.com
@bitdom8
Hi, how can we save array?
gun .get('text') .put({ text: $addatreturntitle, who: 'Bitfinicon', when: new Date().toISOString(), hashtags: { 0: postidname1[0], 1: postidname1[1] } })
It saves the object. How can we take it from database and turn it into array?
Lexi
@Lexi:matrix.org
[m]
@Omarabuziad: can't you access your object/the data in the callback function? That way you don't need to wait until all the data is there to iterate over it
26 replies
cow
@0xcow
hi
i'm trying to build a decentralized chat room, is this current app that I'm using (hitter) built using gunjs?
1 reply
anyone have got good resource to build a chat room from scratch using gunjs?
2 replies
Lexi
@Lexi:matrix.org
[m]
Also, welcome
cow
@0xcow
thanks
what is iris search for lone wolf
Lexi
@Lexi:matrix.org
[m]
I had the same problem but noticed that I cannot tell at runtime whether the complete data has been received. At any time some other user could add data and that data wouldn't be there. So instead of waiting for data I decided to show data as soon as it's received because it's not possible to tell whether there is new data available. It will just also run the callback function. So I set that callback function to update the user interface. The user can still stop updates coming in
It's you, the developer, who has to decide when to stop listening for live updates. You could never stop, let the user decide, stop at a number of records, or on receiving data that has a specific form
cow
@0xcow
any chat application using gunjs I could take a look at? Iris is not a chat application per say
1 reply
entermonke
@entermonke:matrix.org
[m]
notabug has chat on it
iris too
cow
@0xcow
iris has a message function, not a group chat (think)
notabug.org?
oh I see the group chat on iris, thanks
2 replies
entermonke
@entermonke:matrix.org
[m]
iris chat
Daniel Raeder
@draeder
So, I was using Nord VPN up until yesterday when all of my browsing stopped working. The reason? ingest.sentry.io was down. It's a data tracker for marketing! https://confection.io/trackers/ingest-sentry-io/. If you use Nord VPN, I strongly suggest considering another VPN. But, this led me to realize that using device/machine ID for Gunsafe encryption might not be the best approach. Notice in the link that some browsers will allow trackers to consume your device/machine ID. @bmatusiak What are your thoughts about this? I know you have a hardware based solution, but that won't be viable for my API.
Daniel Raeder
@draeder
I think I'm going to generate a unique cryptographically secure key and store it on the device.. It's no less-secure than using machine ID since both approaches would require physical access to the device, and probably more secure than using machine ID since that ID can get leaked to trackers
6 replies
davay
@davay42

Hey guys! Yesterday I've started building my gift economy section for the @gun-vue project. And got the screen recording shared for those, who would like to see some Vite + Vue 3 + Gun + WindiCSS + Pug web development process. It may be boring and not too professional, but may be useful for those who just start building web apps.

https://youtu.be/z29qSr0YG2I

My idea is to make a decentralized donations platform so users can propose some gifts to other users, which they can approve or reject. The actual transaction should be somewhere in the middle. I build this as a piece of a greater public project funding platform.

If you don't have 4 hours to watch that, here's the SEA design I've came up with.

  1. A user publishes a content-addressed gift proposal {from:'pub1', to:'pub2', qn:'2', ql:'USD', wish:'For you', date: 'timestamp' } to a public graph '#gifts'
  2. the sender saves it's hash to his gun.user().get('gifts').get(hash).put(true) - this verifies the author
  3. Once the receiver gets the funding, he saves the hash to his gun.user().get('gifts').get(hash).put(true) and this means that the donation was successful.

So we can iterate over the list of all gifts reading the 'from' and 'to' fields to check if they are signed by the users and filter them out. Or we can just get a list of gifts for any user just by looking and their user/gifts lists of hashes. And once I get the projects section working, the projects will index the linked gifts hashes too, so we won't need to parse the main ever growing #gifts list, only for some stats maybe.

@amark Is this as a viable GUN data structure for the purpose?

3 replies
Bradley Matusiak
@bmatusiak
@draeder so with keypair.js, it takes data, and converts it to a key, the same is done in the hardware. so we can take the hardware key, generate a key->sharedSecret to itself and use that as the data to create a pair
so keypair(machineID, [ hardwarekey(machineid) , someAdditionalData ]
the hardware key can be used in cli apps with and without using the user interaction option so it can be used in something like a raspberry pi. hardware keys can be duplicated also for running multi Pi systems
Daniel Raeder
@draeder
@bmatusiak Thanks -- I'm just worried that browsers leak my machine ID, and even with additional data, the way I'm using that is the additional data is an index of sorts for keypair.js. This makes my data stored in Gun, encrypted by keypair.js vulnerable to brute force dictionary attacks. This is why I'm going with a randomly generated SEA pair that I store and re-use.
Ilham Gumilang
@ilhamgum
has anyone tried to persist data into MongoDB? Please i need some help
reset forward
@8745215_gitlab
Hey team Gun... I an new to development and was wondering a few things..
I cloned the repo from github, and then followed the gun.js beginners guide. after I was done the html, I have no idea what I am supposed to do...
I would like to set up a p2p for myself and friends.
I know everyone is going to say read this or that, I would love to.. Yet there are complications in doing that...
reset forward
@8745215_gitlab
I don;t want somene to build it for me I just would maybe like things explained a bit better???
Bradley Matusiak
@bmatusiak
yea, this is true, and is why i use a seed file for someAdditionalData. it can be a photo or something encrypted (that is decrypted)
rococtz
@rococtz:matrix.org
[m]
@8745215_gitlab: Sorry, do you want someone to explain the entire documentation to you a bit better? :) Maybe you can try to be more specific. I tried to achieve this small thing. I tried that and that, but I got that particular error. Here is a replicable example I made in jsfiddle.
Honestly, the only thing you can do is to start with the docs https://gun.eco/docs/ and read everything page by page until you feel comfortable
When you get stuck or you don't understand something, ask in here
Ilham Gumilang
@ilhamgum
so no one is persisting data to mongo?
@rococtz:matrix.org @bmatusiak @draeder @Lexi:matrix.org ?
nope?
Ilham Gumilang
@ilhamgum
or is it not necessary to persisting data in centralized DB like Mongo?
tedd pasta
@azdez:matrix.org
[m]
@ilhamgum: what do you mean? you want to persist data with gundb like mongodb does?
1 reply
entermonke
@entermonke:matrix.org
[m]
good news elons twitter deal is off https://www.cnbc.com/2022/07/08/elon-musk-notifies-twitter-he-is-terminating-deal.html hopefully he will invest in this space now, so much cheaper
rococtz
@rococtz:matrix.org
[m]
@ilhamgum: There is no benefit in persisting data in mongodb. If you have a server, why not persisting directly into fs?
Daniel Raeder
@draeder
@entermonke:matrix.org We sure could get a lot done with $44 billion :D
@rococtz:matrix.org MongoDB Cloud has some value like S3 as a data fallback
rococtz
@rococtz:matrix.org
[m]
@draeder: I don't think anyone invests 44 billion to get stuff done :) You invest 44 billion to make another 100 billion
Daniel Raeder
@draeder
@rococtz:matrix.org of course
Joel Mathew
@joel_mathew__twitter
hey guys
  import React , {useState} from 'react'
  import Gun from 'gun' 
  const gun = Gun() 

  const messages = gun.get('messages')

  function App() {
    const [message, setMessage] = useState('')

    const addMessage = e => {
      e.preventDefault()
      gun.put({message: message})
    }

    return (
      <>
        <h1>ToDo</h1>

        <form  onSubmit = {addMessage}>
            <input type="text" onChange={(e) => setMessage(e.target.value)} />
            <button type = 'submit'>Add</button>
        </form>

        {
            messages.map(m => {
              <p>{m.message}</p>
            }) 
        }
      </>
    )
  }

  export default App
this is the code i wrote for a simple chat dapp in gun
but i am getting an error