Status Update - 13th July 2016

66 views
Skip to first unread message

happybeing

unread,
Jul 13, 2016, 8:28:43 AM7/13/16
to SAFEpress
Wow, nearly two months have passed since my last update. With all that's been going on in the world and particularly here in the UK (Brexit, a new Prime Minister and so on, plus some time with my family) it feels like no time at all!

I am still plugging away with SAFEpress when I get the time though, and in the coming weeks I expect to be able to sustain this and continue making progress. Progress still seems slow to me though because I'm still in a learning curve on several fronts. So what have I been doing and what is the status?

TL;DR Summary

I have a simple https://remotestorage.io App (screenshot below) talking to the SAFE NFS API using SAFE Launcher (API v0.4 - the one with encrypted communications). It is buggy, but successfully authorises with launcher, creates directories and stores files, and can retrieve the content of stored files. I'm using "mock routing" to do this which makes development much easier as it simulates the network and so I'm not dependent on what the testnets or the developer network are doing, internet access and so on.

To get here I have had two goes at creating a SAFE backend for remoteStorage, the first based on their DropBox backend and the second on a GoogleDrive version. (Note: remoteStorage also includes its own server that is available commercially, or which users can install on their own hosting or servers, so you don't need to use a commercial service or even a third party - this is what http://unhosted.org is about).

I'm now looking into how to handle versioning (which remoteStorage expects but is not yet available in the SAFE NFS API). I hope to be able to work around the bugs I'm seeing - some of which are almost certainly due to my not having worried about versioning or file metadata yet!

Goals
- reminder
I'm building a new backend for remoteStorage that will uses SAFE Network to store its "unhosted" data. The point of this is that people can write, and have written, Web Apps that use the remotestorage.js unhosted client. These are Web Apps that give user ownership and control over their data rather than putting it in the hands of the service provider. Instead your data can be stored where you choose (locally offline, a remotestorage web server, Dropbox account or GoogleDrive for example).

This gives users ownership and privacy for their data,
and I hope soon that will include the added benefits of using SAFE Network: low cost, decentralised, no third-party systems or central points of failure/surveillance etc. RemoteStorage Web Apps also deliver http://offlinefirst.org/ functionality - Web Apps that work without an internet connection!

A remoteStorage option also makes it very easy to build Apps that run on SAFE Network. App developers only need to understand HTML and JavaScript, and use any client side JS framework they like. It will also mean that existing remoteStorage apps will instantly work with SAFEnetwork! :-)

Activity & Status
First of all I used the remoteStorage DropBox backend as a template and got some of the basics working with the SAFE Launcher (v0.4). I got it to authorise, and had some of the PUT (create file) working but other things not quite (creating full directory paths) because of the way the backend and DropBox API worked together. It was really useful learning though, figuring out the basics of using JavaScript "Promises", not to mention JavaScript itself, the browser debugger and so on. I'm also starting to get some insight into the remoteStorage code itself (build system, structure, API), not to mention using git and github. I can now re-base changes! As you see, a lot of foothills for me to get over before the "big climb" to a SAFE backend for remoteStorage! But lots of progress definitely.

Having recognised the version based on the DropBox API wasn't doing what I needed, I began to get some idea of what I did need and looked for the first time at the GoogleDrive API and how the remoteStorage backend for it works. This looked more suitable and so it seemed worth starting from scratch and adapting this instead of trying to fix the one I had developed based on the DropBox API, and so it proved.

I started from scratch and have now adapted the GoogleDrive remoteStorage backend. At the same time I integrated the very nice Safecoin logo as the "Connect" button rather than a rather crude one I hacked together earlier (see image below). The "connect" icon/buttons are at the top right of this image and clicking on the blue 'S' causes the SAFE Launcher to prompt whether to give this App access to your SAFE Drive. Once you have, you can add "drinks" (these are just text entries) using the "My Favorite Drinks" user interface in the web browser and each "drink" appears in a list on the page, and is also stored as entries (files) on your SAFE Drive (in a subdirectory /remotestorage/myfavoritedrinks).















So it now looks the part and the demo App I'm using works, sort of, up to a point! Using @cretz' command line SAFE API (v0.4 still for now) I can see the directories and files that are created in my SAFE Network storage by the Web App :-)

This is still very buggy and there are things that the SAFE NFS API does not do yet
(mainly versioning) which would be a help, or may prove necessary before this can work reliably and with full remoteStorage functionality but I'm seeing if I can work around this at the moment. This is I think the cause of the main bugs I'm seeing and I have some ideas on how to work around this. Things with I will need to look into anyway for when the SAFE API supports versioned access so no loss there.

Reply all
Reply to author
Forward
0 new messages