Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

188
Vistas
How to isolate a Gunjs database?

I've been trying out GunJs for a couple of days now and I'm really enjoying it. As a starter project I've followed the Fireship chat dapp video aimed at building your own chat.

Here's the issue, now that I've finished the tutorial I would like to create my own chat. However, for some reason if I get a 'chat' node within my own app it seems to pick up on the same 'chat' node as the tutorial one that is online.

onMount(() => {

    // Get Messages in large chat
    db.get('chat')
    .map()
    .once(async (data, id) => {
        if (data) {
            // key for E2E - to do: change for web3
            const key = '#foo';

            var message = {
                //transform the data
                who: await db.user(data).get('alias'),
                what: (await SEA.decrypt(data.what, key)) + '',
                when: GUN.state.is(data, 'what'), 
            };

            if (message.what) {
                messages = [...messages.slice(-100), message]
            }
        }
    })
})

This is also the case if I change the encryption key (then the messages just become undefined). Multiple questions arise from this:

  • Are graph node names unique within the whole of GunDb?
  • How do you handle conflicts where two gun-based apps call on the same node name?
  • Is this problem generally solved through filtering using 'header' props?
  • How do I make it pick up on only my data?

Even if I've read most of the docs, there seems to be something I'm missing in my comprehension of how the graph is generally seperated between apps. Any insight on how this works would be much appreciated.

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

Are graph node names unique within the whole of GunDb?

Yes.

How do you handle conflicts where two gun-based apps call on the same node name?

You don't. The expected result will be, they will overwrite each other.

Is this problem generally solved through filtering using 'header' props?

I don't think it's the right way to do it.

How do I make it pick up on only my data?

Use your own relay server.

Conclusion : gunDB doesn't really care about the who fetch / put the data. If you want to protect your data, use your own relay server (not a public one), and put data in your user space. user space is readonly to the public, but read/write for the owner.

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda