Skip to content
Mark Nadal edited this page Dec 22, 2015 · 2 revisions

THIS PAGE IS UNFINISHED AND THEREFORE MIGHT BE WRONG

put

  • HTTP POST peer graph
curl -X POST \
-H "Content-Type: application/json" \
-d '{
  "soul": {
    "_": {"#": "soul", ">": {"field": 1, "hello": 1}},
    "field": "value",
    "hello": "world!"
  }
}' \
https://gunjs.herokuapp.com/gun

ack

{ok: 1}

or

{err: "Persistence layer failed"}
  • WS
// paste this into your browser console
var ws = new WebSocket('wss://gunjs.herokuapp.com/gun');
ws.onopen = function(o){ 
  console.log('open', o);
  ws.send(JSON.stringify({
    "headers": {"ws-rid": "id"},
    "body": {
      "soul": {
        "_": {"#": "soul", ">": {"field": 1, "hello": 1}},
        "field": "value",
        "hello": "world!"
      }
    }
  }));
};
ws.onclose = function(c){ console.log('close', c) };
ws.onmessage = function(m){ console.log('message', m) };
ws.onerror = function(e){ console.log('error', e) };

ack

{headers: {"ws-rid": "id"}, body: {ok: 1}}

or

{headers: {"ws-rid": "id"}, body: {err: "Persistence layer failed"}}

get

  • HTTP GET peer/key
curl https://gunjs.herokuapp.com/gun/some/key

This wiki is where all the GUN website documentation comes from.

You can read it here or on the website, but the website has some special features like rendering some markdown extensions to create interactive coding tutorials.

Please feel free to improve the docs itself, we need contributions!

Clone this wiki locally