Community Registries
From I-names Development Wiki
Contents |
[edit] Running a Community Registry
A community registry is one that offers registration of community XRIs, which are I-names or I-numbers not rooted at the GCS symbol. Exampless of global I-names are:
@example =test
Examples of community I-names are:
@example*foo =test*bar
[edit] Hosted Community Registries
The simplest way to run a community registry is to register an i-name at an ibroker that offers community registry services (for instance http://1id.com or http://linksafe.name where a community i-names registry is included with every i-name. Linksafe even off a free community i-name under @freeid).
If you want to host your own registry you can also do that. Read on.
[edit] Running Your Own Community Registry
[edit] Required Software
The most basic requirement for running any XRI registry is the authority resolution server. An authority resolution server answers resolution queries in the form of XRI subsegments by returning XRDS documents. Since XRI resolution is HTTP-based, a simple server can be written as a CGI script (or PHP, Java servlet, etc.) AuthSrv is one such freely available CGI script written in Perl may be used. See setup instructions at AuthSrv.
[edit] Delegation
Suppose you own the global I-name @example. In order to resolve community i-names under it, you'll need to delegate to the authority resolution server that you created. To do that, add the following to the XRDS document for @example:
<Service priority="10"> <Type select="true">xri://$res*auth*($v*2.0)</Type> <Path match="null"/> <MediaType>application/xrds+xml;trust=none</MediaType> <URI priority="10">http://www.yourserver.biz/cgi-bin/authsrv.pl/@example/</URI> </Service>
This assumes that authsrv.pl is installed at the URL http://www.yourserver.biz/cgi-bin/authsrv.pl
[edit] Testing resolution
It is important to first test your resolution server to ensure that it is answering queries correctly. To query the community i-name @example*foo the corresponding URL would be http://www.yourserver.biz/cgi-bin/authsrv.pl/@example/*foo
You should receive an XRDS document containing the following element XRDS/XRD/Status/@code=100
If you get any other code, you should check the web server error log for information.
Code 222 indicates that the i-name is not found.
Once you are certain that the authority resolution server is configured correctly, try it using the global proxy resolution server:
http://xri.net/@example*foo?_xrd_r=application/xrds+xml;sep=false
