Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Private geth+prysm node #29772

Closed
sergey-msu opened this issue May 14, 2024 · 4 comments
Closed

Private geth+prysm node #29772

sergey-msu opened this issue May 14, 2024 · 4 comments

Comments

@sergey-msu
Copy link

sergey-msu commented May 14, 2024

Hi,
I'm trying to setup a full imitation of Eth mainnet - a PoS network which I plan to use far beyond testing purposes.
The requirements are

  • it should be clean network started from the very first genesis block
  • it should not connected to Eth mainnet or any testnets
  • it should be fully functional EVM-based network (a-la Eth clone for my company's private purposes)
  • it should be a private network, but with PoS (not PoA) concensus

As I understand (please correct me if I'm wrond), I should use a private setup as a starting point: init geth with a genesis block, then start PoS concensus+validator node, and finally raise up other network nodes it the same way.

The first problem I faced - Geth and Prysm do not see each other.
Can anyone help me with initial setup?

my genesis.json:

{
  "config": {
      "chainId": 1234,
      "homesteadBlock": 0,
      "eip150Block": 0,
      "eip155Block": 0,
      "eip158Block": 0,
      "byzantiumBlock": 0,
      "constantinopleBlock": 0,
      "petersburgBlock": 0,
      "istanbulBlock": 0,
      "muirGlacierBlock": 0,
      "berlinBlock": 0,
      "terminalTotalDifficultyPassed": true,
      "londonBlock": 0
  },
  "alloc": {
    "4e80Bb36022bF5947e0A00fF3701510c0efEEad4": {
        "balance": "10000000000000000000000" 
    },
	"4242424242424242424242424242424242424242": {
		"code": "0x608.....0b0033",
		"balance": "0x0"
	}
  },
  "coinbase": "0x0000000000000000000000000000000000000000",
  "difficulty": "0x1",
  "extraData": "0x00000000000000000000000000000000000000000000000000000000000000004e80Bb36022bF5947e0A00fF3701510c0efEEad40000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
  "gasLimit": "0x1c9c380",
  "nonce": "0x0",
  "mixhash": "0x0000000000000000000000000000000000000000000000000000000000000000",
  "parentHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
  "timestamp": "0x00"
}

which I pass to Geth as
./geth --datadir=gethdata init genesis.json

Then I start Geth with the command
./geth --http --http.api eth,net,web3 --ws --ws.api eth,net,web3 --authrpc.jwtsecret jwtsecret --datadir gethdata --nodiscover --syncmode full --allow-insecure-unlock --unlock 0x4e80Bb36022bF5947e0A00fF3701510c0efEEad4 --password password.txt

Then I start the Prysm
./beacon-chain --datadir=beacondata --execution-endpoint=http://localhost:8551 --chain-id=1234 --jwt-secret=jwtsecret --accept-terms-of-use --rpc-host=0.0.0.0 --grpc-gateway-host=0.0.0.0 --contract-deployment-block=0

the latter periodically shows the error
ERROR execution: Unable to process past deposit contract logs, perhaps your execution client is not fully synced error=processPastLogs: no contract code at given address

There are also some outputs in Geth console that seems strange to me, like
The Merge is not yet available for this network!
Engine API started but chain not configured for merge yet
Served eth_coinbase reqid=3 duration="15.964µs" err="the method eth_coinbase does not exist/is not available"

Finally, I start the validator
./validator --datadir validatordata --accept-terms-of-use --wallet-dir=./validator_wallets --beacon-rpc-provider=beacon-chain:4000 --datadir=./validatordata

which says

[2024-05-14 11:48:43]  INFO client: Syncing with beacon node to align on chain genesis info
[2024-05-14 11:48:47]  WARN client: Could not determine if beacon chain started error=could not receive ChainStart from stream: could not setup beacon chain ChainStart streaming client: rpc error: code = Unavailable desc = connection error: desc = "transport: Error while dialing: dial tcp: lookup beacon-chain: no such host": could not connect: could not connect

Please, tell me what could be the problem?
May be I should choose a different setup for my network?

@lzmrd
Copy link

lzmrd commented May 16, 2024

how did you install Prysm? I only see option for "mainnet","Sepolia","Holesky"

@s1na
Copy link
Contributor

s1na commented May 28, 2024

First, I'd like to point out that Ethereum PoS is permissionless. Meaning anyone who gets their hands on enough ether in a network can become a validator and propose blocks. If your use-case is a private "permissioned" network, this will not be suitable for you.

Otherwise: I think you will appreciate kurtosis. Save this to a file:

participants:
  - el_type: geth
  cl_type: prysm
  count: 3
additional_services:
  - dora

and then with a simple command:

kurtosis run github.com/kurtosis-tech/ethereum-package --args-file config.yaml --image-download always

you will have a network with 3 geth-prysm pairs, and a block explorer on top.

@sergey-msu
Copy link
Author

@s1na I'm trying to set up a real-world copy of Ethereum without any connecton to real Ethereum (mainnet or testnets).
The main problem I faced - Prysm stopped to follow the chain after it reloads. It seems to be a known bug in Prysm, please see here rzmahmood/ethereum-pos-testnet#23

If you have an additional comments, I'll be very appreciate it

@s1na
Copy link
Contributor

s1na commented May 28, 2024

Ok then will close here.

@s1na s1na closed this as completed May 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants