ChainSafe / lodestar-quickstart

Scripts to quick start Lodestar and execution clients on Ethereum.
31 stars 23 forks source link

Do not prepend dataDir option with current directory string #30

Closed scorbajio closed 2 weeks ago

scorbajio commented 12 months ago

Currently, if a user wants to use a mounted drive such as /media/user/ExternalDrive/data for the dataDir option of the helper scripts, the setup will fail with an error.

To recreate, run:

./setup.sh --network holesky --dataDir `/media/user/ExternalDrive/data` --elClient ethereumjs

You should see output similar to this:

 ✖ Error: ENOENT: no such file or directory, open '/data/jwtsecret'
    at Object.readFileUtf8 (node:internal/fs/sync:25:18)
    at Object.readFileSync (node:fs:441:19)
    at Module.parseArgs (file:///usr/app/packages/cli/src/options/beaconNodeOptions/eth1.ts:28:32)
    at parseBeaconNodeArgs (file:///usr/app/packages/cli/src/options/beaconNodeOptions/index.ts:30:16)
    at beaconHandlerInit (file:///usr/app/packages/cli/src/cmds/beacon/handler.ts:163:51)
    at Object.beaconHandler [as handler] (file:///usr/app/packages/cli/src/cmds/beacon/handler.ts:36:90)
    at file:///usr/app/packages/cli/node_modules/yargs/build/lib/command.js:206:54
    at maybeAsyncResult (file:///usr/app/packages/cli/node_modules/yargs/build/lib/utils/maybe-async-result.js:9:15)
    at CommandInstance.handleValidationAndGetResult (file:///usr/app/packages/cli/node_modules/yargs/build/lib/command.js:205:25)
    at CommandInstance.applyMiddlewareAndGetResult (file:///usr/app/packages/cli/node_modules/yargs/build/lib/command.js:245:20)

This error results from docker failing to map a non-existant local path to the program container:

docker run --rm --name holesky-ethereumjs --network host -v /home/user/code/lodestar-quickstart//media/user/ExternalDrive/data:/data

This happens because the current directory string is being prepended to the dataDir option that the user has passed in. This change removes the prepended string so that the user can pass in absolute paths, as well.

CLAassistant commented 12 months ago

CLA assistant check
All committers have signed the CLA.