github.com/core-coin/go-core/v2@v2.1.9/cmd/faucet/faucet.html (about) 1 <!DOCTYPE html> 2 <html lang="en"> 3 <head> 4 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> 5 <meta charset="utf-8"> 6 <meta name="viewport" content="width=device-width, initial-scale=1"> 7 <title>{{.NetworkTitle}} 🚰 Core Authenticated Faucet</title> 8 <link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/cryptohub-digital/coco@1.1.4/dist/css/coco.min.css" integrity="sha384-oHEcBjbmLAzG2Iwiq7B0jNw7ml6FnjSm9sYN5isPKdWbxlJqgb/12CgRO4RKT2WA" crossorigin="anonymous" /> 9 <link href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAACXBIWXMAAAsSAAALEgHS3X78AAAChElEQVRYhcVXy43bMBB9EfaedLDeCqxUEAfgRTx5K8huB0oFUTpwKohTQbQX8SIgSgfeCmJ3sKrAwSyGDk3PiNQmQB7gC01q3gzffPjqeDwiB8bZNwBW/Cv595qPPgJ4ArADMPRV12Z9FECSgHF2AaABsA4MpjAC2ALY9FW3fzEB4ywZ/pTrjYCRSTSzCHC4BwDLvzAe4idFsK+6pyQB42zJxnPDnQvSySomcUYg03P6UMv7QpA47wBcJ86ekbiKNrQTximMTV91sWEPWm+MsyS+D8qeJYtz7RdOETDOEvuvysGPfdVtJjw7gbPmV2LbrU/VK/wJvWbgvq+6bY7xBB44wnv+4URgIsc/v8B47Ajd+11fdTtpsydQC/8dpPzlaNVM2uvlkTWwijQkKv+MAN+ZJDzNuJQlS2FtTBknFMw6xqiEfk5x2qSME+gKFsL6xX1xlsypjBcOGGfXwXW3lFkaASnXpUhpOMRNyDhL578HS++Ms/tCISAhdx/CNEs4UBbcx/8bCum+FbbZQ4byzVLaqEVACveWUysHUlWVnHrWgCS4a27LJ3BKSQUrxr0iQKnS7goukZJnF4WIa8MtqVzYP3KTkeqHNBFRpuyeu+FEC32vtV/2yod1SOz7IfxFfabxBLQWSl6VqcFSQ2K6uqHvkgbABr4Jm+hgG+thhvFWMf7FO1UEi7WiBSq/g3E2R4DeeM2eS+PZIdREPBNq9xUfHgSlL7hF14m58G04G0hT8dRoFmIMCk6ZOUVfTFfauyCXRC6IbC2lqPoyYhFt/8HjZHIky3kbNnyvcx8qBx7jJ2fKOa9juhYSmVZWCRRqUj8NG1nDbDaBiAwpPm5Y+9kFC8BvdEcrTS/2KxYAAAAASUVORK5CYII=" rel="icon" type="image/png" /> 10 <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.5.0/jquery.min.js" integrity="sha256-xNzN2a4ltkB44Mc/Jz3pT4iU1cmeR0FkXs4pru/JxaQ=" crossorigin="anonymous"></script> 11 <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-noty/2.4.1/jquery.noty.min.js" integrity="sha256-/kln4DiDHB0fZHUdUeZBy7XXTMJO8Y4f+GV4et0x2QM=" crossorigin="anonymous"></script> 12 <script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.24.0/moment.min.js" integrity="sha256-4iQZ6BVL4qNKlQ27TExEhBN1HFPvAvAMbFavKKosSWQ=" crossorigin="anonymous"></script> 13 <style> 14 .hero { 15 margin-bottom: 1.5em; 16 } 17 div.address { 18 margin-bottom: 0.7em; 19 } 20 div.amount { 21 margin-bottom: 1em; 22 } 23 abbr { 24 position: relative; 25 cursor: help; 26 } 27 abbr:hover::after { 28 position: absolute; 29 bottom: 100%; 30 width: 20em; 31 padding: 1em; 32 background: #fff; 33 content: attr(title); 34 z-index: 1; 35 border: 3px rgb(74, 74, 74) dotted; 36 } 37 </style> 38 </head> 39 <body class="has-sticky-footer"> 40 <main> 41 <section class="hero is-primary"> 42 <div class="hero-body"> 43 <div class="container"> 44 <h1 class="title"> 45 Core Blockchain Faucet 🚰 46 </h1> 47 <h2 class="subtitle"> 48 {{.Network}} Authenticated Faucet 49 </h2> 50 </div> 51 </div> 52 </section> 53 <section> 54 <div class="container"> 55 <div> 56 <div class="address"> 57 <label for="social" class="label">Social network Url{{if .NoAuth}} | Wallet{{end}}</label> 58 <div class="field has-addons"> 59 <div class="control is-expanded"> 60 <input id="social" class="input" type="text" placeholder="https://…{{if .NoAuth}} | CB…{{end}}" /> 61 </div> 62 <div class="control"> 63 <a class="button is-success" onclick="{{if $.Recaptcha}}grecaptcha.execute(){{else}}submit({{$idx}}){{end}}"> 64 Fund me 65 </a> 66 </div> 67 </div> 68 <p class="help">Social network Url containing your Core {{.Network}} Wallet address{{if .NoAuth}} or Wallet address itself{{end}}</p> 69 </div> 70 <div class="amount"> 71 <label for="amount-primary" class="label">Amount</label> 72 <div class="control"> 73 {{range $idx, $amount := .Amounts}} 74 <label class="radio"> 75 <input id="amount-primary" type="radio" name="tier" /> 76 {{$amount}} [{{index $.Periods $idx}}] 77 </label> 78 {{end}} 79 </div> 80 </div> 81 {{if .Recaptcha}}<div class="g-recaptcha" data-sitekey="{{.Recaptcha}}" data-callback="submit" data-size="invisible"></div>{{end}} 82 </div> 83 <div class="stats"> 84 <div class="tags are-medium"> 85 <span class="tag">🛰 <span id="peers"></span> peers</span> 86 <span class="tag">🧱 <span id="block"></span> blocks</span> 87 <span class="tag">🟢 <span id="funds"></span> cores</span> 88 <span class="tag">🧳 <span id="funded"></span> funded</span> 89 </div> 90 </div> 91 <hr /> 92 </div> 93 </section> 94 <section> 95 <div class="container"> 96 <div class="content is-medium"> 97 <h2>How does faucet work?</h2> 98 <p> 99 This faucet is running on the {{.Network}} network. To prevent malicious actors from exhausting all available funds or accumulating enough Cores to mount long running spam attacks, requests are tied to common 3rd party social network accounts. Anyone having a Twitter or Facebook account may request funds within the permitted limits. 100 </p> 101 <ul> 102 <li> 103 <strong>🐙 Github gist</strong> To request funds via Github gist, make a <a href="https://gist.github.com" target="_blank">public gist</a> with your Core address pasted into the contents (surrounding text doesn't matter).<br/>Copy-paste the <abbr title="Click on the 'Create public gist' and copy Url adrress from your browser">gist Url</abbr> into the above input box and fire away! 104 </li> 105 <li> 106 <strong>🐦 Twitter</strong> To request funds via Twitter, make a <a href="https://twitter.com/intent/tweet?text=Requesting%20faucet%20funds%20into%20xc1%E2%80%A6%20on%20the%20%23{{.Network}}%20%23Core%20test%20network." target="_blank">tweet</a> with your Core address pasted into the contents (surrounding text doesn't matter).<br/>Copy-paste the <abbr title="Click on the Moment and find its URL in the address bar of your web browser, or open the menu on the top right of the Moment, and click Copy link to this">tweets Url</abbr> into the above input box and fire away! 107 </li> 108 <li> 109 <strong>👍 Facebook</strong> To request funds via Facebook, publish a new <em>public</em> post with your Core address embedded into the content (surrounding text doesn't matter).<br/>Copy-paste the <abbr title="Click on the Post Timestamp of the Facebook post and click on Copy Link Address">posts Url</abbr> into the above input box and fire away! 110 </li> 111 {{if .NoAuth}} 112 <li> 113 <strong>🔓 Without authentication</strong> To request funds <em>without authentication</em>, simply copy-paste your Core address into the above input box and fire away!<br/>This mode is susceptible to Byzantine attacks. 114 </li> 115 {{end}} 116 </ul> 117 </div> 118 </div> 119 </section> 120 </main> 121 <footer> 122 <div class="container"> 123 <div class="columns is-gapless"> 124 <div class="column is-paddingless"> 125 <strong>Faucet 🚰</strong> <em>a <a href="https://coreblockchain.cc" target="_blank">Core Blockchain</a> faucet</em> 126 </div> 127 <div class="column is-paddingless has-text-right is-hidden-touch"> 128 <small>⛓️ Connected to: {{.NetworkTitle}}</small> 129 {{if .Recaptcha}} 130 <span class="is-hidden-desktop-only"> 131 <span class="divider">•</span> 132 <small>protected by reCaptcha</small> 133 </span> 134 {{end}} 135 </div> 136 </div> 137 </div> 138 </footer> 139 <script> 140 // Global variables to hold the current status of the faucet 141 var attempt = 0; 142 var server; 143 var tier = 0; 144 var requests = []; 145 146 // Convert number to nicer format 147 var SI_SYMBOL_EXT = ["", "k", "M", "G", "T", "P", "E", "Z", "Y", "R", "Q"]; 148 149 function abbreviateNumber(number) { 150 var level = Math.log10(number) / 3 | 0; 151 if(level == 0) return number; 152 var suffix = SI_SYMBOL_EXT[level]; 153 var scale = Math.pow(10, level * 3); 154 var scaled = number / scale; 155 return scaled.toFixed(2) + suffix; 156 } 157 158 // Define a function that creates closures to drop old requests 159 var dropper = function(hash) { 160 return function() { 161 for (var i=0; i<requests.length; i++) { 162 if (requests[i].tx.hash == hash) { 163 requests.splice(i, 1); 164 break; 165 } 166 } 167 } 168 }; 169 170 // Define the function that submits a gist url to the server 171 var submit = function({{if .Recaptcha}}captcha{{end}}) { 172 server.send(JSON.stringify({url: $("#social")[0].value, tier: $("input[name='tier']:checked").val(){{if .Recaptcha}}, captcha: captcha{{end}}})); 173 {{if .Recaptcha}}grecaptcha.reset();{{end}} 174 }; 175 176 // Define a method to reconnect upon server loss 177 var reconnect = function() { 178 server = new WebSocket(((window.location.protocol === "https:") ? "wss://" : "ws://") + window.location.host + "/api"); 179 180 server.onmessage = function(event) { 181 var msg = JSON.parse(event.data); 182 if (msg === null) { 183 return; 184 } 185 186 if (msg.funds !== undefined) { 187 $("#funds").text(abbreviateNumber(Number(msg.funds))); 188 } 189 if (msg.funded !== undefined) { 190 $("#funded").text(msg.funded); 191 } 192 if (msg.peers !== undefined) { 193 $("#peers").text(msg.peers); 194 } 195 if (msg.number !== undefined) { 196 $("#block").text(parseInt(msg.number, 16)); 197 } 198 if (msg.error !== undefined) { 199 noty({layout: 'topCenter', text: msg.error, type: 'error', timeout: 5000, progressBar: true}); 200 } 201 if (msg.success !== undefined) { 202 noty({layout: 'topCenter', text: msg.success, type: 'success', timeout: 5000, progressBar: true}); 203 } 204 } 205 server.onclose = function() { setTimeout(reconnect, 3000); }; 206 } 207 208 // Establish a websocket connection to the API server 209 reconnect(); 210 </script> 211 {{if .Recaptcha}}<script src="https://www.google.com/recaptcha/api.js" async defer></script>{{end}} 212 </body> 213 </html>