Skip to content
This repository has been archived by the owner on Mar 28, 2023. It is now read-only.

Commit

Permalink
Merge pull request #1523 from OpenBazaar/mobile-testnet-flag
Browse files Browse the repository at this point in the history
Provide -t flag for mobile cmd to start in testnet mode
  • Loading branch information
cpacia authored Mar 27, 2019
2 parents 4379a5b + e69a9e1 commit 77d0aca
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions mobile/cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ import (
)

type Options struct {
Datadir string `short:"d" long:"data" description:"location of openbazaar datastore"`
TestnetEnabled bool `short:"t" long:"testnet" description:"use testnet protocol and wallet endpoints"`
Datadir string `short:"d" long:"data" description:"location of openbazaar datastore"`
}

var (
Expand All @@ -26,16 +27,17 @@ func main() {
}
fmt.Printf("error parsing options: %s\n", err.Error())
os.Exit(1)
} else {
if options.Datadir != "" {
dataPath = options.Datadir
}
}

if options.Datadir != "" {
dataPath = options.Datadir
}

var (
wg sync.WaitGroup
n, err = mobile.NewNodeWithConfig(&mobile.NodeConfig{
RepoPath: dataPath,
Testnet: options.TestnetEnabled,
}, "", "")
)
if err != nil {
Expand Down

0 comments on commit 77d0aca

Please sign in to comment.