mirror of
https://gitlab.com/pulsechaincom/prysm-pulse.git
synced 2025-01-03 00:27:38 +00:00
Properly support datadir
Former-commit-id: 80325290698bf7099f0e46cb48af46c9c197842a [formerly c036afc211c79e1134b4e42d5b79dd309d044eb4] Former-commit-id: c2d592d61e4dde4d762253048e07fe54ff48e0a3
This commit is contained in:
parent
92a48ed5a7
commit
0194e1cc0c
@ -1,6 +1,8 @@
|
|||||||
package sharding
|
package sharding
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"fmt"
|
||||||
|
|
||||||
"github.com/ethereum/go-ethereum/accounts/keystore"
|
"github.com/ethereum/go-ethereum/accounts/keystore"
|
||||||
"github.com/ethereum/go-ethereum/cmd/utils"
|
"github.com/ethereum/go-ethereum/cmd/utils"
|
||||||
"github.com/ethereum/go-ethereum/ethclient"
|
"github.com/ethereum/go-ethereum/ethclient"
|
||||||
@ -22,10 +24,11 @@ type Client struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func MakeShardingClient(ctx *cli.Context) *Client {
|
func MakeShardingClient(ctx *cli.Context) *Client {
|
||||||
endpoint := ""
|
path := node.DefaultDataDir()
|
||||||
if ctx.GlobalIsSet(utils.DataDirFlag.Name) {
|
if ctx.GlobalIsSet(utils.DataDirFlag.Name) {
|
||||||
endpoint = ctx.GlobalString(utils.DataDirFlag.Name)
|
path = ctx.GlobalString(utils.DataDirFlag.Name)
|
||||||
}
|
}
|
||||||
|
endpoint := fmt.Sprintf("%s/geth.ipc", path)
|
||||||
|
|
||||||
config := &node.Config{
|
config := &node.Config{
|
||||||
DataDir: "/tmp/ethereum",
|
DataDir: "/tmp/ethereum",
|
||||||
|
@ -28,9 +28,13 @@ func (c *Client) verifyVMC() error {
|
|||||||
log.Info(fmt.Sprintf("No validator management contract found at %s.", validatorManagerAddress.String()))
|
log.Info(fmt.Sprintf("No validator management contract found at %s.", validatorManagerAddress.String()))
|
||||||
|
|
||||||
accounts := c.keystore.Accounts()
|
accounts := c.keystore.Accounts()
|
||||||
|
if len(accounts) == 0 {
|
||||||
|
return fmt.Errorf("no accounts found")
|
||||||
|
}
|
||||||
|
|
||||||
// TODO: get password from file
|
// TODO: get password from file
|
||||||
if err := c.keystore.Unlock(accounts[0], "password"); err != nil {
|
if err := c.keystore.Unlock(accounts[0], "password"); err != nil {
|
||||||
return err
|
return fmt.Errorf("failed to unlock account 0: %v", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
suggestedGasPrice, err := c.client.SuggestGasPrice(context.Background())
|
suggestedGasPrice, err := c.client.SuggestGasPrice(context.Background())
|
||||||
|
Loading…
Reference in New Issue
Block a user