rhmaxdotorg / pulsechain-validator

PulseChain Validator Automated Setup Scripts
https://launchpad.pulsechain.com
38 stars 13 forks source link

Issue setting up test validator #31

Closed BC-Tech-Systems closed 1 year ago

BC-Tech-Systems commented 1 year ago

I get the following error when trying to setup a test node.

...
**Compiling boot_node v2.3.0 (/opt/lighthouse/boot_node)
error: could not compile `lighthouse` (bin "lighthouse")**

Caused by:
  process didn't exit successfully: `/home/node/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/bin/rustc --crate-name lighthouse --edition=2021 lighthouse/src/main.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --diagnostic-width=207 --crate-type bin --emit=dep-info,link -C opt-level=3 -C embed-bitcode=no --cfg 'feature="default"' --cfg 'feature="jemalloc"' --cfg 'feature="slasher-mdbx"' -C metadata=f3b9aa6fdc7432bc -C extra-filename=-f3b9aa6fdc7432bc --out-dir /opt/lighthouse/target/release/deps -L dependency=/opt/lighthouse/target/release/deps --extern account_manager=/opt/lighthouse/target/release/deps/libaccount_manager-4ca890d3223b079d.rlib --extern account_utils=/opt/lighthouse/target/release/deps/libaccount_utils-eaa29814631617ec.rlib --extern beacon_node=/opt/lighthouse/target/release/deps/libbeacon_node-465474407bf562a6.rlib --extern bls=/opt/lighthouse/target/release/deps/libbls-1e2e4db0fedb808a.rlib --extern boot_node=/opt/lighthouse/target/release/deps/libboot_node-7f732a8c1e2d70ee.rlib --extern clap=/opt/lighthouse/target/release/deps/libclap-8224f13e82a28a4c.rlib --extern clap_utils=/opt/lighthouse/target/release/deps/libclap_utils-888d33a6a59f309a.rlib --extern database_manager=/opt/lighthouse/target/release/deps/libdatabase_manager-273b4b0f6da91133.rlib --extern directory=/opt/lighthouse/target/release/deps/libdirectory-cd2697b47a08e899.rlib --extern env_logger=/opt/lighthouse/target/release/deps/libenv_logger-3032a266c0b600e5.rlib --extern environment=/opt/lighthouse/target/release/deps/libenvironment-cdbf46431a4e95ac.rlib --extern eth2_network_config=/opt/lighthouse/target/release/deps/libeth2_network_config-1f5df05feaee5db5.rlib --extern ethereum_hashing=/opt/lighthouse/target/release/deps/libethereum_hashing-182cc1c448c80ccd.rlib --extern futures=/opt/lighthouse/target/release/deps/libfutures-90aaec7e67acb58d.rlib --extern lazy_static=/opt/lighthouse/target/release/deps/liblazy_static-7b70fbdb8bbfe33f.rlib --extern lighthouse_metrics=/opt/lighthouse/target/release/deps/liblighthouse_metrics-9738d07f41538139.rlib --extern lighthouse_version=/opt/lighthouse/target/release/deps/liblighthouse_version-e0ceb39e63982209.rlib --extern malloc_utils=/opt/lighthouse/target/release/deps/libmalloc_utils-592be6237362f4ae.rlib --extern serde=/opt/lighthouse/target/release/deps/libserde-614910754fd6b132.rlib --extern serde_json=/opt/lighthouse/target/release/deps/libserde_json-a548cb7c07de9b63.rlib --extern serde_yaml=/opt/lighthouse/target/release/deps/libserde_yaml-da67ce86be4df687.rlib --extern slasher=/opt/lighthouse/target/release/deps/libslasher-c4036d97f00dc2cd.rlib --extern slog=/opt/lighthouse/target/release/deps/libslog-b3e32537fcbb6628.rlib --extern sloggers=/opt/lighthouse/target/release/deps/libsloggers-a3c5ed99e7e2837d.rlib --extern task_executor=/opt/lighthouse/target/release/deps/libtask_executor-517492dab1ae46e0.rlib --extern types=/opt/lighthouse/target/release/deps/libtypes-17dcaeeaaf846f3e.rlib --extern unused_port=/opt/lighthouse/target/release/deps/libunused_port-613d40bd3318d7c7.rlib --extern validator_client=/opt/lighthouse/target/release/deps/libvalidator_client-82400eef46016419.rlib -L native=/opt/lighthouse/target/release/build/blst-ce3d381fd13719a9/out -L native=/opt/lighthouse/target/release/build/ring-6b507031fbffe114/out -L native=/opt/lighthouse/target/release/build/libsqlite3-sys-dbcaf5add0c3db0f/out -L native=/opt/lighthouse/target/release/build/openssl-sys-e79d79aafdcc2a55/out/openssl-build/install/lib -L native=/opt/lighthouse/target/release/build/leveldb-sys-edba78670fb06689/out/lib -L native=/opt/lighthouse/target/release/build/mdbx-sys-cabde22a486f682a/out -L native=/opt/lighthouse/target/release/build/jemalloc-sys-e26d65d3e249e3a5/out/build/lib` (signal: 9, SIGKILL: kill)
