|
|
|
@ -6,6 +6,14 @@ import ( |
|
|
|
|
"errors" |
|
|
|
|
"flag" |
|
|
|
|
"fmt" |
|
|
|
|
"strings" |
|
|
|
|
|
|
|
|
|
"io" |
|
|
|
|
"io/ioutil" |
|
|
|
|
math_rand "math/rand" |
|
|
|
|
"os" |
|
|
|
|
"strconv" |
|
|
|
|
"time" |
|
|
|
|
|
|
|
|
|
"github.com/dedis/kyber" |
|
|
|
|
"github.com/simple-rules/harmony-benchmark/blockchain" |
|
|
|
@ -17,12 +25,6 @@ import ( |
|
|
|
|
"github.com/simple-rules/harmony-benchmark/p2p" |
|
|
|
|
proto_node "github.com/simple-rules/harmony-benchmark/proto/node" |
|
|
|
|
"github.com/simple-rules/harmony-benchmark/utils" |
|
|
|
|
"io" |
|
|
|
|
"io/ioutil" |
|
|
|
|
math_rand "math/rand" |
|
|
|
|
"os" |
|
|
|
|
"strconv" |
|
|
|
|
"time" |
|
|
|
|
) |
|
|
|
|
|
|
|
|
|
func main() { |
|
|
|
@ -218,6 +220,20 @@ func main() { |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
func getLeaders() []p2p.Peer { |
|
|
|
|
str, _ := client.DownloadUrlAsString("https://s3-us-west-2.amazonaws.com/unique-bucket-bin/leaders.txt") |
|
|
|
|
lines := strings.Split(str, "\n") |
|
|
|
|
var leaders []p2p.Peer |
|
|
|
|
for _, line := range lines { |
|
|
|
|
if line == "" { |
|
|
|
|
continue |
|
|
|
|
} |
|
|
|
|
parts := strings.Split(line, " ") |
|
|
|
|
leaders = append(leaders, p2p.Peer{Ip: parts[0], Port: parts[1]}) |
|
|
|
|
} |
|
|
|
|
return leaders |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
func CreateWalletServerNode() *node.Node { |
|
|
|
|
configr := client_config.NewConfig() |
|
|
|
|
configr.ReadConfigFile("local_config_shards.txt") |
|
|
|
|