github.com/linapex/ethereum-go-chinese@v0.0.0-20190316121929-f8b7a73c3fa1/cmd/puppeth/module_dashboard.go (about) 1 2 //<developer> 3 // <name>linapex 曹一峰</name> 4 // <email>linapex@163.com</email> 5 // <wx>superexc</wx> 6 // <qqgroup>128148617</qqgroup> 7 // <url>https://jsq.ink</url> 8 // <role>pku engineer</role> 9 // <date>2019-03-16 19:16:32</date> 10 //</624450069193560064> 11 12 13 package main 14 15 import ( 16 "bytes" 17 "encoding/json" 18 "fmt" 19 "html/template" 20 "math/rand" 21 "path/filepath" 22 "strconv" 23 "strings" 24 25 "github.com/ethereum/go-ethereum/log" 26 ) 27 28 //DashboardContent是当用户 29 //加载仪表板网站。 30 var dashboardContent = ` 31 <!DOCTYPE html> 32 <html lang="en"> 33 <head> 34 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> 35 <!-- Meta, title, CSS, favicons, etc. --> 36 <meta charset="utf-8"> 37 <meta http-equiv="X-UA-Compatible" content="IE=edge"> 38 <meta name="viewport" content="width=device-width, initial-scale=1"> 39 40 <title>{{.NetworkTitle}}: Ethereum Testnet</title> 41 42 <link href="https://cdnjs.cloudflare.com/ajax/libs/twitter引导程序/3.3.7/css/bootstrap.min.css“rel=”stylesheet“> 43 <link href="https://cdnjs.cloudflare.com/ajax/libs/font-awome/4.7.0/css/font-awome.min.css“rel=”stylesheet“> 44 <link href="https://cdnjs.cloudflare.com/ajax/libs/gentelella/1.3.0/css/custom.min.css“rel=”stylesheet“> 45 <style> 46 .vertical-center { 47 min-height: 100%; 48 min-height: 95vh; 49 display: flex; 50 align-items: center; 51 } 52 .nav.side-menu li a { 53 font-size: 18px; 54 } 55 .nav-sm .nav.side-menu li a { 56 font-size: 10px; 57 } 58 pre{ 59 white-space: pre-wrap; 60 } 61 </style> 62 </head> 63 64 <body class="nav-sm" style="overflow-x: hidden"> 65 <div class="container body"> 66 <div class="main_container"> 67 <div class="col-md-3 left_col"> 68 <div class="left_col scroll-view"> 69 <div class="navbar nav_title" style="border: 0; margin-top: 8px;"> 70 <a class="site_title"><i class="fa fa-globe" style="margin-left: 6px"></i> <span>{{.NetworkTitle}} Testnet</span></a> 71 </div> 72 <div class="clearfix"></div> 73 <br /> 74 <div id="sidebar-menu" class="main_menu_side hidden-print main_menu"> 75 <div class="menu_section"> 76 <ul class="nav side-menu"> 77 {{if .EthstatsPage}}<li id="stats_menu"><a onclick="load('#stats')"><i class="fa fa-tachometer"></i> Network Stats</a></li>{{end}} 78 {{if .ExplorerPage}}<li id="explorer_menu"><a onclick="load('#explorer')"><i class="fa fa-database"></i> Block Explorer</a></li>{{end}} 79 {{if .WalletPage}}<li id="wallet_menu"><a onclick="load('#wallet')"><i class="fa fa-address-book-o"></i> Browser Wallet</a></li>{{end}} 80 {{if .FaucetPage}}<li id="faucet_menu"><a onclick="load('#faucet')"><i class="fa fa-bath"></i> Crypto Faucet</a></li>{{end}} 81 <li id="connect_menu"><a><i class="fa fa-plug"></i> Connect Yourself</a> 82 <ul id="connect_list" class="nav child_menu"> 83 <li><a onclick="$('#connect_menu').removeClass('active'); $('#connect_list').toggle(); load('#geth')">Go Ethereum: Geth</a></li> 84 <li><a onclick="$('#connect_menu').removeClass('active'); $('#connect_list').toggle(); load('#mist')">Go Ethereum: Wallet & Mist</a></li> 85 <li><a onclick="$('#connect_menu').removeClass('active'); $('#connect_list').toggle(); load('#mobile')">Go Ethereum: Android & iOS</a></li>{{if .Ethash}} 86 <li><a onclick="$('#connect_menu').removeClass('active'); $('#connect_list').toggle(); load('#other')">Other Ethereum Clients</a></li>{{end}} 87 </ul> 88 </li> 89 <li id="about_menu"><a onclick="load('#about')"><i class="fa fa-heartbeat"></i> About Puppeth</a></li> 90 </ul> 91 </div> 92 </div> 93 </div> 94 </div> 95 <div class="right_col" role="main" style="padding: 0 !important"> 96 <div id="geth" hidden style="padding: 16px;"> 97 <div class="page-title"> 98 <div class="title_left"> 99 <h3>Connect Yourself – Go Ethereum: Geth</h3> 100 </div> 101 </div> 102 <div class="clearfix"></div> 103 <div class="row"> 104 <div class="col-md-6"> 105 <div class="x_panel"> 106 <div class="x_title"> 107 <h2><i class="fa fa-archive" aria-hidden="true"></i> Archive node <small>Retains all historical data</small></h2> 108 <div class="clearfix"></div> 109 </div> 110 <div class="x_content"> 111 <p>An archive node synchronizes the blockchain by downloading the full chain from the genesis block to the current head block, executing all the transactions contained within. As the node crunches through the transactions, all past historical state is stored on disk, and can be queried for each and every block.</p> 112 <p>Initial processing required to execute all transactions may require non-negligible time and disk capacity required to store all past state may be non-insignificant. High end machines with SSD storage, modern CPUs and 8GB+ RAM are recommended.</p> 113 <br/> 114 <p>To run an archive node, download <a href="/{{.GethGenesis}}"><code>{{.GethGenesis}}</code></a> and start Geth with: 115 <pre>geth --datadir=$HOME/.{{.Network}} init {{.GethGenesis}}</pre> 116 <pre>geth --networkid={{.NetworkID}} --datadir=$HOME/.{{.Network}} --cache=1024 --syncmode=full{{if .Ethstats}} --ethstats='{{.Ethstats}}'{{end}} --bootnodes={{.BootnodesFlat}}</pre> 117 </p> 118 <br/> 119 <p>You can download Geth from <a href="https://geth.ethereum.org/downloads/“target=”about:blank“>https://geth.ethereum.org/downloads/>a><p> 120 </div> 121 </div> 122 </div> 123 <div class="col-md-6"> 124 <div class="x_panel"> 125 <div class="x_title"> 126 <h2><i class="fa fa-laptop" aria-hidden="true"></i> Full node <small>Retains recent data only</small></h2> 127 <div class="clearfix"></div> 128 </div> 129 <div class="x_content"> 130 <p>A full node synchronizes the blockchain by downloading the full chain from the genesis block to the current head block, but does not execute the transactions. Instead, it downloads all the transactions receipts along with the entire recent state. As the node downloads the recent state directly, historical data can only be queried from that block onward.</p> 131 <p>Initial processing required to synchronize is more bandwidth intensive, but is light on the CPU and has significantly reduced disk requirements. Mid range machines with HDD storage, decent CPUs and 4GB+ RAM should be enough.</p> 132 <br/> 133 <p>To run a full node, download <a href="/{{.GethGenesis}}"><code>{{.GethGenesis}}</code></a> and start Geth with: 134 <pre>geth --datadir=$HOME/.{{.Network}} init {{.GethGenesis}}</pre> 135 <pre>geth --networkid={{.NetworkID}} --datadir=$HOME/.{{.Network}} --cache=512{{if .Ethstats}} --ethstats='{{.Ethstats}}'{{end}} --bootnodes={{.BootnodesFlat}}</pre> 136 </p> 137 <br/> 138 <p>You can download Geth from <a href="https://geth.ethereum.org/downloads/“target=”about:blank“>https://geth.ethereum.org/downloads/>a><p> 139 </div> 140 </div> 141 </div> 142 </div> 143 <div class="clearfix"></div> 144 <div class="row"> 145 <div class="col-md-6"> 146 <div class="x_panel"> 147 <div class="x_title"> 148 <h2><i class="fa fa-mobile" aria-hidden="true"></i> Light node <small>Retrieves data on demand</small></h2> 149 <div class="clearfix"></div> 150 </div> 151 <div class="x_content"> 152 <p>A light node synchronizes the blockchain by downloading and verifying only the chain of headers from the genesis block to the current head, without executing any transactions or retrieving any associated state. As no state is available locally, any interaction with the blockchain relies on on-demand data retrievals from remote nodes.</p> 153 <p>Initial processing required to synchronize is light, as it only verifies the validity of the headers; similarly required disk capacity is small, tallying around 500 bytes per header. Low end machines with arbitrary storage, weak CPUs and 512MB+ RAM should cope well.</p> 154 <br/> 155 <p>To run a light node, download <a href="/{{.GethGenesis}}"><code>{{.GethGenesis}}</code></a> and start Geth with: 156 <pre>geth --datadir=$HOME/.{{.Network}} init {{.GethGenesis}}</pre> 157 <pre>geth --networkid={{.NetworkID}} --datadir=$HOME/.{{.Network}} --syncmode=light{{if .Ethstats}} --ethstats='{{.Ethstats}}'{{end}} --bootnodes={{.BootnodesFlat}}</pre> 158 </p> 159 <br/> 160 <p>You can download Geth from <a href="https://geth.ethereum.org/downloads/“target=”about:blank“>https://geth.ethereum.org/downloads/>a><p> 161 </div> 162 </div> 163 </div> 164 <div class="col-md-6"> 165 <div class="x_panel"> 166 <div class="x_title"> 167 <h2><i class="fa fa-microchip" aria-hidden="true"></i> Embedded node <small>Conserves memory vs. speed</small></h2> 168 <div class="clearfix"></div> 169 </div> 170 <div class="x_content"> 171 <p>An embedded node is a variation of the light node with configuration parameters tuned towards low memory footprint. As such, it may sacrifice processing and disk IO performance to conserve memory. It should be considered an <strong>experimental</strong> direction for now without hard guarantees or bounds on the resources used.</p> 172 <p>Initial processing required to synchronize is light, as it only verifies the validity of the headers; similarly required disk capacity is small, tallying around 500 bytes per header. Embedded machines with arbitrary storage, low power CPUs and 128MB+ RAM may work.</p> 173 <br/> 174 <p>To run an embedded node, download <a href="/{{.GethGenesis}}"><code>{{.GethGenesis}}</code></a> and start Geth with: 175 <pre>geth --datadir=$HOME/.{{.Network}} init {{.GethGenesis}}</pre> 176 <pre>geth --networkid={{.NetworkID}} --datadir=$HOME/.{{.Network}} --cache=16 --ethash.cachesinmem=1 --syncmode=light{{if .Ethstats}} --ethstats='{{.Ethstats}}'{{end}} --bootnodes={{.BootnodesFlat}}</pre> 177 </p> 178 <br/> 179 <p>You can download Geth from <a href="https://geth.ethereum.org/downloads/“target=”about:blank“>https://geth.ethereum.org/downloads/>a><p> 180 </div> 181 </div> 182 </div> 183 </div> 184 </div> 185 <div id="mist" hidden style="padding: 16px;"> 186 <div class="page-title"> 187 <div class="title_left"> 188 <h3>Connect Yourself – Go Ethereum: Wallet & Mist</h3> 189 </div> 190 </div> 191 <div class="clearfix"></div> 192 <div class="row"> 193 <div class="col-md-6"> 194 <div class="x_panel"> 195 <div class="x_title"> 196 <h2><i class="fa fa-credit-card" aria-hidden="true"></i> Desktop wallet <small>Interacts with accounts and contracts</small></h2> 197 <div class="clearfix"></div> 198 </div> 199 <div class="x_content"> 200 <p>The Ethereum Wallet is an <a href="https:// 201 <p>Under the hood the wallet is backed by a go-ethereum full node, meaning that a mid range machine is assumed. Similarly, synchronization is based on <strong>fast-sync</strong>, which will download all blockchain data from the network and make it available to the wallet. Light nodes cannot currently fully back the wallet, but it's a target actively pursued.</p> 202 <br/> 203 <p>To connect with the Ethereum Wallet, you'll need to initialize your private network first via Geth as the wallet does not currently support calling Geth directly. To initialize your local chain, download <a href="/{{.GethGenesis}}"><code>{{.GethGenesis}}</code></a> and run: 204 <pre>geth --datadir=$HOME/.{{.Network}} init {{.GethGenesis}}</pre> 205 </p> 206 <p>With your local chain initialized, you can start the Ethereum Wallet: 207 <pre>ethereumwallet --rpc $HOME/.{{.Network}}/geth.ipc --node-networkid={{.NetworkID}} --node-datadir=$HOME/.{{.Network}}{{if .Ethstats}} --node-ethstats='{{.Ethstats}}'{{end}} --node-bootnodes={{.BootnodesFlat}}</pre> 208 <p> 209 <br/> 210 <p>You can download the Ethereum Wallet from <a href="https://github.com/ethereum/mist/releases“target=”about:blank“>https://github.com/ethereum/mist/releases</a>。 211 </div> 212 </div> 213 </div> 214 <div class="col-md-6"> 215 <div class="x_panel"> 216 <div class="x_title"> 217 <h2><i class="fa fa-picture-o" aria-hidden="true"></i> Mist browser <small>Interacts with third party DApps</small></h2> 218 <div class="clearfix"></div> 219 </div> 220 <div class="x_content"> 221 <p>The Mist browser is an <a href="https:// 222 <p>Under the hood the browser is backed by a go-ethereum full node, meaning that a mid range machine is assumed. Similarly, synchronization is based on <strong>fast-sync</strong>, which will download all blockchain data from the network and make it available to the wallet. Light nodes cannot currently fully back the wallet, but it's a target actively pursued.</p> 223 <br/> 224 <p>To connect with the Mist browser, you'll need to initialize your private network first via Geth as Mist does not currently support calling Geth directly. To initialize your local chain, download <a href="/{{.GethGenesis}}"><code>{{.GethGenesis}}</code></a> and run: 225 <pre>geth --datadir=$HOME/.{{.Network}} init {{.GethGenesis}}</pre> 226 </p> 227 <p>With your local chain initialized, you can start Mist: 228 <pre>mist --rpc $HOME/.{{.Network}}/geth.ipc --node-networkid={{.NetworkID}} --node-datadir=$HOME/.{{.Network}}{{if .Ethstats}} --node-ethstats='{{.Ethstats}}'{{end}} --node-bootnodes={{.BootnodesFlat}}</pre> 229 <p> 230 <br/> 231 <p>You can download the Mist browser from <a href="https://github.com/ethereum/mist/releases“target=”about:blank“>https://github.com/ethereum/mist/releases</a>。 232 </div> 233 </div> 234 </div> 235 </div> 236 </div> 237 <div id="mobile" hidden style="padding: 16px;"> 238 <div class="page-title"> 239 <div class="title_left"> 240 <h3>Connect Yourself – Go Ethereum: Android & iOS</h3> 241 </div> 242 </div> 243 <div class="clearfix"></div> 244 <div class="row"> 245 <div class="col-md-6"> 246 <div class="x_panel"> 247 <div class="x_title"> 248 <h2><i class="fa fa-android" aria-hidden="true"></i> Android devices <small>Accesses Ethereum via Java</small></h2> 249 <div class="clearfix"></div> 250 </div> 251 <div class="x_content"> 252 <p>Starting with the 1.5 release of go-ethereum, we've transitioned away from shipping only full blown Ethereum clients and started focusing on releasing the code as reusable packages initially for Go projects, then later for Java based Android projects too. Mobile support is still evolving, hence is bound to change often and hard, but the Ethereum network can nonetheless be accessed from Android too.</p> 253 <p>Under the hood the Android library is backed by a go-ethereum light node, meaning that given a not-too-old Android device, you should be able to join the network without significant issues. Certain functionality is not yet available and rough edges are bound to appear here and there, please report issues if you find any.</p> 254 <br/> 255 <p>The stable Android archives are distributed via Maven Central, and the develop snapshots via the Sonatype repositories. Before proceeding, please ensure you have a recent version configured in your Android project. You can find details in <a href="https://github.com/ethereum/go ethereum/wiki/mobile:-简介android archive“target=”about:blank“>mobile:introduction&ndash;android archive</a>。 256 <p>Before connecting to the Ethereum network, download the <a href="/{{.GethGenesis}}"><code>{{.GethGenesis}}</code></a> genesis json file and either store it in your Android project as a resource file you can access, or save it as a string in a variable. You're going to need to to initialize your client.</p> 257 <p>Inside your Java code you can now import the geth archive and connect to Ethereum: 258 <pre>import org.ethereum.geth.*;</pre> 259 <pre> 260 Enodes bootnodes = new Enodes();{{range .Bootnodes}} 261 bootnodes.append(new Enode("{{.}}"));{{end}} 262 263 NodeConfig config = new NodeConfig(); 264 config.setBootstrapNodes(bootnodes); 265 config.setEthereumNetworkID({{.NetworkID}}); 266 config.setEthereumGenesis(genesis);{{if .Ethstats}} 267 config.setEthereumNetStats("{{.Ethstats}}");{{end}} 268 269 Node node = new Node(getFilesDir() + "/.{{.Network}}", config); 270 node.start(); 271 </pre> 272 <p> 273 </div> 274 </div> 275 </div> 276 <div class="col-md-6"> 277 <div class="x_panel"> 278 <div class="x_title"> 279 <h2><i class="fa fa-apple" aria-hidden="true"></i> iOS devices <small>Accesses Ethereum via ObjC/Swift</small></h2> 280 <div class="clearfix"></div> 281 </div> 282 <div class="x_content"> 283 <p>Starting with the 1.5 release of go-ethereum, we've transitioned away from shipping only full blown Ethereum clients and started focusing on releasing the code as reusable packages initially for Go projects, then later for ObjC/Swift based iOS projects too. Mobile support is still evolving, hence is bound to change often and hard, but the Ethereum network can nonetheless be accessed from iOS too.</p> 284 <p>Under the hood the iOS library is backed by a go-ethereum light node, meaning that given a not-too-old Apple device, you should be able to join the network without significant issues. Certain functionality is not yet available and rough edges are bound to appear here and there, please report issues if you find any.</p> 285 <br/> 286 <p>Both stable and develop builds of the iOS framework are available via CocoaPods. Before proceeding, please ensure you have a recent version configured in your iOS project. You can find details in <a href="https://github.com/ethereum/go-ethereum/wiki/mobile:-简介ios framework“target=”about:blank“>mobile:introduction&ndash;ios framework</a>。 287 <p>Before connecting to the Ethereum network, download the <a href="/{{.GethGenesis}}"><code>{{.GethGenesis}}</code></a> genesis json file and either store it in your iOS project as a resource file you can access, or save it as a string in a variable. You're going to need to to initialize your client.</p> 288 <p>Inside your Swift code you can now import the geth framework and connect to Ethereum (ObjC should be analogous): 289 <pre>import Geth</pre> 290 <pre> 291 var error: NSError? 292 293 let bootnodes = GethNewEnodesEmpty(){{range .Bootnodes}} 294 bootnodes?.append(GethNewEnode("{{.}}", &error)){{end}} 295 296 let config = GethNewNodeConfig() 297 config?.setBootstrapNodes(bootnodes) 298 config?.setEthereumNetworkID({{.NetworkID}}) 299 config?.setEthereumGenesis(genesis){{if .Ethstats}} 300 config?.setEthereumNetStats("{{.Ethstats}}"){{end}} 301 302 let datadir = NSSearchPathForDirectoriesInDomains(.documentDirectory, .userDomainMask, true)[0] 303 let node = GethNewNode(datadir + "/.{{.Network}}", config, &error); 304 try! node?.start(); 305 </pre> 306 <p> 307 </div> 308 </div> 309 </div> 310 </div> 311 </div>{{if .Ethash}} 312 <div id="other" hidden style="padding: 16px;"> 313 <div class="page-title"> 314 <div class="title_left"> 315 <h3>Connect Yourself – Other Ethereum Clients</h3> 316 </div> 317 </div> 318 <div class="clearfix"></div> 319 <div class="row"> 320 <div class="col-md-6"> 321 <div class="x_panel"> 322 <div class="x_title"> 323 <h2> 324 <svg height="14px" xmlns="http:// 325 C++ Ethereum <small>Official C++ client from the Ethereum Foundation</small> 326 </h2> 327 <div class="clearfix"></div> 328 </div> 329 <div class="x_content"> 330 <p>C++ Ethereum is the third most popular of the Ethereum clients, focusing on code portability to a broad range of operating systems and hardware. The client is currently a full node with transaction processing based synchronization.</p> 331 <br/> 332 <p>To run a cpp-ethereum node, download <a href="/{{.CppGenesis}}"><code>{{.CppGenesis}}</code></a> and start the node with: 333 <pre>eth --config {{.CppGenesis}} --datadir $HOME/.{{.Network}} --peerset "{{.CppBootnodes}}"</pre> 334 </p> 335 <br/> 336 <p>You can find cpp-ethereum at <a href="https://github.com/ethereum/cpp ethereum/“target=”about:blank“>https://github.com/ethereum/cpp ethereum/> 337 </div> 338 </div> 339 </div> 340 <div class="col-md-6"> 341 <div class="x_panel"> 342 <div class="x_title"> 343 <h2> 344 <svg height="14px" version="1.1" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64"><path d="M46.42,13.07S24.51,18.54,35,30.6c3.09,3.55-.81,6.75-0.81,6.75s7.84-4,4.24-9.11C35,23.51,32.46,21.17,46.42,13.07ZM32.1,16.88C45.05,6.65,38.4,0,38.4,0c2.68,10.57-9.46,13.76-13.84,20.34-3,4.48,1.46,9.3,7.53,14.77C29.73,29.77,21.71,25.09,32.1,16.88Z" transform="translate(-8.4)" fill="#e57125"/><path d="M23.6,49.49c-9.84,2.75,6,8.43,18.51,3.06a23.06,23.06,0,0,1-3.52-1.72,36.62,36.62,0,0,1-13.25.56C21.16,50.92,23.6,49.49,23.6,49.49Zm17-5.36a51.7,51.7,0,0,1-17.1.82c-4.19-.43-1.45-2.46-1.45-2.46-10.84,3.6,6,7.68,21.18,3.25A7.59,7.59,0,0,1,40.62,44.13ZM51.55,54.68s1.81,1.49-2,2.64c-7.23,2.19-30.1,2.85-36.45.09-2.28-1,2-2.37,3.35-2.66a8.69,8.69,0,0,1,2.21-.25c-2.54-1.79-16.41,3.51-7,5C37.15,63.67,58.17,57.67,51.55,54.68ZM42.77,39.12a20.42,20.42,0,0,1,2.93-1.57s-4.83.86-9.65,1.27A87.37,87.37,0,0,1,20.66,39c-7.51-1,4.12-3.77,4.12-3.77A22,22,0,0,0,14.7,37.61C8.14,40.79,31,42.23,42.77,39.12Zm2.88,7.77a1,1,0,0,1-.24.31C61.44,43,55.54,32.35,47.88,35a2.19,2.19,0,0,0-1,.79,9,9,0,0,1,1.37-.37C52.1,34.66,57.65,40.65,45.64,46.89zm0.43,14.75a94.76,94.76,0,0,1-29.17.45s1.47,1.22,9,1.7c11.53,0.74,29.22-.41,29.64-5.86c55.6,57.94,54.79,60,46.08,61.65z“transform=“translate(-8.4)”fill=“5482a2”/></svg> 345 Ethereum Harmony<small>Third party Java client from EtherCamp</small> 346 </h2> 347 <div class="clearfix"></div> 348 </div> 349 <div class="x_content"> 350 <p>Ethereum Harmony is a web user-interface based graphical Ethereum client built on top of the EthereumJ Java implementation of the Ethereum protocol. The client currently is a full node with state download based synchronization.</p> 351 <br/> 352 <p>To run an Ethereum Harmony node, download <a href="/{{.HarmonyGenesis}}"><code>{{.HarmonyGenesis}}</code></a> and start the node with: 353 <pre>./gradlew runCustom -DgenesisFile={{.HarmonyGenesis}} -Dpeer.networkId={{.NetworkID}} -Ddatabase.dir=$HOME/.harmony/{{.Network}} {{.HarmonyBootnodes}} </pre> 354 </p> 355 <br/> 356 <p>You can find Ethereum Harmony at <a href="https://github.com/ether-camp/ethereum-harmony/“target=”about:blank“>https://github.com/ether-camp/ethereum-harmony/<a>。 357 </div> 358 </div> 359 </div> 360 </div> 361 <div class="clearfix"></div> 362 <div class="row"> 363 <div class="col-md-6"> 364 <div class="x_panel"> 365 <div class="x_title"> 366 <h2> 367 <svg height="14px" xmlns:dc="http://purl.org/dc/elements/1.1/“xmlns:cc=“http://creatvecommons.org/ns \35;”xmlns:rdf=“http://www.w3.org/1999/02/22/22 rdf sy语法ns \35;”xmlns:svg=“http://www.w3.org/2000/svg”xmlns=“http://www.w3.org/2000/svg”viewbox=“0 0 0 104.104.56749 104.56675”versi=“1.1”viewbox=“0 0 144 144 144 144 144”y=“0px”x=“0px”x“><metadata id=“metaetid=“metaeta id=“metaeta id=“metaeta id=“eta id=“metaeta.id data10“><rdf:rdf><cc:work rdf:about><dc:format>image/SVG+XML</dc:forma><dc:type RDf:resohttp://purl.org/dc/dcmittype/stillimage”/>-<cc:Work><RDf:RDf><元数据><defs id=“DefS8”/><路径style=“Filt:\35;676767;“id=“path2”d=“m 49.0125,12.3195 a 3.108 3.108,3.108 0 0 0 0 0 0 0 0/SVG+XML<DC:格式><DC:格式><DC:type RDf:type RDf:resohttp://www:resohttp://purl.org/drl.org/dc/dcmittype/ststill图像>MatMatMatMatMatMatMatMatMatMatMatMatMatMatMatMatMatMatMatMat0 1 6.216,0 3.108,3.108 0 0 1-6.216,0 m 74.153,0.145 a 3.108,3.108 0 0 1 6.216,0 3.108,3.108 0 0 1 -6.216,0 m -65.156,4.258 c 1.43,-0.635 2.076,-2.311 1.441,-3.744 l -1.379,-3.118 h 5.423 v 24.444 h -10.941 a 38.265,38.265 0 0 1 -1.239,-14.607 z m 22.685,0.601 v -7.205 h 12.914 c 0.667,0 4.71,0.771 4.71,3.794 0,2.51 -3.101,3.41 -5.651,3.41 z m -17.631,38.793 a 3.108,3.108 0 0 1 6.216,0 3.108,3.108 0 0 1 -6.216,0 m 46.051,0.145 a 3.108,3.108 0 0 1 6.216,0 3.108,3.108 0 0 1 -6.216,0 m 0.961,-7.048 c -1.531,-0.328 -3.037,0.646 -3.365,2.18 l -1.56,7.28 a 38.265,38.265 0 0 1 -31.911,-0.153 l -1.559,-7.28 c -0.328,-1.532 -1.834,-2.508 -3.364,-2.179 l -6.427,1.38 a 38.265,38.265 0 0 1 -3.323,-3.917 h 31.272 c 0.354,0 0.59,-0.064 0.59,-0.386 v -11.062 c 0,-0.322 -0.236,-0.386 -0.59,-0.386 h -9.146 v -7.012 h 9.892 c 0.903,0 4.828,0.258 6.083,5.275 0.393,1.543 1.256,6.562 1.846,8.169 0.588,1.802 2.982,5.402 5.533,5.402 h 16.146 a 38.265,38.265 0 0 1 -3.544,4.102 z m 17.365,-29.207 a 38.265,38.265 0 0 1 0.081,6.643 h -3.926 c -0.393,0 -0.551,0.258 -0.551,0.643 v 1.803 c 0,4.244 -2.393,5.167 -4.49,5.402 -1.997,0.225 -4.211,-0.836 -4.484,-2.058 -1.178,-6.626 -3.141,-8.041 -6.241,-10.486 3.847,-2.443 7.85,-6.047 7.85,-10.871 0,-5.209 -3.571,-8.49 -6.005,-10.099 -3.415,-2.251 -7.196,-2.702 -8.216,-2.702 h -40.603 a 38.265,38.265 0 0 1 21.408,-12.082 l 4.786,5.021 c 1.082,1.133 2.874,1.175 4.006,0.092 l 5.355,-5.122 a 38.265,38.265 0 0 1 26.196,18.657 l -3.666,8.28 c -0.633,1.433 0.013,3.109 1.442,3.744 z m 9.143,0.134 -0.125,-1.28 3.776,-3.522 c 0.768,-0.716 0.481,-2.157 -0.501,-2.523 l -4.827,-1.805 -0.378,-1.246 3.011,-4.182 c 0.614,-0.85 0.05,-2.207 -0.984,-2.377 l -5.09,-0.828 -0.612,-1.143 2.139,-4.695 c 0.438,-0.956 -0.376,-2.179 -1.428,-2.139 l -5.166,0.18 -0.816,-0.99 1.187,-5.032 c 0.24,-1.022 -0.797,-2.06 -1.819,-1.82 l -5.031,1.186 -0.992,-0.816 0.181,-5.166 c 0.04,-1.046 -1.184,-1.863 -2.138,-1.429 l -4.694,2.14 -1.143,-0.613 -0.83,-5.091 c -0.168,-1.032 -1.526,-1.596 -2.376,-0.984 l -4.185,3.011 -1.244,-0.377 -1.805,-4.828 c -0.366,-0.984 -1.808,-1.267 -2.522,-0.503 l -3.522,3.779 -1.28,-0.125 -2.72,-4.395 c -0.55,-0.89 -2.023,-0.89 -2.571,0 l -2.72,4.395 -1.281,0.125 -3.523,-3.779 c -0.714,-0.764 -2.156,-0.481 -2.522,0.503 l -1.805,4.828 -1.245,0.377 -4.184,-3.011 c -0.85,-0.614 -2.209,-0.048 -2.377,0.984 l -0.83,5.091 -1.143,0.613 -4.694,-2.14 c -0.954,-0.436 -2.178,0.383 -2.138,1.429 l 0.18,5.166 -0.992,0.816 -5.031,-1.186 c -1.022,-0.238 -2.06,0.798 -1.82,1.82 l 1.185,5.032 -0.814,0.99 -5.166,-0.18 c -1.042,-0.03 -1.863,1.183 -1.429,2.139 l 2.14,4.695 -0.613,1.143 -5.09,0.828 c -1.034,0.168 -1.594,1.527 -0.984,2.377 l 3.011,4.182 -0.378,1.246 -4.828,1.805 c -0.98,0.366 -1.267,1.807 -0.501,2.523 l 3.777,3.522 -0.125,1.28 -4.394,2.72 c -0.89,0.55 -0.89,2.023 0,2.571 l 4.394,2.72 0.125,1.28 -3.777,3.523 c -0.766,0.714 -0.479,2.154 0.501,2.522 l 4.828,1.805 0.378,1.246 -3.011,4.183 c -0.612,0.852 -0.049,2.21 0.985,2.376 l 5.089,0.828 0.613,1.145 -2.14,4.693 c -0.436,0.954 0.387,2.181 1.429,2.139 l 5.164,-0.181 0.816,0.992 -1.185,5.033 c -0.24,1.02 0.798,2.056 1.82,1.816 l 5.031,-1.185 0.992,0.814 -0.18,5.167 c -0.04,1.046 1.184,1.864 2.138,1.428 l 4.694,-2.139 1.143,0.613 0.83,5.088 c 0.168,1.036 1.527,1.596 2.377,0.986 l 4.182,-3.013 1.246,0.379 1.805,4.826 c 0.366,0.98 1.808,1.269 2.522,0.501 l 3.523,-3.777 1.281,0.128 2.72,4.394 c 0.548,0.886 2.021,0.888 2.571,0 l 2.72,-4.394 1.28,-0.128 3.522,3.777 c 0.714,0.768 2.156,0.479 2.522,-0.501 l 1.805,-4.826 1.246,-0.379 4.183,3.013 c 0.85,0.61 2.208,0.048 2.376,-0.986 l 0.83,-5.088 1.143,-0.613 4.694,2.139 c 0.954,0.436 2.176,-0.38 2.138,-1.428 l -0.18,-5.167 0.991,-0.814 5.031,1.185 c 1.022,0.24 2.059,-0.796 1.819,-1.816 l -1.185,-5.033 0.814,-0.992 5.166,0.181 c 1.042,0.042 1.866,-1.185 1.428,-2.139 l -2.139,-4.693 0.612,-1.145 5.09,-0.828 c 1.036,-0.166 1.598,-1.524 0.984,-2.376 L-3.011,-4.183 0.378,-1.246 4.827,-1.805 C 0.982,-0.368 1.269,-1.808 0.501,-2.522 L-3.776,-3.523 0.125,-1.28 4.394,-2.72 C 0.89,-0.548 0.891,-2.021 10E-4,-2.571 Z“/><svg> 368 Parity<small>Third party Rust client from Parity Technologies</small> 369 </h2> 370 <div class="clearfix"></div> 371 </div> 372 <div class="x_content"> 373 <p>Parity is a fast, light and secure Ethereum client, supporting both headless mode of operation as well as a web user interface for direct manual interaction. The client is currently a full node with transaction processing based synchronization and state pruning enabled.</p> 374 <br/> 375 <p>To run a Parity node, download <a href="/{{.ParityGenesis}}"><code>{{.ParityGenesis}}</code></a> and start the node with: 376 <pre>parity --chain={{.ParityGenesis}}</pre> 377 </p> 378 <br/> 379 <p>You can find Parity at <a href="https://parity.io/“target=”about:blank“>https://parity.io/<a><p> 380 </div> 381 </div> 382 </div> 383 <div class="col-md-6"> 384 <div class="x_panel"> 385 <div class="x_title"> 386 <h2> 387 <svg height="14px" version="1.1" role="img" xmlns="http://www.w3.org/2000/svg”viewbox=“0 0 64 64“><defs><lineargragenid id=“a”x1=“13.79”y1=“38.21”x2=“75.87”Y2=“-15.2”dididinttrans=“矩阵(0.56,0,0,-0.57,-8.96,23.53)”didientunits=“用户spaceONuse”><停止offs=“0 0 0 0 64 64 64 64 64“><Defs><Defs><lineargragragraradid id id id id id id id id id id id<lineargragragragragraradid id id id id id id id id id id=“38.28.21”x2=“75.21”Y2=“-15.2”didididididi半径id=“b”x1=“99.87”y1=“-47.53”x2="77.7" y2="-16.16" gradientTransform="matrix(0.56, 0, 0, -0.57, -8.96, 23.53)" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#ffd43d"/><stop offset="1" stop-color="#fee875"/></linearGradient></defs><g><path d="M31.62,0a43.6,43.6,0,0,0-7.3.62c-6.46,1.14-7.63,3.53-7.63,7.94v5.82H32v1.94H11a9.53,9.53,0,0,0-9.54,7.74,28.54,28.54,0,0,0,0,15.52c1.09,4.52,3.68,7.74,8.11,7.74h5.25v-7a9.7,9.7,0,0,1,9.54-9.48H39.58a7.69,7.69,0,0,0,7.63-7.76V8.56c0-4.14-3.49-7.25-7.63-7.94A47.62,47.62,0,0,0,31.62,0ZM23.37,4.68A2.91,2.91,0,1,1,20.5,7.6,2.9,2.9,0,0,1,23.37,4.68Z" transform="translate(-0.35)" fill="url(#a)"/><path d="M49.12,16.32V23.1a9.79,9.79,0,0,1-9.54,9.68H24.33a7.79,7.79,0,0,0-7.63,7.76V55.08c0,4.14,3.6,6.57,7.63,7.76a25.55,25.55,0,0,0,15.25,0c3.84-1.11,7.63-3.35,7.63-7.76V49.26H32V47.32H54.85c4.44,0,6.09-3.1,7.63-7.74s1.53-9.38,0-15.52c-1.1-4.42-3.19-7.74-7.63-7.74H49.12ZM40.54,53.14A2.91,2.91,0,1,1,37.67,56,2.88,2.88,0,0,1,40.54,53.14Z" transform="translate(-0.35)" fill="url(#b)"/></g></svg> 388 PyEthApp<small>Official Python client from the Ethereum Foundation</small> 389 </h2> 390 <div class="clearfix"></div> 391 </div> 392 <div class="x_content"> 393 <p>Pyethapp is the Ethereum Foundation's research client, aiming to provide an easily hackable and extendable codebase. The client is currently a full node with transaction processing based synchronization and state pruning enabled.</p> 394 <br/> 395 <p>To run a pyethapp node, download <a href="/{{.PythonGenesis}}"><code>{{.PythonGenesis}}</code></a> and start the node with: 396 <pre>mkdir -p $HOME/.config/pyethapp/{{.Network}}</pre> 397 <pre>pyethapp -c eth.genesis="$(cat {{.PythonGenesis}})" -c eth.network_id={{.NetworkID}} -c data_dir=$HOME/.config/pyethapp/{{.Network}} -c discovery.bootstrap_nodes="[{{.PythonBootnodes}}]" -c eth.block.HOMESTEAD_FORK_BLKNUM={{.Homestead}} -c eth.block.ANTI_DOS_FORK_BLKNUM={{.Tangerine}} -c eth.block.SPURIOUS_DRAGON_FORK_BLKNUM={{.Spurious}} -c eth.block.METROPOLIS_FORK_BLKNUM={{.Byzantium}} -c eth.block.DAO_FORK_BLKNUM=18446744073709551615 run --console</pre> 398 </p> 399 <br/> 400 <p>You can find pyethapp at <a href="https://github.com/ethereum/pyethapp/“target=”about:blank“>https://github.com/ethereum/pyethapp/> 401 </div> 402 </div> 403 </div> 404 </div> 405 </div>{{end}} 406 <div id="about" hidden> 407 <div class="row vertical-center"> 408 <div style="margin: 0 auto;"> 409 <div class="x_panel"> 410 <div class="x_title"> 411 <h3>Puppeth – Your Ethereum private network manager</h3> 412 <div class="clearfix"></div> 413 </div> 414 <div style="display: inline-block; vertical-align: bottom; width: 623px; margin-top: 16px;"> 415 <p>Puppeth is a tool to aid you in creating a new Ethereum network down to the genesis block, bootnodes, signers, ethstats server, crypto faucet, wallet browsers, block explorer, dashboard and more; without the hassle that it would normally entail to manually configure all these services one by one.</p> 416 <p>Puppeth uses ssh to dial in to remote servers, and builds its network components out of docker containers using docker-compose. The user is guided through the process via a command line wizard that does the heavy lifting and topology configuration automatically behind the scenes.</p> 417 <br/> 418 <p>Puppeth is distributed as part of the <a href="https://geth.ethereum.org/downloads/“target=”about:blank“>geth&;tools</a>bundles,but can also be installed separally via:<pre>go get github.com/ethereum/go ethereum/cmd/puppeth</pre><p> 419 <br/> 420 <p><em>Copyright 2017. The go-ethereum Authors.</em></p> 421 </div> 422 <div style="display: inline-block; vertical-align: bottom; width: 217px;"> 423 <img src="puppeth.png" style="height: 256px; margin: 16px 16px 16px 16px"></img> 424 </div> 425 </div> 426 </div> 427 </div> 428 </div> 429 <div id="frame-wrapper" hidden style="position: absolute; height: 100%;"> 430 <iframe id="frame" style="position: absolute; width: 1920px; height: 100%; border: none;" onload="if ($(this).attr('src') != '') { resize(); $('#frame-wrapper').fadeIn(300); }"></iframe> 431 </div> 432 </div> 433 </div> 434 </div> 435 436 <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.2.0/jquery.min.js“>.<script> 437 <script src="https://cdnjs.cloudflare.com/ajax/libs/twitter bootstrap/3.3.7/js/bootstrap.min.js“><script> 438 <script src="https://cdnjs.cloudflare.com/ajax/libs/gentelella/1.3.0/js/custom.min.js“>.<script> 439 <script> 440 var load = function(hash) { 441 window.location.hash = hash; 442 443 //淡出所有可能的页面(是,难看,不,不在乎) 444 $("#geth").fadeOut(300) 445 $("#mist").fadeOut(300) 446 $("#mobile").fadeOut(300) 447 $("#other").fadeOut(300) 448 $("#about").fadeOut(300) 449 $("#frame-wrapper").fadeOut(300); 450 451 //根据哈希值,将其解析为本地或远程URL 452 var url = hash; 453 switch (hash) { 454 case "#stats": 455 url = "//.ethstattspage“; 456 break; 457 case "#explorer": 458 url = "//.探险家页面“; 459 break; 460 case "#wallet": 461 url = "//.walletpage“; 462 break; 463 case "#faucet": 464 url = "//.水龙头页“; 465 break; 466 } 467 setTimeout(function() { 468 if (url.substring(0, 1) == "#") { 469 $('.body').css({overflowY: 'auto'}); 470 $("#frame").attr("src", ""); 471 $(url).fadeIn(300); 472 } else { 473 $('.body').css({overflowY: 'hidden'}); 474 $("#frame").attr("src", url); 475 } 476 }, 300); 477 } 478 var resize = function() { 479 var sidebar = $($(".navbar")[0]).width(); 480 var limit = document.body.clientWidth - sidebar; 481 var scale = limit / 1920; 482 483 $("#frame-wrapper").width(limit); 484 $("#frame-wrapper").height(document.body.clientHeight / scale); 485 $("#frame-wrapper").css({ 486 transform: 'scale(' + (scale) + ')', 487 transformOrigin: "0 0" 488 }); 489 }; 490 $(window).resize(resize); 491 492 if (window.location.hash == "") { 493 var item = $(".side-menu").children()[0]; 494 $(item).children()[0].click(); 495 $(item).addClass("active"); 496 } else { 497 load(window.location.hash); 498 var menu = $(window.location.hash + "_menu"); 499 if (menu !== undefined) { 500 $(menu).addClass("active"); 501 } 502 } 503 </script> 504 </body> 505 </html> 506 ` 507 508 //DashboardMascot是要在Dashboard About页面上显示的吉祥物的PNG转储。 509 //诺林:拼写错误 510 /* 511 512 //DashboardDockerfile是构建仪表板容器所需的Dockerfile 513 //在一个易于访问的页面下聚合各种专用网络服务。 514 var dashboardDockerfile=` 515 来自mhart/alpine节点:最新 516 517 运行 518 NPM安装连接服务静态 519 \ 520 echo'var connect=require(“connect”);'>server.js&&\ 521 echo'var serve static=require(“服务静态”);'>>server.js&&\ 522 echo'connect()。使用(servestatic(“/dashboard”)).listen(80,function()'>>server.js&&\ 523 echo'console.log(“服务器运行于80…”);'>>server.js&&\ 524 echo')';'>>server.js 525 526 添加.network.json/dashboard/.network.json 527 添加.network-cpp.json/dashboard/.network-cpp.json 528 添加.network-harmony.json/dashboard/.network-harmony.json 529 添加.network-parity.json/dashboard/.network-parity.json 530 添加.network-python.json/dashboard/.network-python.json 531 添加index.html/dashboard/index.html 532 添加puppeth.png/dashboard/puppeth.png 533 534 揭发80 535 536 命令[“node”,“/server.js”] 537 538 539 //DashboardComposeFile是部署和 540 //维护服务聚合仪表板。 541 var DashboardComposeFile=` 542 版本:“2” 543 服务: 544 仪表板: 545 建筑: 546 图片:.network/dashboard如果不是.vhost 547 端口: 548 -“.端口:80”结束 549 环境: 550 -ethstats_page=.ethstats page 551 -资源管理器页面=.资源管理器页面 552 -钱包.钱包 553 -水龙头页面.水龙头页面如果.vhost 554 -虚拟主机=.vhost结束 555 登录中: 556 驱动程序:“json文件” 557 选项: 558 最大尺寸:“1m” 559 MAX文件:“10” 560 重新启动:总是 561 ` 562 563 //deploydashboard通过ssh将新的仪表板容器部署到远程计算机, 564 //docker和docker compose。如果具有指定网络名称的实例 565 //已经存在,将被覆盖! 566 func deploydashboard(client*sshclient,network string,conf*config,config*dashboardinfos,nocache bool)([]字节,错误) 567 //生成上传到服务器的内容 568 工作目录:=fmt.sprintf(“%d”,rand.int63()) 569 文件:=make(map[string][]byte) 570 571 dockerfile:=新建(bytes.buffer) 572 template.must(template.new(“”).parse(dashboardDockerfile)).execute(dockerfile,map[string]接口 573 574 }) 575 files[filepath.join(workdir,“dockerfile”)]=dockerfile.bytes()) 576 577 composeFile:=新建(bytes.buffer) 578 template.must(template.new(“”).parse(dashboardcomposefile)).execute(composefile,map[string]接口 579 “Network”:网络, 580 “端口”:配置端口, 581 “vhost”:配置主机, 582 “ethstatspage”:config.ethstats, 583 “Explorer页面”:config.explorer, 584 “walletpage”:config.wallet, 585 “水龙头页面”:配置水龙头, 586 }) 587 files[filepath.join(workdir,“docker compose.yaml”)]=composefile.bytes() 588 589 statsLogin:=fmt.sprintf(“yournode:%s”,conf.ethstats) 590 如果!config.trusted_ 591 状态标语=“” 592 593 索引文件:=新建(bytes.buffer) 594 bootcpp:=make([]string,len(conf.bootnodes))。 595 对于i,boot:=range conf.bootnodes_ 596 bootcpp[i]=“必需:”+strings.trimPrefix(boot,“enode://”) 597 598 bootsharmony:=make([]string,len(conf.bootnodes))。 599 对于i,boot:=range conf.bootnodes_ 600 bootsharmony[i]=fmt.sprintf(“-dpeer.active.%d.url=%s”,i,boot) 601 602 bootphython:=make([]string,len(conf.bootnodes))。 603 对于i,boot:=range conf.bootnodes_ 604 bootphython[i]=“'”+boot+“'” 605 606 template.must(template.new(“”).parse(dashboardContent)).execute(indexfile,map[string]接口 607 “Network”:网络, 608 “networkid”:conf.genesis.config.chainid, 609 “NetworkTitle”:strings.title(网络), 610 “ethstatspage”:config.ethstats, 611 “Explorer页面”:config.explorer, 612 “walletpage”:config.wallet, 613 “水龙头页面”:配置水龙头, 614 “gethgenesis”:网络+“.json”, 615 “bootnodes”:conf.bootnodes, 616 “bootnodesflat”:strings.join(conf.bootnodes,”,“), 617 “ethstats”:状态登录, 618 “ethash”:conf.genesis.config.ethash!=零, 619 “cppGenesis”:network+“-cpp.json”, 620 “cppbootnodes”:strings.join(bootcp,”“), 621 “伤害发生”:network+“-harmony.json”, 622 “harmonybootnodes”:strings.join(bootcharmony,”“), 623 “paritygenesis”:network+“-parity.json”, 624 “pythongenesis”:network+“-python.json”, 625 “pythonbootnodes”:strings.join(bootphython,”,“), 626 “宅基地”:conf.genesis.config.homesteadblock, 627 “橘子”:conf.genesis.config.eip150 block, 628 “假”:conf.genesis.config.eip155block, 629 “拜占庭”:conf.genesis.config.byzantiumblock, 630 “君士坦丁堡”:conf.genesis.config.constantinopleblock, 631 }) 632 文件[filepath.join(workdir,“index.html”)]=indexfile.bytes() 633 634 //为go-ethereum和所有其他客户机整理genesis spec文件 635 Genesis,=conf.genesis.marshaljson()。 636 文件[filepath.join(workdir,network+“.json”)]=genesis 637 638 如果是conf.genesis.config.ethash!= nIL{ 639 640 如果犯错!= nIL{ 641 返回零 642 643 cppspec json,:=json.marshal(cppspec) 644 文件[filepath.join(workdir,network+“-cpp.json”)]=cppspecjson 645 646 harmonyspecjson,:=conf.genesis.marshaljson()。 647 文件[filepath.join(workdir,network+“-harmony.json”)]=harmonyspecjson 648 649 parityspec,err:=newparitychainspec(网络,conf.genesis,conf.bootnodes) 650 如果犯错!= nIL{ 651 返回零 652 653 parityspec json,:=json.marshal(parityspec) 654 文件[filepath.join(workdir,network+“-parity.json”)]=parityspecjson 655 656 pyethspec,err:=newpyethereumgeneisspec(网络,conf.genesis) 657 如果犯错!= nIL{ 658 返回零 659 660 pyethspec json,:=json.marshal(pyethspec) 661 文件[filepath.join(workdir,network+“-python.json”)]=pyethspejson 662 }否则{ 663 对于u,客户机:=range[]string“cpp”、“harmony”、“parity”、“python” 664 文件[filepath.join(workdir,network+“-”+client+“.json”)]=[]byte 665 666 667 files[filepath.join(workdir,“puppeth.png”)]=仪表板吉祥物 668 669 //将部署文件上传到远程服务器(然后清理) 670 如果退出,则错误:=client.upload(文件);错误!= nIL{ 671 返回,错误 672 673 延迟client.run(“rm-rf”+workdir) 674 675 //构建和部署仪表板服务 676 如果NoCy缓存{ 677 返回nil,client.stream(fmt.sprintf(“cd%s&&docker compose-p%s build--pull--无缓存和docker compose-p%s up-d--强制重新创建--超时60”,workdir,network,network) 678 679 返回nil,client.stream(fmt.sprintf(“cd%s&&docker compose-p%s up-d--build--force recreate--timeout 60”,workdir,network))。 680 681 682 //仪表板信息从仪表板状态检查返回以允许报告 683 //各种配置参数。 684 类型仪表盘信息结构 685 主机字符串 686 端口int 687 可信布尔 688 689 埃斯塔斯弦 690 资源管理器字符串 691 钱包串 692 水龙头串 693 } 694 695 //报表将类型化结构转换为纯字符串->字符串映射,其中包含 696 //大多数(但不是全部)字段用于向用户报告。 697 func(info*dashboardinfos)report()映射[string]string_ 698 返回映射[string]string_ 699 “网址”:info.host, 700 “网站侦听器端口”:strconv.itoa(info.port), 701 “ethstats服务”:info.ethstats, 702 “资源管理器服务”:info.explorer, 703 “钱包服务”:info.wallet, 704 “水龙头服务”:信息水龙头, 705 } 706 } 707 708 //checkDashboard对Dashboard容器执行运行状况检查,以验证 709 //正在运行,如果是,则收集有关它的有用信息集合。 710 func checkdashboard(客户端*sshclient,网络字符串)(*仪表盘信息,错误) 711 //检查主机上可能的ethstats容器 712 713 如果犯错!= nIL{ 714 返回零 715 716 如果!信息运行 717 返回nil,errserviceOffline 718 } 719 //从主机或反向代理解析端口 720 端口:=infos.portmap[“80/tcp”] 721 如果端口=0 { 722 如果是proxy,:=checknginx(客户机、网络);proxy!= nIL{ 723 端口=proxy.port 724 725 726 如果端口=0 { 727 返回零,errnotexposed 728 729 //从反向代理解析主机并配置连接字符串 730 主机:=infos.envvars[“虚拟主机”] 731 如果主机= =“”{ 732 主机=client.server 733 } 734 //运行健全性检查以查看端口是否可访问 735 如果err=checkport(主机、端口);err!= nIL{ 736 log.warn(“仪表板服务似乎无法访问”,“服务器”,“主机”,“端口”,“端口”,“错误”,err) 737 } 738 //容器可用,组装并返回有用的信息 739 退货和仪表盘信息 740 宿主:宿主, 741 端口: 742 ethstats:infos.envvars[“ethstats_page”], 743 explorer:infos.envvars[“explorer_page”], 744 电子钱包:infos.envvars[“电子钱包页面”], 745 水龙头:infos.envvars[“水龙头页面”], 746 },nIL 747 748