How to access http server

$ ./grin server run
Jan 28 14:04:58.730 INFO Using configuration file at: /home/coolio/grin/target/release/grin.toml
Jan 28 14:04:58.732 INFO Starting the Grin server...
Jan 28 14:04:58.733 INFO Starting server, genesis block: 02007902
Jan 28 14:04:58.765 INFO Chain init: Tip { height: 0, last_block_h: 02007902, prev_block_h: 02007902, total_difficulty: Difficulty { num: 1 } }
Jan 28 14:04:58.808 WARN No seed(s) configured, will stay solo until connected to
Jan 28 14:04:58.810 WARN P2P server started on 0.0.0.0:13414
Jan 28 14:04:58.810 INFO Starting rest apis at: 127.0.0.1:13413
Jan 28 14:04:58.811 WARN Grin server started.
Jan 28 14:04:58.812 WARN No seeds were retrieved.
Jan 28 14:04:58.812 INFO Starting HTTP API server at 127.0.0.1:13413.

On a separate terminal

$ curl -vvv 127.0.0.1:13413
* Rebuilt URL to: 127.0.0.1:13413/
*   Trying 127.0.0.1...
* TCP_NODELAY set
* Connected to 127.0.0.1 (127.0.0.1) port 13413 (#0)
> GET / HTTP/1.1
> Host: 127.0.0.1:13413
> User-Agent: curl/7.53.1
> Accept: */*
> 
< HTTP/1.1 404 Not Found
< Content-Length: 0
< Date: Sun, 28 Jan 2018 13:05:31 GMT
< 
* Connection #0 to host 127.0.0.1 left intact

Not sure what’s wrong. Any idea?

There is no endpoint on the root, try either of these:

curl 127.0.0.1:13413/v1
curl 127.0.0.1:13413/v1/chain

Great, thanks! Are these APIs documented anywhere? If not, what’s the best place to do so?

Throwing this out here - it would be nice to support something like OpenAPI for generating API docs. I may take a stab at a poc.


http://lessis.me/openapi/openapi/index.html

We were looking at generating them but I think that wasn’t trivial. For doc, how about the wiki?