Nodes in the Ethereum network, by default, communicate using 30303 port. But nodes are also free to listen on some other port numbers. The --datadir
option is used to specify where to store the blockchain.
If Geth
uses a datadir to store the blockchain, accounts and some additional information, this directory cannot be shared between running instances and this data structure does hold all those information, because it is not included in every BeaconBlock
.
However, you can rebuild the BeaconState by re-executing/verifying all the TX included in the BeaconBlocks prior to the one that is currently considered the head of the chain.
The beacon state can be recomputed by public informations present in the blocks.
This basically mean that when you sync to the beacon chain, you rebuild the BeaconState, exactly the same as in the case of syncing on 'Ethereum 1.0 means rebuilding the 'Ethereum 1.0 global state'.
The jwtsecret
file is required to create an authenticated connection between Geth and a consensus client. JWT stands for JSON Web Token and it is signed using a secret key. The signed token acts as a shared secret used to check that information is sent to and received from the correct peer, and everything precisely about API usage.
The Merge responsibility for consensus logic and block propagation were handed over to the consensus layer, but all of Geth’s other functionality remains intact (transactions, contract deployments and data queries can still be handled by Geth using the same methods as before).
This includes interacting with Geth via JSON_RPC_API directly using tools such as curl, third party libraries such as Web3.js and Web3.py in development frameworks, Truffle, Hardhat, Brownie, Foundry or using Web3.js in Geth’s built-in Javascript console.
Obviously you can dive deeper about Slots and Epochs and how to run multiple instances finding more details in the documentation geth.ethereum.org or ethereum developer docs.
About your comment, this behavior is unacceptable because it would allow a perpetrator to re-spend coins that have already been spent, a process commonly known as double spending.
The major reason this doesn’t happen or rather happens rarely, it is consensus rules and consensus mechanism. If full nodes start validating false transactions and passing around invalid blocks, they will be banned by other nodes
(the banning process is usually automatized).
Since blockchain operates on a trustless basis, each node must reach conclusions on the validity of transactions and blocks on its own. This way, when the results are compared, unreliable nodes are quickly weeded out.