From 6a999d348a8e9b865c0e7f3847d6f17cb52190f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Magiera?= Date: Tue, 29 Oct 2019 19:28:54 +0100 Subject: [PATCH] fountain: Allow picking sector size --- cmd/lotus-fountain/main.go | 8 +++++++- cmd/lotus-fountain/site/miner.html | 7 ++++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/cmd/lotus-fountain/main.go b/cmd/lotus-fountain/main.go index d6c6f9107..6c27758a6 100644 --- a/cmd/lotus-fountain/main.go +++ b/cmd/lotus-fountain/main.go @@ -5,6 +5,7 @@ import ( "fmt" "net/http" "os" + "strconv" "time" rice "github.com/GeertJohan/go.rice" @@ -200,6 +201,11 @@ func (h *handler) mkminer(w http.ResponseWriter, r *http.Request) { return } + ssize, err := strconv.ParseInt(r.FormValue("sectorSize"), 10, 64) + if err != nil { + return + } + if owner.Protocol() != address.BLS { w.WriteHeader(400) w.Write([]byte("Miner address must use BLS")) @@ -254,7 +260,7 @@ func (h *handler) mkminer(w http.ResponseWriter, r *http.Request) { params, err := actors.SerializeParams(&actors.CreateStorageMinerParams{ Owner: owner, Worker: owner, - SectorSize: 1 << 30, // build.SectorSizes[0], // TODO: dropdown allowing selection (1GiB for now) + SectorSize: uint64(ssize), PeerID: peer.ID("SETME"), }) if err != nil { diff --git a/cmd/lotus-fountain/site/miner.html b/cmd/lotus-fountain/site/miner.html index 8aec74eac..c78342eac 100644 --- a/cmd/lotus-fountain/site/miner.html +++ b/cmd/lotus-fountain/site/miner.html @@ -11,9 +11,14 @@ [CREATING STORAGE MINER]
-
+ Enter destination address: +