ethereum / go-ethereum

Go implementation of the Ethereum protocol
https://geth.ethereum.org
GNU Lesser General Public License v3.0
47.48k stars 20.09k forks source link

Geth error caused by location of clef.ipc #22121

Closed fang19911030 closed 3 years ago

fang19911030 commented 3 years ago

System information

Geth version: 1.9.25-stable-e7872729 OS & Version: Ubuntu 20.04.1 LTS Commit hash : (if develop)

Expected behaviour

Start get successfully.

Actual behaviour

Error message

Steps to reproduce the behaviour

I follow the guidance here. Type the command: geth --goerli --syncmode "light" --rpc --signer=/clef.ipc geth --goerli --syncmode "light" --rpc --signer=/usr/bin/clef/clef.ipc

Backtrace

INFO [01-05|20:29:17.240] Starting Geth on Görli testnet... 
INFO [01-05|20:29:17.241] Dropping default light client cache      provided=1024 updated=128
INFO [01-05|20:29:17.241] Maximum peer count                       ETH=0 LES=10 total=50
WARN [01-05|20:29:17.241] The flag --rpc is deprecated and will be removed in the future, please use --http 
INFO [01-05|20:29:17.242] Smartcard socket not found, disabling    err="stat /run/pcscd/pcscd.comm: no such file or directory"
INFO [01-05|20:29:17.242] Using external signer                    url=/usr/bin/clef/clef.ipc
Fatal: Failed to create the protocol stack: error connecting to external signer: dial unix /usr/bin/clef/clef.ipc: connect: not a directory

The output of location of clef:

/home/pfang/.clef /home/pfang/.clef/1704e6eb6320a493735d /home/pfang/.clef/masterseed.json /usr/bin/clef /usr/share/doc/clef /usr/share/doc/clef/AUTHORS.gz /usr/share/doc/clef/changelog.gz /usr/share/doc/clef/copyright /var/cache/apt/archives/clef_1.9.25+build24398+focal_amd64.deb /var/lib/dpkg/info/clef.list /var/lib/dpkg/info/clef.md5sums

ligi commented 3 years ago

It seems clef is not started. Can you show the output of the step "Start Clef"?

fang19911030 commented 3 years ago

Command: clef --keystore /usr/bin/geth/keystore --chainid 5

``INFO [01-05|21:33:14.133] Starting signer chainid=5 keystore=/usr/bin/geth/keystore light-kdf=false advanced=false DEBUG[01-05|21:33:14.133] Failed to reload keystore contents err="open /usr/bin/geth/keystore: not a directory" DEBUG[01-05|21:33:14.133] Ledger support enabled DEBUG[01-05|21:33:14.133] Trezor support enabled via HID DEBUG[01-05|21:33:14.133] Trezor support enabled via WebUSB INFO [01-05|21:33:14.133] Smartcard socket file missing, disabling err="stat /run/pcscd/pcscd.comm: no such file or directory" INFO [01-05|21:33:14.134] Audit logs configured file=audit.log DEBUG[01-05|21:33:14.134] IPCs registered namespaces=account INFO [01-05|21:33:14.134] IPC endpoint opened url=/home/pfang/.clef/clef.ipc ------- Signer info -------

ligi commented 3 years ago

please create the directory - seems it does not exist.

Also I do not really think having it in /usr/bin is a good idea. I think it is better if it is in the home directory of your user.

fang19911030 commented 3 years ago

The command in the link is: clef --keystore /keystore --chainid 5, the can be everywhere by user or the path to the executable geth?

ligi commented 3 years ago

it can be everywhere

fang19911030 commented 3 years ago

Cool, Solved. The explanation about CLEF_LOCATION is also very misleading.

ligi commented 3 years ago

Great! That's why I added the type:docs label ;-) If you could describe it better - ideally in a PR - that would be awesome!

gosuto-inzasheru commented 2 years ago

please create the directory - seems it does not exist.

Also I do not really think having it in /usr/bin is a good idea. I think it is better if it is in the home directory of your user.

just curious: why is this directory not created automatically? I installed go-ethereum through brew on macos in order to be able to run clef. after clef init, running clef gave me the error mentioned. creating Ethereum/ and Ethereum/keystore in my user's Library folder solved the problem.

are there no permissions in place for clef to create these folders by default?