mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-20 10:52:25 +00:00
add input seed
This commit is contained in:
parent
a22e56974f
commit
d972357ca1
2 changed files with 12 additions and 0 deletions
|
|
@ -40,6 +40,7 @@ var (
|
||||||
allhosts string
|
allhosts string
|
||||||
hosts []string
|
hosts []string
|
||||||
filesize int
|
filesize int
|
||||||
|
inputSeed int
|
||||||
syncDelay int
|
syncDelay int
|
||||||
httpPort int
|
httpPort int
|
||||||
wsPort int
|
wsPort int
|
||||||
|
|
@ -74,6 +75,12 @@ func main() {
|
||||||
Usage: "ws port",
|
Usage: "ws port",
|
||||||
Destination: &wsPort,
|
Destination: &wsPort,
|
||||||
},
|
},
|
||||||
|
cli.IntFlag{
|
||||||
|
Name: "seed",
|
||||||
|
Value: 0,
|
||||||
|
Usage: "input seed in case we need deterministic upload",
|
||||||
|
Destination: &inputSeed,
|
||||||
|
},
|
||||||
cli.IntFlag{
|
cli.IntFlag{
|
||||||
Name: "filesize",
|
Name: "filesize",
|
||||||
Value: 1024,
|
Value: 1024,
|
||||||
|
|
|
||||||
|
|
@ -39,6 +39,11 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
func uploadAndSyncCmd(ctx *cli.Context, tuid string) error {
|
func uploadAndSyncCmd(ctx *cli.Context, tuid string) error {
|
||||||
|
// use input seed if it has been set
|
||||||
|
if inputSeed != 0 {
|
||||||
|
seed = inputSeed
|
||||||
|
}
|
||||||
|
|
||||||
randomBytes := testutil.RandomBytes(seed, filesize*1000)
|
randomBytes := testutil.RandomBytes(seed, filesize*1000)
|
||||||
|
|
||||||
errc := make(chan error)
|
errc := make(chan error)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue