Where communities thrive

  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
Repo info
  • Jan 26 19:44
    dweorh updated the wiki
  • Jan 26 17:10
    phantomlsh commented #1193
  • Jan 26 12:22
    Jourdelune closed #1183
  • Jan 26 12:22
    Jourdelune commented #1183
  • Jan 26 10:17
    atordvairn commented #1183
  • Jan 26 10:16
    atordvairn commented #1183
  • Jan 26 01:36
    phantomlsh opened #1193
  • Jan 25 06:54
    janbkrejci commented #1119
  • Jan 24 22:51
    lmangani commented #68
  • Jan 24 22:39
    ericvrp commented #68
  • Jan 24 13:27
    705queenbee commented on ce20e07
  • Jan 21 08:17
    Orimay synchronize #1191
  • Jan 21 08:11
    Orimay synchronize #1191
  • Jan 19 18:24
    julesl23 opened #1192
  • Jan 16 08:22
    davay42 updated the wiki
  • Jan 16 08:20
    davay42 updated the wiki
  • Jan 16 06:22
    Orimay opened #1191
  • Jan 16 05:22

    amark on master

    Update README.md (#1181) (compare)

  • Jan 16 05:22
    amark closed #1181
  • Jan 16 05:22
    amark commented #1181
Nicolas Frati
Hey guys! I was making a little research of GUN, and found this video of Mark talking about AXE a couple of years ago. Wanted to know what was the state of that and where I can learn a little bit more. I've found AXErunners.com but not sure if it's the same protocol. Sorry if it's an ignorant question
sua yoo

is there a way to manually add/trigger an error from gun middleware? i'm using bullet-catcher to verify JWTs, but since it fails silently, i cant tell the client to ask for another JWT

@SuaYoo context.on('in', {'@': msg['#'], err: "error!"})

updated the example here to implement marks suggestion if anyones curious: https://github.com/SuaYoo/gundb-react-express-auth-example/pull/1/files

Connor Davis
https://youtu.be/LDG9T2hN7i0 As you all know I have been working on an app, Here is the Demo Video
Mark Nadal
@deathg0d will you do me a favor and... in NodeJS gun will try to pull all the NodeJS modules automatically, try dropping the extra import statements, and see if that changes anything? (If not, then try turning AXE back on). If these last checks don't work then I don't know what is going on, and maybe would need to screenshare or something.
@Monknow <3 thanks :) :) :) . AXE in browser is experimental and not necessary, if you remove it tho, you need to add/specify peers GUN([peer1, peer2, etc.
@connor-davis :fire: yay
@rrmckinley:matrix.org nice tip off! Have any connections to him?
@jnfrati we announced before them and are not related to them. AXE is like 40% complete, if you want to help build the last 60% we have quite a few "PANIC" tests we simulate it under to test against. Curious?
@SuaYoo :pray: thank you! Did it work for you too?
@connor-davis Nice, can I tweet about this?
@amark: no connection no. It is left-field for them and makes me think there may be a tipping point in interest in decentralization and zero knowledge
Hey folks, I have a couple questions about gun. When I use sessionStorage: true with gun.user, I notice that my alias is now encrypted when I revisit the page. Which now means I have to use SEA to decrypt it. If this is false, feel free to let me know. However, what should I decrypt it with? User.is only has 3 options, alias, epub, and pub. Thanks for your help.
any one in genz mafia? cant find it in my discord anymore and can only guess i got kicked for shilling
@amark hey man! Im having a problem with users, maybe you found a better way of doing this, but, what is the defacto, best and proper way of making user accounts recoverable using Gun? The passphrase/hint method is quite bad to be honest, people forget just details of their passwords like a number or an uppercase, and the hint unless it contains the whole password, does not help in those situations. I have had a LOT of complaints with this particular issue.. Have you found a solution for that, or rather, an alternative?
@amark Do you have some time? Can you please fix the issue #1137 ?
Mark Nadal
@achilldotes_twitter interesting that also seems like a bug.
@libensveto_twitter I was there a long time ago. What were you "shilling"?
@Manuel-777 the problem is no other system even comes comparably close to any method, at all :( so something is better than nothing. Luckily, @aethiop built a 3FA method too! https://twitter.com/marknadal/status/1427715775838572545
@mimiza agreeeeeeed, after being gone on legal stuff for the few weeks, I've back been in docs world and then Brave said they'd review my SecureRender proposal. I need to fix this for you, can it be done after SecureRender or no?
@amark if it is possible I want it to be fixed soon, but it's up to you to arrange your time. There are certify unit tests and some bus delayed for weeks now. I just want to finish them.
@amark myself mainly, they get abit uptight if you do it in the wrong channel or start asking for help
Oscar Hilton
Major breakthrough in my understanding of GUN! Thank you everyone to helped me out!
@amark Konva is a canvas library that makes developing UIs in the canvas super simple! :)
Hey so I’ve made a lot of progress since my last question. I have each gun instance listening to nodes and waiting for changes on certain nodes but I’m worried about the network being flooded with malicious “put” operations, making it hard to get data we actually want to see. I suppose I could maintain a blacklist for each client but I feel like that might spiral out of control since creating a new user is so easy that the blacklist would become untenable in size even via a complex implementation. Any suggestions? Is there any clever way for me to embed metadata in property names to use lex to filter out data from “bad” sources or is implementing an adapter more helpful for me here?
Barłomiej Bąk

hey guys, I have a pretty weird issue with .map()

gun.get('dict').map((data, key) => {
  if (data == 1) 
    return { data, key, status: 1}
  return {data, key, status: 2}
}).once({ data, key, status } => {
  console.log(data, key, status)

that's just an example, thing is that pretty often .map() does not call .once(). Any idea why?

Mark Nadal
@libensveto_twitter :+1:
@oscarhilton (?)
@mochic Iris' Web of Trust is what fixes this. Don't worry tho, launch your app first, do not over-engineer it, you can integrate Iris and stuff later.
@dweorh_twitter hmm, there are minimal tests for filter and transform functions in map. if you just do map().once((data,key) => { if(data === 1){ ... are there any issues?
@libensveto_twitter w0000 nice homepage!!! Clicking "start" didn't do anything tho
1 reply
@amark yep havnt linked it up yet
Ronald Prato
Hey there! i've been reading the docs all day and i'm still having a question about delete data. What if i have a medium-deeply nested schema? if i set null to a node which have other relationships those get deleted as well ?
Wasis Haryo Sasoko
@Ronald-Prato no.
kristof de spiegeleer
trying to figure out how to use gun with typescript, but the examples I found don't work, anyone an idea, would be great
@amark Is there a way to log get requests on a node.js gun server?
yash deore
How long does a gun js server hold on to data .
Asking because I made a chat app but some hours later it did not show the previous messages .
Did you have a relay node set up or did you just use the browser's local storage?
has anyone combined RxJS with gun?
@yash-deore i think the one click heroku peers delete data every 15 mins
@yash-deore: if you are using some community gun relay (or even yours) that happen to be deployed on heroku free tier, the storage will be wiped after some minutes of inactivity. If you are using some real production environment it will be stored for ever.
@mossmanpete RxJS with Gun is a really good idea since they are both working with streams, definitely doable
Mark Nadal
@Ronald-Prato @despiegk @yash-deore @simjnd:matrix.org 👋👋
@rococtz:matrix.org 👏
@adam-12:matrix.org 👏
@simjnd:matrix.org 👏
@despiegk very few people seem to know how to fix typescript 😥 could someone on discord tag the typescript role and tell them to move here?
Mark Nadal
@deathg0d not an ways flag, but could add an adapter gun.on('in', cb
Tho it may need to be wired correctly, I need to update those docs...
I wonder if just using dts-gen to generate new typescript definition files would be better than what we have now.
yash deore
@rococtz:matrix.org @adam-12:matrix.org @amark Thanks a lot for your anticipation guys 😀.
Devin Santamaria

hey amazing ppl - I'm building a nextjs app, and getting the following err thrown when using getServerSideProps - interestingly, neither page is using any gun functionality.

ERROR    Error: Cannot find module './lib/text-encoding'
Require stack:
- /var/task/node_modules/gun/sea.js

has anyone run into this, or is a next/gun wizard who'd be willing to take a peak at my code?


@amark so the problem seems to be docker. My setup was:

ufw firewall
    - docker-compose
        - nginx proxy manager docker container
        - gundb node.js docker container

I could not debug the issue at all. All realtime updates are fine but unable to receive old data from the client side. I put logs on the node.js server to make sure it does have the data and it does. Connections also look fine. I have no idea what's wrong. It feels like when I spin up the docker instance and connect remote clients to it, the clients connect to a different gun instance that has no record of old file, which is so weird.

I changed the setup to:

ufw firewall
    - docker-compose 
       - nginx proxy manager docker container
    - gundb node.js run using pm2 instead of inside a docker container

And now the issue seems to be solved. I have some other pressing tasks right now so cannot really play around more for the time being, but it would be great if I could solve this using the docker container (docker compose). By doing this I could avoid node dependencies on the host machine. It would also be easier to maintain the server.

Mark Nadal
@webprismdevin look for any import or require statements of gun in your project (?)
@deathg0d wow that seems obscure, I can't believe you figured it out. Is it because Docker routes to a different container? I'm sure there is a way to force "sticky" sessions cause websockets in general need this.
Hey, there seem to be problem with: https://gun-manhattan.herokuapp.com/gun . I remember there was list of community /fallback gun servers do you know where i can find them?
Mark Nadal
@MaciejDot may be end-of-month it only has so many hours per month it can run. https://github.com/amark/gun/wiki/volunteer.dht yipes, I need to get docs & Secure Render finished so I can get on AXE again (which will automatically choose peers for you)
@amark thanks a lot for help

@despiegk i had the same problem i wrote some proxy types but its bit hacky and i dont use all functions from api so i didnt need full interface also i restricted their usage to end on first on() or once()

import Gun, { SEA } from "gun";
import 'gun/axe'
import 'gun/sea'
import { IGunConstructorOptions } from "gun/types/options";
import { AckCallback } from "gun/types/types";

type AuthArgs = [username: string, password: string, callback: (data: { err?: string }) => any] | [ pair :SEAPair, callback: (data: { err?: string }) => any]

export interface GunUser<T> {
    is?: undefined
    recall: (opt?: { sessionStorage: typeof sessionStorage }) => GunUser<T> |AuthenticatedGunUser<T>
    auth: (...t: AuthArgs) => GunUser<T> |AuthenticatedGunUser<T> 
    create: (...t: AuthArgs) => GunUser<T> |AuthenticatedGunUser<T> 

export interface AuthenticatedGunUser<T >{
    is: {
        alias: string | SEAPair
        epub: string
        pub: string
    get: <TKey extends keyof T>(name: TKey) => AuthenticatedGunUserTree<T, TKey> & Promise<T[TKey]>
    leave: () => void

type AuthenticatedGunUserTree<T  , TKey extends keyof T> = AuthenticatedGunUser<T[TKey]> & GunTree<T,TKey>;

interface GunGet<T> {
    get: <TKey extends keyof T>(name: TKey) =>  GunTree<T ,TKey> & GunGet<T[TKey]> &Promise<T[TKey]>

type GunTree<T  , TKey extends keyof T> = {
    on: (callback:(state:T[TKey], key: TKey) => any) => { off: ()=> void }
    once: (callback: (state:T[TKey], key: TKey) => any) => void
    put: (state: T[TKey], callback?: AckCallback, options ?: {opt ?: { cert ?: string}} ) => void,
    set: (state: T[TKey]) => void,
    map: (match?: any) => AuthenticatedGunUserTree<T[TKey], keyof T[TKey]>

export function isUserAuthenticated  <T>(user : GunUser<T> |AuthenticatedGunUser<T>): user is AuthenticatedGunUser<T>{
    return !!user.is

interface GunDefinition {
    user: <T>() => GunUser<T> | AuthenticatedGunUser<T>,
    get: <T,TKey extends keyof T>(name: TKey) =>  GunTree<T ,TKey> & GunGet<T[TKey]> &Promise<T[TKey]>,
    on: (eventName: 'auth', callback: () => any) => { off: ()=> void },

const TypedGun = Gun as any as {
    (options?: string | string[] | IGunConstructorOptions): GunDefinition;
    new (options?: string | string[] | IGunConstructorOptions): GunDefinition;

export interface SEAPair{
    epriv: string
    epub: string
    priv: string
    pub: string

type Authority = SEAPair

export const TypedSEA = SEA as any as {
    secret: (epubKey: string, pair: SEAPair) => Promise<string>
    pair: () => Promise<SEAPair>
    sign: (data:any, pair: SEAPair) => Promise<string>
    verify: <T>(data: string, pair: SEAPair | string) => Promise<T | undefined>
    encrypt: (data:any, pair: SEAPair | string) => Promise<string>
    decrypt: <T>(data:string, pair: SEAPair | string) => Promise<T| undefined>
    certify: (user : string | string[]| {pub:string} | {pub:string}[], policies: any, pair: Authority, callback: (cert:string) => any, opt?: { blacklist?: string, expiry?:number }) => Promise<string>

just use TypedGun or TypedSEA


@amark. Please implement this Forum as multiple threads initiated by each user, not a single thread currently. It is just a mess. Shift this Forum to reddit, and leave gitter?

@amark how can I change the username or alias for gun.user()?

@amark. I want to implement state management on the Clent-side using gundb. I want to expose only a subset of nodes e.g. gun.get("sessionid") on Client-side. I searched a lot, but still have doubts what if client-side hacking may access full gun graph network using XSS/code-injection. What security measures should I take? Is including SEA library enough security measure?

@amark. I am implementing gundb for a production grade app.

First post. Been stuck on reproducing the basic to-do list example on my desktop. Initialized the http server at local host and ran the following code. The list doesn't update or really do anything. Understand this is extremely basic, but I've been stuck for days now. Thanks!

// Clear out localstorage to give Gun a fresh start on every load

// Import Gun as a dependency
import Gun from 'gun'

var gun = Gun();

const server = require('http').createServer().listen(8080);
const gun = Gun({web: server});

var items = gun.get('items');

$('form').on('submit', function(e){

items.map().on(function(item, id){
var li = $('#' + id).get(0) || $('<li>').attr('id', id).appendTo('ul');
} else {

Barłomiej Bąk
@shecky2000 it seems you messed up browser and server side there