Giter VIP home page Giter VIP logo

supernet_api's Introduction

SuperNET_API

make sure you have google-chrome, chromium is having different instructions http://askubuntu.com/questions/510056/how-to-install-google-chrome

launch chrome with --allow-nacl-socket-api=localhost command line arg

git clone https://github.com/jl777/SuperNET_API;
cd SuperNET_API;
tools/httpd.py -C . -p 7777 &

now you can go to http://localhost:7777

To issue API calls use SNapi:

gcc -o SNapi SNapi.c plugins/utils/cJSON.c -lnanomsg -lm

./SNapi "{\"plugin\":\"InstantDEX\",\"method\":\"allexchanges\"}"

You can change any of the html or JS files and just refresh to test it. After the first clone, just a git pull and refresh the page.

To recompile the pexe files from scratch, you need to setup a nacl_sdk toolchain (https://developer.chrome.com/native-client/sdk/download) and copy the toolchain directory into the SuperNET_API directory. From there make will recompile, make serve will recompile and launch httpd.py localhost server.

There are five ways of accessing the SuperNET_API:

  • via JS function bindings that will send JSON to SuperNET core and get a JSON return back
  • via SNapi to send in a JSON request to SuperNET core and it will print to stdout the JSON return
  • from SuperNET console
  • using ./BitcoinDarkd SuperNET '{<json request>}'
  • via C code that is linked into the SuperNET_API itself

On unix systems, you can use ./m_unix to build a standalone SuperNET, SNapi and BitcoinDarkd. It shares the same codebase, but on most unix (or mac osx) systems it will be 64bit code vs the 32bit bytecodes and of course an entirely different toolchain, so there could be subtle differences in behavior other than the ~2x performance the native code will get

The nanomsg comms between the native and pnacl should be compatible as long as control messages are not used and the transports are limited to inproc, ipc and tcp

James

supernet_api's People

Contributors

jl777 avatar brandoncollins7 avatar mess110 avatar

Watchers

James Cloos avatar

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.