eblanshey / safenet Goto Github PK
View Code? Open in Web Editor NEWLow-level javascript API wrapper for communicating with the SAFE Network launcher
License: MIT License
Low-level javascript API wrapper for communicating with the SAFE Network launcher
License: MIT License
The descriptions of the authorize and authenticate methods are switched.
The documentation recommends using authorize, when in fact authenticate is the one that will do the check to see if local storage already has authentication data and authorize will just go for it.
Hello !
do you have plans to update safenet to the new launcher api ? This would be really neat !
Hi Ephi,
I'm poking around and having some problems installing. I don't know my way around modern web development so wondering if any of this is obvious to fix...
I did:
npm install -g webpack
This was fine apart from one warning:
npm WARN optional dep failed, continuing [email protected]
But I'm getting a load of errors here:
$ git clone https://github.com/eblanshey/safenet/ ephi-safenet
$ cd ephi-safenet
$ npm install
[snip]
Hash: 31e5047e679a242bd675
Version: webpack 1.13.0
Time: 589ms
Asset Size Chunks Chunk Names
index.js 11.4 kB 0 [emitted] main
[0] ./src/index.js 256 bytes {0} [built]
[1] ./src/utils.js 2.07 kB {0} [built] [2 errors]
[3] ./src/api/auth.js 4.18 kB {0} [built] [2 errors]
[4] ./src/api/dns.js 1.48 kB {0} [built]
[5] ./src/api/nfs.js 2.52 kB {0} [built]
[6] ./src/init.js 867 bytes {0} [built] [2 errors]
[7] ./src/request.js 7.37 kB {0} [built]
[8] ./src/safe.js 2.22 kB {0} [built]
[9] ./src/storage.js 333 bytes {0} [built]
+ 1 hidden modules
ERROR in ./src/init.js
Module not found: Error: Cannot resolve module 'es6-promise' in /home/mrh/src/ephi-safenet/src
@ ./src/init.js 2:0-22
ERROR in ./src/init.js
Module not found: Error: Cannot resolve module 'isomorphic-fetch' in /home/mrh/src/ephi-safenet/src
@ ./src/init.js 3:0-27
ERROR in ./src/api/auth.js
Module not found: Error: Cannot resolve module 'tweetnacl' in /home/mrh/src/ephi-safenet/src/api
@ ./src/api/auth.js 1:11-31
ERROR in ./src/api/auth.js
Module not found: Error: Cannot resolve module 'base64-js' in /home/mrh/src/ephi-safenet/src/api
@ ./src/api/auth.js 2:13-33
ERROR in ./src/utils.js
Module not found: Error: Cannot resolve module 'base64-js' in /home/mrh/src/ephi-safenet/src
@ ./src/utils.js 1:13-33
ERROR in ./src/utils.js
Module not found: Error: Cannot resolve module 'tweetnacl' in /home/mrh/src/ephi-safenet/src
@ ./src/utils.js 2:11-31
npm WARN deprecated [email protected]: Jade has been renamed to pug, please install the latest version of pug instead of jade
npm WARN deprecated [email protected]: graceful-fs v3.0.0 and before will fail on node releases >= v6.0. Please update to graceful-fs@^4.0.0
[snip]
I am trying to sync a bunch of files from browserFS via the safenet library onto safenet but I get some problems with that in the browser and I am not sure, what is going wrong.
If I use the BrowserFS's fs.readFileSync()
(which mimics the node js FS-module), it gives me a Buffer-Object, but passing that to safenet's nfs.updateFile
doesn't work (it saves a json-to-string). While using fs.readFileSync(filename, 'utf8')
appears to give me the string I can pass to updateFile
, that fails on binary data (like PNG-files). Do you have any example of uploading a binary file via the safenet API? How are you doing it with buffers?
Hello,
trying to fetch a file using :
function getfile ( filename ) { var deferred = $.Deferred(); var getFile = filename, options = { isPathShared: true , offset: undefined , length: undefined }; Safe.nfs.getFile(getFile, options).then(function(file) { console.log ( 'downloaded :' , file.body ); }); return deferred.promise(); }
I get :
uncaught exception: error: t.headers.entries is not a function (0)
This is on column 17885 in index.js
Any idea what may cause this ? thank you !
By the way, is there a reason why index.js is a single line ? this is... hard to read to say the least :)
when using authorize and authenticate, while you receive a promise it doesn't inform you whether authentication worked or not. You'd have to observe the calls to safe.log in order to learn that โ not really the API you'd expect ;) .
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.