Dev:APIseedlist

Aus YaCyWiki
Wechseln zu: Navigation, Suche

Inhaltsverzeichnis

Seedlist Export

This is a description of the api at http://localhost:8090/yacy/seedlist.html AND (it's the same) the format of the YaCy bootstraping-seedlist. The seedlist has two representations: a binary format which is used as bootstraping basis and a textual format in json(p) representation.

Operations performed when the servlet is called

The peer collects information about remote peers and represents it in either binary or textual format.

Properties in the http header

The caller must obey the http header rules.

Properties in the http post-arguments

Calls to the servlet can be made using a GET or POST operation. The properties are:

  • node=anything - if given then only node-type peers are selected
  • me=anything - if given then the output includes the called peer seed
  • my=anything - if given then the output contains only the called peer seed
  • id=peerhash - if given then the output contains only the peer with peer-hash peerhash
  • name=peername - if given then the output contains only the peer with peer-name peername
  • address=anything - if given then the output contains only the IP:port information
  • callback=<function-name> this is the name of the jsonp function. If the servlet is called with the 'json' extension and the callback property is present, the result is jsonp, not json.

Result

The result may be returned in two different formats. The format is selected by the file name extension of the servlet, either 'html' for the binary format or 'json' for the clear-text format.

Binary Seedlist

The seedlist servlet generates a 'seedlist' file that is used for the bootstraping process of the YaCy p2p network. This file is a list of peer seeds in a SimpleCoding representation of a Seed DNA property map string. Formal:

seedstring  = '{', nucleotides, '}'
nucleotides = nucleotide, (',', nucleotide)*
nucleotide  = seed-attibute-key, '=', seed-attibute-value

Where seed-attibute-key and the corresponding seed-attibute-value is explained in Seed. Then we can defined the seedlist as list of encoded seedstrings:

seedlist    = ( seedencoding, CRLF )*

Where the seedencoding is a SimpleCoding of seedstring.

Clear-Text Seedlist

If you call the seedlist with http://localhost:8090/yacy/seedlist.html you will not get a html page but a page with encoded seedstrings as described above. There is an alternative representation of the seed list using the same api with json encoding. The page http://localhost:8090/yacy/seedlist.json shows the seed DNA with all the nucleotides in clear text. The same api is available for a json-p encoding using the following schema: http://localhost:8090/yacy/seedlist.json?callback=seedlistobject A clear-text seedlist looks like

{
   "peers":[{
       "Hash":"3J_kC-uVIWrS",
       "seedURL":"http://www.yacy.net/seed.txt",
       "Version":"1.67009304",
       "NCount":"0",
       "CCount":"121.0",
       "Uptime":"21",
       "LastSeen":"20131217213712",
       "USpeed":"0",
       "sU":"319904942",
       "SCount":"119",
       "IP":"92.228.41.20",
       "IP6":"92.228.41.21",
       "LCount":"20902347",
       "sI":"32040145",
       "RCount":"0",
       "ISpeed":"0",
       "Port":"8000",
       "PeerType":"senior",
       "UTC":"+0100",
       "Name":"bluebox",
       "ICount":"2586810",
       "Tags":"*",
       "rI":"776774245",
       "rU":"59172406",
       "IPType":"∅",
       "RSpeed":"0.0041598985",
       "news":"",
       "BDate":"20121114224458",
       "Flags":"!   ",
       "Address":["92.228.41.20:8000","92.228.41.21:8000"]
   }
}

This example shows only a single seed entry, the actual seedlist may contain hundreds of entries. If you call the xml-variant of the servlet, the output looks like:

<?xml version="1.0"?>
<peers>
  <seed>
   <Hash>BmoCd7RmYw8o</Hash>
   <NCount>0</NCount>
   <Version>0.10000000</Version>
   <CCount>49.0</CCount>
   <Uptime>12</Uptime>
   <LastSeen>20140913085222</LastSeen>
   <USpeed>0</USpeed>
   <sU>45398</sU>
   <SCount>224</SCount>
   <LCount>11119</LCount>
   <IP>92.227.207.117</IP>
   <IP6>92.227.207.118|92.227.207.119</IP6>
   <ISpeed>0</ISpeed>
   <RCount>0</RCount>
   <sI>14475</sI>
   <Port>8090</Port>
   <PeerType>senior</PeerType>
   <UTC>+0200</UTC>
   <Name>_anonxmfe-36621712-16</Name>
   <ICount>111947</ICount>
   <rI>7326</rI>
   <rU>7326</rU>
   <IPType>&empty;</IPType>
   <RSpeed>0.0</RSpeed>
   <news></news>
   <BDate>20140905105305</BDate>
   <Flags>%   </Flags>
   <Address>92.227.207.117:8090</Address>
   <Address>92.227.207.118:8090</Address>
   <Address>92.227.207.119:8090</Address>
  </seed>
</peers>
Meine Werkzeuge
Namensräume
Varianten
Aktionen
Gemeinschafts-Portal
Navigation
Werkzeuge