149 Commits

Author SHA1 Message Date
Mark Nadal
9b752c3937 clarify root more for SEA, lots more to go 2017-04-21 15:42:42 -07:00
Mark Nadal
fc74a80cf5 uggh ws & uws 2017-04-10 13:10:36 -07:00
Mark Nadal
6950f7d90c have file adapter support lexical all souls cursor 2017-04-04 18:56:53 -07:00
Mark Nadal
181b6bd767 0.7 with .val(cb) also hearing .not 2017-04-03 13:02:20 -07:00
Mark Nadal
c804df9b77 updated examples! 2017-03-27 23:36:08 -07:00
Zane Hitchcox
d46db34d45 add default path for gun 2017-03-24 12:56:11 -04:00
Mark Nadal
0e234d5c43 Update server.js 2017-03-15 14:16:37 -07:00
Mark Nadal
2d455d30b5 fix express 2017-03-13 19:46:12 -07:00
Mark Nadal
fff3a99bb2 load testing!!! 1.7K inserts/sec! Only will get more better! 2017-03-11 07:36:48 -08:00
Mark Nadal
9c640d2000 load testing!!! 1.7K inserts/sec! Only will get more better! 2017-03-11 07:33:51 -08:00
Mark Nadal
bfdfa9b8a9 load testing!!! 1.7K inserts/sec! Only will get more better! 2017-03-11 07:23:46 -08:00
Mark Nadal
ec3288e583 load testing! 2017-03-11 07:03:55 -08:00
Mark Nadal
8aa649ef4a s3 fix & begin adding load tests 2017-02-20 15:27:02 -08:00
Mark Nadal
3f0c2c6267 fix S3 2017-02-16 23:38:34 -08:00
Mark Nadal
6dd1b1b536 v0.6.0 baby! 2017-02-14 16:46:24 -08:00
Zane Hitchcox
3e77509084 ensure replaced 'http' is at beginning of url or not replaced 2017-02-14 16:14:21 -05:00
d3x0r
d4a8ec655f Fixed _field mangle. 2017-02-09 10:56:55 -08:00
d3x0r
8d5f6deee6 Move file state object to gun root opt
add _file to  gun.opt.
use at.gun.back('opt._file')  to get this object; allows per-gun-graph file options.
2017-02-09 10:21:52 -08:00
Mark Nadal
b03f6e0de8 put as merge 2017-01-27 22:12:50 -08:00
Mark Nadal
40c991426b launching 0.5! 2017-01-27 07:40:24 -08:00
Mark Nadal
d0bbcef285 0.5! 2017-01-27 06:27:04 -08:00
Mark Nadal
4a2a845458 launching! 2017-01-27 05:23:49 -08:00
Mark Nadal
77d71a0c94 pushing! 2017-01-27 04:58:16 -08:00
Mark Nadal
baf99d7e72 Update client.js 2017-01-11 10:47:50 -08:00
Mark Nadal
d5cf9938c1 Update file.js 2016-12-26 22:48:59 -08:00
Mark Nadal
2e826ca9d8 fix reads 2016-12-26 22:46:27 -08:00
Mark Nadal
096e224af5 Merge pull request #298 from d3x0r/patch-6
#297 passing options to websocket
2016-12-26 22:50:28 -07:00
Mark Nadal
db74549326 warning: file.js/data.json is for local development testing only. 2016-12-26 21:12:21 -08:00
d3x0r
a4425bda24 remove redundant option fetch
since options have to be fetched higher anyway... 
Or rather - this options is outside of knowing gun options
2016-12-23 00:43:05 -08:00
d3x0r
266b18109c Missed a change to get the options....
Somehow my other options test didn't work... had to add something like this.

