Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
Ken Eucker
@KenEucker

I'm almost there: https://codesandbox.io/s/typescript-forked-ut6my?file=/src/index.ts

I just can't get this code to work on my machine in my project using import * as Gun from 'gun/gun'

Kier
@syonfox
i use to start a gun server need to npm install express
var Gun     = require('gun');
var app    = express();
// app.use(Gun.serve);
app.use(express.static(__dirname));
var server = app.listen(port);
var gun = Gun({    file: 'data', web: server, peers: [] });
rococtz
@rococtz:matrix.org
[m]
@KenEucker: If it's only returning pointers it's because you are putting nested objects and once() only returns the first level deep by default. You have 2 options here:
1) If you are rendering it somewhere, you can still pass that reference to a component and then let the component retrieve each data (the bad part is that you make a lot of requests, the good part is that you can only retrieve small parts of each nested item)
2) Replace the open() method with load() (it's documented in the docs https://gun.eco/docs/API#-extended-api- )
Quote from the docs: Loads the full object once. It is the same as open but with the behavior of once.
rococtz
@rococtz:matrix.org
[m]
:point_up: Edit: @KenEucker: If it's only returning pointers it's because you are putting nested objects and once() only returns the first level deep by default. You have 2 options here:
  1. If you are rendering it somewhere, you can still pass that reference to a component and then let the component retrieve each data (the bad part is that you make a lot of requests, the good part is that you can only retrieve small parts of each nested item)
  2. Replace the once() method with load() (it's documented in the docs https://gun.eco/docs/API#-extended-api- )
    Quote from the docs: Loads the full object once. It is the same as open but with the behavior of once.
Ken Eucker
@KenEucker

@rococtz:matrix.org using load works well, I added:

require("gun/lib/load.js");
...
const getTags = (chain: BikeTagGunClient) => {
  return new Promise((r, c) => {
    return chain.get(gameName).get("tags").load!(r);
  });
};

And I get the full object back.

rococtz
@rococtz:matrix.org
[m]
@KenEucker: awesome, you are on fire 🔥
Mark Nadal
@amark
@yarnball GUN should not be used for banking as it is offline-first eventually-consistent, financial data is usually online-only globally-consistent. Some people are doing stuff anyways, like @libensveto_twitter may want to talk to.
@fsvieira utoh, axe: false didn't fix? Then definitely sounds like a bug. Will you open a github issue with replicable example?
@Manuel-777 holy cow, you've also built your own DHT thing? Can I do a call with you + @connor-davis @Dletta @lmangani this Wednesday or Thursday? Seems like you all have built AXE without me needing to!
@StrongStarter_twitter :wave: :) cool, have any demos to share yet?? :)
@Mac16661 :clap: @Mac16661
@connor-davis will you DM me on twitter some times? (for secure render testing, separate from DHT)
@Emad-salah correct :( do you know what the right ASCII check is? oh wow, I didn't see that one, looks nice too. amark/gun#1156
@basic-bhavya do you have a HTML page instead? Or jsbin, even better?
:clap: @syonfox :+1: yeah, unverified means maybe weren't logged in.
@3210jr yo, @aethiop has an in-depth tutorial with exact details and just made a PR with fix: amark/gun#1169 (based off @sirpy work but ported to latest GUN)
@syonfox great Q! as in most of my codebase is a pass-thru object from one function scope to another function scope (most people use this but it has some performance penalties when used with call/apply). So you'll see as often has as.opt and other temporary/scope data.
@davay42 you could ...on(function(data){ this.get(data.subitem).once(... if you have SEA it bundles a promise you can use instead of once. Tho it'd be nice if you'd be willing to screencall with me for us to work on .open(? Fix it for manhattan ( + @KenEucker )
@syonfox there is no way to make remote p2p data to be JS synchronous sadly, however you'll really love the SecureRender demo https://twitter.com/marknadal/status/1459369619488010243 it also uses proxies and fixes JS synchronousness by running in a game loop. It does not depend on GUN, cause as always, I like to keep most tools usable on their own, but (also like always) I'll be making very tight integrations between them so performance is epic.
@kuhlmann.markus:matrix.kusys.de :clap: @rococtz:matrix.org !!!
@KenEucker :clap: @rococtz:matrix.org woah! That was elegant!!! Nice!!
Tho what if a list has 1M items, you don't want to "await for the whole list to load" (that'd be very slow), do we just assume that'll force people back to no promises? I don't think there should be a lazy way that codes you down a bad route tho. Can we unite promises with streaming? Or we should just keep devs heavily discouraged from doing this on lists like currently?
Yeesh, why is TypeScript breaking stuff? Any clue?
:clap: :clap: @rococtz:matrix.org !

New p2p game demo out!!! https://twitter.com/marknadal/status/1465135435965878273 thanks to @mike.stone_gitlab !!!
I can feel all the puzzle pieces coming together.... SecureRender for high performance and encrypted no-login/register UIs across browser/desktop/mobile, GUN for metaverse sync, and AXE fixed with people's DHT demos to scale!
Mark Nadal
@amark
gosh, such critical last pieces, still need a ton of work/engineering. Ping me if you can help.
:fire: :clap: :zap: :star: :fire: :clap: :zap: :star: :fire: :clap: :zap: :star: :fire: :clap: :zap: :star: :fire: :clap: :zap: :star: @aethiop 's PR to fix React Native with the latest manhattan version is now merged!!!!!! What an epic role model of OSS contribution :) :) :). To use it, please npm install from github main. :fire: :clap: :zap: :star: :fire: :clap: :zap: :star: :fire: :clap: :zap: :star: :fire: :clap: :zap: :star: :fire: :clap: :zap: :star:
Manwë
@Manwe-777
@amark I did not built the DHT but merely connected an existing one (https://www.npmjs.com/package/discovery-channel using bitorrent dht) with Gun, that also works for any other library alike. I would say this is nothing like AXE though, at least not the ideal version of axe you described in the papers. I am happy to join on a call anytime to explain a little more in depth how I managed to get it working along Gun and my ToolDB! could probably set up a small demo too :)
Not sure how hard would it be for you to read this (typescript) but the server of my app is already running on this schema I described above;
https://github.com/Manuel-777/chain-swarm
The db is almost entirely built based on some of Gun's concepts but adapted to my own vision here;
https://github.com/Manuel-777/tool-db
Mark Nadal
@amark
@Manuel-777 :fire: :fire: wow nice thinking! Yes, demo and is Thurs 11am CA work? + @Dletta @lmangani @connor-davis
The only important goal of AXE is to be able to handle 100M monthly active users
that is gonna require a lot of engineering work :P
swarm/dht/whatever is all necessary, so I want to understand your efforts more and write code with PANIC to benchmark scale.
WILL
@WillWang002_twitter
Hello guys. Dose anyone knows that how to see the gunDB performance such as memory, CPU etc. It is best to present it in the form of a graph
Mark Nadal
@amark
@WillWang002_twitter :) yupe check yourPeer||localhost:8765/stats.html
Vasyl Dovhanchyn
@theaspirational
can we use .open in prod? I got bunch of Deprecated warnings
image.png
Connor Davis
@connor-davis
@amark HyperCore has basically developed the dht and one of the devs has created something called, dht-relay, and its working. I am able to connect to the dht from the browser and that means we can mess around and get gun working with it :)
Connor Davis
@connor-davis
That works for me @amark I am finished with school on Wednesday
Connor Davis
@connor-davis
image.png
Data coming through hypercore dht
This isnt the best case scenario because everyones gun data gets synced, but eventually work will pay off and they will only receive the data they ask for.
But a one room chat can use this method
Speaking of, does anyone know which event gets fired when data is meant to go out to a relay peer and be forwarded?
Lorenzo Mangani @qxip
@lmangani:matrix.org
[m]
@Dletta: will probably know
James
@u007
hi, on a nodejs stack, using another gunjs instance that i used from react frontend that work with register, get and login, and now dont work on my other nodejs stack. im connecting to my local [ 'http://localhost:8765/gun' ],
import * as SEA from 'gun/sea';
const gun = SEA.GUN(gunHosts);
// hang here, no callback
gun.user().auth('username', 'pass', (res) => {
console.log('result!', res);
}));
Jasper Molgvits
@jaspermolgvits_gitlab
Sorry if this is a dumb question, but how do I create a websockety host server for gun? Just run gun on node and direct client to the IP? But how does gun know how to use websockets on my server, and how do I add the IP to the client? I'm really struggling to find this in the docs
James
@u007
Im also struggling with websocket as i know ws is the only way to connect with client peer automatically, which i do not know if it stills stand true
herrkpunkt
@kuhlmann.markus:matrix.kusys.de
[m]
+1 to the two questions above. I also can't really get a hold on this in my mind...
Connor Davis
@connor-davis
LoneWolf New UI
image.png
image.png
libensveto
@libensveto_twitter
@yarnball yea drop me a dm if you have questions
@connor-davis 😍
Connor Davis
@connor-davis
Inspired by Discord and Whatsapp @libensveto_twitter
libensveto
@libensveto_twitter
its v clean i like it
[whispers - get us off gitter be our saviour]
Connor Davis
@connor-davis
Hehehe, I will have to build "room" chats into it :)
Manwë
@Manwe-777
wait @connor-davis you're writing Gun's graph to the dht? haha
Connor Davis
@connor-davis
Well not necessarily, I am relaying it over the dht
Manwë
@Manwe-777
thats rad, I thought you were just using it for handshaking ! :D
Connor Davis
@connor-davis
Nah XD
Im still learning the inner workings of how stuff gets transferred in Gun
See what happens is that the client connects to the dht and from there I get the dht to relay the data to the other sockets.
What I am excited about more so is being able to expand the capabilities, for e.g. I have built a p2p file sharing app with hyperswarm/dht that allows the desktop app (electron) to act as a server and a client, so if someone is "hosting" then someone connects to their http connection that is relayed over the dht and the "client" connects to that relay and can perform axios get requests etc, now this enables that to work in theory :)
Connor Davis
@connor-davis
But as well as that, now imagine this:
You have gun-relays that connect to eachother using the dht and the dht allows them to query data from eachother, simple enough because in nodejs you can pipe data from one relay to another, so when one asks for data, whoever has the data can send it to them. The same can work for a browser client, it connects to the dht and the dht can forward that get request to all on the network and whoever has it sends it to the client. This dht-relay will open those doors if we use it correctly, together. We basically need to work together as a community on this.
Manwë
@Manwe-777
That could work yeah, I cant imagine a regular dht being as fast or reliable to handle too many things floating around though, but then again thats what Mark noticed when designing AXE over a traditional solution like this.
Have you seen this one ? https://www.npmjs.com/package/trystero Im testing it to get two browsers connected and it works like a charm, its webrtc so it probably does not scale but it could be interesting