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
Namecoin Database access
Re: Namecoin Database access
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.
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/
BM-GtQnWM3vcdorfqpKXsmfHQ4rVYPG5pKS
Use your Namecoin identity as OpenID: https://nameid.org/
Re: Namecoin Database access
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.
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.
Re: Namecoin Database access
Usually you will have to run a client of some kind which you can query, e.g. namecoindASZ 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.
Re: Namecoin Database access
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:
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.