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