Namecoin Database access

Post Reply
ASZ
Posts: 6
Joined: Sun Mar 15, 2015 3:29 pm

Namecoin Database access

Post by ASZ »

Hi,

What's the best way to retrieve data from the namecoin database?

I've seen that nameid.org (implemented by Daniel Kraft) uses JSON-RPC calls. The problem is that the only available libraries are for c++ and php.
Furthermore I would like to be able to search not only for IDs (as seen in nameid.org), but also for other, more specific, information (also using pattern-matching). How can this be accomplished?

This question is probably better suited for the dev. forum, feel free to move it ;)

domob
Posts: 1129
Joined: Mon Jun 24, 2013 11:27 am
Contact:

Re: Namecoin Database access

Post by domob »

I believe that there are probably JSON-RPC libraries available for much more languages than C++ and PHP. (At least Python code is also flowing around that does this specifically for Namecoin.) Also, it is not too hard to implement. If you want to do pattern matching on the name (not the value), you can use the "name_filter" RPC command. For matching against the value, you probably should mirror the full database into some SQL database of your own with appropriate indices.

If you use Namecoin Core (the new client recently developed), you can also use a REST interface to query for name data. With this, you don't need to worry about the credentials and it may be even easier to find an appropriate library or write the code yourself. Basically, you just need some way to make a HTTP GET request.
BTC: 1domobKsPZ5cWk2kXssD8p8ES1qffGUCm | NMC: NCdomobcmcmVdxC5yxMitojQ4tvAtv99pY
BM-GtQnWM3vcdorfqpKXsmfHQ4rVYPG5pKS
Use your Namecoin identity as OpenID: https://nameid.org/

ASZ
Posts: 6
Joined: Sun Mar 15, 2015 3:29 pm

Re: Namecoin Database access

Post by ASZ »

Thanks for the answer!

Where would I have to send the requests to? Since namecoin is decentralized, I was thinking of querying a local database, which would have to be held up-to-date. How does nameid.org handle this?

Thanks in advace.

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

Re: Namecoin Database access

Post by phelix »

ASZ wrote:Thanks for the answer!

Where would I have to send the requests to? Since namecoin is decentralized, I was thinking of querying a local database, which would have to be held up-to-date. How does nameid.org handle this?

Thanks in advace.
Usually you will have to run a client of some kind which you can query, e.g. namecoind
nx.bit - some namecoin stats
nf.bit - shortcut to this forum

cassini
Posts: 336
Joined: Sun May 26, 2013 6:36 pm

Re: Namecoin Database access

Post by cassini »

We should create a Wiki page about both the centralized and decentralized methods of fetching data from the Namecoin blockchain.

One of the decentralized methods is:
  • Download the Namecoin-Qt client (or namecoind) and start. This may take a while.
  • As soon as it has finished synchronizing (i.e. downloaded the whole blockchain), quit the client.
  • Create a namecoin.conf file, see
    https://forum.namecoin.info/viewtopic.p ... 960#p12960
    (applies to MS-Windows or Linux accordingly).
    Standard location for namecoin.conf:
    Windows: C:\Documents and Settings\<username>\Application Data\Namecoin\namecoin.conf
    (i.e. %APPDATA%\Namecoin\namecoin.conf)
    Mac: ~/Library/Application Support/Namecoin/namecoin.conf
    Linux: ~/.namecoin/namecoin.conf
  • Restart Namecoin-Qt with the -server parameter (or -daemon if you use namecoind).
  • Try one of the JSON-RPC examples from the Bitcoin API tutorial. For Namecoin RPCs simply replace 8332 with Namecoin's standard RPC port 8336.

ASZ
Posts: 6
Joined: Sun Mar 15, 2015 3:29 pm

Re: Namecoin Database access

Post by ASZ »

deleted by OP

Post Reply