Giter VIP home page Giter VIP logo

ethdo's Introduction

Tag License GoDoc Travis CI

A command-line tool for managing common tasks in Ethereum 2.

Table of Contents

Install

Binaries

Binaries for the latest version of ethdo can be obtained from the releases page.

Docker

You can obtain the latest version of ethdo using docker with:

docker pull wealdtech/ethdo

Source

ethdo is a standard Go program which can be installed with:

go install github.com/wealdtech/ethdo@latest

Note that ethdo requires at least version 1.20 of go to operate. The version of go can be found with go version.

If this does not work please see the troubleshooting page.

The docker image can be build locally with:

docker build -t ethdo .

You can run ethdo using docker after that. Example:

docker run -it ethdo --help

Note that that many ethdo commands connect to the beacon node to obtain information. If the beacon node is running directly on the server this requires the --network=host command, for example:

docker run --network=host ethdo chain status

Alternatively, if the beacon node is running in a separate docker container a shared network can be created with docker network create eth2 and accessed by adding --network=eth2 added to both the beacon node and ethdo containers.

Setting up

ethdo needs a connection to a beacon node for many of its features. ethdo can connect to any beacon node that fully supports the standard REST API using the --connection <beacon-node:port> argument. The following changes are required to beacon nodes to make this available.

Lighthouse

Lighthouse disables the REST API by default. To enable it, the beacon node must be started with the --http parameter. If you want to access the REST API from a remote server then you should also look to change the --http-address and --http-allow-origin options as per the Lighthouse documentation.

The default port for the REST API is 5052, which can be changed with the --http-port parameter.

Nimbus

Nimbus disables the REST API by default. To enable it, the beacon node must be started with the --rest parameter. If you want to access the REST API from a remote server then you should also look to change the --rest-address and --rest-allow-origin options as per the Nimbus documentation.

The default port for the REST API is 5052, which can be changed with the --rest-port parameter.

Prysm

Prysm enables the REST API by default. You will need to add the parameter --grpc-max-msg-size 268435456 to be obtain to obtain large sets of information such as the list of current validators. If you want to access the REST API from a remote server then you should also look to change the --grpc-gateway-host and --grpc-gateway-corsdomain options as per the Prysm documentation.

The default port for the REST API is 3500, which can be changed with the --grpc-gateway-port parameter.

Teku

Teku disables the REST API by default. To enable it, the beacon node must be started with the --rest-api-enabled parameter. If you want to access the REST API from a remote server then you should also look to change the --rest-api-interface, --rest-api-host-allowlist and --rest-api-cors-origins options as per the Teku documentation.

The default port for the REST API is 5051, which can be changed with the --rest-api-port parameter.

Lodestar

Lodestar enables the REST API by default and should just work locally. If you want to access the REST API from a remote server then you should also look to change the --rest.address to 0.0.0.0 as per the Lodestar documentation.

The default port for the REST API is 9596, which can be changed with the --rest.port parameter.

Usage

ethdo contains a large number of features that are useful for day-to-day interactions with the different consensus clients.

Wallets and accounts

ethdo uses the go-eth2-wallet system to provide unified access to different wallet types. When on the filesystem the locations of the created wallets and accounts are:

- for Linux: $HOME/.config/ethereum2/wallets
- for OSX: $HOME/Library/Application Support/ethereum2/wallets
- for Windows: %APPDATA%\ethereum2\wallets

If using the filesystem store, the additional parameter base-dir can be supplied to change this location.

If using docker as above you can make this directory accessible to docker to make wallets and accounts persistent. For example, for linux you could use the following command to list your wallets on Linux:

docker run -v $HOME/.config/ethereum2/wallets:/data ethdo --base-dir=/data wallet list

This will allow you to use ethdo with or without docker, with the same location for wallets and accounts.

