commit | 42e56f2c1e3f12a4cc02d99d3f64ce5fa91451d4 | [log] [tgz] |
---|---|---|
author | Jason Campbell <jason@artifact.sh> | Wed Sep 30 16:25:20 2015 -0700 |
committer | Jason Campbell <jason@artifact.sh> | Thu Oct 01 14:01:15 2015 -0700 |
tree | b21e75ac9d93e12fe3a34a24902817ef7eb438eb | |
parent | ecfb257d3aeac89f9d0340231822e358ab1a2374 [diff] |
reader: add support for sync groups. Several changes to support adding sync groups have been made to `browser/vanadium/syncbase`. Raw Syncbase API calls have been broken out into separate, reusable modules for accomplishing simple tasks like getting a database or a table. All `syncbased` instances are started with very permissive ACLs to get a minimum working example of sync between peers (SEE: #19). Code has been added to support watching for changes to originate from sync. Peer discovery has been temporarily removed since all previous data sharing now goes through Syncbase. The browser/vanadium/glob-stream module was refactored due to a serious bug where failing RPC requests were not being handled correctly. This caused a recursive loop of uncaught exceptions. Some additional, smaller changes in this CL. * Old, non-syncbase storage and transfer code has been removed. * Added a quick way to change an application id via query param. * Added a generic error wrapper to add more context to Vanadium RPC errors. Closes #16 Change-Id: I6d45790de7551386bfcbc6c5ec3b93ef47066fc2
An example PDF reader using Vanadium.
If you have a $JIRI_ROOT
setup you can install Node.js from $JIRI_ROOT/third_party
by running:
jiri profile install nodejs
Optionally, it is possible to use your own install of Node.js if you would like to use a more recent version.
The Makefile is setup to handle all dependencies once Node.js is installed. The default make task will install any modules listed in the package.json
and build a browser bundle from browser/index.js
via browserify.
make
It is possible to have the build happen automatically anytime a JavaScript file changes using the watch tool:
watch make
To run a local dev server use:
make start
If you would like to change the host and or port that is used:
make start port=<port> host=<host>
Run syncbase with:
make syncbase
Run the syncbase instance which hosts the syncgroup:
make cloudsync
This will run a syncbased instance that will mount as “users//reader/cloudsync” and host the syncgroup. In order for peers to sync an instance of this needs to be running somewhere.
To run a new syncbase peer and corresponding application use variables to change the startup settings:
syncbase_port=8888 id=`./bin/cuid` make syncbase
This will generate a new client id and start a new syncbased instance on a different port. The generated id can be grabbed from the standard out and will look something like this “cif7en1kb00007uigyohv58tx”. Once you have the id you can open a new browser window and use the id in a query param to initialize the application to connect as that peer.
http://127.0.0.1:8080/?id=<id>
This will automatically have you set up credentials etc. If you want to remove stored data & credentials use:
make clean