GithubHelp home page GithubHelp logo

eblanshey / safenet Goto Github PK

View Code? Open in Web Editor NEW
5.0 5.0 2.0 200 KB

Low-level javascript API wrapper for communicating with the SAFE Network launcher

License: MIT License

CSS 42.44% JavaScript 48.73% HTML 8.83%

safenet's People

Contributors

eblanshey avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

joshuef artogn

safenet's Issues

Authorize and authenticate are switched in the documentation

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.

api v0.5

Hello !

do you have plans to update safenet to the new launcher api ? This would be really neat !

Install issues

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]

loading binary content?

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?

uncaught exception: error: t.headers.entries is not a function (0)

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 :)

Authorize/Authenticate don't report status

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 ;) .

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.