github.com/fozzysec/SiaPrime@v0.0.0-20190612043147-66c8e8d11fe3/doc/api/HostDB.md (about)

     1  Host DB API
     2  ===========
     3  
     4  This document contains detailed descriptions of the hostdb's API routes. For an
     5  overview of the hostdb's API routes, see [API.md#host-db](/doc/API.md#host-db).
     6  For an overview of all API routes, see [API.md](/doc/API.md)
     7  
     8  There may be functional API calls which are not documented. These are not
     9  guaranteed to be supported beyond the current release, and should not be used
    10  in production.
    11  
    12  Overview
    13  --------
    14  
    15  The hostdb maintains a database of all hosts known to the network. The database
    16  identifies hosts by their public key and keeps track of metrics such as price.
    17  
    18  Index
    19  -----
    20  
    21  | Request                                                       | HTTP Verb | Examples                      |
    22  | ------------------------------------------------------------- | --------- | ----------------------------- |
    23  | [/hostdb](#hostdb-get-example)                                | GET       | [HostDB Get](#hostdb-get)     |
    24  | [/hostdb/active](#hostdbactive-get-example)                   | GET       | [Active hosts](#active-hosts) |
    25  | [/hostdb/all](#hostdball-get-example)                         | GET       | [All hosts](#all-hosts)       |
    26  | [/hostdb/hosts/___:pubkey___](#hostdbhostspubkey-get-example) | GET       | [Hosts](#hosts)               |
    27  
    28  #### /hostdb [GET] [(example)](#hostdb-get)
    29  
    30  shows some general information about the state of the hostdb.
    31  
    32  ###### JSON Response 
    33  
    34  Either the following JSON struct or an error response. See [#standard-responses](#standard-responses).
    35  
    36  ```javascript
    37  {
    38      "initialscancomplete": false // indicates if all known hosts have been scanned at least once.
    39  }
    40  ```
    41  
    42  #### /hostdb/active [GET] [(example)](#active-hosts)
    43  
    44  lists all of the active hosts known to the renter, sorted by preference.
    45  
    46  ###### Query String Parameters
    47  ```
    48  // Number of hosts to return. The actual number of hosts returned may be less
    49  // if there are insufficient active hosts. Optional, the default is all active
    50  // hosts.
    51  numhosts
    52  ```
    53  
    54  ###### JSON Response
    55  ```javascript
    56  {
    57    "hosts": [
    58      {
    59        // true if the host is accepting new contracts.
    60        "acceptingcontracts": true,
    61  
    62        // The maximum amount of money that the host will put up as collateral
    63        // for storage that is contracted by the renter
    64        "collateral": "20000000000", // hastings / byte / block
    65  
    66        // The price that a renter has to pay to create a contract with the
    67        // host. The payment is intended to cover transaction fees
    68        // for the file contract revision and the storage proof that the host
    69        // will be submitting to the blockchain.
    70        "contractprice": "1000000000000000000000000", // hastings
    71  
    72        // The price that a renter has to pay when downloading data from the
    73        // host
    74        "downloadbandwidthprice": "35000000000000", // hastings / byte
    75  
    76        // Firstseen is the last block height at which this host was announced.
    77        "firstseen": 160000, // blocks
    78  
    79        // Total amount of time the host has been offline.
    80        "historicdowntime": 0,
    81  
    82        // Number of historic failed interactions with the host.
    83        "historicfailedinteractions": 0,
    84  
    85        // Number of historic successful interactions with the host.
    86        "historicsuccessfulinteractions": 5,
    87  
    88        // Total amount of time the host has been online.
    89        "historicuptime": 41634520900246576,
    90  
    91        // List of IP subnet masks used by the host. For IPv4 the /24 and for IPv6 the /54 subnet mask
    92        // is used. A host can have either one IPv4 or one IPv6 subnet or one of each. E.g. these
    93        // lists are valid: [ "IPv4" ], [ "IPv6" ] or [ "IPv4", "IPv6" ]. The following lists are 
    94        // invalid: [ "IPv4", "IPv4" ], [ "IPv4", "IPv6", "IPv6" ]. Hosts with an invalid list are ignored.
    95        "ipnets": [
    96          "1.2.3.0",
    97          "2.1.3.0"
    98        ],
    99  
   100        // The last time that the interactions within scanhistory have been compressed into the historic ones
   101        "lasthistoricupdate": 174900, // blocks
   102  
   103        // The last time the list of IP subnet masks was updated. When equal subnet masks are found for
   104        // different hosts, the host that occupies the subnet mask for a longer time is preferred.
   105        "lastipnetchange": "2015-01-01T08:00:00.000000000+04:00",
   106  
   107        // The maximum amount of collateral that the host will put into a
   108        // single file contract.
   109        "maxcollateral": "1000000000000000000000000000", // hastings
   110  
   111        // Maximum number of bytes that the host will allow to be requested by a
   112        // single download request.
   113        "maxdownloadbatchsize": 17825792, // bytes
   114  
   115        // Maximum duration in blocks that a host will allow for a file contract.
   116        // The host commits to keeping files for the full duration under the
   117        // threat of facing a large penalty for losing or dropping data before
   118        // the duration is complete. The storage proof window of an incoming file
   119        // contract must end before the current height + maxduration.
   120        //
   121        // There is a block approximately every 10 minutes.
   122        // e.g. 1 day = 144 blocks
   123        "maxduration": 25920, // blocks
   124  
   125        // Maximum size in bytes of a single batch of file contract
   126        // revisions. Larger batch sizes allow for higher throughput as there is
   127        // significant communication overhead associated with performing a batch
   128        // upload.
   129        "maxrevisebatchsize": 17825792, // bytes
   130  
   131        // Remote address of the host. It can be an IPv4, IPv6, or hostname,
   132        // along with the port. IPv6 addresses are enclosed in square brackets.
   133        "netaddress": "123.456.789.0:4282",
   134  
   135        // Public key used to identify and verify hosts.
   136        "publickey": {
   137          // Algorithm used for signing and verification. Typically "ed25519".
   138          "algorithm": "ed25519",
   139  
   140          // Key used to verify signed host messages.
   141          "key": "RW50cm9weSBpc24ndCB3aGF0IGl0IHVzZWQgdG8gYmU="
   142        },
   143  
   144        // The string representation of the full public key, used when calling
   145        // /hostdb/hosts.
   146        "publickeystring": "ed25519:1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef",
   147  
   148        // Number of recent failed interactions with the host.
   149        "recentfailedinteractions": 0,
   150  
   151        // Number of recent successful interactions with the host.
   152        "recentsuccessfulinteractions": 0,
   153  
   154        // Unused storage capacity the host claims it has.
   155        "remainingstorage": 35000000000, // bytes
   156  
   157        // The revision number indicates to the renter what iteration of
   158        // settings the host is currently at. Settings are generally signed.
   159        // If the renter has multiple conflicting copies of settings from the
   160        // host, the renter can expect the one with the higher revision number
   161        // to be more recent.
   162        "revisionnumber": 12733798,
   163  
   164        // Measurements that have been taken on the host. The most recent measurements
   165        // are kept in full detail.
   166        "scanhistory": [
   167          {
   168            "success": true,
   169            "timestamp": "2018-09-23T08:00:00.000000000+04:00"
   170          },
   171          {
   172            "success": true,
   173            "timestamp": "2018-09-23T06:00:00.000000000+04:00"
   174          },
   175          {
   176            "success": true,
   177            "timestamp": "2018-09-23T04:00:00.000000000+04:00"
   178          }
   179        ],
   180  
   181        // Smallest amount of data in bytes that can be uploaded or downloaded to
   182        // or from the host.
   183        "sectorsize": 4194304, // bytes
   184  
   185        // The price that a renter has to pay to store files with the host.
   186        "storageprice": "14000000000", // hastings / byte / block
   187  
   188        // Total amount of storage capacity the host claims it has.
   189        "totalstorage": 35000000000, // bytes
   190  
   191        // Address at which the host can be paid when forming file contracts.
   192        "unlockhash": "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789ab",
   193  
   194        "uploadbandwidthprice": "3000000000000", // hastings / byte
   195  
   196        // The version of the host.
   197        "version": "1.3.8",
   198  
   199        // A storage proof window is the number of blocks that the host has to
   200        // get a storage proof onto the blockchain. The window size is the
   201        // minimum size of window that the host will accept in a file contract.
   202        "windowsize": 144 // blocks
   203      }
   204    ]
   205  }
   206  ```
   207  
   208  #### /hostdb/all [GET] [(example)](#all-hosts)
   209  
   210  lists all of the hosts known to the renter. Hosts are not guaranteed to be in
   211  any particular order, and the order may change in subsequent calls.
   212  
   213  ###### JSON Response
   214  ```javascript
   215  {
   216    "hosts": [
   217      {
   218        // true if the host is accepting new contracts.
   219        "acceptingcontracts": true,
   220  
   221        // The maximum amount of money that the host will put up as collateral
   222        // for storage that is contracted by the renter
   223        "collateral": "20000000000", // hastings / byte / block
   224  
   225        // The price that a renter has to pay to create a contract with the
   226        // host. The payment is intended to cover transaction fees
   227        // for the file contract revision and the storage proof that the host
   228        // will be submitting to the blockchain.
   229        "contractprice": "1000000000000000000000000", // hastings
   230  
   231        // The price that a renter has to pay when downloading data from the
   232        // host
   233        "downloadbandwidthprice": "35000000000000", // hastings / byte
   234  
   235        // Firstseen is the last block height at which this host was announced.
   236        "firstseen": 160000, // blocks
   237  
   238        // Total amount of time the host has been offline.
   239        "historicdowntime": 0,
   240  
   241        // Number of historic failed interactions with the host.
   242        "historicfailedinteractions": 0,
   243  
   244        // Number of historic successful interactions with the host.
   245        "historicsuccessfulinteractions": 5,
   246  
   247        // Total amount of time the host has been online.
   248        "historicuptime": 41634520900246576,
   249  
   250        // List of IP subnet masks used by the host. For IPv4 the /24 and for IPv6 the /54 subnet mask
   251        // is used. A host can have either one IPv4 or one IPv6 subnet or one of each. E.g. these
   252        // lists are valid: [ "IPv4" ], [ "IPv6" ] or [ "IPv4", "IPv6" ]. The following lists are 
   253        // invalid: [ "IPv4", "IPv4" ], [ "IPv4", "IPv6", "IPv6" ]. Hosts with an invalid list are ignored.
   254        "ipnets": [
   255          "1.2.3.0",
   256          "2.1.3.0"
   257        ],
   258  
   259        // The last time that the interactions within scanhistory have been compressed into the historic ones
   260        "lasthistoricupdate": 174900, // blocks
   261  
   262        // The last time the list of IP subnet masks was updated. When equal subnet masks are found for
   263        // different hosts, the host that occupies the subnet mask for a longer time is preferred.
   264        "lastipnetchange": "2015-01-01T08:00:00.000000000+04:00",
   265  
   266        // The maximum amount of collateral that the host will put into a
   267        // single file contract.
   268        "maxcollateral": "1000000000000000000000000000", // hastings
   269  
   270        // Maximum number of bytes that the host will allow to be requested by a
   271        // single download request.
   272        "maxdownloadbatchsize": 17825792, // bytes
   273  
   274        // Maximum duration in blocks that a host will allow for a file contract.
   275        // The host commits to keeping files for the full duration under the
   276        // threat of facing a large penalty for losing or dropping data before
   277        // the duration is complete. The storage proof window of an incoming file
   278        // contract must end before the current height + maxduration.
   279        //
   280        // There is a block approximately every 10 minutes.
   281        // e.g. 1 day = 144 blocks
   282        "maxduration": 25920, // blocks
   283  
   284        // Maximum size in bytes of a single batch of file contract
   285        // revisions. Larger batch sizes allow for higher throughput as there is
   286        // significant communication overhead associated with performing a batch
   287        // upload.
   288        "maxrevisebatchsize": 17825792, // bytes
   289  
   290        // Remote address of the host. It can be an IPv4, IPv6, or hostname,
   291        // along with the port. IPv6 addresses are enclosed in square brackets.
   292        "netaddress": "123.456.789.0:4282",
   293  
   294        // Public key used to identify and verify hosts.
   295        "publickey": {
   296          // Algorithm used for signing and verification. Typically "ed25519".
   297          "algorithm": "ed25519",
   298  
   299          // Key used to verify signed host messages.
   300          "key": "RW50cm9weSBpc24ndCB3aGF0IGl0IHVzZWQgdG8gYmU="
   301        },
   302  
   303        // The string representation of the full public key, used when calling
   304        // /hostdb/hosts.
   305        "publickeystring": "ed25519:1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef",
   306  
   307        // Number of recent failed interactions with the host.
   308        "recentfailedinteractions": 0,
   309  
   310        // Number of recent successful interactions with the host.
   311        "recentsuccessfulinteractions": 0,
   312  
   313        // Unused storage capacity the host claims it has.
   314        "remainingstorage": 35000000000, // bytes
   315  
   316        // The revision number indicates to the renter what iteration of
   317        // settings the host is currently at. Settings are generally signed.
   318        // If the renter has multiple conflicting copies of settings from the
   319        // host, the renter can expect the one with the higher revision number
   320        // to be more recent.
   321        "revisionnumber": 12733798,
   322  
   323        // Measurements that have been taken on the host. The most recent measurements
   324        // are kept in full detail.
   325        "scanhistory": [
   326          {
   327            "success": true,
   328            "timestamp": "2018-09-23T08:00:00.000000000+04:00"
   329          },
   330          {
   331            "success": true,
   332            "timestamp": "2018-09-23T06:00:00.000000000+04:00"
   333          },
   334          {
   335            "success": true,
   336            "timestamp": "2018-09-23T04:00:00.000000000+04:00"
   337          }
   338        ],
   339  
   340        // Smallest amount of data in bytes that can be uploaded or downloaded to
   341        // or from the host.
   342        "sectorsize": 4194304, // bytes
   343  
   344        // The price that a renter has to pay to store files with the host.
   345        "storageprice": "14000000000", // hastings / byte / block
   346  
   347        // Total amount of storage capacity the host claims it has.
   348        "totalstorage": 35000000000, // bytes
   349  
   350        // Address at which the host can be paid when forming file contracts.
   351        "unlockhash": "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789ab",
   352  
   353        "uploadbandwidthprice": "3000000000000", // hastings / byte
   354  
   355        // The version of the host.
   356        "version": "1.3.8",
   357  
   358        // A storage proof window is the number of blocks that the host has to
   359        // get a storage proof onto the blockchain. The window size is the
   360        // minimum size of window that the host will accept in a file contract.
   361        "windowsize": 144 // blocks
   362      }
   363    ]
   364  }
   365  ```
   366  
   367  #### /hostdb/hosts/___:pubkey___ [GET] [(example)](#hosts)
   368  
   369  fetches detailed information about a particular host, including metrics
   370  regarding the score of the host within the database. It should be noted that
   371  each renter uses different metrics for selecting hosts, and that a good score on
   372  in one hostdb does not mean that the host will be successful on the network
   373  overall.
   374  
   375  ###### Path Parameters
   376  ```
   377  // The public key of the host. Each public key identifies a single host.
   378  //
   379  // Example Pubkey: ed25519:1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef
   380  :pubkey
   381  ```
   382  
   383  ###### JSON Response
   384  ```javascript
   385  {
   386    "entry": {
   387      // true if the host is accepting new contracts.
   388      "acceptingcontracts": true,
   389  
   390      // The maximum amount of money that the host will put up as collateral
   391      // for storage that is contracted by the renter
   392      "collateral": "20000000000", // hastings / byte / block
   393  
   394      // The price that a renter has to pay to create a contract with the
   395      // host. The payment is intended to cover transaction fees
   396      // for the file contract revision and the storage proof that the host
   397      // will be submitting to the blockchain.
   398      "contractprice": "1000000000000000000000000", // hastings
   399  
   400      // The price that a renter has to pay when downloading data from the
   401      // host
   402      "downloadbandwidthprice": "35000000000000", // hastings / byte
   403  
   404      // Firstseen is the last block height at which this host was announced.
   405      "firstseen": 160000, // blocks
   406  
   407      // Total amount of time the host has been offline.
   408      "historicdowntime": 0,
   409  
   410      // Number of historic failed interactions with the host.
   411      "historicfailedinteractions": 0,
   412  
   413      // Number of historic successful interactions with the host.
   414      "historicsuccessfulinteractions": 5,
   415  
   416      // Total amount of time the host has been online.
   417      "historicuptime": 41634520900246576,
   418  
   419      // List of IP subnet masks used by the host. For IPv4 the /24 and for IPv6 the /54 subnet mask
   420      // is used. A host can have either one IPv4 or one IPv6 subnet or one of each. E.g. these
   421      // lists are valid: [ "IPv4" ], [ "IPv6" ] or [ "IPv4", "IPv6" ]. The following lists are 
   422      // invalid: [ "IPv4", "IPv4" ], [ "IPv4", "IPv6", "IPv6" ]. Hosts with an invalid list are ignored.
   423      "ipnets": [
   424        "1.2.3.0",
   425        "2.1.3.0"
   426      ],
   427  
   428      // The last time that the interactions within scanhistory have been compressed into the historic ones
   429      "lasthistoricupdate": 174900, // blocks
   430  
   431      // The last time the list of IP subnet masks was updated. When equal subnet masks are found for
   432      // different hosts, the host that occupies the subnet mask for a longer time is preferred.
   433      "lastipnetchange": "2015-01-01T08:00:00.000000000+04:00",
   434  
   435      // The maximum amount of collateral that the host will put into a
   436      // single file contract.
   437      "maxcollateral": "1000000000000000000000000000", // hastings
   438  
   439      // Maximum number of bytes that the host will allow to be requested by a
   440      // single download request.
   441      "maxdownloadbatchsize": 17825792, // bytes
   442  
   443      // Maximum duration in blocks that a host will allow for a file contract.
   444      // The host commits to keeping files for the full duration under the
   445      // threat of facing a large penalty for losing or dropping data before
   446      // the duration is complete. The storage proof window of an incoming file
   447      // contract must end before the current height + maxduration.
   448      //
   449      // There is a block approximately every 10 minutes.
   450      // e.g. 1 day = 144 blocks
   451      "maxduration": 25920, // blocks
   452  
   453      // Maximum size in bytes of a single batch of file contract
   454      // revisions. Larger batch sizes allow for higher throughput as there is
   455      // significant communication overhead associated with performing a batch
   456      // upload.
   457      "maxrevisebatchsize": 17825792, // bytes
   458  
   459      // Remote address of the host. It can be an IPv4, IPv6, or hostname,
   460      // along with the port. IPv6 addresses are enclosed in square brackets.
   461      "netaddress": "123.456.789.0:4282",
   462  
   463      // Public key used to identify and verify hosts.
   464      "publickey": {
   465        // Algorithm used for signing and verification. Typically "ed25519".
   466        "algorithm": "ed25519",
   467  
   468        // Key used to verify signed host messages.
   469        "key": "RW50cm9weSBpc24ndCB3aGF0IGl0IHVzZWQgdG8gYmU="
   470      },
   471  
   472      // The string representation of the full public key, used when calling
   473      // /hostdb/hosts.
   474      "publickeystring": "ed25519:1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef",
   475  
   476      // Number of recent failed interactions with the host.
   477      "recentfailedinteractions": 0,
   478  
   479      // Number of recent successful interactions with the host.
   480      "recentsuccessfulinteractions": 0,
   481  
   482      // Unused storage capacity the host claims it has.
   483      "remainingstorage": 35000000000, // bytes
   484  
   485      // The revision number indicates to the renter what iteration of
   486      // settings the host is currently at. Settings are generally signed.
   487      // If the renter has multiple conflicting copies of settings from the
   488      // host, the renter can expect the one with the higher revision number
   489      // to be more recent.
   490      "revisionnumber": 12733798,
   491  
   492      // Measurements that have been taken on the host. The most recent measurements
   493      // are kept in full detail.
   494      "scanhistory": [
   495        {
   496          "success": true,
   497          "timestamp": "2018-09-23T08:00:00.000000000+04:00"
   498        },
   499        {
   500          "success": true,
   501          "timestamp": "2018-09-23T06:00:00.000000000+04:00"
   502        },
   503        {
   504          "success": true,
   505          "timestamp": "2018-09-23T04:00:00.000000000+04:00"
   506        }
   507      ],
   508  
   509      // Smallest amount of data in bytes that can be uploaded or downloaded to
   510      // or from the host.
   511      "sectorsize": 4194304, // bytes
   512  
   513      // The price that a renter has to pay to store files with the host.
   514      "storageprice": "14000000000", // hastings / byte / block
   515  
   516      // Total amount of storage capacity the host claims it has.
   517      "totalstorage": 35000000000, // bytes
   518  
   519      // Address at which the host can be paid when forming file contracts.
   520      "unlockhash": "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789ab",
   521  
   522      "uploadbandwidthprice": "3000000000000", // hastings / byte
   523  
   524      // The version of the host.
   525      "version": "1.3.8",
   526  
   527      // A storage proof window is the number of blocks that the host has to
   528      // get a storage proof onto the blockchain. The window size is the
   529      // minimum size of window that the host will accept in a file contract.
   530      "windowsize": 144 // blocks
   531    },
   532  
   533    // A set of scores as determined by the renter. Generally, the host's final
   534    // final score is all of the values multiplied together. Modified renters may
   535    // have additional criteria that they use to judge a host, or may ignore
   536    // certin criteia. In general, these fields should only be used as a loose
   537    // guide for the score of a host, as every renter sees the world differently
   538    // and uses different metrics to evaluate hosts.
   539    "scorebreakdown": {
   540      // The multiplier that gets applied to the host based on how long it has
   541      // been a host. Older hosts typically have a lower penalty.
   542      "ageadjustment": 0.1234,
   543  
   544      // The multiplier that gets applied to the host based on how much
   545      // proof-of-burn the host has performed. More burn causes a linear increase
   546      // in score.
   547      "burnadjustment": 23.456,
   548  
   549      // The multiplier that gets applied to a host based on how much collateral
   550      // the host is offering. More collateral is typically better, though above
   551      // a point it can be detrimental.
   552      "collateraladjustment": 23.456,
   553  
   554      // conversionrate is the likelihood that the host will be selected 
   555      // by renters forming contracts.
   556      "conversionrate": 9.12345,
   557  
   558      // The multipler that gets applied to a host based on previous interactions
   559      // with the host. A high ratio of successful interactions will improve this
   560      // hosts score, and a high ratio of failed interactions will hurt this
   561      // hosts score. This adjustment helps account for hosts that are on
   562      // unstable connections, don't keep their wallets unlocked, ran out of
   563      // funds, etc.
   564      "interactionadjustment": 0.1234,
   565  
   566      // The multiplier that gets applied to a host based on the host's price.
   567      // Lower prices are almost always better. Below a certain, very low price,
   568      // there is no advantage.
   569      "pricesmultiplier": 0.1234,
   570  
   571      // The overall score for the host. Scores are entriely relative, and are
   572      // consistent only within the current hostdb. Between different machines,
   573      // different configurations, and different versions the absolute scores for
   574      // a given host can be off by many orders of magnitude. When displaying to a
   575      // human, some form of normalization with respect to the other hosts (for
   576      // example, divide all scores by the median score of the hosts) is
   577      // recommended.
   578      "score": 123456,
   579  
   580      // The multiplier that gets applied to a host based on how much storage is
   581      // remaining for the host. More storage remaining is better, to a point.
   582      "storageremainingadjustment": 0.1234,
   583  
   584      // The multiplier that gets applied to a host based on the uptime percentage
   585      // of the host. The penalty increases extremely quickly as uptime drops
   586      // below 90%.
   587      "uptimeadjustment": 0.1234,
   588  
   589      // The multiplier that gets applied to a host based on the version of SiaPrime
   590      // that they are running. Versions get penalties if there are known bugs,
   591      // scaling limitations, performance limitations, etc. Generally, the most
   592      // recent version is always the one with the highest score.
   593      "versionadjustment": 0.1234
   594    }
   595  }
   596  ```
   597  
   598  Examples
   599  --------
   600  
   601  #### HostDB Get
   602  
   603  ###### Request
   604  ```
   605  /hostdb
   606  ```
   607  
   608  ###### Expected Response Code
   609  ```
   610  200 OK
   611  ```
   612  
   613  ###### Example JSON Response
   614  ```javascript
   615  {
   616      "initialscancomplete": false
   617  }
   618  ```
   619  
   620  #### Active hosts
   621  
   622  ###### Request
   623  ```
   624  /hostdb/active?numhosts=2
   625  ```
   626  
   627  ###### Expected Response Code
   628  ```
   629  200 OK
   630  ```
   631  
   632  ###### Example JSON Response
   633  ```javascript
   634  {
   635    "hosts": [
   636      {
   637        "acceptingcontracts": true,
   638        "collateral": "20000000000",
   639        "contractprice": "1000000000000000000000000",
   640        "downloadbandwidthprice": "35000000000000",
   641        "firstseen": 160000,
   642        "historicdowntime": 0,
   643        "historicfailedinteractions": 0,
   644        "historicsuccessfulinteractions": 5,
   645        "historicuptime": 41634520900246576,
   646        "lasthistoricupdate": 174900,
   647        "maxcollateral": "1000000000000000000000000000",
   648        "maxdownloadbatchsize": 17825792,
   649        "maxduration": 25920,
   650        "maxrevisebatchsize": 17825792,
   651        "netaddress": "123.456.789.0:4282",
   652        "publickey": {
   653          "algorithm": "ed25519",
   654          "key": "RW50cm9weSBpc24ndCB3aGF0IGl0IHVzZWQgdG8gYmU="
   655        },
   656        "publickeystring": "ed25519:1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef",
   657        "recentfailedinteractions": 0,
   658        "recentsuccessfulinteractions": 0,
   659        "remainingstorage": 35000000000,
   660        "revisionnumber": 12733798,
   661        "scanhistory": [
   662          {
   663            "success": true,
   664            "timestamp": "2018-09-23T08:00:00.000000000+04:00"
   665          },
   666          {
   667            "success": true,
   668            "timestamp": "2018-09-23T06:00:00.000000000+04:00"
   669          },
   670          {
   671            "success": true,
   672            "timestamp": "2018-09-23T04:00:00.000000000+04:00"
   673          }
   674        ],
   675        "sectorsize": 4194304,
   676        "storageprice": "14000000000",
   677        "totalstorage": 35000000000,
   678        "unlockhash": "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789ab",
   679        "uploadbandwidthprice": "3000000000000",
   680        "version": "1.3.8",
   681        "windowsize": 144
   682      },
   683      {
   684        "acceptingcontracts": true,
   685        "collateral": "20000000000",
   686        "contractprice": "1000000000000000000000000",
   687        "downloadbandwidthprice": "35000000000000",
   688        "firstseen": 160000,
   689        "historicdowntime": 0,
   690        "historicfailedinteractions": 0,
   691        "historicsuccessfulinteractions": 5,
   692        "historicuptime": 41634520900246576,
   693        "lasthistoricupdate": 174900,
   694        "maxcollateral": "1000000000000000000000000000",
   695        "maxdownloadbatchsize": 17825792,
   696        "maxduration": 25920,
   697        "maxrevisebatchsize": 17825792,
   698        "netaddress": "123.456.789.0:4282",
   699        "publickey": {
   700          "algorithm": "ed25519",
   701          "key": "RW50cm9weSBpc24ndCB3aGF0IGl0IHVzZWQgdG8gYmU="
   702        },
   703        "publickeystring": "ed25519:1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef",
   704        "recentfailedinteractions": 0,
   705        "recentsuccessfulinteractions": 0,
   706        "remainingstorage": 35000000000,
   707        "revisionnumber": 12733798,
   708        "scanhistory": [
   709          {
   710            "success": true,
   711            "timestamp": "2018-09-23T08:00:00.000000000+04:00"
   712          },
   713          {
   714            "success": true,
   715            "timestamp": "2018-09-23T06:00:00.000000000+04:00"
   716          },
   717          {
   718            "success": true,
   719            "timestamp": "2018-09-23T04:00:00.000000000+04:00"
   720          }
   721        ],
   722        "sectorsize": 4194304,
   723        "storageprice": "14000000000",
   724        "totalstorage": 35000000000,
   725        "unlockhash": "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789ab",
   726        "uploadbandwidthprice": "3000000000000",
   727        "version": "1.3.8",
   728        "windowsize": 144
   729      }
   730    ]
   731  }
   732  ```
   733  
   734  #### All hosts
   735  
   736  ###### Request
   737  ```
   738  /hostdb/all
   739  ```
   740  
   741  ###### Expected Response Code
   742  ```
   743  200 OK
   744  ```
   745  
   746  ###### Example JSON Response
   747  ```javascript
   748  {
   749    "hosts": [
   750      {
   751        "acceptingcontracts": true,
   752        "collateral": "20000000000",
   753        "contractprice": "1000000000000000000000000",
   754        "downloadbandwidthprice": "35000000000000",
   755        "firstseen": 160000,
   756        "historicdowntime": 0,
   757        "historicfailedinteractions": 0,
   758        "historicsuccessfulinteractions": 5,
   759        "historicuptime": 41634520900246576,
   760        "lasthistoricupdate": 174900,
   761        "maxcollateral": "1000000000000000000000000000",
   762        "maxdownloadbatchsize": 17825792,
   763        "maxduration": 25920,
   764        "maxrevisebatchsize": 17825792,
   765        "netaddress": "123.456.789.0:4282",
   766        "publickey": {
   767          "algorithm": "ed25519",
   768          "key": "RW50cm9weSBpc24ndCB3aGF0IGl0IHVzZWQgdG8gYmU="
   769        },
   770        "publickeystring": "ed25519:1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef",
   771        "recentfailedinteractions": 0,
   772        "recentsuccessfulinteractions": 0,
   773        "remainingstorage": 35000000000,
   774        "revisionnumber": 12733798,
   775        "scanhistory": [
   776          {
   777            "success": true,
   778            "timestamp": "2018-09-23T08:00:00.000000000+04:00"
   779          },
   780          {
   781            "success": true,
   782            "timestamp": "2018-09-23T06:00:00.000000000+04:00"
   783          },
   784          {
   785            "success": true,
   786            "timestamp": "2018-09-23T04:00:00.000000000+04:00"
   787          }
   788        ],
   789        "sectorsize": 4194304,
   790        "storageprice": "14000000000",
   791        "totalstorage": 35000000000,
   792        "unlockhash": "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789ab",
   793        "uploadbandwidthprice": "3000000000000",
   794        "version": "1.3.8",
   795        "windowsize": 144
   796      },
   797      {
   798        "acceptingcontracts": true,
   799        "collateral": "20000000000",
   800        "contractprice": "1000000000000000000000000",
   801        "downloadbandwidthprice": "35000000000000",
   802        "firstseen": 160000,
   803        "historicdowntime": 0,
   804        "historicfailedinteractions": 0,
   805        "historicsuccessfulinteractions": 5,
   806        "historicuptime": 41634520900246576,
   807        "lasthistoricupdate": 174900,
   808        "maxcollateral": "1000000000000000000000000000",
   809        "maxdownloadbatchsize": 17825792,
   810        "maxduration": 25920,
   811        "maxrevisebatchsize": 17825792,
   812        "netaddress": "123.456.789.0:4282",
   813        "publickey": {
   814          "algorithm": "ed25519",
   815          "key": "RW50cm9weSBpc24ndCB3aGF0IGl0IHVzZWQgdG8gYmU="
   816        },
   817        "publickeystring": "ed25519:1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef",
   818        "recentfailedinteractions": 0,
   819        "recentsuccessfulinteractions": 0,
   820        "remainingstorage": 35000000000,
   821        "revisionnumber": 12733798,
   822        "scanhistory": [
   823          {
   824            "success": true,
   825            "timestamp": "2018-09-23T08:00:00.000000000+04:00"
   826          },
   827          {
   828            "success": true,
   829            "timestamp": "2018-09-23T06:00:00.000000000+04:00"
   830          },
   831          {
   832            "success": true,
   833            "timestamp": "2018-09-23T04:00:00.000000000+04:00"
   834          }
   835        ],
   836        "sectorsize": 4194304,
   837        "storageprice": "14000000000",
   838        "totalstorage": 35000000000,
   839        "unlockhash": "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789ab",
   840        "uploadbandwidthprice": "3000000000000",
   841        "version": "1.3.8",
   842        "windowsize": 144
   843      },
   844      {
   845        "acceptingcontracts": true,
   846        "collateral": "20000000000",
   847        "contractprice": "1000000000000000000000000",
   848        "downloadbandwidthprice": "35000000000000",
   849        "firstseen": 160000,
   850        "historicdowntime": 0,
   851        "historicfailedinteractions": 0,
   852        "historicsuccessfulinteractions": 5,
   853        "historicuptime": 41634520900246576,
   854        "lasthistoricupdate": 174900,
   855        "maxcollateral": "1000000000000000000000000000",
   856        "maxdownloadbatchsize": 17825792,
   857        "maxduration": 25920,
   858        "maxrevisebatchsize": 17825792,
   859        "netaddress": "123.456.789.0:4282",
   860        "publickey": {
   861          "algorithm": "ed25519",
   862          "key": "RW50cm9weSBpc24ndCB3aGF0IGl0IHVzZWQgdG8gYmU="
   863        },
   864        "publickeystring": "ed25519:1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef",
   865        "recentfailedinteractions": 0,
   866        "recentsuccessfulinteractions": 0,
   867        "remainingstorage": 35000000000,
   868        "revisionnumber": 12733798,
   869        "scanhistory": [
   870          {
   871            "success": true,
   872            "timestamp": "2018-09-23T08:00:00.000000000+04:00"
   873          },
   874          {
   875            "success": true,
   876            "timestamp": "2018-09-23T06:00:00.000000000+04:00"
   877          },
   878          {
   879            "success": true,
   880            "timestamp": "2018-09-23T04:00:00.000000000+04:00"
   881          }
   882        ],
   883        "sectorsize": 4194304,
   884        "storageprice": "14000000000",
   885        "totalstorage": 35000000000,
   886        "unlockhash": "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789ab",
   887        "uploadbandwidthprice": "3000000000000",
   888        "version": "1.3.8",
   889        "windowsize": 144
   890      }
   891    ]
   892  }
   893  ```
   894  
   895  #### Hosts
   896  
   897  ###### Request
   898  ```
   899  /hostdb/hosts/ed25519:1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef
   900  ```
   901  
   902  ###### Expected Response Code
   903  ```
   904  200 OK
   905  ```
   906  
   907  ###### Example JSON Response
   908  ```javascript
   909  {
   910    "entry": {
   911      "acceptingcontracts": true,
   912      "collateral": "20000000000",
   913      "contractprice": "1000000000000000000000000",
   914      "downloadbandwidthprice": "35000000000000",
   915      "firstseen": 160000,
   916      "historicdowntime": 0,
   917      "historicfailedinteractions": 0,
   918      "historicsuccessfulinteractions": 5,
   919      "historicuptime": 41634520900246576,
   920      "lasthistoricupdate": 174900,
   921      "maxcollateral": "1000000000000000000000000000", 
   922      "maxdownloadbatchsize": 17825792,
   923      "maxduration": 25920,
   924      "maxrevisebatchsize": 17825792,
   925      "netaddress": "123.456.789.0:4282",
   926      "publickey": {
   927        "algorithm": "ed25519",
   928        "key": "RW50cm9weSBpc24ndCB3aGF0IGl0IHVzZWQgdG8gYmU="
   929      },
   930      "publickeystring": "ed25519:1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef",
   931      "recentfailedinteractions": 0,
   932      "recentsuccessfulinteractions": 0,
   933      "remainingstorage": 35000000000,
   934      "revisionnumber": 12733798,
   935      "scanhistory": [
   936        {
   937          "success": true,
   938          "timestamp": "2018-09-23T08:00:00.000000000+04:00"
   939        },
   940        {
   941          "success": true,
   942          "timestamp": "2018-09-23T06:00:00.000000000+04:00"
   943        },
   944        {
   945          "success": true,
   946          "timestamp": "2018-09-23T04:00:00.000000000+04:00"
   947        }
   948      ],
   949      "sectorsize": 4194304,
   950      "storageprice": "14000000000",
   951      "totalstorage": 35000000000,
   952      "unlockhash": "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789ab",
   953      "uploadbandwidthprice": "3000000000000", 
   954      "version": "1.3.8",
   955      "windowsize": 144
   956    },
   957    "scorebreakdown": {
   958      "ageadjustment": 0.1234,
   959      "burnadjustment": 23.456,
   960      "collateraladjustment": 23.456,
   961      "conversionrate": 9.12345,
   962      "interactionadjustment": 0.1234,
   963      "pricesmultiplier": 0.1234,
   964      "score": 123456,
   965      "storageremainingadjustment": 0.1234,
   966      "uptimeadjustment": 0.1234,
   967      "versionadjustment": 0.1234
   968    }
   969  }
   970  ```