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:
Roman Khimov 2020-06-18 09:43:37 +03:00
parent 16ce63e653
commit d22286cbbc
5 changed files with 23 additions and 19 deletions

View file

@ -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 {