Skip to content

Commit

Permalink
akash: use testnet node for default
Browse files Browse the repository at this point in the history
fixes #320
  • Loading branch information
boz committed Jul 30, 2018
1 parent 452da9a commit 38b90cd
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 8 deletions.
7 changes: 5 additions & 2 deletions _integration/cmp/base.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,11 @@ func akashd(name string, args ...string) gx.Cmd {
func akash_(root vars.Ref, name string, args ...string) gx.Cmd {
cmd := g.EXEC("akash-"+name,
"{{akash-path}}",
append([]string{"-d", root.Var()}, args...)...)
append([]string{"-d", root.Var()}, args...)...).
AddEnv("AKASH_NODE", "{{akash-node}}")

cmd.WithMeta(g.Require("akash-path", root.Name()))
cmd.WithMeta(g.
Require("akash-path", root.Name()).
Default("akash-node", "http://localhost:46657"))
return cmd
}
4 changes: 3 additions & 1 deletion _run/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@ AKASH_ROOT=../..
DATA_ROOT=data
AKASH_DIR=$DATA_ROOT/client
AKASHD_DIR=$DATA_ROOT/node
DEFAULT_AKASH_NODE="http://localhost:46657"

_akash() {
"$AKASH_ROOT/akash" -d "$AKASH_DIR" "$@"
AKASH_NODE="${AKASH_NODE:-$DEFAULT_AKASH_NODE}" \
"$AKASH_ROOT/akash" -d "$AKASH_DIR" "$@"
}

_akashd() {
Expand Down
3 changes: 1 addition & 2 deletions _run/multi/env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@ nodeuri(){
}

akash(){
export AKASH_NODE=$(nodeuri)
_akash "$@"
AKASH_NODE=$(nodeuri) _akash "$@"
}

akashd(){
Expand Down
4 changes: 2 additions & 2 deletions _run/single/env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ akashd() {
}

akash_provider() {
"$AKASH_ROOT/akash" -d "$PROVIDER_DIR" "$@"
AKASH_NODE="${AKASH_NODE:-$DEFAULT_AKASH_NODE}" \
"$AKASH_ROOT/akash" -d "$PROVIDER_DIR" "$@"
}

1 change: 1 addition & 0 deletions cmd/akash/session/base.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ const (
defaultCodec = "english"
defaultPassword = "0123456789"
defaultHost = "localhost"
defaultNode = "http://api.akashtest.net:80"
)

func SetupBaseCommand(cmd *cobra.Command) {
Expand Down
2 changes: 1 addition & 1 deletion cmd/akash/session/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
)

func AddFlagNode(cmd *cobra.Command, flags *pflag.FlagSet) {
flags.StringP(flagNode, "n", "http://localhost:46657", "node host")
flags.StringP(flagNode, "n", defaultNode, "node host")
viper.BindPFlag(flagNode, flags.Lookup(flagNode))
}

Expand Down

0 comments on commit 38b90cd

Please sign in to comment.