github.com/Synthesix/Sia@v1.3.3-0.20180413141344-f863baeed3ca/doc/api/Daemon.md (about) 1 Daemon API 2 =========== 3 4 This document contains detailed descriptions of the daemon's API routes. For an 5 overview of the daemon's API routes, see [API.md#daemon](/doc/API.md#daemon). 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 daemon is responsible for starting and stopping the modules which make up 16 the rest of Sia. It also provides endpoints for viewing build constants. 17 18 Index 19 ----- 20 21 | Route | HTTP verb | 22 | ----------------------------------------- | --------- | 23 | [/daemon/constants](#daemonconstants-get) | GET | 24 | [/daemon/stop](#daemonstop-get) | GET | 25 | [/daemon/version](#daemonversion-get) | GET | 26 27 #### /daemon/constants [GET] 28 29 returns the set of constants in use. 30 31 ###### JSON Response 32 ```javascript 33 { 34 // Timestamp of the genesis block. 35 "genesistimestamp": 1433600000, // Unix time 36 37 // Maximum size, in bytes, of a block. Blocks larger than this will be 38 // rejected by peers. 39 "blocksizelimit": 2000000, // bytes 40 41 // Target for how frequently new blocks should be mined. 42 "blockfrequency": 600, // seconds per block 43 44 // Farthest a block's timestamp can be in the future before the block is 45 // rejected outright. 46 "extremefuturethreshold": 10800, // seconds 47 48 // Height of the window used to adjust the difficulty. 49 "targetwindow": 1000, // blocks 50 51 // Duration of the window used to adjust the difficulty. 52 "mediantimestampwindow": 11, // blocks 53 54 // How far in the future a block can be without being rejected. A block 55 // further into the future will not be accepted immediately, but the daemon 56 // will attempt to accept the block as soon as it is valid. 57 "futurethreshold": 10800, // seconds 58 59 // Total number of siafunds. 60 "siafundcount": "10000", 61 62 // Fraction of each file contract payout given to siafund holders. 63 "siafundportion": "39/1000", 64 65 // Number of children a block must have before it is considered "mature." 66 "maturitydelay": 144, // blocks 67 68 // Number of coins given to the miner of the first block. Note that elsewhere 69 // in the API currency is typically returned in hastings and as a bignum. 70 // This is not the case here. 71 "initialcoinbase": 300000, // Siacoins 72 73 // Minimum number of coins paid out to the miner of a block (the coinbase 74 // decreases with each block). Note that elsewhere in the API currency is 75 // typically returned in hastings and as a bignum. This is not the case 76 // here. 77 "minimumcoinbase": 30000, // Siacoins 78 79 // Initial target. 80 "roottarget": [0,0,0,0,32,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], 81 82 // Initial depth. 83 "rootdepth": [255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255], 84 85 // Largest allowed ratio between the old difficulty and the new difficulty. 86 "maxadjustmentup": "5/2", 87 88 // Smallest allowed ratio between the old difficulty and the new difficulty. 89 "maxadjustmentdown": "2/5", 90 91 // Number of Hastings in one siacoin. 92 "siacoinprecision": "1000000000000000000000000" // hastings per siacoin 93 } 94 ``` 95 96 #### /daemon/stop [GET] 97 98 cleanly shuts down the daemon. May take a few seconds. 99 100 ###### Response 101 standard success or error response. See 102 [#standard-responses](#standard-responses). 103 104 #### /daemon/version [GET] 105 106 returns the version of the Sia daemon currently running. 107 108 ###### JSON Response 109 ```javascript 110 { 111 // Version number of the running Sia Daemon. This number is visible to its 112 // peers on the network. 113 "version": "1.0.0" 114 } 115 ```