All ethdo comands take the following parameters:

  • store: the name of the storage system for wallets. This can be one of "filesystem" (for local storage of the wallet) or "s3" (for remote storage of the wallet on Amazon's S3 storage system), and defaults to "filesystem"
  • storepassphrase: the passphrase for the store. If this is empty the store is unencrypted
  • walletpassphrase: the passphrase for the wallet. This is required for some wallet-centric operations such as creating new accounts
  • passphrase: the passphrase for the account. This is required for some account-centric operations such as signing data

Accounts are specified in the standard "/" format, for example the account "savings" in the wallet "primary" would be referenced as "primary/savings".

Configuration file and environment

ethdo supports a configuration file; by default in the user's home directory but changeable with the --config argument on the command line. The configuration file provides values that override the defaults but themselves can be overridden with command-line arguments.

The default file name is .ethdo.json or .ethdo.yml depending on the encoding used (JSON or YAML, respectively). An example .ethdo.json file is shown below:

{
  "store": "s3",
  "storepassphrase": "s3 secret passphrse",
  "account": "Personal wallet/Operations",
  "verbose": true
}

ethdo also supports environment variables. Environment variables are prefixed with "ETHDO_" and are upper-cased. So for example to provide your account passphrase in an environment variable on a Unix system you could use:

export ETHDO_PASSPHRASE="my account passphrase"

S3 store options

Amazon S3-compatible stores have additional options available, which can be configured under the "stores.s3" key. An example configuration is as follows:

{
  "stores": {
    "s3": {
      "bucket":"mybucketname",
      "path":"path/in/bucket",
      "passphrase":"secret"
    }
  }
}

Information on these and other options can be found in the S3 store repository.

Output and exit status

If set, the --quiet argument will suppress all output.

If set, the --verbose argument will output additional information related to the command. Details of the additional information is command-specific and explained in the command help below.

If set, the --debug argument will output additional information about the operation of ethdo as it carries out its work.

Commands will have an exit status of 0 on success and 1 on failure. The specific definition of success is specified in the help for each command.

Validator specifier

Ethereum validators can be specified in a number of different ways. The options are:

  • an ethdo account, in the format wallet/account. It is possible to use the validator specified in this way to sign validator-related operations, if the passphrase is also supplied, with a passphrase (for local accounts) or authority (for remote accounts)
  • the validator's 48-byte public key. It is not possible to use the a validator specified in this way to sign validator-related operations
  • a keystore, supplied either as direct JSON or as a path to a keystore on the local filesystem. It is possible to use the validator specified in this way to sign validator-related operations, if the passphrase is also supplied
  • the validator's numeric index. It is not possible to use a validator specified in this way to sign validator-related operations. Note that this only works with on-chain operations, as the validator's index must be resolved to its public key

Passphrase strength

ethdo will by default not allow creation or export of accounts or wallets with weak passphrases. If a weak pasphrase is used then ethdo will refuse to continue.

If a weak passphrase is required, ethdo can be supplied with the --allow-weak-passphrases option which will force it to accept any passphrase, even if it is considered weak.

Rules for account passphrases

Account passphrases are used in various places in ethdo. Where they are used, the following rules apply:

  • commands that require passphrases to operate, for example unlocking an account, can be supplied with multiple passphrases. If they are, then each passphrase is tried until one succeeds or they all fail
  • commands that require passphrases to create, for example creating an account, must be supplied with a single passphrase. If more than one passphrase is supplied the command will fail

In addition, the following rules apply to passphrases supplied on the command line:

  • passphrases must not start with 0x
  • passphrases must not contain the comma (,) character

Commands

Command information, along with sample outputs and optional arguments, is available in the usage section.

HOWTO

There is a HOWTO that covers details about how to carry out various common tasks. There is also a specific document that provides details of how to carry out common conversions from mnemonic, to account, to deposit data, for launchpad-related configurations.

Maintainers

Jim McDonald: @mcdee.

Special thanks to @SuburbanDad for updating xgo to allow for cross-compilation of ethdo releases.

Contribute

Contributions welcome. Please check out the issues.

License

Apache-2.0 © 2019, 2020 Weald Technology Trading Ltd

ethdo's People

Contributors

0xtylerholmes avatar aaron-alderman avatar barnabasbusa avatar db2510 avatar dependabot[bot] avatar dsystems-io avatar fredriksvantes avatar infosecual avatar joaorodrigues-consensys avatar jonaspf avatar ladidan avatar lastperson avatar lyfsn avatar mcdee avatar mksh avatar myu-unix avatar nflaig avatar oisinkyne avatar olegshmuelov avatar superphiz avatar tcrossland avatar valo avatar yorickdowne avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ethdo's Issues

Attempt to Exit Without Specifying Epoch Fails w/ Error

Attempted to exit a validator from the Onyx network using a command of the following form:

ETHDO_PASSPHRASE="XXXXXXXXXXXXXXX" ethdo validator exit --account "Wallet/Account"

Got the following error:

panic: interface conversion: interface {} is nil, not uint64

goroutine 1 [running]:
github.com/wealdtech/ethdo/cmd.validatorExitHandleAccountInput(0x139ff80, 0xc000594120, 0x10eb1fe, 0x18, 0x0)
        /home/metanull/go/pkg/mod/github.com/wealdtech/[email protected]/cmd/validatorexit.go:116 +0xe86
github.com/wealdtech/ethdo/cmd.validatorExitHandleInput(0x0, 0x0, 0x11102af)
        /home/metanull/go/pkg/mod/github.com/wealdtech/[email protected]/cmd/validatorexit.go:65 +0x375
github.com/wealdtech/ethdo/cmd.glob..func14(0x1ca2c00, 0xc00000f340, 0x0, 0x2)
        /home/metanull/go/pkg/mod/github.com/wealdtech/[email protected]/cmd/validatorexit.go:52 +0x41
github.com/spf13/cobra.(*Command).execute(0x1ca2c00, 0xc00000f320, 0x2, 0x2, 0x1ca2c00, 0xc00000f320)
        /home/metanull/go/pkg/mod/github.com/spf13/[email protected]/command.go:846 +0x29d
github.com/spf13/cobra.(*Command).ExecuteC(0x1ca1c40, 0x46293a, 0x1cb39a0, 0xc000000180)
        /home/metanull/go/pkg/mod/github.com/spf13/[email protected]/command.go:950 +0x349
github.com/spf13/cobra.(*Command).Execute(...)
        /home/metanull/go/pkg/mod/github.com/spf13/[email protected]/command.go:887
github.com/wealdtech/ethdo/cmd.Execute()
        /home/metanull/go/pkg/mod/github.com/wealdtech/[email protected]/cmd/root.go:138 +0x31
main.main()
        /home/metanull/go/pkg/mod/github.com/wealdtech/[email protected]/main.go:19 +0x20

However, after looking at the relevant ethdo code, I decided I could probably avoid the error by explicitly setting the epoch, and it worked. For example:

ETHDO_PASSPHRASE="XXXXXXXXXXXXXXX" ethdo validator exit --account "Wallet/Account" --epoch 9665

Resulted in:

Validator exit transaction sent

Exit verify failed

I tried to verify my signature generated by validator exit command with --json flag, but it failed with following output:
Failed to obtain exit data: data is not valid JSON: exit missing
It seems that the json generated doesn't match.

Offline bls to execution change workflow...

Currently, if we are offline signing and then submitting validator withdrawal credential changes, it is possible to do the entire flow with no confirmation or warning...

  • validator credentials set --offline-preparation
  • validator credentials set --offline
    will create the change-operations.json file

Then the user can post that directly to their beacon-api for submitting the changes.

It'd be nice if during --offline, a warning can be given prior to signing. Ideally its an actual prompt that can be turned off with --yes or something for script users...

The reason I think this is important, is once this operation is complete, it can't be changed again. It would help us at least ensure the user knew that it couldn't be undone before they go and submit their change and do something really permanent...

Prior to signing is the best place to put this, as once the message is signed and in the correct file format, it can be submitted directly with no other tools we control.

so I guess, the user does

validator credentials set --offline

WARNING: Updating validator credentials to an eth address is permanent and cannot be changed again once this operation completes. Are you sure that the above is correct?

I'd be very tempted to force them to type YES all in caps to proceed so they don't automatically go 'y' and ignore it...

Invalid deposit data generated when connecting to testnet prysm node

Hi Jim,

This issue may be on the Prysm side, but going to open here to start. When generating a deposit data for a validator using --connection to a prysm pyrmont node, the forkversion is set incorrectly, resulting in an invalid deposit. Using --forkversion 0x00002009 instead will generate a valid deposit.

When connecting to a Prysm node, the resulting deposit data has "fork_version": "0x00000000", instead of "fork_version": "0x00002009", which means the deposit_data_root is wrong. Full output below:

Invalid:

[{"name": "Deposit for Validator/1", "account": "Validator/1", "pubkey": "0x96add68b6c5b4f01df7271982c90a3e29e3301d6bcd669786cf64fb61d9a023c572cef3e8ff1e1d338ac8b7f71ce6534", "withdrawal_credentials": "<don't want to dox someone, let me know if its crucial>", "signature": "0x88ef1f142f06fcb57c52be8e33b052c4d0262eb0195516a72e817a02685d282763ed6d48a4948046847b7c12a82a4c1219186d5eeed688c72cf88050251848f3202df37e18ea977ab42de338ac497d26d9ffbefb79d76390792abfde966ac304", "amount": 32000000000, "deposit_data_root": "0xfcc3dda871de66f2e3f0e45334e5221a3b9846a9564b2c19811e25ec2c764492", "deposit_message_root": "0x03794b1e359947d5dd6216daed850a644cc339bbf80da49fcc3adc544ab1d447", "fork_version": "0x00000000", "version": 3}]

Valid:

[{"name": "Deposit for Validator/1", "account": "Validator/1", "pubkey": "0x96add68b6c5b4f01df7271982c90a3e29e3301d6bcd669786cf64fb61d9a023c572cef3e8ff1e1d338ac8b7f71ce6534", "withdrawal_credentials": "<don't want to dox someone, let me know if its crucial>", "signature": "0x879af46619b0a1cdb31f1d4852efbab3fa457bfc44b2324ae4e00f3296f6af479b074fa2906d9930a0cd0485784599020c408262f67e85d6316f1c0aa259cb1f6bf9f5e000d8f559ca075edd4a3814980bcdc822115a9cedc0834bdf42799d4a", "amount": 32000000000, "deposit_data_root": "0xa7070a4cd11cc9c3aabbfc13164b79722ea9de437b4c28004cd75ccfdb4476b0", "deposit_message_root": "0x03794b1e359947d5dd6216daed850a644cc339bbf80da49fcc3adc544ab1d447", "fork_version": "0x00002009", "version": 3}]

Versions:
ethdo docker 1.8.0
prysm docker v1.3.2

Extra Notes:
Generated this while Prysm is syncing to chain head, I can repeat this tomorrow when fully synced to see if I get a different result.

VEM Online generation - Issue with keystore passphrases with "$" or "!"

Running TEKU / GETH, generated Keystores using the staking deposit CLI.

Tried to generate VEM using below guide and "ONLINE only" part. Generating the offline-preparation.json on the online machine.

https://mirror.xyz/ladislaus.eth/wmoBbUBes2Wp1_6DvP6slPabkyujSU7MZOFOC3QpErs

When trying to generate the exit-preparation.json on keystores with passphrase starting with a "$", with a "$" midway and ending with a "!", keep on failing to unlock the account.

Tried to regenerate the keystore files with a simpler passphrase (without $ or !), it worked like a charm.

Command line that failed :
sudo ./ethdo validator exit --validator=/home/user/ethdo_folder/keystore_0.json --passphrase=$xxxx$xxxx! (27 characters in total) --offline

Command line that suceeded :
sudo ./ethdo validator exit --validator=/home/user/ethdo_folder/keystore_0.json --passphrase=xxxxXxxx00 (16 characters in total) --offline

Tried with a not renamed file, renamed file, with simpler passphrase both worked. Checked authorizations also.

Edit: I did few extra tests to confirm the bug and be more accurate. I generated the test keystore files using the same mnemonic for the 5 cases and the staking deposit CLI, the ONLY thing that changed was the passphrase and the withdrawal address being set up or not.

Each time the command line was:!
sudo ./ethdo validator exit --validator=/home/user/ethdo_folder/keystore_X.json --passphrase=Depends --offline

  • Case 1: With withdrawal address, simple passphrase (XxxxXxxx88) --> Worked
  • Case 2: No withdrawal address, complex passphrase that starts with a $ ($Xxxx$XxxxXxxx88!) 27 characters in total --> Failed
  • Case 3: No withdrawal address, complex passphrase that DOES NOT start with a $ (XxxxxXxxxx$88!) 14 characters in total --> Failed
  • Case 4: With withdrawal address, complex passphrase that starts with a $ ($Xxxxx$XxxxXxxx88!) 27 characters in total --> Failed
  • Case 5: With withdawal address, complex passphrase that DOES NOT start with a $, 14 characters in total --> Failed

Definitely something wrong with passphrases containing either a $ or a !.

Issue with using Windows ENV variables

C:\Users\chase>ethdo version
1.4.21

In this image you can see I have configured ETHDO_ variables for BASEDIR, STORE, and STOREPASSPHRASE (I know STORE defaults to filesystem, I added it as a test, because it doesn't work either way)

image

Here you can see that if I manually add the same parameters, it works fine, but it isn't reading from the ENV variables, even though they are set...

image

I THINK this was working before / on older versions, I had this configured before, I think...I'm not sure what changed...I could just be doing something totally wrong...?

Separation of keys between testnets

I've said it before, but I like to start first issues with a thanks to the developers. So, thanks for creating this project and starting the effort to standardize wallets.

Something I've been considering is separating keys between testnets. For example, Geth maintains a separate goerli/keystore dir so you don't mix up mainnet and testnet keys. I've found this to be generally pretty useful.

Whilst I haven't done anything on the Lighthouse side to achieve this, it's one of those lingering todos. I'm interested to hear your thoughts on if segregation of testnets is necessary and how we might go about it.

Error when generating a raw deposit transactions

I am getting fatal SIGTRAP error when I try to generate the deposit transaction. Steps to reproduce:

docker run -it -v /data:/root/.config valo/ethdo wallet create --wallet=Validators --type="hd" --walletpassphrase=12345 --seed="alien chef acid jealous essay save blast giant west vehicle gospel source exhaust pluck choose mind swamp moral duty kit denial stay danger antenna"
docker run -it -v /data:/root/.config valo/ethdo account create --account=Validators/1 --walletpassphrase=12345 --passphrase=validator12345
docker run -it -v /data:/root/.config valo/ethdo wallet create --wallet=Withdraw --type="hd" --walletpassphrase=12345 --seed="mosquito alarm pig lumber spend eager click acoustic find they universe donor economy equal woman misery dress night sorry scorpion uncover logic coin express"
docker run -it -v /data:/root/.config valo/ethdo account create --account=Withdraw/Primary --walletpassphrase=12345 --passphrase=withdraw12345
docker run -it -v /data:/root/.config valo/ethdo validator depositdata --validatoraccount=Validators/1 --withdrawalaccount=Withdraw/Primary --depositvalue=32Ether --passphrase=validator12345

I get the following error:

fatal: morestack on g0
SIGTRAP: trace trap
PC=0x482cb2 m=3 sigcode=128

goroutine 0 [idle]:
runtime.abort()
	/usr/local/go/src/runtime/asm_amd64.s:859 +0x2
runtime.morestack()
	/usr/local/go/src/runtime/asm_amd64.s:416 +0x25

goroutine 1 [syscall]:
runtime.cgocall(0xdf1df0, 0xc0006494f0, 0xc0000391c0)
	/usr/local/go/src/runtime/cgocall.go:133 +0x5b fp=0xc0006494c0 sp=0xc000649488 pc=0x42430b
github.com/herumi/bls-eth-go-binary/bls._Cfunc_blsSignHash(0xc000654000, 0xc000038fc0, 0xc0000391c0, 0x20, 0x0)
	_cgo_gotypes.go:836 +0x4d fp=0xc0006494f0 sp=0xc0006494c0 pc=0x6403ed
github.com/herumi/bls-eth-go-binary/bls.(*SecretKey).SignHash.func1(0xc000649590, 0xc000038fc0, 0xc000649578, 0xc000649580)
	/go/pkg/mod/github.com/herumi/[email protected]/bls/bls.go:641 +0xbf fp=0xc000649540 sp=0xc0006494f0 pc=0x645c9f
github.com/herumi/bls-eth-go-binary/bls.(*SecretKey).SignHash(0xc000038fc0, 0xc0000391c0, 0x20, 0x20, 0xc000654000)
	/go/pkg/mod/github.com/herumi/[email protected]/bls/bls.go:641 +0x62 fp=0xc000649570 sp=0xc000649540 pc=0x6440b2
github.com/wealdtech/go-eth2-types/v2.(*BLSPrivateKey).Sign(0xc000038fc0, 0xc0000391c0, 0x20, 0x20, 0x180, 0xc0000362d0)
	/go/pkg/mod/github.com/wealdtech/go-eth2-types/[email protected]/blsprivatekey.go:58 +0x4f fp=0xc0006495b0 sp=0xc000649570 pc=0x6720bf
github.com/wealdtech/go-eth2-wallet-hd/v2.(*account).Sign(0xc0006af8c0, 0xc0000391c0, 0x20, 0x20, 0x0, 0x0, 0x0, 0x0)
	/go/pkg/mod/github.com/wealdtech/go-eth2-wallet-hd/[email protected]/account.go:227 +0x153 fp=0xc000649610 sp=0xc0006495b0 pc=0xdcb0a3
github.com/wealdtech/ethdo/cmd.sign(0x13811e0, 0xc0006af8c0, 0xc0000391c0, 0x20, 0x20, 0xc000036280, 0x4e, 0x0, 0x1a69740)
	/app/cmd/root.go:412 +0x160 fp=0xc0006496a0 sp=0xc000649610 pc=0xddfb00
github.com/wealdtech/ethdo/cmd.signRoot(0x13811e0, 0xc0006af8c0, 0xc3a0c022bb542389, 0xf3f4ff25c084fa0a, 0xb2c338893966704, 0x778106094e2c6fa9, 0xc0000388a0, 0x20, 0x20, 0x38, ...)
	/app/cmd/root.go:402 +0x2fb fp=0xc000649788 sp=0xc0006496a0 pc=0xddf7fb
github.com/wealdtech/ethdo/cmd.signStruct(0x13811e0, 0xc0006af8c0, 0xff4920, 0xc0000348c0, 0xc0000388a0, 0x20, 0x20, 0xc0000388a0, 0x20, 0x20, ...)
	/app/cmd/root.go:380 +0x1dc fp=0xc000649870 sp=0xc000649788 pc=0xddf43c
github.com/wealdtech/ethdo/cmd.glob..func13(0x1a77c40, 0xc00007ea00, 0x0, 0x5)
	/app/cmd/validatordepositdata.go:95 +0xb5a fp=0xc000649d68 sp=0xc000649870 pc=0xdeb81a
github.com/spf13/cobra.(*Command).execute(0x1a77c40, 0xc00007e9b0, 0x5, 0x5, 0x1a77c40, 0xc00007e9b0)
	/go/pkg/mod/github.com/spf13/[email protected]/command.go:846 +0x29d fp=0xc000649e40 sp=0xc000649d68 pc=0x5f388d
github.com/spf13/cobra.(*Command).ExecuteC(0x1a76f20, 0x4631ea, 0x1a88840, 0xc000000180)
	/go/pkg/mod/github.com/spf13/[email protected]/command.go:950 +0x349 fp=0xc000649f18 sp=0xc000649e40 pc=0x5f4569
github.com/spf13/cobra.(*Command).Execute(...)
	/go/pkg/mod/github.com/spf13/[email protected]/command.go:887
github.com/wealdtech/ethdo/cmd.Execute()
	/app/cmd/root.go:157 +0x31 fp=0xc000649f78 sp=0xc000649f18 pc=0xddcaf1
main.main()
	/app/main.go:19 +0x20 fp=0xc000649f88 sp=0xc000649f78 pc=0xdf12d0
runtime.main()
	/usr/local/go/src/runtime/proc.go:203 +0x212 fp=0xc000649fe0 sp=0xc000649f88 pc=0x456882
runtime.goexit()
	/usr/local/go/src/runtime/asm_amd64.s:1373 +0x1 fp=0xc000649fe8 sp=0xc000649fe0 pc=0x4833a1

goroutine 6 [select]:
github.com/dgraph-io/ristretto.(*defaultPolicy).processItems(0xc00010a6f0)
	/go/pkg/mod/github.com/dgraph-io/[email protected]/policy.go:96 +0xbe
created by github.com/dgraph-io/ristretto.newDefaultPolicy
	/go/pkg/mod/github.com/dgraph-io/[email protected]/policy.go:80 +0x129

goroutine 7 [select]:
github.com/dgraph-io/ristretto.(*Cache).processItems(0xc000074300)
	/go/pkg/mod/github.com/dgraph-io/[email protected]/cache.go:299 +0xed
created by github.com/dgraph-io/ristretto.NewCache
	/go/pkg/mod/github.com/dgraph-io/[email protected]/cache.go:162 +0x22a

goroutine 8 [select]:
github.com/dgraph-io/ristretto.(*defaultPolicy).processItems(0xc0001a4810)
	/go/pkg/mod/github.com/dgraph-io/[email protected]/policy.go:96 +0xbe
created by github.com/dgraph-io/ristretto.newDefaultPolicy
	/go/pkg/mod/github.com/dgraph-io/[email protected]/policy.go:80 +0x129

goroutine 9 [select]:
github.com/dgraph-io/ristretto.(*Cache).processItems(0xc000074480)
	/go/pkg/mod/github.com/dgraph-io/[email protected]/cache.go:299 +0xed
created by github.com/dgraph-io/ristretto.NewCache
	/go/pkg/mod/github.com/dgraph-io/[email protected]/cache.go:162 +0x22a

goroutine 10 [select]:
github.com/dgraph-io/ristretto.(*defaultPolicy).processItems(0xc0001ea930)
	/go/pkg/mod/github.com/dgraph-io/[email protected]/policy.go:96 +0xbe
created by github.com/dgraph-io/ristretto.newDefaultPolicy
	/go/pkg/mod/github.com/dgraph-io/[email protected]/policy.go:80 +0x129

goroutine 11 [select]:
github.com/dgraph-io/ristretto.(*Cache).processItems(0xc000074600)
	/go/pkg/mod/github.com/dgraph-io/[email protected]/cache.go:299 +0xed
created by github.com/dgraph-io/ristretto.NewCache
	/go/pkg/mod/github.com/dgraph-io/[email protected]/cache.go:162 +0x22a

rax    0x17
rbx    0xc00004e700
rcx    0x484e65
rdx    0x17
rdi    0x2
rsi    0x10d5a96
rbp    0x7f6701e34820
rsp    0x7f6701e31d90
r8     0x6c3125fc13e165d8
r9     0xd1d20fdf4ac0212c
r10    0xe7176e6ec60b0ac2
r11    0x212
r12    0x7f6701e35120
r13    0x7f6701e33620
r14    0x7f6701e34820
r15    0x7f6701e57868
rip    0x482cb2
rflags 0x216
cs     0x33
fs     0x0
gs     0x0

The error seems to happen from time to time, which is really weird. I am not sure how to isolate it even more.

BLS withdrawal derivation key "search" constraint

Based on the docs, if a staker wants to migrate all of the validators to one unified EL ETH address, the docs outline that ethdo will search for all used keys based on the 24 seed phrase. Out of curiosity, how far (e.g. how many derivations) will ethdo try before it determines there are no more? 10? 100? 1000? more? thx.

--generate flag in help for exit doesn't work

I tried to generate the hex data for an exit using the "--generate" flag mentioned when I rant ethdo -h, but instead of getting hex data, ethdo sent the transaction. Oops.

Help text:

metanull@beacon01:~/scripts$ ethdo validator exit -h
Send an exit request for a validator.  For example:

    ethdo validator exit --account=primary/validator --passphrase=secret

In quiet mode this will return 0 if the transaction has been generated, otherwise 1.

Usage:
  ethdo validator exit [flags]

Flags:
      --epoch int     Epoch at which to exit (defaults to current epoch) (default -1)
      --generate      Do not send the transaction; generate and output as a hex string only
  -h, --help          help for exit
      --json string   Use JSON as created by --json-output to exit
      --json-output   Print JSON transaction; do not broadcast to network
      --key string    Private key if account not known by ethdo
      --wait          wait for the transaction to be mined before returning

Global Flags:
      --account string            Account name (in format "wallet/account")
      --basedir string            Base directory for filesystem wallets
      --client-cert string        location of a client certificate file when connecting to the remote wallet daemon
      --client-key string         location of a client key file when connecting to the remote wallet daemon
      --config string             config file (default is $HOME/.ethdo.yaml)
      --connection string         connection to Ethereum 2 node via GRPC (default "localhost:4000")
      --debug                     generate debug output
      --log string                log activity to the named file (default $HOME/ethdo.log).  Logs are written for every action that generates a transaction
      --passphrase string         Passphrase for account (if applicable)
      --quiet                     do not generate any output
      --remote string             connection to a remote wallet daemon
      --server-ca-cert string     location of the server certificate authority certificate when connecting to the remote wallet daemon
      --store string              Store for accounts (default "filesystem")
      --storepassphrase string    Passphrase for store (if applicable)
      --timeout duration          the time after which a network request will be considered failed.  Increase this if you are running on an error-prone, high-latency or low-bandwidth connection (default 10s)
      --verbose                   generate additional output where appropriate
      --walletpassphrase string   Passphrase for wallet (if applicable)

Command I ran:

ETHDO_PASSPHRASE="XXXXXXXXXX" ethdo validator exit --generate --account="Validator Wallet/Validator Account 01"

Looking at the code for ethdo, I see a reference to the --generate flag, but I couldn't find its usage in the code.

Not able to build for Linux 32 bits

Hi,
I need to run ethdo on a 32bits Linux machine (an air gapped PC).
There's no 32bits binary release.
I tried to build one from source.
But then I have the following errors on bls-eth-go-binary:

$ GOOS=linux GOARCH=386 go build -o ethdo-linux-32 main.go
go: downloading github.com/wealdtech/go-string2eth v1.1.0
go: downloading github.com/pkg/errors v0.9.1
go: downloading github.com/wealdtech/go-eth2-wallet-types/v2 v2.8.2
go: downloading github.com/spf13/viper v1.7.1
go: downloading github.com/spf13/pflag v1.0.5
go: downloading github.com/mitchellh/go-homedir v1.1.0
go: downloading github.com/wealdtech/go-eth2-util v1.6.3
go: downloading golang.org/x/text v0.3.5
go: downloading github.com/google/uuid v1.2.0
go: downloading github.com/attestantio/go-eth2-client v0.6.21
go: downloading github.com/rs/zerolog v1.20.0
go: downloading github.com/tyler-smith/go-bip39 v1.1.0
go: downloading github.com/herumi/bls-eth-go-binary v0.0.0-20210130185500-57372fb27371
go: downloading github.com/wealdtech/go-eth2-wallet-dirk v1.1.5
go: downloading github.com/magiconair/properties v1.8.4
go: downloading github.com/mitchellh/mapstructure v1.4.1
go: downloading github.com/ferranbt/fastssz v0.0.0-20210120143747-11b9eff30ea9
go: downloading github.com/prysmaticlabs/go-bitfield v0.0.0-20210129193852-0db57134419f
go: downloading golang.org/x/crypto v0.0.0-20201221181555-eec23a3978ad
go: downloading gopkg.in/ini.v1 v1.62.0
go: downloading github.com/wealdtech/go-eth2-wallet-distributed v1.1.3
go: downloading github.com/spf13/cast v1.3.1
go: downloading github.com/subosito/gotenv v1.2.0
go: downloading github.com/hashicorp/hcl v1.0.0
go: downloading github.com/jackc/puddle v1.1.3
go: downloading github.com/nbutton23/zxcvbn-go v0.0.0-20201221231540-e56b841a3c88
go: downloading github.com/pelletier/go-toml v1.8.1
go: downloading github.com/wealdtech/go-eth2-wallet-encryptor-keystorev4 v1.1.3
go: downloading github.com/wealdtech/go-bytesutil v1.1.1
go: downloading github.com/wealdtech/go-eth2-wallet-store-filesystem v1.16.14
go: downloading github.com/spf13/cobra v1.1.1
go: downloading github.com/wealdtech/go-indexer v1.0.0
go: downloading github.com/spf13/jwalterweatherman v1.1.0
go: downloading github.com/wealdtech/go-eth2-wallet-hd/v2 v2.5.4
go: downloading github.com/gofrs/uuid v4.0.0+incompatible
go: downloading github.com/wealdtech/go-eth2-wallet-nd/v2 v2.3.3
go: downloading google.golang.org/grpc v1.35.0
go: downloading github.com/prysmaticlabs/go-ssz v0.0.0-20210121151755-f6208871c388
go: downloading github.com/r3labs/sse/v2 v2.3.0
go: downloading github.com/shibukawa/configdir v0.0.0-20170330084843-e180dbdc8da0
go: downloading github.com/spf13/afero v1.5.1
go: downloading gopkg.in/yaml.v2 v2.4.0
go: downloading github.com/wealdtech/go-eth2-wallet v1.14.4
go: downloading gopkg.in/cenkalti/backoff.v1 v1.1.0
go: downloading github.com/wealdtech/eth2-signer-api v1.6.0
go: downloading github.com/minio/sha256-simd v0.1.1
go: downloading github.com/minio/highwayhash v1.0.1
go: downloading golang.org/x/net v0.0.0-20210119194325-5f4716e94777
go: downloading github.com/wealdtech/go-eth2-wallet-store-s3 v1.9.4
go: downloading github.com/protolambda/zssz v0.1.5
go: downloading github.com/goccy/go-yaml v1.8.6
go: downloading github.com/fsnotify/fsnotify v1.4.9
go: downloading github.com/gogo/protobuf v1.3.2
go: downloading github.com/dgraph-io/ristretto v0.0.3
go: downloading github.com/golang/protobuf v1.4.3
go: downloading github.com/prysmaticlabs/ethereumapis v0.0.0-20210201130911-92b2a467c108
go: downloading google.golang.org/genproto v0.0.0-20210201184850-646a494a81ea
go: downloading golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c
go: downloading github.com/aws/aws-sdk-go v1.37.1
go: downloading github.com/grpc-ecosystem/grpc-gateway v1.16.0
go: downloading google.golang.org/protobuf v1.25.0
go: downloading github.com/fatih/color v1.10.0
go: downloading github.com/wealdtech/go-ecodec v1.1.1
go: downloading github.com/wealdtech/go-eth2-types/v2 v2.5.2
go: downloading github.com/cespare/xxhash v1.1.0
go: downloading github.com/mattn/go-colorable v0.1.8
go: downloading golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1
go: downloading github.com/mattn/go-isatty v0.0.12
go: downloading github.com/jmespath/go-jmespath v0.4.0
# github.com/herumi/bls-eth-go-binary/bls
../go/pkg/mod/github.com/herumi/[email protected]/bls/cast.go:9:28: undefined: SecretKey
../go/pkg/mod/github.com/herumi/[email protected]/bls/cast.go:9:40: undefined: Fr
../go/pkg/mod/github.com/herumi/[email protected]/bls/cast.go:13:26: undefined: Fr
../go/pkg/mod/github.com/herumi/[email protected]/bls/cast.go:13:31: undefined: SecretKey
../go/pkg/mod/github.com/herumi/[email protected]/bls/cast.go:19:28: undefined: PublicKey
../go/pkg/mod/github.com/herumi/[email protected]/bls/cast.go:19:40: undefined: G1
../go/pkg/mod/github.com/herumi/[email protected]/bls/cast.go:23:26: undefined: G1
../go/pkg/mod/github.com/herumi/[email protected]/bls/cast.go:23:31: undefined: PublicKey
../go/pkg/mod/github.com/herumi/[email protected]/bls/cast.go:29:23: undefined: Sign
../go/pkg/mod/github.com/herumi/[email protected]/bls/cast.go:29:30: undefined: G2
../go/pkg/mod/github.com/herumi/[email protected]/bls/cast.go:29:30: too many errors
# github.com/attestantio/go-eth2-client/spec/phase0
../go/pkg/mod/github.com/attestantio/[email protected]/spec/phase0/beaconstate_encoding.go:189:23: constant 1099511627776 overflows int
../go/pkg/mod/github.com/attestantio/[email protected]/spec/phase0/beaconstate_encoding.go:200:21: constant 1099511627776 overflows int
../go/pkg/mod/github.com/attestantio/[email protected]/spec/phase0/beaconstate_encoding.go:424:45: constant 1099511627776 overflows int
../go/pkg/mod/github.com/attestantio/[email protected]/spec/phase0/beaconstate_encoding.go:442:43: constant 1099511627776 overflows int
../go/pkg/mod/github.com/attestantio/[email protected]/spec/phase0/beaconstate_encoding.go:652:22: constant 1099511627776 overflows int

Is it possible to build for 32bits? If it is, how?
Thanks.

`Failed to unknown validator` error on `ethdo validator exit`

I am trying to import a validator key keystore and generate an exit message for it:

./ethdo wallet create --base-dir=/data/wallet --type=hd --wallet=withdrawal-validator --mnemonic="XXXXX" --wallet-passphrase="XXXXXX"
./ethdo account create --base-dir=/data/wallet --account=withdrawal-validator/0 --wallet-passphrase="XXXXX" --passphrase="XXXXX" --path="m/12381/3600/0/0/0"
./ethdo validator exit --connection=127.0.0.1:3500 --base-dir=/data/wallet --json --account=withdrawal-validator/0 --passphrase="XXXXX"

But this results in an error:

Error: failed to process: failed to obtain validators: failed to request validators: failed to call GET endpoint: Get "http://127.0.0.1:3500/eth/v1/beacon/states/head/validators": context deadline exceeded

Am I doing something wrong?

Complete log:

Increasing timeout to 2m0s
Failed to read offline preparation file: stat offline-preparation.json: no such file or directory
Populating chain info from beacon node
Genesis validators root obtained from chain info
Using genesis validators root 0x043db0d9a83813551ee2f33450d23797757d430911a9320530ad8a0eabc43efb
Fork version obtained from chain info
Using fork version 0x03001020
Domain is 0x04000000628941ef21d1fe8c7134720add10bb91e3b02c007e0046d2472c6695
Error: failed to process: unknown validator

I'm on latest ethdo version:

> ./ethdo version
1.28.4

The document I refer to is https://notes.ethereum.org/@launchpad/withdrawals-guide

Can't unlock keystore without a passphrase

My keystore has an empty passphrase and using the command below fails:

./ethdo account import --account=Validators/1 --keystore=/Users/usr/validator_keys/keystore.json --keystore-passphrase=""

Error:
Error: failed to obtain input: failed to obtain wallet: wallet not found

Stuck on "BLS credentials" after broadcasting change

OS: Windows
Client: Prysm v3.2.1
Geth: 1.11.1-stable
ethdo: 1.28.1

I configured my Pyrsm client with the --grpc-max-msg-size 268435456 and followed all the steps for an offline change. Everything executed successfully. When I run

X:\ethdo>ethdo validator credentials get --validator=XXXX
BLS credentials: 0x00...

It's been like this for about 7-8 hours. The documentation reads:

"If the result starts with the phrase "BLS credentials" then it may be that the operation has yet to be incorporated on the chain, please wait a few minutes and check again. If this continues to be the case please obtain help to understand why the change operation failed to work."

However there are no details beyond that and nothing in the troubleshooting section. Not sure what happened or if I should wait longer.

`Failed to unlock account` error on `ethdo validator exit`

I am trying to import a validator key keystore and generate an exit message for it:

./ethdo wallet create --wallet=wallet
./ethdo account import --account=wallet/account --keystore=keystore.json --keystore-passphrase=12345678 --passphrase=pass --allow-weak-passphrases
./ethdo validator exit --validator=wallet/account --passphrase=pass --connection="https://RPC" --json --verbose --debug

But this results in an error:

Error: failed to process: failed to unlock account

Am I doing something wrong?

Complete log:

Increasing timeout to 2m0s
Failed to read offline preparation file: stat offline-preparation.json: no such file or directory
Populating chain info from beacon node
Genesis validators root obtained from chain info
Using genesis validators root 0x043db0d9a83813551ee2f33450d23797757d430911a9320530ad8a0eabc43efb
Fork version obtained from chain info
Using fork version 0x02001020
Domain is 0x04000000c2ce3aa85707d491e3dd033a53971deb9bed9d4813d74c99369642f5
Error: failed to process: failed to unlock account

I'm on latest ethdo version:

> ./ethdo version  
1.28.0

It also appears that in docs:

$ ethdo validator exit --account=Validators/1 --passphrase="my validator secret"

Should be:

$ ethdo validator exit --validator=Validators/1 --passphrase="my validator secret"

Panic when "ethdo chain status"

Ran the command ethdo --connection=localhost:4000 chain status which resulted in a dump.
It says: "missing method finality"

On the other hand ethdo --connection=localhost:4000 chain info works correctly.
The beacon behind this is Prysm setup as nocturne

2021-05-13_12-45-40

Cannot `go get`

When I try to run go get

# github.com/wealdtech/go-eth2-wallet-nd
..\..\..\go\src\github.com\wealdtech\go-eth2-wallet-nd\account.go:228:20: impossible type assertion:
        *wallet does not implement "github.com/wealdtech/go-eth2-wallet-types".Wallet (wrong type for Accounts method)
                have Accounts() <-chan "github.com/wealdtech/go-eth2-wallet-types".Account
                want Accounts(context.Context) <-chan "github.com/wealdtech/go-eth2-wallet-types".Account
..\..\..\go\src\github.com\wealdtech\go-eth2-wallet-nd\account.go:231:20: impossible type assertion:
        *wallet does not implement "github.com/wealdtech/go-eth2-wallet-types".Wallet (wrong type for Accounts method)
                have Accounts() <-chan "github.com/wealdtech/go-eth2-wallet-types".Account
                want Accounts(context.Context) <-chan "github.com/wealdtech/go-eth2-wallet-types".Account
..\..\..\go\src\github.com\wealdtech\go-eth2-wallet-nd\account.go:240:11: cannot use w (type *wallet) as type "github.com/wealdtech/go-eth2-wallet-types".Wallet in assignment:
        *wallet does not implement "github.com/wealdtech/go-eth2-wallet-types".Wallet (wrong type for Accounts method)
                have Accounts() <-chan "github.com/wealdtech/go-eth2-wallet-types".Account
                want Accounts(context.Context) <-chan "github.com/wealdtech/go-eth2-wallet-types".Account
..\..\..\go\src\github.com\wealdtech\go-eth2-wallet-nd\wallet.go:151:2: cannot use w (type *wallet) as type "github.com/wealdtech/go-eth2-wallet-types".Wallet in return argument:
        *wallet does not implement "github.com/wealdtech/go-eth2-wallet-types".Wallet (wrong type for Accounts method)
                have Accounts() <-chan "github.com/wealdtech/go-eth2-wallet-types".Account
                want Accounts(context.Context) <-chan "github.com/wealdtech/go-eth2-wallet-types".Account
..\..\..\go\src\github.com\wealdtech\go-eth2-wallet-nd\wallet.go:175:2: cannot use wallet (type *wallet) as type "github.com/wealdtech/go-eth2-wallet-types".Wallet in return argument:
        *wallet does not implement "github.com/wealdtech/go-eth2-wallet-types".Wallet (wrong type for Accounts method)
                have Accounts() <-chan "github.com/wealdtech/go-eth2-wallet-types".Account
                want Accounts(context.Context) <-chan "github.com/wealdtech/go-eth2-wallet-types".Account
..\..\..\go\src\github.com\wealdtech\go-eth2-wallet-nd\wallet.go:268:11: cannot use w (type *wallet) as type "github.com/wealdtech/go-eth2-wallet-types".Wallet in assignment:
        *wallet does not implement "github.com/wealdtech/go-eth2-wallet-types".Wallet (wrong type for Accounts method)
                have Accounts() <-chan "github.com/wealdtech/go-eth2-wallet-types".Account
                want Accounts(context.Context) <-chan "github.com/wealdtech/go-eth2-wallet-types".Account
..\..\..\go\src\github.com\wealdtech\go-eth2-wallet-nd\wallet.go:317:11: cannot use w (type *wallet) as type "github.com/wealdtech/go-eth2-wallet-types".Wallet in assignment:
        *wallet does not implement "github.com/wealdtech/go-eth2-wallet-types".Wallet (wrong type for Accounts method)
                have Accounts() <-chan "github.com/wealdtech/go-eth2-wallet-types".Account
                want Accounts(context.Context) <-chan "github.com/wealdtech/go-eth2-wallet-types".Account
..\..\..\go\src\github.com\wealdtech\go-eth2-wallet-nd\wallet.go:397:14: cannot use ext.Wallet (type *wallet) as type "github.com/wealdtech/go-eth2-wallet-types".Wallet in assignment:
        *wallet does not implement "github.com/wealdtech/go-eth2-wallet-types".Wallet (wrong type for Accounts method)
                have Accounts() <-chan "github.com/wealdtech/go-eth2-wallet-types".Account
                want Accounts(context.Context) <-chan "github.com/wealdtech/go-eth2-wallet-types".Account
..\..\..\go\src\github.com\wealdtech\go-eth2-wallet-nd\wallet.go:406:12: cannot use ext.Wallet (type *wallet) as type "github.com/wealdtech/go-eth2-wallet-types".Wallet in return argument:
        *wallet does not implement "github.com/wealdtech/go-eth2-wallet-types".Wallet (wrong type for Accounts method)
                have Accounts() <-chan "github.com/wealdtech/go-eth2-wallet-types".Account
                want Accounts(context.Context) <-chan "github.com/wealdtech/go-eth2-wallet-types".Account
# github.com/wealdtech/go-eth2-wallet-hd
..\..\..\go\src\github.com\wealdtech\go-eth2-wallet-hd\account.go:238:20: impossible type assertion:
        *wallet does not implement "github.com/wealdtech/go-eth2-wallet-types".Wallet (wrong type for Accounts method)
                have Accounts() <-chan "github.com/wealdtech/go-eth2-wallet-types".Account
                want Accounts(context.Context) <-chan "github.com/wealdtech/go-eth2-wallet-types".Account
..\..\..\go\src\github.com\wealdtech\go-eth2-wallet-hd\account.go:241:20: impossible type assertion:
        *wallet does not implement "github.com/wealdtech/go-eth2-wallet-types".Wallet (wrong type for Accounts method)
                have Accounts() <-chan "github.com/wealdtech/go-eth2-wallet-types".Account
                want Accounts(context.Context) <-chan "github.com/wealdtech/go-eth2-wallet-types".Account
..\..\..\go\src\github.com\wealdtech\go-eth2-wallet-hd\account.go:250:11: cannot use w (type *wallet) as type "github.com/wealdtech/go-eth2-wallet-types".Wallet in assignment:
        *wallet does not implement "github.com/wealdtech/go-eth2-wallet-types".Wallet (wrong type for Accounts method)
                have Accounts() <-chan "github.com/wealdtech/go-eth2-wallet-types".Account
                want Accounts(context.Context) <-chan "github.com/wealdtech/go-eth2-wallet-types".Account
..\..\..\go\src\github.com\wealdtech\go-eth2-wallet-hd\wallet.go:183:2: cannot use w (type *wallet) as type "github.com/wealdtech/go-eth2-wallet-types".Wallet in return argument:
        *wallet does not implement "github.com/wealdtech/go-eth2-wallet-types".Wallet (wrong type for Accounts method)
                have Accounts() <-chan "github.com/wealdtech/go-eth2-wallet-types".Account
                want Accounts(context.Context) <-chan "github.com/wealdtech/go-eth2-wallet-types".Account
..\..\..\go\src\github.com\wealdtech\go-eth2-wallet-hd\wallet.go:220:2: cannot use w (type *wallet) as type "github.com/wealdtech/go-eth2-wallet-types".Wallet in return argument:
        *wallet does not implement "github.com/wealdtech/go-eth2-wallet-types".Wallet (wrong type for Accounts method)
                have Accounts() <-chan "github.com/wealdtech/go-eth2-wallet-types".Account
                want Accounts(context.Context) <-chan "github.com/wealdtech/go-eth2-wallet-types".Account
..\..\..\go\src\github.com\wealdtech\go-eth2-wallet-hd\wallet.go:244:2: cannot use wallet (type *wallet) as type "github.com/wealdtech/go-eth2-wallet-types".Wallet in return argument:
        *wallet does not implement "github.com/wealdtech/go-eth2-wallet-types".Wallet (wrong type for Accounts method)
                have Accounts() <-chan "github.com/wealdtech/go-eth2-wallet-types".Account
                want Accounts(context.Context) <-chan "github.com/wealdtech/go-eth2-wallet-types".Account
..\..\..\go\src\github.com\wealdtech\go-eth2-wallet-hd\wallet.go:358:11: cannot use w (type *wallet) as type "github.com/wealdtech/go-eth2-wallet-types".Wallet in assignment:
        *wallet does not implement "github.com/wealdtech/go-eth2-wallet-types".Wallet (wrong type for Accounts method)
                have Accounts() <-chan "github.com/wealdtech/go-eth2-wallet-types".Account
                want Accounts(context.Context) <-chan "github.com/wealdtech/go-eth2-wallet-types".Account
..\..\..\go\src\github.com\wealdtech\go-eth2-wallet-hd\wallet.go:450:14: cannot use ext.Wallet (type *wallet) as type "github.com/wealdtech/go-eth2-wallet-types".Wallet in assignment:
        *wallet does not implement "github.com/wealdtech/go-eth2-wallet-types".Wallet (wrong type for Accounts method)
                have Accounts() <-chan "github.com/wealdtech/go-eth2-wallet-types".Account
                want Accounts(context.Context) <-chan "github.com/wealdtech/go-eth2-wallet-types".Account
..\..\..\go\src\github.com\wealdtech\go-eth2-wallet-hd\wallet.go:459:12: cannot use ext.Wallet (type *wallet) as type "github.com/wealdtech/go-eth2-wallet-types".Wallet in return argument:
        *wallet does not implement "github.com/wealdtech/go-eth2-wallet-types".Wallet (wrong type for Accounts method)
                have Accounts() <-chan "github.com/wealdtech/go-eth2-wallet-types".Account
                want Accounts(context.Context) <-chan "github.com/wealdtech/go-eth2-wallet-types".Account
..\..\..\go\src\github.com\wealdtech\go-eth2-wallet-hd\wallet.go:513:11: cannot use w (type *wallet) as type "github.com/wealdtech/go-eth2-wallet-types".Wallet in assignment:
        *wallet does not implement "github.com/wealdtech/go-eth2-wallet-types".Wallet (wrong type for Accounts method)
                have Accounts() <-chan "github.com/wealdtech/go-eth2-wallet-types".Account
                want Accounts(context.Context) <-chan "github.com/wealdtech/go-eth2-wallet-types".Account
..\..\..\go\src\github.com\wealdtech\go-eth2-wallet-hd\wallet.go:513:11: too many errors

panic: runtime error: invalid memory address or nil pointer dereference

Command line

./ethdo validator credentials set --offline \
--mnemonic="indoor dish desk flag debris potato excuse depart ticket judge file exit" \
--withdrawal-address=0x95222290DD7278Aa3Ddd389Cc1E1d165CC4BAfe5 \
--debug --verbose

The offline-preparation.json file is valid and exists in the current directory. It's too large (contains all validators on the network) to attach.

The Panic

offline-preparation.json found; loading chain state
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x30 pc=0xdabbf5]

goroutine 1 [running]:
github.com/wealdtech/ethdo/cmd/validator/credentials/set.(*command).generateOperations(0xc00040cea0, {0x1396fb0, 0xc00013e000})
	/go/src/github.com/wealdtech/ethdo/cmd/validator/credentials/set/process.go:220 +0x35
github.com/wealdtech/ethdo/cmd/validator/credentials/set.(*command).process(0xc00040cea0, {0x1396fb0, 0xc00013e000})
	/go/src/github.com/wealdtech/ethdo/cmd/validator/credentials/set/process.go:58 +0x75
github.com/wealdtech/ethdo/cmd/validator/credentials/set.Run(0x1a75da0)
	/go/src/github.com/wealdtech/ethdo/cmd/validator/credentials/set/run.go:36 +0x65
github.com/wealdtech/ethdo/cmd.glob..func31(0x1a75da0, {0x1063fce, 0x5, 0x5})
	/go/src/github.com/wealdtech/ethdo/cmd/validatorcredentialsset.go:40 +0x1d
github.com/spf13/cobra.(*Command).execute(0x1a75da0, {0xc000148820, 0x5, 0x5})
	/go/pkg/mod/github.com/spf13/[email protected]/command.go:856 +0x60e
github.com/spf13/cobra.(*Command).ExecuteC(0x1a794a0)
	/go/pkg/mod/github.com/spf13/[email protected]/command.go:974 +0x3bc
github.com/spf13/cobra.(*Command).Execute(...)
	/go/pkg/mod/github.com/spf13/[email protected]/command.go:902
github.com/wealdtech/ethdo/cmd.Execute()
	/go/src/github.com/wealdtech/ethdo/cmd/root.go:155 +0x25
main.main()
	/go/src/github.com/wealdtech/ethdo/main.go:19 +0x17

OS

Ubuntu official docker image.

Wallet not found after wallet create

After creating a wallet it doesn't seem to find it.

I'm running the following command and get the mnemonic in the output as expected.

docker run wealdtech/ethdo wallet create --wallet=“Wallet” --type=hd --wallet-passphrase=secret

However, when I then run wallet list it doesn't show anything, and for wallet info --wallet"Wallet" it returns unknown wallet: wallet not found

Somehow it fails to store the wallet locally. Creating works, but then it doesn't seem to find it anymore.

Problem with custom connection string

ethdo version 1.26.3
when using a connection flag such as "ethdo --connection=http://localhost:5053 node info --verbose"
I receive the following error: "Failed to obtain beacon chain configuration: rpc error: code = Unavailable desc = connection error: desc = "transport: Error while dialing dial tcp: address http://localhost:5053: too many colons in address"

It appears to be adding an extra colon on the end of option string but I could not find any work around

Invalid deposit data with distributed accounts

I've created a set of distributed accounts via

ethdo account create --remote=localhost-1:8881 --server-ca-cert ${HOME}/dirk-multi/1/security/ca.crt --client-cert ${HOME}/dirk-multi/client1.crt --client-key ${HOME}/dirk-multi/client1.key --account=DistributedWallet/1 --signing-threshold=2 --participants=3 --forkversion 00001020

and wanted upload the deposit data to the Prater testnet's deposit contract, which is why I included the fork version as per eth2-testnets. What I've got looks something like this:

...
{
        "pubkey":"b1f6a0b67dd45d202c7fa59015031128555d60553e6266f737684bf7b88bf35cea8972c939ce0f81d9ef5afe965cc211",
        "withdrawal_credentials":"[...]",
        "amount":32000000000,
        "signature":"8009c2aeb1f9257930c645f82ff0f4f26743c2850479dfcd06f4868749ca8cdf24deb7ebc2a9ce0eddbc293288f9eddb025db26051f46ddc0f6deedc3d2be68fced6543eb799ec39e42bc21e57096f4c10c0e6b285336e31a02184a5930af23e",
        "deposit_message_root":"24ddd987c1a2a234435522f0e6e6e5c020822fff902aabb0091fa903a4be1e03",
        "deposit_data_root":"53b93f167fedea323edb83eb9356e605f8ca54a69549450f09029a83fbb788b4",
        "fork_version":"00001020",
        "eth2_network_name":"prater",
        "deposit_cli_version":"1.1.1"
},
...

I've adjusted eth2_network_name and deposit_cli_version by hand.

The problem is now, if I try uploading the deposit data to Prater's deposit contract, it tells me that it's invalid. I did a little bit of debugging and narrowed the issue down to a faulty signature. I've also tried generating deposit data for a HD wallet and that worked perfectly fine on the launchpad, so the issue seems to be with distributed accounts.

Cannot find mnemonic after `wallet create`

I was looking for a non-interactive tool to create Eth2 wallets. The official deposit-cli does not support non-interactive usage so I end up here.

I created a new wallet with

./ethdo wallet create --wallet=test --type=non-deterministic --wallet-passphrase=test

The resulting files were (none of them containing the mnemonic)

8f2caac6-c0d4-4e40-9273-029e67b76f80  index

I expected within the resulting files to be the mnemonic of the wallet, what am I missing here?

Thanks in advanced!

FR: hd wallet accounts sort/index

The sorting of the accounts seems to be random when you do ethdo wallet accounts --wallet <wallet_name>

Which is especially strange when using HD wallets...

When I created 5 accounts under an HD wallet using:

ethdo account create --account="prysm/0" ...
ethdo account create --account="prysm/1" ...
ethdo account create --account="prysm/2" ...
ethdo account create --account="prysm/3" ...
ethdo account create --account="prysm/4" ...

and then do a list:
ethdo wallet accounts --wallet prysm

They come back in a random order:

0
4
3
1
2

Anyway, just thought it was weird and that might be a UX improvement?

Goerli Convert Fail

Latest Prysm version is v3.2.0.
Geth
Version: 1.10.26-stable

First of all, apologies for my English.
I am trying to convert my 0x00 to 0x01 in goerli network.
I am using this guide.
https://notes.ethereum.org/@launchpad/withdrawals-guide
But I have the following error when checking

 sudo docker run --rm -it --network=host   wealdtech/ethdo   --connection 127.0.0.1:4000       validator info       --validator=0       --verbose
Failed to connect to Ethereum 2 beacon node: failed to connect to beacon node: failed to confirm node connection: failed to fetch genesis: failed to request genesis: failed to call GET endpoint: Get "http://127.0.0.1:4000/eth/v1/beacon/genesis": net/http: HTTP/1.x transport connection broken: malformed HTTP response "\x00\x00\x06\x04\x00\x00\x00\x00\x00\x00\x05\x00\x00@\x00"
 sudo netstat -anp | grep 4000
tcp        0      0 127.0.0.1:4000          0.0.0.0:*               ESCUCHAR    3856/prysm.sh
tcp        0      0 127.0.0.1:35598         127.0.0.1:4000          ESTABLECIDO 3856/prysm.sh
tcp        0      0 127.0.0.1:57508         127.0.0.1:4000          ESTABLECIDO 3857/prysm.sh
tcp        0      0 127.0.0.1:4000          127.0.0.1:57508         ESTABLECIDO 3856/prysm.sh
tcp        0      0 127.0.0.1:4000          127.0.0.1:35598         ESTABLECIDO 3856/prysm.sh
sudo docker run --network=host ethdo chain status
Current slot: 4816290
Current epoch: 150509
Time until next slot: 3s
Time until next epoch: 5m51s
Slots until next epoch: 30
Justified epoch: 150508
Finalized epoch: 150507
Sync committee period: 587

Beacon service.

 sudo cat /etc/systemd/system/beacon-chain_test.service
# The eth2 beacon chain service (part of systemd)
# file: /etc/systemd/system/beacon-chain_test.service

[Unit]
Description     = eth2 beacon chain test service
Wants           = network-online.target
After           = network-online.target

[Service]
Type            = simple
User            = eth
Restart         = always
RestartSec      = 5
ExecStart       = /home/eth/prysm/prysm.sh beacon-chain \
  --goerli \
  --http-web3provider=http://localhost:8555  \
  --jwt-secret=/home/eth/.eth2validators_test/secrets/jwtsecret \
  --suggested-fee-recipient=0xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx0 \
  --p2p-tcp-port 13005 \
  --p2p-udp-port 12005 \
  --genesis-state=/home/eth/prysm/genesis.ssz \
  --datadir /mnt/ssd/eth2_test \
  --p2p-max-peers=30 \
  --monitoring-port 8181 \
  --http-mev-relay=http://127.0.0.1:18550 \
  --grpc-max-msg-size 268435456
  --accept-terms-of-use

Unclear on derivation paths

I was trying to use ethdo for some things related to getting things at particular derivation paths, however I am really confused here.
In HD wallets there are public and private derivations (as I'm sure you know). They are normally represented as "m/A/B'/..." where A is a public derivation and B is a private derivation (with the quote mark). I've also seen things use negative for private instead of quote mark, but whatever. It seems that ethdo is doing private derivations for everything (but I'm not sure) and using the notation that is normally used for public derivations.

Maybe some documentation on the "--path" option to state what ethdo is doing would be helpful.

Can't import account with name `null`

I'm using the lighthouse local_testnet scripts, which create local keystores for the validators on the launched beacon chain.

They create keystores like this, with "name": null

{
    "crypto": {
        "kdf": {
            "function": "scrypt",
            "params": {
                "dklen": 32,
                "n": 2,
                "r": 8,
                "p": 1,
                "salt": "0101010101010101010101010101010101010101010101010101010101010101"
            },
            "message": ""
        },
        "checksum": {
            "function": "sha256",
            "params": {},
            "message": "0535d31da8c72792ec6e706064c4cad942a93b1a39a340d2df8949206fad14e0"
        },
        "cipher": {
            "function": "aes-128-ctr",
            "params": {
                "iv": "c729eabe2fa5855e957da700f7f24255"
            },
            "message": "7af5f565c0c36ea7d249f97074087d25d6ccd10fc6b4dd0407824c7b58be5ddb"
        }
    },
    "uuid": "d1dd0dcb-1e70-4d56-94a1-5e7f861f145b",
    "path": "",
    "pubkey": "8f467e5723deac7659e1ca273e28410cbaa6d495ab66ae77014f4cd21c64b6b5ab9987c9b5537fe0279bd063fe609be7",
    "version": 4,
    "description": "",
    "name": null
}

I can't find a way to import such a file (without removing the name field, which works but is tedious). I tried

  1. ethdo account import --account "Test/whatever" (even tried "Test/null" in case)
    • Error: failed to process: failed to import wallet: account name invalid
  2. ethdo account import --account "Test/"
    • Error: failed to obtain input: account name is required

Export to EIP2335 spec keystore

Hi there,

I know a lot of key management is in flux at the moment with respect to Eth2 and ethdo, I'm just wondering if there are plans for exporting ND accounts/private keys in the EIP2335 format?

From talking to the Prysm team, currently the best way to make prysm work with ethdo generated wallets is to make a HD wallet on ethdo with a custom derivation path in the form prysm expects (m/12381/3600/i/0/0), and then use prysm wallet-v2 recover with the mnemonic and it will assume the derivation path of each sub account.

I am using ethdo to create validating keys only, and as such, ND accounts with password protection seemed the most convenient way for me to create and manage these wallets rather than mnemonics. In a perfect world, I would use ethdo to generate a ND account, use it to generate deposit data for this account with a supplied withdrawal pub key, and then subsequently load the ND account into a prysm validator with the passphrase and off I go (assuming I can do that with EIP2335 format keystore files). Is this something that is feasible/planned or should I be going down the HD route of creating wallets and importing them via mnemonic?

validator depositdata

I am completely lost with regards to the validator depositdata functions now.

It used to be that I could do:

ethdo validator depositdata --validatoraccount="Validators/1" --withdrawalaccount="Withdrawal/Withdrawal" --depositvalue="32Ether" --passphrase="secret"

I could then feed that output to ethereal

It doesn't look like that's the proper course of action anymore. As I just get:

ethdo validator depositdata --validatoraccount="Validators/1"
Failed to obtain validator account

I know everything is in flux and keeps changing 😞

To make matters worse, I must have used an older version to generate my deposits, because they're invalid, even though I used ethereal to submit them. Them being invalid made me download the latest ethdo and try to re-generate the deposit data when I saw this.

This is confusing since I haven't seen any mention to the change in the signature scheme or whatever would cause my data to be invalid?

Here's a sample:

https://beaconscan.com/validator/0xa49d4d036e7278ba6190ee1cadc2b8f75f31f5b83436d023f1cd7e028f312f065c8b378f6b78db3a0463aeb41fe31253#deposits

[Feature Request] Shard an existing key into multiple shares

Distributed validator technology (DVT) solutions such as SSV and Obol offer the possibility to shard an existing key (an account from an hd wallet) into multiple shares (that they then distribute amongst different "operators").
Nimbus is also offering a similar solution (not production ready) to split a keystore and store shares in separate instances of web3signer: https://github.com/status-im/nimbus-eth2/blob/b564ddd2f95f68f53692482199a2abaa5963376e/docs/the_nimbus_book/src/web3-signer.md#distributed-keystores

The outcome is similar to a remote ethdo wallet distributed across multiple instances, but comes with a lot more custom infrastructure to adopt (SSV token for example).

Having a similar built-in feature in ethdo directly would enhance all applications that leverage ethdo (such as dirk) to offer similar benefits to the native distributed wallet, but from existing "standard" hd wallets.
There are many cases were only hd wallets are supported (for example the keys generated by the RocketPool CLI) so offering built-in support to split them within ethdo could greatly improve the resilience of these use cases.

Original request under dirk's github: attestantio/dirk#30

Issue with installation (unknown revision)

trying to install ethdo wallet. getting this message. Is it ok?

[root@master-0 ~]# go version
go version go1.15.2 linux/amd64

[root@master-0 ~]# GO111MODULE=on go get github.com/wealdtech/ethdo
go: downloading github.com/wealdtech/ethdo v1.7.2
go: github.com/wealdtech/ethdo upgrade => v1.7.2
go get: github.com/wealdtech/[email protected] requires
        github.com/attestantio/[email protected] requires
        google.golang.org/[email protected]: reading google.golang.org/grpc/go.mod at revision v1.33.0: unknown revision v1.33.0

Apple silicon build

I wonder if you have any pointers for building for the Apple M1 chipset. The issue I hit is with the bls-eth-go-binary which ostensibly has support for Apple silicon but compilation fails as follows (on both go1.15.8 and go1.16):

$ GOOS=darwin GOARCH=arm64 go build .
# github.com/herumi/bls-eth-go-binary/bls
../go-bls/bls-eth-go-binary/bls/cast.go:9:28: undefined: SecretKey
../go-bls/bls-eth-go-binary/bls/cast.go:9:40: undefined: Fr
../go-bls/bls-eth-go-binary/bls/cast.go:13:26: undefined: Fr
../go-bls/bls-eth-go-binary/bls/cast.go:13:31: undefined: SecretKey
../go-bls/bls-eth-go-binary/bls/cast.go:19:28: undefined: PublicKey
../go-bls/bls-eth-go-binary/bls/cast.go:19:40: undefined: G1
../go-bls/bls-eth-go-binary/bls/cast.go:23:26: undefined: G1
../go-bls/bls-eth-go-binary/bls/cast.go:23:31: undefined: PublicKey
../go-bls/bls-eth-go-binary/bls/cast.go:29:23: undefined: Sign
../go-bls/bls-eth-go-binary/bls/cast.go:29:30: undefined: G2
../go-bls/bls-eth-go-binary/bls/cast.go:29:30: too many errors

In the above I replaced the bls-eth-go-binary in the go.mod file to a locally compiled copy, but the regular copy behaves exactly the same.

The regular old go get route also creates an ethdo bin that is not yet functional.

$ ethdo
SIGILL: illegal instruction
PC=0x4c9fa5d m=0 sigcode=2
signal arrived during cgo execution
instruction bytes: 0xc4 0xe1 0xf9 0x6e 0xc7 0x48 0x8d 0x3d 0x17 0xfc 0xff 0xff 0xc4 0xc1 0xf9 0x6e

Can't Create Accounts in v1.5.5

Just upgraded to latest version and I can no longer create new accounts on existing wallets, nor newly created wallets. Been using these functions in previous versions up to 1.5.2

Environment

Ubuntu 18.04
Golang 1.14.4
Ethdo 1.5.5

Steps to Reproduce

ethdo wallet create --wallet="Validators"
ethdo account create --account="Validators/test" --passphrase="1234"

Results in

Failed to access wallet: invalid account format

Version not bumped

The latest docker is tagged 1.4.22 and current tags on github are showing 1.4.22 but ethdo version is still 1.4.21

Add Support for RAW Deposit Data Verification

Currently the deposit verify command accepts either 1) JSON or 2) JSON file. However, the validator depositData command also outputs RAW data. Is it possible for the deposit verify command to also validate the RAW format data as well?

