Hii, this is my first post here and I will be using this medium to curate my journey through the ethereum protocol fellowship. My initial notes are actually [here](https://); there, you will find me going in on Ephemery, i also mention RIG's cryptoeconomic problems as well. # Running nodes and clients for the first time The focus of today's post, will be on the the bugs i encountered while trying to reproduce the week2's [Office hour](https://github.com/eth-protocol-fellows/cohort-four/issues/95) tutorial organized by Mario on running a node and clients. The first 50mins of the presentation was actually smooth sailing for me, until we got to the part about running public networks like Ephemery. In retrospect all the bugs where directory related, and here they are: 1. **geth: geth command not found** I got this error while trying to initialize *ephemery's* genesis state with: > $ `./geth init /Downloads/ephemery/genesis.json` This was a directory path problem. The *geth* installation was only executable in its folder. Which means if i wanted to use *geth*, i had to navigate to its directory to use it. A temporary solution was to copy *ephemery* into *geth's* folder, but that isn't optimal at all, as i would have to do the same for lighthouse, nimbus, et al. A more proper solution requires an understanding of directory paths and how they work when executing programs. For that we need [PATH](https://www.digitalocean.com/community/tutorials/how-to-view-and-update-the-linux-path-environment-variable). We can call ==`PATH`== on the terminal using: >`$ echo $PATH` This will return something like this: > usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin Here, ==`PATH`== is returning directories that contain programs Linux executes globally from anywhere in the terminal. Thus i can solve this problem in two ways: * I can add *geth* to one of the current directories available under ==`PATH`== f.e by using a symbolic link: >`$ sudo ln -s /home/yourusername/Downloads/geth /usr/local/bin/geth` * I can add the *geth* directory itself to the ==`PATH`== variable via the bash.src file using: > `$ export PATH=$PATH:/home/yourusername/Downloads/geth` On closing and reopening the terminal, geth (or any other client for that matter) should work. 2. **Fatal: Failed to write genesis block: database contains incompatible genesis (have d4e56740f876aef8c010b86a40d5fmamamatrma** I got this error also while trying to initialize *ephemery's* genesis state with the ==`geth init`== command as above :arrow_up: This was a bit obfuscating and solving it required being quite literal with the solution i found [online](https://tech-isid-co-jp.translate.goog/entry/2021/12/03/Geth%28%E3%82%B2%E3%82%B9%29%E3%81%AF%E3%81%98%E3%82%81%E3%81%BE%E3%81%97%E3%81%9F?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en) (warning: it's in japanese!). Apparently, the database *geth* was writing to, was the wrong one, and i needed to specify the right one using ==`--datadir`==. Solution: > `$ geth init --datadir data genesis.json` This command pointed geth to the correct ==data== directory and successfully initialized ==genesis.json==. ![](https://hackmd.io/_uploads/S1JVNxCon.png) Successful initialization ![](https://hackmd.io/_uploads/rkpuNxAsh.png) Failed initialization Notice the difference in the database being written to in the terminal logs! 3. **ERROR Failed jwt authorization error: InvalidToken, service: exec** I got this error while trying to run ephemery using lighthouse > $ `lighthouse bn --testnet-dir ~/Downloads/ephemery --execution-endpoint http://127.0.0.1:8551 --execution-jwt=" /home/yourusername/Downloads/ephemery/gethdata/geth/jwtsecret" --boot-nodes "enr:-Iq4QNMYHuJGbnXyBj6FPS2UkOQ-hnxT-mIdNMMr7evR9UYtLemaluorL6J10RoUG1V4iTPTEbl3huijSNs5_ssBWFiGAYhBNHOzgmlkgnY0gmlwhIlKy_CJc2VjcDI1NmsxoQNULnJBzD8Sakd9EufSXhM4rQTIkhKBBTmWVJUtLCp8KoN1ZHCCIyk"` This was a [whitespace error](https://www.reddit.com/r/ethstaker/comments/x9t8ur/switched_from_geth_to_besu_but_now_appears_issue/) in the directory pointing to the jwtsecret folder! Clients like *lighthouse* and *besu* do not support trailing newline/whitespace characters. ### Bonus Bugs * [Bash not showing current working directory](https://www.cyberciti.biz/tips/howto-linux-unix-bash-shell-setup-prompt.html)