Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 02:57
    bmatusiak commented #1239
  • 02:42
    bmatusiak opened #1239
  • 00:14

    amark on master

    prepare to sync gun lib unbuild… (compare)

  • 00:14
    amark closed #1237
  • 00:14
    amark commented #1237
  • May 23 15:55
    draeder updated the wiki
  • May 22 14:36
    igormuba opened #1238
  • May 22 12:04
    bmatusiak opened #1237
  • May 22 11:42
    bmatusiak synchronize #865
  • May 22 11:42
    bmatusiak closed #865
  • May 19 16:06
    bmatusiak opened #1236
  • May 19 01:36

    amark on master

    ok ack + webrtc Merge branch 'master' of http:/… bump (ok ack + webrtc) @Draeder… (compare)

  • May 17 23:08
    bresnow updated the wiki
  • May 16 01:07

    amark on master

    websocket ../index to ./index (… (compare)

  • May 16 01:07
    amark closed #1235
  • May 16 01:07
    amark commented #1235
  • May 15 21:38
    amark updated the wiki
  • May 15 21:37
    amark updated the wiki
  • May 15 20:04
    bmatusiak opened #1235
  • May 15 13:07
    bmatusiak updated the wiki
rococtz
@rococtz:matrix.org
[m]
I am sorry, I don't know what a LineFeed is
but I have a feeling you don't have a gun problem; you probably have a html/javascript problem
maybe someone else in this chat knows what this is about and they can help you 👍️
Smarthug
@smarthug
@rococtz:matrix.org Thank you for the feedback. You are right , this is not a gun problem. I will go through examples you provide me. Thanks I appreciate it
gunchatbridge
@gunchatbridge
[D]tynamite: @rococtz:matrix.org :+1: :fire: discord@tynamite did you get answered? https://gun.eco/docs/nginx might be useful hints?
I'm not using nginx, I'm using apache webserver.
tedd pasta
@azdez:matrix.org
[m]
https://github.com/resession/gun-fetch finally made some progress. now using headers, GET works, PUT works, DELETE works. now gotta work on the user/alias/key creation and authentication stuff.
Radu
@rococtz
@azdez:matrix.org what is the use case for your library? who should use it?
βτεsηΘω
@bresnow
i likey
@azdez:matrix.org
βτεsηΘω
@bresnow
@amark animation_assets
Im playing around with the assets before i animate them.
wanted to get your opinion before i did
deathg0d
@deathg0d

@amark I am building a GPS application using Electron vue. My server side setup (node server, using as a backup storage server) is working fine. However my client side (Electron) is not able to sync data. It is able to push data though. When I push data it syncs the data to the server (I can log this on the node.js server) and keeps a local copy in Electron. This is working fine. Now if I delete local cache (electron developer tools), it is unable to fetch the latest data from the server (which it itself pushed). I put data using the following:

let newUsername = 'myNewUser'
const userObj = {};
userObj[newUsername] = {
    username: newUsername,
};
this.gun.get("users").put(userObj, () => {
});

I have connected to the server using peers:
gun: GUN({ peers: ["https://example.com/gun"], axe: false }),

According to the discussion here: amark/gun#823 , I have axe: false on all clients (node.js and electron client)

This returns undefined in Electron console:

this.gun.get("users").map().on((node) => {
    console.log(node)
})
4 replies
deathg0d
@deathg0d

I ran a local node server on my PC and also ran a vue client (instead of Electron). What I noticed is that, doesn't matter what you use: .on or .once, data comes in only after changes are made to the server instance. I thought .once would give me existing data?

When my local node and vue client was running, I put existing data again to the remote server instance, the new data shows up instantly on both local node and vue client.

How do I get the latest data that is already existing in the server, without putting new data?

Connor Davis
@connor-davis
In my experience, .once and .on both retrieve data when I don't have it in my browser, What does your console in electron say?
3 replies
RilDev
@RilDev
gun-chat-working-prototype-same-browser-working.gif
Hi, I'm trying to get a basic chat app working. I got some ideas from the example/chat and it seems like it is working, but only when I use the same browser and split it into two windows
But when using a different browser it doesn't work
Here is the live url https://rildev.tk/chat/#gun-chat
And here is the code
<head>
  <link href="https://cdnjs.cloudflare.com/ajax/libs/tailwindcss/2.2.17/tailwind.min.css" rel="stylesheet">
</head>

<div class="app h-screen bg-gray-100" x-data="{messages: []}" x-init="
  $watch('messages', value => window.scrollTo({top: document.body.scrollHeight, behavior: 'smooth'}))
  gun = Gun('https://178.62.11.88:8765/gun');
  chat = gun.get(`chat/${location.hash.slice(1)}`);
  chat.get('messages').map().once((message) => {
    messages = messages ? [...messages, message] : [];
  });
">
  <div class="messages divide-y divide-gray-300 pb-11">
    <template x-for="message in messages">
      <div class="message px-4 py-2 break-all" x-text="message"><span class="font-bold">user:</span> message</div>
    </template>
  </div>
  <div class="chat-bar fixed bottom-0 w-full flex"><input class="rounded-none border w-full px-4 py-2 bg-white" type="text" placeholder="Enter your message here..." x-ref="unsentMessage" @keyup.enter="sendMessage"><button class="send bg-blue-500 text-white px-4 py-2 uppercase text-sm font-bold tracking-widest" @click="sendMessage">send</button></div>
</div>

<script src="https://cdnjs.cloudflare.com/ajax/libs/gun/0.2020.1235/gun.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/alpinejs/3.4.2/cdn.js"></script>

<script>
  function sendMessage() {
    if (this.$refs.unsentMessage.value) {
    chat.get('messages').set(this.$refs.unsentMessage.value);
    }

    this.$refs.unsentMessage.value = '';
  }
</script>
Do you see anything wrong with it ?
I used this script to start the pm2 session cd node_modules/gun && HTTPS_KEY=/home/rildev/ssl/rildev/privkey.pem HTTPS_CERT=/home/rildev/ssl/rildev/fullchain.pem npm start
RilDev
@RilDev
Thank you!
achilles
@achilldotes_twitter
When I ran a local copy of Iris, it seemed to populate with the same peers as the public version of Iris. This is because the peers are shared within PeerManager. Does anyone know what change I can make to get Gun to look at this as a completely separate project starting off with 0 peers? I tried changing the DEFAULT_PEERS variable but that did not seem to work.
Mark Nadal
@amark
@smarthug :clap: @rococtz:matrix.org !
@tynamite :+1:
@azdez:matrix.org :fire: wow, looks like pretty comprehensive REST support?? Make sure this is listed in awesome-gun list/docs!
@bresnow woooah I love the retro look! Do the screens / pie charts / growth charts move up & down at the same time?? THat'd be a really cool way to show it syncing. :pray: :pray: :pray: very kind/thoughtful you're willing to help out!!
@deathg0d oh hmm, you already have axe: false (maybe try that on both?) I was hoping that was causing the issue. :clap: @connor-davis . So its not an issue with GUN in electron, as the vue one also does not get the first value? Question, if you switch your .once( to a .on( does it fire initially? To debug if .once( is being buggy.
@RilDev nice app! :) looks like HTTPS errors, if I go to your IP it says wrong cert name.
@achilldotes_twitter maybe resetting all your data first then changing the hardcoded and config peers? So that way it doesn't re-sync them while you're mid code change? I'm not a pro on that code base tho, @mmalmi is tho.
pretty busy today, should be around more tomorrow. Cheers.
deathg0d
@deathg0d

@amark same issue with both .on and .once. The only difference is that with .on, it does not go into the callback so there is no log.

I have also set axe: false on all clients. The weird thing is as soon as new data is pushed to the server, it syncs with all connected clients, so the connections look fine. It is unable to get already existing data.

deathg0d
@deathg0d

@amark My server setup looks like this:

import Gun from 'gun';
import "gun/nts";
import "gun/lib/radix";
import "gun/lib/radisk";
import "gun/lib/store";
import "gun/lib/rindexed";

const PORT = 8080;
const HOST = "0.0.0.0";
var http = require('http');
var server = http.createServer();
var gun = Gun({ web: server, axe: false });

server.listen(PORT, HOST, () => {
  console.log(`Server listening to localhost:${PORT}/gun`);
});

I checked the radata folder and it does contain old data

Martti Malmi
@mmalmi
@achilldotes_twitter it loads peers from default_peers and localstorage - check that both are empty. Thanks for checking out Iris, let me know how it goes!
achilles
@achilldotes_twitter
@mmalmi Hey Martti! Thank you for the advice, I will be trying this later. Iris is a very impressive project. I see there is some concern about state not being consistent. Do you happen to know why that might be?
tedd pasta
@azdez:matrix.org
[m]
@rococtz: gundb doesn't expose any uri scheme, this would use a uri scheme for gundb. i am working on it because then it can be used on the agregore web browser. agregore mixes fetch with p2p protocols, with this gundb to be added on the agregore browser. so as far as use case by itself, it would be good for anyone who is used to using uri along with with databases. but even before that use case, it is used specifically to use in agregore.
@amark that would be awesome, how do i get it on the awesome list and the docs? is there someone i should message?
RilDev
@RilDev
@amark Thank you, I think that's it. I'll fix it ASAP!
shimon
@shimon_b_h_twitter
As I understand the DB syncs all the data across all peers
Is it possible to do selective sync (group of peers)?
for instance, in a chat app where you have different chat groups, you want to do selective sync only to the group members
1 reply
RilDev
@RilDev

@amark I fixed the SSL Certificate issue with an Nginx proxy looking like this

server {
    server_name gun.rildev.tk;

    location / {
        proxy_pass https://localhost:8765;
    }   

   # Certbot auto-generated config

}

So now gun.rildev.tk/gun should be usable right?

But when I connect to rildev.tk/chat/#gun-chat, it still doesn't sync like before.
Is there something else I'm missing here?

PS: for reference, yes the https instead of http in the proxy_passmatters.
Martti Malmi
@mmalmi
@achilles Maybe the server or browser peers can’t handle the amount of traffic. Or maybe it’s the lack of online peers who would persist the content (my server doesn’t)
Working on this rust port in order to improve performance and make the source code easier to read and contribute to https://github.com/mmalmi/rusty-gun
rococtz
@rococtz:matrix.org
[m]
@mmalmi: do you plan to migrate SEA as-well?
Martti Malmi
@mmalmi
Yes, I’m trying to add everything that Iris needs
rococtz
@rococtz:matrix.org
[m]
@mmalmi: That sounds great, but I was just curious if you had the chance to benchmark the performance of the rust version against the nodejs version?
Martti Malmi
@mmalmi
I haven’t tested against nodejs yet. In a simple memory-only browser test the Rust version was maybe 20% faster on Mark’s computer, but many times slower on my M1 — don’t know why. Different types of queries and network message processing will change the situation to one direction or another. Also the Rust version is not optimized yet, unlike gun.js.
You can test on https://rusty-gun-demo.netlify.app/ :
var i = 28000, j = i, s = +new Date; while(--i){ gun.get('a'+i).get('lol').put(i+'yo') } console.log(j / ((+new Date - s) / 1000), 'ops/sec');
If you want to test with networking, use a new instance of gun that connects to a peer, like new Gun(peerUrl) or new Gun({peers:[..]})
Wasm multithreading can also improve performance. And I believe the non-wasm version (for server and desktop application use) will be faster than wasm, because it doesn’t need to interface between javascript
rococtz
@rococtz:matrix.org
[m]
This is what I get:
91803.27868852459 'ops/sec'
Devin Santamaria
@webprismdevin
does anyone have a working example of password reset with SEA?
1 reply
rococtz
@rococtz:matrix.org
[m]
@webprismdevin: it's not very straight-forward... but very doable nonetheless. Maybe this examples makes sense?
https://gun.eco/docs/SEA#example
you don't really reset the password or anything like this. You just use two other separate words to encrypt a hint that will remind you what the password used to be
but you have to have already had that system into place when you want to remember it