Unable to get address for account

I was trying to use ethdo for something it probably wasn't designed for, namely to derive seeds that I have and give me their ethereum addresses. I could not manage to do this thing that it is not designed for. There is probably good reason for this. If you show users addresses they will send funds to those addresses and if it isn't an expected derivation path that probably won't work out well for them.

Add Hashicorp Vault store

Hello @wealdtech ,
First of all, thank you for your jobs on ETH2 validation components.
I'm Cloud Architect working for Stake Capital and I'm building an ETH2 validation infrastructure to provide a large range of validators.
The technical stack is build on top of EKS (Kubernetes managed service on AWS) for Dirk and Vouch.
Historically, we are using Hashicorp Vault (https://www.vaultproject.io/) for secret management and we want to use it as wallet storage for this infra.
We are using Vault as Certificate Authority too to manage certificate of Dirk and Vouch services

So, I've fork your S3 wallet store librairy and i've adapted it to work with the KVv2 of vault storage:
https://github.com/bliiitz/go-eth2-wallet-store-vault (tests inside hasn't been updated)

For Vault authentication, I've implemented 2 ways:

  • Provide directly a vault token (for test localy)
  • Authentication with Kubernetes service account (for production)

After that, I've fork and update Dirk to handle this new lib:
https://github.com/bliiitz/dirk/blob/master/core/stores.go#L82

And now for wallet management, I've fork ethdo to add vault storage and be allowed to manage wallets with a pod spawned in the Kubernetes cluster.

What do you think about to merge this forks on your repos ?
Can we have a discussion about this ? (i'm not a golang expert so i prefer discuss about your development standard)

Thanks you !

pyrmont and --launchpad switch

On version 1.7.0 I ran this:

./ethdo validator depositdata --withdrawalaccount="Staking Wallet/withdrawel0" --validatoraccount="Staking Wallet/validator0" --depositvalue=32Ether --passphrase="mypass" --launchpad --forkversion=0x00002009

I pasted the output this into a file called upload.json
[{"pubkey":"afd7aa0438d1db0d9d2f692c5aa7533a8a136da7971d7eee28cd29706e19dfdb5e5ef86e9127fa7e5f863dab6eb78eb1","withdrawal_credentials":"00c3af365daab1416183c616dcb6125562c40b033f49e721570d4150186929ac","amount":32000000000,"signature":"b05e369be6e463ae9aafdbcc751dbf8e4763380c2a91fefa9f9013cf6004de285a28d15e77a2383e2155414a7df85cd9164f949af424d637851f530ffb550144dc263f1d1830cc40e391dd9af6d7eebea9c49091fb9277157154ad288df491c8","deposit_message_root":"d5789c6c8c36c49d6ea4d9f31788ed26628eb0154db6a3698b0dc8bdcaf9e156","deposit_data_root":"2a8184ec35b8f1b81e2de52bc28d583e49cadbf7517f9dba608abcb97967752a","fork_version":"00002009"}]

I tried to upload this json on this website:

https://pyrmont.launchpad.ethereum.org/upload-validator

I got this message

Oops! The json file you provided isn't for the Pyrmont testnet

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.