From a20255d60643ddb005401979ebe306fbe79974bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Magiera?= Date: Thu, 17 Oct 2019 16:28:03 +0200 Subject: [PATCH] Fancier faucet --- cmd/lotus-fountain/main.go | 12 +++---- cmd/lotus-fountain/site/funds.html | 29 ++++++++++++++++ cmd/lotus-fountain/site/index.html | 33 ++++++++++-------- cmd/lotus-fountain/site/main.css | 56 ++++++++++++++++++++++++++++++ cmd/lotus-fountain/site/miner.html | 43 +++++++++++++++++++++++ 5 files changed, 153 insertions(+), 20 deletions(-) create mode 100644 cmd/lotus-fountain/site/funds.html create mode 100644 cmd/lotus-fountain/site/main.css create mode 100644 cmd/lotus-fountain/site/miner.html diff --git a/cmd/lotus-fountain/main.go b/cmd/lotus-fountain/main.go index bee3e8b71..705c7d148 100644 --- a/cmd/lotus-fountain/main.go +++ b/cmd/lotus-fountain/main.go @@ -94,17 +94,17 @@ var runCmd = &cli.Command{ limiter: NewLimiter(LimiterConfig{ TotalRate: time.Second, TotalBurst: 20, - IPRate: 5 * time.Minute, + IPRate: time.Minute, IPBurst: 5, - WalletRate: time.Hour, + WalletRate: 15 * time.Minute, WalletBurst: 1, }), colLimiter: NewLimiter(LimiterConfig{ TotalRate: time.Second, TotalBurst: 20, - IPRate: 24 * time.Hour, + IPRate: 10 * time.Minute, IPBurst: 1, - WalletRate: 24 * 364 * time.Hour, + WalletRate: 1 * time.Hour, WalletBurst: 1, }), } @@ -206,7 +206,7 @@ func (h *handler) mkminer(w http.ResponseWriter, r *http.Request) { return } - log.Infof("mkactoer on %s", owner) + log.Infof("mkactor on %s", owner) // Limit based on wallet address limiter = h.colLimiter.GetWalletLimiter(owner.String()) @@ -307,5 +307,5 @@ func (h *handler) mkminer(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "text/plain") w.WriteHeader(200) fmt.Fprintf(w, "New storage miners address is: %s\n", addr) - fmt.Fprintf(w, "Run lotus-storage-miner init --actor=%s -owner=%s", addr, owner) + fmt.Fprintf(w, "Run lotus-storage-miner init --actor=%s --owner=%s", addr, owner) } diff --git a/cmd/lotus-fountain/site/funds.html b/cmd/lotus-fountain/site/funds.html new file mode 100644 index 000000000..cd26032f3 --- /dev/null +++ b/cmd/lotus-fountain/site/funds.html @@ -0,0 +1,29 @@ + + + + Sending Funds - Lotus Fountain + + + +
+
+
+ [SENDING FUNDS] +
+
+
+ Enter destination address: + + +
+
+
+ +
+ + diff --git a/cmd/lotus-fountain/site/index.html b/cmd/lotus-fountain/site/index.html index 632470b7f..85226e4c0 100644 --- a/cmd/lotus-fountain/site/index.html +++ b/cmd/lotus-fountain/site/index.html @@ -2,21 +2,26 @@ Lotus Fountain - + -
- Enter destination address: - - - -
-When creating storage miner, DO NOT REFRESH THE PAGE, wait for it to load. This can take more than 5min. +
+
+
+ [LOTUS DEVNET FAUCET] +
+ + +
+ +
diff --git a/cmd/lotus-fountain/site/main.css b/cmd/lotus-fountain/site/main.css new file mode 100644 index 000000000..efcd5dc26 --- /dev/null +++ b/cmd/lotus-fountain/site/main.css @@ -0,0 +1,56 @@ +body { + font-family: 'monospace'; + background: #1f1f1f; + color: #f0f0f0; + padding: 0; + margin: 0; +} + +.Index { + width: 100vw; + height: 100vh; + background: #1a1a1a; + color: #f0f0f0; + font-family: monospace; + + display: grid; + grid-template-columns: auto 40vw auto; + grid-template-rows: auto auto auto 3em; + grid-template-areas: + ". . ." + ". main ." + ". . ." + "footer footer footer"; +} +.Index-footer { + background: #2a2a2a; + grid-area: footer; +} + +.Index-footer > div { + padding-left: 0.7em; + padding-top: 0.7em; +} + +.Index-nodes { + grid-area: main; + background: #2a2a2a; +} + +.Index-node { + margin: 5px; + padding: 15px; + background: #1f1f1f; +} + +a:link { + color: #50f020; +} + +a:visited { + color: #50f020; +} + +a:hover { + color: #30a00a; +} diff --git a/cmd/lotus-fountain/site/miner.html b/cmd/lotus-fountain/site/miner.html new file mode 100644 index 000000000..31952269e --- /dev/null +++ b/cmd/lotus-fountain/site/miner.html @@ -0,0 +1,43 @@ + + + + Creating Storage Miner - Lotus Fountain + + + +
+
+
+ [CREATING STORAGE MINER] +
+
+
+ Enter destination address: + + +
+
+ +
+ When creating storage miner, DO NOT REFRESH THE PAGE, wait for it to load. This can take more than 5min. +
+
+ +
+ + + \ No newline at end of file