Now I feel this is such a huge hack
2016-12-23 00:35:11 -08:00
d3x0r
8dac820902 fix default assignment 2016-12-21 12:18:39 -08:00
d3x0r
8e6d827216 fix indentation 2016-12-21 12:17:56 -08:00
d3x0r
9c41182004 Fix quotes 2016-12-21 12:17:31 -08:00
d3x0r
320183fa54 Set default options more robustly 2016-12-21 12:17:01 -08:00
d3x0r
f28b62fd4c Setup default option
if wsc doesn't previosuly exist, create a empty option block.
add option 'protocols' for wsc that can specify the optional protocols before the options.
Options will also only apply to node client websockets; (package 'ws'), browser websockets only take 1 with 1 optional parameter (being the list of protocols to connect with; so I added that optional param for compatibility.
2016-12-21 12:09:10 -08:00
d3x0r
f548db293b pull opions from 'wsc' in gun options
'ws' options are used by server
'wsc' options to be used by websock client... ?
2016-12-21 11:59:28 -08:00
d3x0r
e8f840c548 pass gun's options to websocket
I recently had to set options given to the websocket client especially 

rejectUnauthorized {Boolean} Verify or not the server certificate.

for connecting to wss which are using self signed certs...
could also pass things like 'protocol' to differentiate a Gun websocket connection from some other websocket connection....

I don't know if maybe websock options should be a object in options instead ?  To avoid namespace collision?
2016-12-21 11:21:13 -08:00
Mark Nadal
9abe3fb75f fix for d3x0r and Stefdv 2016-11-28 17:57:20 -08:00
Jesse Gibson
4848493530 Add envelope-system server sync
Using gun's new envelope system (where routing and de-duplication happen
inside gun core), server-to-server synchronization has been
implemented.
However, it comes with this warning: the chain isn't yet ready and
you'll have difficulty reading or writing data via the chain.
2016-11-25 14:42:44 -07:00
Jesse Gibson
6a63b46d2b Add max reconnect backoff
Sockets will try to reconnect upon disconnection with an exponentially
rising backoff (configurable). However, if it's unbounded, at a certain
point does it need to even try? Probably not. Instead there's now a
`max` option that defaults to a minute, and the backoff will never
exceed that time.
2016-11-18 12:49:58 -07:00
Jesse Gibson
2696b4cf88 Merge branch '0.5' into s2s-sync 2016-11-18 11:57:06 -07:00
Jesse Gibson
e402e3966e Optimistically open client sockets
Changes behavior from only opening sockets when absolutely necessary to
keeping them open for as long as possible. Key differences:
- Much higher success rate for messages sent from the connected server.
- Process no longer shuts down if nothing is done with gun, instead
  listens for incoming messages on client sockets.
Socket reconnect handle by Peer instances, meaning better handling for
deferred messages and predictable backoff.
The client.js logic has been significantly refactored. Among the
improvements, GET/PUT requests now respect the `peers` option for each
gun instance, only sending requests to the URLs listed.
2016-11-18 11:42:24 -07:00
Jesse Gibson
e8f8047cb6 Expose websocket events
The Peer "class" now extends EventEmitter. Listening to any websocket
events (e.g., "message", "close", "open", etc.) will not only subscribe
to the current websocket, but all future websockets. This provides a
much needed abstraction, since reconnection replaces the socket, which
would typically destroy your listeners.
2016-11-17 14:07:26 -07:00
Jesse Gibson
37696e1ada Prevent most broadcast storms
Better de-duplication on messages sent for GET and PUT requests,
allowing full circular connections without blowing up your computer.
Sadly, this broke some things against the previous version, so per
@amark's request I'm publishing so he can debug.
2016-11-16 16:40:14 -07:00
Jesse Gibson
f999e5f2ea Fix chain option search
If you're reading this commit history, please avert your eyes. 3
commits to fix this admittedly simple problem is more than my pride can handle.
The `gun.Back()` function was only searching for `opt`, not
`opt.file`. It would stop at the first mention of `opt` even if it
didn't have settings for `file`. Now it won't.
2016-11-15 16:20:18 -07:00
Jesse Gibson
e7162aa098 Reliably check file.js options
The FileJS module can be passed options in two ways, and this commit
ensures they're treated in the right way.
Previously, options passed as .put or .get parameters would be favored
over those used on the chain, even if `file` wasn't specified. Now, the
module will only use the method options if `file` is mentioned, falling
back to the chain options.
This was a mistake on my part with the first PR (#268), I failed to notice notice that edge case.
2016-11-15 13:10:00 -07:00
Jesse Gibson
ddf272bbb0 Allow greeting messages to be opt-out
If you use gun a bunch, you've probably noticed the messages like "Hello
wonderful person :)" and "WARNING: This file.js module...".
This PR allows you to silence them.
Use `Gun.log.off = true` to bring peace back to your workflow.
> **Note:** great when used with file watchers like nodemon."
2016-11-14 17:00:06 -07:00
Jesse Gibson
406276739a Merge pull request #268 from PsychoLlama/allow-file-json-opt-out
Allow opting out of file.json
2016-11-14 16:39:24 -07:00
Jesse Gibson
3e66aff985 Allow opting out of file.json
If the most recent gun options disable the file module, then it
won't try to read/write from the json. Previously it would. Also, now
you can override the behavior by passing `{ file: false }` as the
options in `gun.put`.
2016-11-14 16:31:45 -07:00
Jesse Gibson
ba43dcac17 Add server push
Pushes graph updates to connected clients, listening for
acknowledgements.
2016-11-14 13:40:55 -07:00