Skip to content
No description, website, or topics provided.
C C++ Makefile HTML M4 JavaScript Other
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
Release
css
exchanges
include fixes Oct 23, 2015
js
lib/pnacl/Release test Nov 5, 2015
libs
miniupnpc
mxepatch
nanosrc test Nov 5, 2015
old
picocoin
plugins
pnacl/Release
share rest Nov 2, 2015
src
tools test Nov 5, 2015
.gitignore
AUTHORS
COPYING initial commit Oct 22, 2015
DEVELOPER-AGREEMENT initial commit Oct 22, 2015
LICENSE
Makefile
README.md
SNapi.c SNapi Oct 29, 2015
SuperNET.c test Nov 5, 2015
THIRDPARTY-LICENSES
background.js initial commit Oct 22, 2015
chrome.localhost test Nov 5, 2015
clean test Nov 5, 2015
codesize
common.js
example.js
handlers.c fixes Oct 23, 2015
handlers.h
hdrsize
icon128.png
index.html
jquery-2.1.4.min.js
launch test Oct 23, 2015
libjl777.c test Nov 1, 2015
logo.png
m_unix
makefile.libs
makefile.shared
makefile.ulibs m_unix Nov 2, 2015
makefile.unix test Nov 5, 2015
manifest.json test Nov 5, 2015
n
nacl_io.stamp
nacl_io_demo.c test Nov 1, 2015
nacl_io_demo.h commit Oct 22, 2015
prep
queue.c fixes Oct 23, 2015
queue.h
run.sh test Nov 4, 2015

README.md

SuperNET_API

Make sure you have Google Chrome, Chromium has different instructions.

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 do 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

You can’t perform that action at this time.