mirror of
https://github.com/nspcc-dev/neo-go.git
synced 2025-05-03 11:41:48 +00:00
client/cli: add network option to the RPC client
It doesn't affect anything yet, but it's going to be used in the future for network-specific behavior. It also renames short '--timeout' form to '-s' avoiding conlict with '-t' used for '--testnet'.
This commit is contained in:
parent
16ce63e653
commit
d22286cbbc
5 changed files with 23 additions and 19 deletions
|
@ -5,13 +5,14 @@ import (
|
|||
"fmt"
|
||||
"os"
|
||||
|
||||
"github.com/nspcc-dev/neo-go/pkg/config/netmode"
|
||||
"github.com/nspcc-dev/neo-go/pkg/encoding/address"
|
||||
"github.com/nspcc-dev/neo-go/pkg/rpc/client"
|
||||
)
|
||||
|
||||
func Example() {
|
||||
endpoint := "http://seed5.bridgeprotocol.io:10332"
|
||||
opts := client.Options{}
|
||||
opts := client.Options{Network: netmode.MainNet}
|
||||
|
||||
c, err := client.New(context.TODO(), endpoint, opts)
|
||||
if err != nil {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue