Page 1 of 1

Experimental API Server

Posted: Thu Mar 05, 2015 2:38 pm
by phelix
Experimental version online. See the nmcapiclient.py example.

https://github.com/phelixnmc/nmcapi

You are welcome to review, especially the nginx config.

Readme:

Code: Select all

nmcAPI
======

API server for Namecoin names.


Features
=======
Handles imports.
Requests and output are obfuscated (nothing is encrypted for now).
Fetching uncached data takes about a millisecond. This is a bottleneck.
All caching is done in Nginx (10 minutes).
Cached responses should be super fast
Rate limiting in Nginx
namecoind and backend run supervisord


Dependencies
==========
bottle:
    pip install bottle

waitless (optional, to improve performance):
    pip install waitless

How to use
=========
Start a local server:
    python ./api.py -debug -port=8080
Start a public server:
    python ./api.py -public

See nmcapiclient.py on how to do lookups. Currently the server can be used with nmcontrol-hyperion and hopefully soon with official nmcontrol.


Performance & Stability
==================
For anything else than personal use the server should run through waitless and nginx and be managed by supervisord. Config files for nginx and to set up supervisord are included. For security you might want to set up a separate user account.


ToDo
====
help at root url (automated via route function?)
improve https handling
check https fingerprint for self signed certs
new query: current block height / block time
serve block headers to improve security
  - for name_op
  - for current height
harden against ddos


License
=======
LGPL unless it says otherwise in the source file.
(edited)

Re: Experimental API Server

Posted: Wed Mar 11, 2015 3:04 pm
by phelix
Now available at api.namecoin.org

Re: Experimental API Server

Posted: Wed Apr 22, 2015 9:10 am
by phelix
In the meantime I enabled TLS: https://api.namecoin.org/beta1/xname/sO ... =+1Mjxkg==

BTW: It is quite easy to run your own API server:

Install supervisord
Install nginx
Install namecoin
Maybe create special users
copy/paste nginx and supervisord config files, edit paths/users if necessary

Re: Experimental API Server

Posted: Tue Jun 16, 2015 3:58 pm
by phelix
The API is still trucking along steadily though I never touched it. :mrgreen:

Re: Experimental API Server

Posted: Tue Jul 28, 2015 3:41 pm
by phelix
Added readme with instructions on how to play with it (e.g. set up your own API server). You need to have namecoind running (and synced) for it to work.