Skip to content

Commit

Permalink
Add SetNetwork method
Browse files Browse the repository at this point in the history
  • Loading branch information
KrishnaDeqode committed Jun 23, 2020
1 parent 7cbb7c0 commit 5cf7e58
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
5 changes: 5 additions & 0 deletions zboxcore/sdk/sdk.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,11 @@ func SetQuerySleepTime(time int) {
blockchain.SetQuerySleepTime(time)
}

func SetNetwork(miners []string, sharders []string) {
blockchain.SetMiners(miners)
blockchain.SetSharders(sharders)
}

//
// read pool
//
Expand Down
5 changes: 5 additions & 0 deletions zcncore/wallet.go
Original file line number Diff line number Diff line change
Expand Up @@ -363,6 +363,11 @@ func GetNetwork() *Network {
}
}

func SetNetwork(miners []string, sharders []string) {
_config.chain.Miners = miners
_config.chain.Sharders = sharders
}

func GetNetworkJSON() string {
network := GetNetwork()
networkBytes, _ := json.Marshal(network)
Expand Down

0 comments on commit 5cf7e58

Please sign in to comment.