Geth - Prysm

Setup Repository

Visit this Repository Testnet & Fork / Clone

A. Run these commands to enter this Cartenz Chain directory

cd gitshock-chain/cartenz 

B. Create a JWT Secret to create a new secret key by running this command

openssl rand -hex 32 | tr -d "\n" > "jwt.hex" 

C. Run this command to create a new execution layer account

geth account new --datadir "data" << data is folder PATH for your keystore

Your new account is locked with a password. Please give a password. Do not forget this password.
Password: (.............)
Create a password and remember it (as you wish)

a public address of the key will be generated (public address of the key will look like 0x.. something). Then a path of the secret key file will also be generated, save it .You’ll need to save them in a safe place directly and you can share the PUBLIC KEY, and don’t EVEN Share your path to the secret key

D. Run this command to write custom genesis block

geth --datadir /yourfolder/yourfolderwallet init /folder/to/genesis.json

# Example: 
geth --datadir /geth/geth-data init /execution/genesis.json

Before running the Node, we use the POSIX Nohup (No Hang UP) command which means (Do Not Close) a command in Linux systems that keeps the process running even after exiting the shell or terminal. Nohup prevents the process or job from receiving the SIGHUP (Signal Hang UP) signal. This is the signal sent to the process after closing or exiting the terminal.

Running Execution Layer

# Create Folder
mkdir logs 
cd logs 
touch geth_1.log 
cd ..

# Create Folder
mkdir logs 
cd logs 
touch geth_1.log 
cd ..

nohup geth \
--datadir "/PATH/YOUR/ACCOUNT" \
--http --http.api="engine,eth,web3,net,admin" \
--ws \
--ws.api="engine,eth,web3,net,debug" \
--http.corsdomain="*" \
--networkid=1881 \
--syncmode=full \
--authrpc.jwtsecret="/your/path/folder/jwt.hex" \
> /your/path/folder/log/geth_1.log &

# If You Need RPC Api, You Can Add This
--http.addr 0.0.0.0 
--http.port 8545 

Add Peer Node

geth attach http://localhost:8545

After entering the Geth Interactive Console Javascript, you must add a Manual Peer & Trusted Peer of at least 1 to connect to the blockchain, please take it in the  folder: consensus/bootnodes_enr.txt

Example: admin.addPeer("enode://03fc89e2035b52a609715a15dacad4179f57c0b1e51b3464a931f0fa913b9169d06df1b23515f41e4ed6d9be0e50f33175cbf836e7b6738c62eee00ad45250b0@212.47.241.173:30303")

Output: 
> True

Get Bootnodes

Get the Bootnode Inside the Geth Interactive Console, for You to Save Using Command

admin.nodeInfo.enode

Example Output: 
"enode://03fc89e2035b52a609715a15dacad4179f57c0b1e51b3464a931f0fa913b9169d06df1b23515f41e4ed6d9be0e50f33175cbf836e7b6738c62eee00ad45250b0@212.47.241.173:30303"

Installing Prysm

mkdir prysm && cd prysm 
curl https://raw.githubusercontent.com/prysmaticlabs/prysm/master/prysm.sh --output prysm.sh && chmod +x prysm.sh

Pre-requisites: git, bazel Ensure bazel 5.3.+ is installed.

## Optional. This command is necessary only if you've previously configured USE_PRYSM_VERSION
USE_PRYSM_VERSION=v4.0.0

## Required.
./prysm.sh beacon-chain generate-auth-secret

Running Consensus Layer

./prysm.sh beacon-chain \
--accept-terms-of-use=true \
--genesis-state=/your/path/folder/genesis.ssz \
--datadir=/your/path/folder/prysmdata-dir  \
--chain-config-file=/your/path/folder/config.yaml \
--execution-endpoint=http://localhost:8551 \
--jwt-secret=/your/path/folder/jwt.hex \
--contract-deployment-block=0 \
--bootstrap-node="ADD IT FROM THE CARTENZ CHAIN ENR." \
--suggested-fee-recipient="YOUR ADDRESS VALIDATOR HERE" #If validators enabled

Running Second Consensus Layer

./prysm.sh beacon-chain \
--accept-terms-of-use=true \
--genesis-state=/your/path/folder/genesis.ssz \
--datadir=/your/path/folder/prysmdata-dir  \
--chain-config-file=/your/path/folder/config.yaml \
--execution-endpoint=http://localhost:8551 \
--jwt-secret=/your/path/folder/jwt.hex \
--contract-deployment-block=0 \
--bootstrap-node="FILL IN THE ENR YOU GOT FROM THE FIRST CONSENSUS LAYER AND ADD IT FROM THE CARTENZ CHAIN ENR." \
--suggested-fee-recipient="YOUR ADDRESS VALIDATOR HERE" #If validators enabled

Building a Staker To Be Good Validator

Visit the Staking Website and Select Deposit and Make a Deposit with Command:

// Example From Deposit 

deposit new-mnemonic --num_validators 200 --eth1_withdrawal_address 0x9adddA86C9479C45bD145BBa9FC28146FdF46C83

# Example Output Mnemonic: 
"vibrant refuse observe flag shy depth disagree proud race angle vote picnic fancy renew museum bonus arena people thumb there atom tuna abstract negative"

Import Validator Keystore

./prysm.sh validator accounts import \
--accept-terms-of-use \
--wallet-dir=/your/path/folder/validator-data \
--keys-dir=/your/path/folder/validator-data/keys

To start the validator client, make sure you have created a secret file (containing with your secret info in) and call it prysm-dir/validator-data/secret.txt. Then it will not prompt you at each startup.

Running Validator Node

To start the validator client, make sure you have created a secret file (containing with your secret info in) and call it prysm-dir/validator-data/secret.txt. Then it will not prompt you at each startup.

./prysm.sh validator \
--accept-terms-of-use=true \
--datadir=/your/path/folder/prysmdir \
--chain-config-file=/your/path/folder/config \
--beacon-rpc-provider=http://localhost:4000 \
--wallet-dir=/your/path/folder/validator-data  \
--wallet-password-file=/your/path/folder/validator-data/secret.txt \
--suggested-fee-recipient="YOUR ADDRESS VALIDATOR HERE" #If validators enabled 

How long does it take to sync a node?

48-72 hours this cannot be an actual reference time. The sync process is very long and can take up to 48-72 hours. Sync speed depends on your internet speed and storage device write speed. Because data is stored in blocks and linked together, corruption in a single block can corrupt the entire data chain

Last updated