wealdtech / ethereal

Apache License 2.0
209 stars 41 forks source link

ethereal fails to see accounts that exist in geth node #41

Closed nivshitrit closed 1 year ago

nivshitrit commented 1 year ago

on my geth node, running 'eth.accounts' prints my wallet address, so geth recognizes my wallet.

I also made sure the account is unlocked with personal.unlockAccount() on geth ipc.

and yet when I run:

ethereal beacon deposit --data=data/depo --from=address --passphrase=pass --eth2network=prater --connection=geth-node:8545

i get the output :

Failed to generate deposit options: failed to obtain wallet for 0xc590e9576621aA7C4B4C2e80f854A4631DDc4D0E

also,ethereal account list prints nothing

mcdee commented 1 year ago

You need to supply the Ethereum network with which the commands are interacting by providing the --network option, e.g. ethereal --network=goerli account list

nivshitrit commented 1 year ago

You need to supply the Ethereum network with which the commands are interacting by providing the --network option, e.g. ethereal --network=goerli account list

sorry i forgot to mention i was using the --connection flag (same way i used in ethereal beacon depositcommand), which overrides --network if im not mistaken.

ethereal account list --connection=geth-node:8545 and ethereal account list --network=goerli both return empty output

mcdee commented 1 year ago

If you run geth --goerli account list what does it give for the paths for the keystores (the information starting with keystore://)?

nivshitrit commented 1 year ago

If you run geth --goerli account list what does it give for the paths for the keystores (the information starting with keystore://)?

i get this : keystore:///go-ethereum/keystore/UTC--2022........

mcdee commented 1 year ago

ethereal is designed to work with the standard keystore path. For goerli this would be /home/<user>/.ethereum/goerli. Can you map your go-ethereum directory to there and see if this works?

nivshitrit commented 1 year ago

i have configured geth's datadir to the default /.ethereum

running geth --goerli account list outputs:

keystore:///.ethereum/keystore/UTC--2022-11-24T11.......

yet im still getting empty output when i run ethereal account list --connection=geth-node:8545 and ethereal account list --network=goerli

mcdee commented 1 year ago

Is the geth user's home directory really /? Also, I would expect to see a goerli directory in the keystore's path if you are querying for the goerli network.

When I run geth --goerli account list on my machine I see keystores of the form keystore:///home/user/.ethereum/goerli/keystore/UTC-... and this is what Ethereal looks for.

nivshitrit commented 1 year ago

yes im querying for goerli network. wierd that geth didnt place the data in goerli folder. anyway i went ahead and forced the data dir to /.ethereum/goerli, now geth --goerli account list outputs:

keystore:///.ethereum/goerli/keystore/UTC--2022-11-24T11.......

and still getting empty output for ethereal --goerli account list

and yes /is the home directory, this is running in kubernetes

mcdee commented 1 year ago

Can I confirm that the command you are running is ethereal --network=goerli account list and not ethereal --goerli account list as you put above? The latter should create an error.

nivshitrit commented 1 year ago

sorry that was a typo, --goerliis geth's flag, i meant --network=goerli im actually using --connection=geth-node:8545 (but i also try with --network=goerli aswell), i also know that i can establish connection succesfully between ethereal and my geth node. it just fails to see the accounts in the geth container.

mcdee commented 1 year ago

When you say "container", do you mean that the accounts not visible to ethereal directly? ethereal fetches accounts directly from the filesystem where it runs, without contacting geth. So if the accounts are not in etheral's filesystem it won't be able to access them.

nivshitrit commented 1 year ago

the geth container and the ethereal container share the same filesystem. in the ethereal container, the path /.ethereum/goerli/keystore/ has keystore files this is the path ethereal looks at for accounts, right ?

mcdee commented 1 year ago

I have added some debug information to the command to see which path ethereal is looking at. Please could you compile ethereal from the github repo and rerun the account list command with the --debug flag and let me know the output? Thank you.

nivshitrit commented 1 year ago
Using default configuration
Geth key directory is /root/.ethereum/goerli/keystore
Parity key directory is /root/.local/share/io.parity.ethereum/keys
mcdee commented 1 year ago

That shows that the root directory for the user running ethereal is /root, not /. You should set your geth path accordingly (or just don't set it, it will default to the correct path).

nivshitrit commented 1 year ago

I have set the path under /root instead of /, still getting empty output for ethereal accounts list

but actually now beacon depositoutputs a different error:

Existing deposit check: failed to check if there is already a deposit for this validator: Post "https://api.thegraph.com/subgraphs/name/attestantio/eth2deposits-prater": x509: certificate signed by unknown authority

so it seems putting .ethereum under /root might have helped, yet still empty output for ethereal accounts list

mcdee commented 1 year ago

The certificate authority error is likely because you don't have the appropriate root certificates in your environment.

As for not seeing accounts with ethereal: it will look in /root/.ethereum/goerli/keystore for accounts, given the information you have supplied so far (and assuming you are running ethereal --network=goerli account list). The keystores need to be in that directory for the command to be picked up. Note that running geth --goerli account new should create keystores in this location.

mcdee commented 1 year ago

Closing due to inactivity.