amark on master
subscribe only on backpropagati… Merge branch 'master' of http:/… PANIC 4: AXE get subscriptions (compare)
amark on master
Panic tests for rod & radix.js … (compare)
amark on master
reduce not-found acks if via/re… test undo tmp (compare)
I guess I don’t understand something. Isn’t there some kind of a built in mechanism for peer discovery?
That's the plan for AXE. Don't know how far it's done already.
Does it just use the list you provide and that’s it?
The list of peers in the GUN constructor? Yes, except if using AXE which is default.
I thought gun uses webRTC under the hood, so shouldn’t the connections information be already available?
WebRTC is used for p2p communication between browsers. For browser ↔️ NodeJS clients websockets are used. Remember to import lib/webrtc.js
to enable WebRTC and even then it might not work for the current version. Would be cool if you'd test it and report back!
Does the ack in put comes from a remote peer?
I'm guessing it comes from one or all of the peers set up in the GUN constructor. If it's not properly described on the API could you report back? Extra points for testing and finding out again :-) That's kinda how it works for unstable GUN right now :\
Is there a way to know that an entire database is in sync? Let’s say I have a client making changes. I want to show user a spinner until his changes are successfully propagated through the network. (Or at least to the nearest relay peer)
The latter point is easy. As I said there's the ack
callback for that in put()
. The former could be done by recording the datetime of the last complete sync. Would that be what you want?
/gun
require('dotenv').config()
const express = require('express')
const Gun = require('gun')
const cors = require('cors')
const app = express()
app.use(cors())
app.get('/', (req, res) => {
return res.status(200).json('success')
})
app.use(Gun.serve)
app.get('*', (req, res) => {
return res.status(400).json('unsuccessful')
})
Gun({web: app.listen(Number(process.env.PORT), '0.0.0.0'), radisk: true, file: './folder'})
console.log('Server started on port ' + process.env.PORT + ' with /gun')
/gun
route always gives me a 400
npm install gun && cd node_modules/gun && npm start
gun.on('hi', function...
and 'byte'
not connected/disconnect.*
taking higher precedence?gun/gun.js
(don't build it). If React Native, see https://github.com/aethiop/jot tutorial.express.use(Gun.serve)
or express.use(Gun.serve(someDirectoryToServe))
?
hey guys quick question, is there a way to "construct" the subproperties of a chain just one level deep before returning it?
for example:
{
"name": "foo",
"address": {
"city": "bar",
"street": {
// unneeded data
}
}
}
here, i'd like to access just the name
and address.city
i thought about using load()
, but i don't really need to access all the subproperties
or will i have to do separate get()
calls to achieve this?
tldr: is there a way to include the resolution of subproperties when using on()
or once()
on a document?
Is there a full text search example? Like, how do I search for let’s say post’s descriptions that include the word ‘test’? Especially if the searching peer does not have all the posts currently available in it’s database.
Is there a way to tell the network “hey does anybody has X” and retrieve only the search results, but not an entire posts set? I’m okay if some kind of indexing setup is needed, since O(n) for this isn’t very nice...
get({ ".": { "*": e.target.value } })
don't you subscribe to an entire peer?
{ ".": { "*": e.target.value } }
part? I can't see anything in docs mentioning that you can use something other than a string as a key to get
.