Skip to content

Commit

Permalink
feat: implement ClientForPreviewnet()
Browse files Browse the repository at this point in the history
  • Loading branch information
janaakhterov committed Jul 27, 2020
1 parent 8a2de8d commit 2091da1
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions client.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,13 @@ var testnetNodes = map[string]AccountID{
"3.testnet.hedera.com:50211": {Account: 6},
}

var previewnetNodes = map[string]AccountID{
"0.previewnet.hedera.com:50211": {Account: 3},
"1.previewnet.hedera.com:50211": {Account: 4},
"2.previewnet.hedera.com:50211": {Account: 5},
"3.previewnet.hedera.com:50211": {Account: 6},
}

// ClientForMainnet returns a preconfigured client for use with the standard
// Hedera mainnet.
// Most users will want to set an operator account with .SetOperator so
Expand All @@ -80,6 +87,14 @@ func ClientForTestnet() *Client {
return NewClient(testnetNodes)
}

// ClientForPreviewnet returns a preconfigured client for use with the standard
// Hedera previewnet.
// Most users will want to set an operator account with .SetOperator so
// transactions can be automatically given TransactionIDs and signed.
func ClientForPreviewnet() *Client {
return NewClient(previewnetNodes)
}

// NewClient takes in a map of node addresses to their respective IDS (network)
// and returns a Client instance which can be used to
func NewClient(network map[string]AccountID) *Client {
Expand Down

0 comments on commit 2091da1

Please sign in to comment.