Skip to content

Commit

Permalink
stashing before I lose my mind
Browse files Browse the repository at this point in the history
  • Loading branch information
badgersrus committed Jul 2, 2024
1 parent 635ae66 commit 04ff2d9
Show file tree
Hide file tree
Showing 3 changed files with 62 additions and 23 deletions.
10 changes: 4 additions & 6 deletions integration/eth2network/eth2_configs.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,9 @@ DENEB_FORK_VERSION: 0x20000093
DENEB_FORK_EPOCH: 0
# Time parameters
SECONDS_PER_SLOT: 3
SECONDS_PER_SLOT: 12
SLOTS_PER_EPOCH: 6
DEPOSIT_NETWORK_ID: 48815
# Deposit contract
DEPOSIT_CONTRACT_ADDRESS: 0x4242424242424242424242424242424242424242
`
Expand All @@ -74,13 +72,13 @@ const _baseGenesis = `{
"londonBlock": 0,
"arrowGlacierBlock": 0,
"grayGlacierBlock": 0,
"shanghaiTime": 0,
"cancunTime": 0,
"shanghaiTime": 1695897038,
"cancunTime": 1695897038,
"terminalTotalDifficulty": 0,
"terminalTotalDifficultyPassed": true
},
"nonce": "0x0",
"timestamp": "0x0",
"timestamp": "0x651555ce",
"gasLimit": "0x1c9c380",
"difficulty": "0x1",
"mixHash":"0x0000000000000000000000000000000000000000000000000000000000000000",
Expand Down
38 changes: 21 additions & 17 deletions integration/eth2network/eth2_network.go
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ func (n *Impl) Start() error {
dataDir := nodeDataDir
go func() {
n.prysmBeaconProcesses[nodeID], err = n.prysmStartBeaconNode(
n.gethHTTPPorts[nodeID],
n.gethAuthRPCPorts[nodeID],
n.prysmBeaconHTTPPorts[nodeID],
n.prysmBeaconP2PPorts[nodeID],
dataDir,
Expand Down Expand Up @@ -393,9 +393,10 @@ func (n *Impl) gethImportMinerAccount(nodeID int) error {

func (n *Impl) gethStartNode(executionPort, networkPort, httpPort, wsPort int, dataDirPath string, minerAddress string) (*exec.Cmd, error) {
// full command list at https://geth.ethereum.org/docs/fundamentals/command-line-options
println("GETH HTTP PORT: ", httpPort)
println("GETH AUTH PORT: ", executionPort)
println("GETH NET PORT: ", networkPort)

println("GETH HTTP: ", httpPort)
println("GETH RPC: ", executionPort)
println("GETH NET: ", networkPort)
args := []string{
_dataDirFlag, dataDirPath,
"--http",
Expand All @@ -408,20 +409,20 @@ func (n *Impl) gethStartNode(executionPort, networkPort, httpPort, wsPort int, d
"--ws",
"--ws.api", "admin,eth,net,web3,debug,txpool",
"--ws.addr", "0.0.0.0",
"--ws.port", fmt.Sprintf("%d", wsPort),
"--ws.origins", "*",
//"--ws.port", fmt.Sprintf("%d", wsPort),
//"--authrpc.addr", "0.0.0.0",
//"--authrpc.port", fmt.Sprintf("%d", executionPort),
//"--authrpc.jwtsecret", path.Join(dataDirPath, "geth", "jwtsecret"),
"--port", fmt.Sprintf("%d", networkPort),
"--authrpc.addr", "0.0.0.0",
"--authrpc.port", fmt.Sprintf("%d", executionPort),
"--authrpc.jwtsecret", path.Join(dataDirPath, "geth", "jwtsecret"),
//"--port", fmt.Sprintf("%d", networkPort),
"--networkid", fmt.Sprintf("%d", n.chainID),
"--gcmode", "archive",
"--history.transactions", "0",
"--history.state", "0",
"--syncmode", "full", // sync mode to download and test all blocks and txs
"--allow-insecure-unlock", // allows to use personal accounts over http/ws
"--nodiscover", // don't try and discover peers
"--verbosity", "5", // error log level
"--verbosity", "1", // error log level
}
fmt.Printf("gethStartNode: %s %s\n", n.gethBinaryPath, strings.Join(args, " "))
cmd := exec.Command(n.gethBinaryPath, args...) //nolint
Expand Down Expand Up @@ -463,16 +464,17 @@ func (n *Impl) prysmStartBeaconNode(gethPort, rpcPort, p2pPort int, nodeDataDir
"--chain-config-file", n.prysmConfigPath,
"--contract-deployment-block", "0",
"--chain-id", fmt.Sprintf("%d", n.chainID),
"--rpc-host", "0.0.0.0",
"--grpc-gateway-host", "0.0.0.0",
"--rpc-host", "127.0.0.1",
"--rpc-port", fmt.Sprintf("%d", rpcPort),
//"--grpc-gateway-host", "0.0.0.0",
//"--grpc-gateway-corsdomain", "*",
//"--grpc-gateway-port", fmt.Sprintf("%d", rpcPort+10),
"--accept-terms-of-use",
"--jwt-secret", path.Join(nodeDataDir, "geth", "jwtsecret"),
//"--suggested-fee-recipient", n.preFundedMinerPKs["n0"]
"--minimum-peers-per-subnet", "0",
"--enable-debug-rpc-endpoints",
"--verbosity", "debug",
"--execution-endpoint", fmt.Sprintf("http://127.0.0.1:%d", gethPort),
"--force-clear-db",
"--verbosity", "trace",
}

fmt.Printf("prysmStartBeaconNode: %s %s\n", n.prysmBeaconBinaryPath, strings.Join(args, " "))
Expand All @@ -485,13 +487,15 @@ func (n *Impl) prysmStartBeaconNode(gethPort, rpcPort, p2pPort int, nodeDataDir

func (n *Impl) prysmStartValidator(beaconHTTPPort int, nodeDataDir string) (*exec.Cmd, error) {
// full command list at https://docs.prylabs.network/docs/prysm-usage/parameters
println("BEACON HTTP PORT: ", beaconHTTPPort)

args := []string{
"--datadir", path.Join(nodeDataDir, "prysm", "validator"),
"--beacon-rpc-provider", fmt.Sprintf("127.0.0.1:%d", beaconHTTPPort),
"--accept-terms-of-use",
"--interop-num-validators", fmt.Sprintf("%d", len(n.dataDirs)),
"--interop-start-index", "0",
"--chain-config-file", n.prysmConfigPath,
"--verbosity", "trace",
"--verbosity", "error",
}

fmt.Printf("prysmStartValidator: %s %s\n", n.prysmValidatorBinaryPath, strings.Join(args, " "))
Expand Down
37 changes: 37 additions & 0 deletions integration/eth2network/main/pos-network.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Run the Prysm beacon node
./beacon-chain --datadir beacondata \
--min-sync-peers 0 \
--genesis-state genesis.ssz \
--bootstrap-node= \
--interop-eth1data-votes \
--chain-config-file config.yml \
--contract-deployment-block 0 \
--chain-id 32382 \
--rpc-host=127.0.0.1 \
--rpc-port=4000 \
--accept-terms-of-use \
--jwt-secret jwt.hex \
--suggested-fee-recipient 0x123463a4B065722E99115D6c222f267d9cABb524 \
--minimum-peers-per-subnet 0 \
--enable-debug-rpc-endpoints \
--verbosity=debug \
--execution-endpoint gethdata/geth.ipc > "${prysm_logs}"/beacon-chain.log 2>&1 &

#1run Prysm validator client
./validator --beacon-rpc-provider=localhost:4000 \
--datadir validatordata \
--accept-terms-of-use \
--interop-num-validators 64 \
--chain-config-file config.yml > "${prysm_logs}"/validator.log 2>&1 &

# run go-ethereum
./geth --http \
--http.api eth,net,web3 \
--ws --ws.api eth,net,web3 \
--authrpc.jwtsecret jwt.hex \
--datadir gethdata \
--nodiscover \
--syncmode full \
--allow-insecure-unlock \
--unlock 0x123463a4b065722e99115d6c222f267d9cabb524 \
--password ./password.txt > "${prysm_logs}"/geth.log 2>&1 &

0 comments on commit 04ff2d9

Please sign in to comment.