Merge pull request #493 from filecoin-project/feat/faucet-ssize
fountain: Allow picking sector size
This commit is contained in:
commit
157853e47a
@ -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 {
|
||||
|
@ -11,9 +11,14 @@
|
||||
[CREATING STORAGE MINER]
|
||||
</div>
|
||||
<div class="Index-node" id="formnd">
|
||||
<form id="f" action='/mkminer' method='get'>
|
||||
<form id="f" action='/mkminer' method='POST'>
|
||||
<span>Enter destination address:</span>
|
||||
<input type='text' name='address' style="width: 300px">
|
||||
<select name="sectorSize">
|
||||
<option selected value="1073741824">1GiB sectors</option>
|
||||
<option value="268435456">256MiB sectors</option>
|
||||
<option value="16777216">16MiB sectors</option>
|
||||
</select>
|
||||
<button type='submit'>Create Miner</button>
|
||||
</form>
|
||||
</div>
|
||||
|
Loading…
Reference in New Issue
Block a user