error: failed to compile `lighthouse v2.3.0 (/opt/lighthouse/lighthouse)`, intermediate artifacts can be found at `/opt/lighthouse/target`.
To reuse those artifacts with a future compilation, set the environment variable `CARGO_TARGET_DIR` to that path.
make: *** [Makefile:48: install] Error 101

Steps to reproduce: Setup a clean Ubuntu 22.04 LTS server

Logon to the server cli and run these commands: mkdir repos cd repos git clone https://github.com/rhmaxdotorg/pulsechain-validator.git cd pulsechain-validator

Edit pulsechain-validator-setup.sh and change it to the testnet values nano pulsechain-validator-setup.sh

#GETH_CHAIN=$GETH_MAINNET_CHAIN
#LIGHTHOUSE_CHAIN=$LIGHTHOUSE_MAINNET_CHAIN
GETH_CHAIN=$GETH_TESTNET_CHAIN
LIGHTHOUSE_CHAIN=$LIGHTHOUSE_TESTNET_CHAIN

#LIGHTHOUSE_CHECKPOINT_URL=$LIGHTHOUSE_MAINNET_CHECKPOINT_URL
LIGHTHOUSE_CHECKPOINT_URL=$LIGHTHOUSE_TESTNET_CHECKPOINT_URL

(Exit nano via (ctrl+x)

Run the setup command Substitute the following: [wallet] = wallet id on the test network [ip] = external IP address of the router ./pulsechain-validator-setup.sh [wallet] [ip]

The build should fail on the very last step.

I have reproduced this on two different servers.

wishbonesr commented 1 year ago

@BC-Tech-Systems. can you provide more screen output content above this error. When I had a compilation issue, it was because of missing dependencies like snap. Look further back to see if there is any unexpected output.

rhmaxdotorg commented 1 year ago

Thanks for reporting this @BC-Tech-Systems!

As @wishbonesr mentioned, could you look for any failures (or attach logs of the process via script command like here or otherwise) of dependencies before building the clients such as Lighthouse?

@BC-Tech-Systems. can you provide more screen output content above this error. When I had a compilation issue, it was because of missing dependencies like snap. Look further back to see if there is any unexpected output.

As I thought I tested this a while back on the supported Ubuntu 22.04 LTS and didn't see any issues. It appears from a quick look at the error that rust is failing to build Lighthouse, which usually is a dependency issue OR a node user error.

In that case, make sure you are running the script as a user with sudo privileges and that the node user was added properly as the script does this as one of the first tasks.

BC-Tech-Systems commented 1 year ago

Thanks for the suggestions. I can confirm the testnet settings were a red herring (false positive) as I was able to reproduce the issue with mainnet settings after deleting the repo and cloning it again.

I did add my account to the sudoer group this time via the following command:
usermod -aG sudo blockchain

Also, I change the visudo command to remove the need to enter my password for sudo commands:

sudo visudo
blockchain ALL=(ALL) NOPASSWD: ALL

This time I ran the script via the following command: Wallet and IP address changed for privacy: sudo ./pulsechain-validator-setup.sh 0xxxxyyyzzz6679C8cbbE561xxxyyyzzz 20.0.0.71

The command ran successfully now. I do not recall having to sudo this command on my mainnet (Prod) validator...

rhmaxdotorg commented 1 year ago

Great, glad you got it working.

Yes, the script expects the user running the script to have admin (passwordless sudo) privileges unless other arrangements are made. This can be the default on different Ubuntu installations, but sometimes not.

Appreciate your pull requests and support as well.