mirror of
https://github.com/wealdtech/ethdo.git
synced 2026-01-12 23:47:55 -05:00
Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f898466395 | ||
|
|
e496fa1977 | ||
|
|
d016326779 | ||
|
|
ee14b5ee8e | ||
|
|
9ae927feab |
@@ -1,3 +1,6 @@
|
||||
dev:
|
||||
- allow use of keystores with validator credentials set
|
||||
|
||||
1.28.4:
|
||||
- allow validator exit to use a keystore as its validator parameter
|
||||
|
||||
|
||||
@@ -42,7 +42,7 @@ import (
|
||||
// minTimeout is the minimum timeout for this command.
|
||||
// It needs to be set here as we want timeouts to be low in general, but this can be pulling
|
||||
// a lot of data for an unsophisticated audience so it's easier to set a higher timeout..
|
||||
var minTimeout = 2 * time.Minute
|
||||
var minTimeout = 5 * time.Minute
|
||||
|
||||
// defaultBeaconNode is used if no other connection is supplied.
|
||||
var defaultBeaconNode = "http://mainnet-consensus.attestant.io/"
|
||||
@@ -329,7 +329,16 @@ func (c *command) generateOperationsFromAccountAndPrivateKey(ctx context.Context
|
||||
}
|
||||
|
||||
func (c *command) generateOperationsFromValidatorAndPrivateKey(ctx context.Context) error {
|
||||
validatorInfo, err := c.chainInfo.FetchValidatorInfo(ctx, c.validator)
|
||||
validatorAccount, err := util.ParseAccount(ctx, c.validator, nil, false)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
validatorPubkey, err := util.BestPublicKey(validatorAccount)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
validatorInfo, err := c.chainInfo.FetchValidatorInfo(ctx, fmt.Sprintf("%#x", validatorPubkey.Marshal()))
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
@@ -721,7 +730,7 @@ func (c *command) setup(ctx context.Context) error {
|
||||
if c.debug {
|
||||
fmt.Fprintf(os.Stderr, "No node connection, attempting to use %s\n", defaultBeaconNode)
|
||||
}
|
||||
c.consensusClient, err = util.ConnectToBeaconNode(ctx, defaultBeaconNode, c.timeout, c.allowInsecureConnections)
|
||||
c.consensusClient, err = util.ConnectToBeaconNode(ctx, defaultBeaconNode, c.timeout, true)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
@@ -41,7 +41,7 @@ import (
|
||||
// minTimeout is the minimum timeout for this command.
|
||||
// It needs to be set here as we want timeouts to be low in general, but this can be pulling
|
||||
// a lot of data for an unsophisticated audience so it's easier to set a higher timeout..
|
||||
var minTimeout = 2 * time.Minute
|
||||
var minTimeout = 5 * time.Minute
|
||||
|
||||
// validatorPath is the regular expression that matches a validator path.
|
||||
var validatorPath = regexp.MustCompile("^m/12381/3600/[0-9]+/0/0$")
|
||||
@@ -51,6 +51,9 @@ var (
|
||||
exitOperationFilename = "exit-operation.json"
|
||||
)
|
||||
|
||||
// defaultBeaconNode is used if no other connection is supplied.
|
||||
var defaultBeaconNode = "http://mainnet-consensus.attestant.io/"
|
||||
|
||||
func (c *command) process(ctx context.Context) error {
|
||||
if err := c.setup(ctx); err != nil {
|
||||
return err
|
||||
@@ -442,7 +445,22 @@ func (c *command) setup(ctx context.Context) error {
|
||||
var err error
|
||||
c.consensusClient, err = util.ConnectToBeaconNode(ctx, c.connection, c.timeout, c.allowInsecureConnections)
|
||||
if err != nil {
|
||||
return errors.Wrap(err, "failed to connect to consensus node")
|
||||
if c.connection != "" {
|
||||
// The user provided a connection, so don't second-guess them by using a different node.
|
||||
return err
|
||||
}
|
||||
|
||||
// The user did not provide a connection, so attempt to use the default node.
|
||||
if c.debug {
|
||||
fmt.Fprintf(os.Stderr, "No node connection, attempting to use %s\n", defaultBeaconNode)
|
||||
}
|
||||
c.consensusClient, err = util.ConnectToBeaconNode(ctx, defaultBeaconNode, c.timeout, true)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if !c.quiet {
|
||||
fmt.Fprintf(os.Stderr, "No connection supplied; using mainnet public access endpoint\n")
|
||||
}
|
||||
}
|
||||
|
||||
// Set up chaintime.
|
||||
|
||||
@@ -24,7 +24,7 @@ import (
|
||||
|
||||
// ReleaseVersion is the release version of the codebase.
|
||||
// Usually overridden by tag names when building binaries.
|
||||
var ReleaseVersion = "local build (latest release 1.28.4)"
|
||||
var ReleaseVersion = "local build (latest release 1.28.5)"
|
||||
|
||||
// versionCmd represents the version command.
|
||||
var versionCmd = &cobra.Command{
|
||||
|
||||
@@ -592,7 +592,7 @@ $ ethdo validator credentials get --validator=Validators/1
|
||||
`ethdo validator credentials set` updates withdrawal credentials from BLS "type 0" credentials to execution "type 1" credentials. Full information about using this command can be found in the [specific documentation](./changingwithdrawalcredentials.md).
|
||||
|
||||
```sh
|
||||
$ ethdo validator credentials set --validator=Validators/1 --execution-address=0x8f…9F --private-key=0x3b…9c
|
||||
$ ethdo validator credentials set --validator=Validators/1 --withdrawal-address=0x8f…9F --private-key=0x3b…9c
|
||||
```
|
||||
|
||||
#### `depositdata`
|
||||
|
||||
@@ -52,7 +52,7 @@ func ParseAccount(ctx context.Context,
|
||||
account, err := parseAccountFromSpecifier(ctx, accountStr, supplementary, unlock)
|
||||
if err != nil {
|
||||
// It is possible that this is actually a path to a keystore, so try that instead.
|
||||
if _, err = os.Stat(accountStr); err == nil {
|
||||
if _, statErr := os.Stat(accountStr); statErr == nil {
|
||||
account, err = parseAccountFromKeystorePath(ctx, accountStr, supplementary, unlock)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user