Experimental API Server

Forum rules
Warning !
Avoid using binary softwares from untrusted users.
Prefer compiling it yourself and verify sources.
Post Reply
phelix
Posts: 1631
Joined: Thu Aug 18, 2011 6:59 am

Experimental API Server

Post by phelix » Thu Mar 05, 2015 2:38 pm

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)
nx.bit - some namecoin stats
nf.bit - shortcut to this forum

phelix
Posts: 1631
Joined: Thu Aug 18, 2011 6:59 am

Re: Experimental API Server

Post by phelix » Wed Mar 11, 2015 3:04 pm

Now available at api.namecoin.org
nx.bit - some namecoin stats
nf.bit - shortcut to this forum

phelix
Posts: 1631
Joined: Thu Aug 18, 2011 6:59 am

Re: Experimental API Server

Post by phelix » Wed Apr 22, 2015 9:10 am

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
nx.bit - some namecoin stats
nf.bit - shortcut to this forum

phelix
Posts: 1631
Joined: Thu Aug 18, 2011 6:59 am

Re: Experimental API Server

Post by phelix » Tue Jun 16, 2015 3:58 pm

The API is still trucking along steadily though I never touched it. :mrgreen:
nx.bit - some namecoin stats
nf.bit - shortcut to this forum

phelix
Posts: 1631
Joined: Thu Aug 18, 2011 6:59 am

Re: Experimental API Server

Post by phelix » Tue Jul 28, 2015 3:41 pm

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.
nx.bit - some namecoin stats
nf.bit - shortcut to this forum

Post Reply