fix deps and allow passing the datadir as the first arg like geth attach

Former-commit-id: 6d2f0e329a63a06f08927d30717fa1fef2b82d74 [formerly 31a3ce5de98f6a9fdace9f972418ce38b5e265b9]
Former-commit-id: b7caa9b86ec4c75f9fce07200358315fb0c7f85b
This commit is contained in:
Preston Van Loon 2018-01-20 19:03:20 -05:00
parent 4a89464c91
commit f139cb33e2
2 changed files with 8 additions and 5 deletions

View File

@ -2,7 +2,10 @@ package sharding
import (
"fmt"
"io/ioutil"
"strings"
"github.com/ethereum/go-ethereum/accounts"
"github.com/ethereum/go-ethereum/accounts/keystore"
"github.com/ethereum/go-ethereum/cmd/utils"
"github.com/ethereum/go-ethereum/ethclient"
@ -31,7 +34,11 @@ func MakeShardingClient(ctx *cli.Context) *Client {
if ctx.GlobalIsSet(utils.DataDirFlag.Name) {
path = ctx.GlobalString(utils.DataDirFlag.Name)
}
endpoint := fmt.Sprintf("%s/%s.ipc", path, clientIdentifier)
endpoint := ctx.Args().First()
if endpoint == "" {
endpoint = fmt.Sprintf("%s/%s.ipc", path, clientIdentifier)
}
config := &node.Config{
DataDir: path,

View File

@ -4,13 +4,9 @@ import (
"bytes"
"context"
"fmt"
"io/ioutil"
"math/big"
"strings"
"time"
"github.com/ethereum/go-ethereum/accounts"
"github.com/ethereum/go-ethereum/cmd/utils"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/log"