gitlab.com/SkynetLabs/skyd@v1.6.9/skymodules/README.md (about) 1 # Modules 2 3 The modules package is the top-level package for all skymodules. It contains the interface for each module, sub-packages which implement said modules and other shared constants and code which needs to be accessible within all sub-packages. 4 5 ## Top-Level Modules 6 - [Consensus](#consensus) 7 - [Explorer](#explorer) 8 - [Gateway](#gateway) 9 - [Host](#host) 10 - [Miner](#miner) 11 - [Renter](#renter) 12 - [Transaction Pool](#transaction-pool) 13 - [Wallet](#wallet) 14 15 ## Subsystems 16 - [Alert System](#alert-system) 17 - [Append-Only Persist](#append-only-persist) 18 - [Dependencies](#dependencies) 19 - [Negotiate](#negotiate) 20 - [Network Addresses](#network-addresses) 21 - [Siad Configuration](#siad-configuration) 22 - [Skyfile Reader](#skyfile-reader) 23 - [Skylink](#skylink) 24 - [Skynet](#skynet) 25 - [Skynetbackup](#skynet-backup) 26 - [SiaPath](#siapath) 27 - [Storage Manager](#storage-manager) 28 29 ### Consensus 30 **Key Files** 31 - [consensus.go](./consensus.go) 32 - [README.md](./consensus/README.md) 33 34 *TODO* 35 - fill out module explanation 36 37 ### Explorer 38 **Key Files** 39 - [explorer.go](./explorer.go) 40 - [README.md](./explorer/README.md) 41 42 *TODO* 43 - fill out module explanation 44 45 ### Gateway 46 **Key Files** 47 - [gateway.go](./gateway.go) 48 - [README.md](./gateway/README.md) 49 50 *TODO* 51 - fill out module explanation 52 53 ### Host 54 **Key Files** 55 - [host.go](./host.go) 56 - [README.md](./host/README.md) 57 58 *TODO* 59 - fill out module explanation 60 61 ### Miner 62 **Key Files** 63 - [miner.go](./miner.go) 64 - [README.md](./miner/README.md) 65 66 *TODO* 67 - fill out module explanation 68 69 ### Renter 70 **Key Files** 71 - [renter.go](./renter.go) 72 - [README.md](./renter/README.md) 73 74 *TODO* 75 - fill out module explanation 76 77 ### Transaction Pool 78 **Key Files** 79 - [transactionpool.go](./transactionpool.go) 80 - [README.md](./transactionpool/README.md) 81 82 *TODO* 83 - fill out module explanation 84 85 ### Wallet 86 **Key Files** 87 - [wallet.go](./wallet.go) 88 - [README.md](./wallet/README.md) 89 90 *TODO* 91 - fill out subsystem explanation 92 93 ### Alert System 94 **Key Files** 95 - [alert.go](./alert.go) 96 97 The Alert System provides the `Alerter` interface and an implementation of the interface which can be used by modules which need to be able to register alerts in case of irregularities during runtime. An `Alert` provides the following information: 98 99 - **Message**: Some information about the issue 100 - **Cause**: The cause for the issue if it is known 101 - **Module**: The name of the module that registered the alert 102 - **Severity**: The severity level associated with the alert 103 104 The following levels of severity are currently available: 105 106 - **Unknown**: This should never be used and is a safeguard against developer errors 107 - **Warning**: Warns the user about potential issues which might require preventive actions 108 - **Error**: Alerts the user of an issue that requires immediate action to prevent further issues like loss of data 109 - **Critical**: Indicates that a critical error is imminent. e.g. lack of funds causing contracts to get lost 110 111 ### Dependencies 112 **Key Files** 113 - [dependencies.go](./dependencies.go) 114 115 *TODO* 116 - fill out subsystem explanation 117 118 ### Negotiate 119 **Key Files** 120 - [negotiate.go](./negotiate.go) 121 122 *TODO* 123 - fill out subsystem explanation 124 125 ### Network Addresses 126 **Key Files** 127 - [netaddress.go](./netaddress.go) 128 129 *TODO* 130 - fill out subsystem explanation 131 132 ### Siad Configuration 133 **Key Files** 134 - [siadconfig.go](./siadconfig.go) 135 136 *TODO* 137 - fill out subsystem explanation 138 139 ### Skyfile Reader 140 141 **Key Files** 142 -[skyfilereader.go](./skyfilereader.go) 143 144 **TODO** 145 - fill out subsystem explanation 146 147 ### Skylink 148 149 **Key Files** 150 -[skylink.go](./skylink.go) 151 152 The skylink is a format for linking to data sectors stored on the Sia network. 153 In addition to pointing to a data sector, the skylink contains a lossy offset an 154 length that point to a data segment within the sector, allowing multiple small 155 files to be packed into a single sector. 156 157 All told, there are 32 bytes in a skylink for encoding the Merkle root of the 158 sector being linked, and 2 bytes encoding a link version, the offset, and the 159 length of the sector being fetched. 160 161 For more information, check out the documentation in the [skylink.go](./skylink.go) file. 162 163 ### Skynet 164 165 **Key Files** 166 -[skynet.go](./skynet.go) 167 168 **TODO** 169 - fill out subsystem explanation 170 171 ### Skynet Backup 172 173 **Key Files** 174 -[skynetbackup.go](./skynetbackup.go) 175 176 The Skynet Backup subsystem handles persistence for creating and reading skynet 177 backup data. These backups contain all the information needed to restore 178 a Skyfile with the original Skylink. 179 180 ### SiaPath 181 **Key Files** 182 - [siapath.go](./siapath.go) 183 184 Siapaths are the format of filesystem paths on the Sia network. Internally they 185 are handled as linux paths and use the `/` separator. Siapaths are used to 186 identify directories on the Sia network as well as files. When manipulating 187 Siapaths in memory the `strings` package should be used so that the `/` 188 separator can be enforced. When Siapaths are being translated to System paths, 189 the `filepath` package is used to ensure the correct path separator is used for 190 the OS that is running. 191 192 ### Storage Manager 193 **Key Files** 194 - [storagemanager.go](./storagemanager.go) 195 196 *TODO* 197 - fill out subsystem explanation