Skip to content

Commit

Permalink
Revert seal parameter removal (#2024)
Browse files Browse the repository at this point in the history
* Revert "Removed seal parameter (#1886)"

This reverts commit 4d379fd.

* Fix

* Set validator field
  • Loading branch information
Stefan-Ethernal committed Nov 2, 2023
1 parent 34e08f1 commit fa8c777
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 17 deletions.
16 changes: 8 additions & 8 deletions command/regenesis/howtotest.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,10 +94,10 @@ This document outlines step necessary to perform a regenesis data migration.
8. Try to start a new v0.7 chain
```bash
./polygon-edge server --data-dir ./test-chain-1 --chain genesis.json --grpc-address :10000 --libp2p :30301 --jsonrpc :10002 --log-level DEBUG &
./polygon-edge server --data-dir ./test-chain-2 --chain genesis.json --grpc-address :20000 --libp2p :30302 --jsonrpc :20002 --log-level DEBUG &
./polygon-edge server --data-dir ./test-chain-3 --chain genesis.json --grpc-address :30000 --libp2p :30303 --jsonrpc :30002 --log-level DEBUG &
./polygon-edge server --data-dir ./test-chain-4 --chain genesis.json --grpc-address :40000 --libp2p :30304 --jsonrpc :40002 --log-level DEBUG &
./polygon-edge server --data-dir ./test-chain-1 --chain genesis.json --grpc-address :10000 --libp2p :30301 --jsonrpc :10002 --seal --log-level DEBUG &
./polygon-edge server --data-dir ./test-chain-2 --chain genesis.json --grpc-address :20000 --libp2p :30302 --jsonrpc :20002 --seal --log-level DEBUG &
./polygon-edge server --data-dir ./test-chain-3 --chain genesis.json --grpc-address :30000 --libp2p :30303 --jsonrpc :30002 --seal --log-level DEBUG &
./polygon-edge server --data-dir ./test-chain-4 --chain genesis.json --grpc-address :40000 --libp2p :30304 --jsonrpc :40002 --seal --log-level DEBUG &
wait

[1] 2615
Expand Down Expand Up @@ -140,10 +140,10 @@ This document outlines step necessary to perform a regenesis data migration.
10. Run chain again
```bash
./polygon-edge server --data-dir ./test-chain-1 --chain genesis.json --grpc-address :10000 --libp2p :30301 --jsonrpc :10002 --log-level DEBUG &
./polygon-edge server --data-dir ./test-chain-2 --chain genesis.json --grpc-address :20000 --libp2p :30302 --jsonrpc :20002 --log-level DEBUG &
./polygon-edge server --data-dir ./test-chain-3 --chain genesis.json --grpc-address :30000 --libp2p :30303 --jsonrpc :30002 --log-level DEBUG &
./polygon-edge server --data-dir ./test-chain-4 --chain genesis.json --grpc-address :40000 --libp2p :30304 --jsonrpc :40002 --log-level DEBUG &
./polygon-edge server --data-dir ./test-chain-1 --chain genesis.json --grpc-address :10000 --libp2p :30301 --jsonrpc :10002 --seal --log-level DEBUG &
./polygon-edge server --data-dir ./test-chain-2 --chain genesis.json --grpc-address :20000 --libp2p :30302 --jsonrpc :20002 --seal --log-level DEBUG &
./polygon-edge server --data-dir ./test-chain-3 --chain genesis.json --grpc-address :30000 --libp2p :30303 --jsonrpc :30002 --seal --log-level DEBUG &
./polygon-edge server --data-dir ./test-chain-4 --chain genesis.json --grpc-address :40000 --libp2p :30304 --jsonrpc :40002 --seal --log-level DEBUG &
wait
[1] 2721
Expand Down
4 changes: 3 additions & 1 deletion command/server/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ type Config struct {
JSONRPCAddr string `json:"jsonrpc_addr" yaml:"jsonrpc_addr"`
Telemetry *Telemetry `json:"telemetry" yaml:"telemetry"`
Network *Network `json:"network" yaml:"network"`
ShouldSeal bool `json:"seal" yaml:"seal"`
TxPool *TxPool `json:"tx_pool" yaml:"tx_pool"`
LogLevel string `json:"log_level" yaml:"log_level"`
RestoreFile string `json:"restore_file" yaml:"restore_file"`
Expand Down Expand Up @@ -116,7 +117,8 @@ func DefaultConfig() *Config {
defaultNetworkConfig.Addr.Port,
),
},
Telemetry: &Telemetry{},
Telemetry: &Telemetry{},
ShouldSeal: true,
TxPool: &TxPool{
PriceLimit: 0,
MaxSlots: 4096,
Expand Down
2 changes: 2 additions & 0 deletions command/server/params.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ const (
prometheusAddressFlag = "prometheus"
natFlag = "nat"
dnsFlag = "dns"
sealFlag = "seal"
maxPeersFlag = "max-peers"
maxInboundPeersFlag = "max-inbound-peers"
maxOutboundPeersFlag = "max-outbound-peers"
Expand Down Expand Up @@ -176,6 +177,7 @@ func (p *serverParams) generateConfig() *server.Config {
Chain: p.genesisConfig,
},
DataDir: p.rawConfig.DataDir,
Seal: p.rawConfig.ShouldSeal,
PriceLimit: p.rawConfig.TxPool.PriceLimit,
MaxSlots: p.rawConfig.TxPool.MaxSlots,
MaxAccountEnqueued: p.rawConfig.TxPool.MaxAccountEnqueued,
Expand Down
7 changes: 7 additions & 0 deletions command/server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,13 @@ func setFlags(cmd *cobra.Command) {
"the path to the archive blockchain data to restore on initialization",
)

cmd.Flags().BoolVar(
&params.rawConfig.ShouldSeal,
sealFlag,
defaultConfig.ShouldSeal,
"the flag indicating that the client should seal blocks",
)

cmd.Flags().BoolVar(
&params.rawConfig.Network.NoDiscover,
command.NoDiscoverFlag,
Expand Down
10 changes: 5 additions & 5 deletions consensus/polybft/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -119,22 +119,22 @@ It has a native support for running bridge, which enables running cross-chain tr

```bash
$ polygon-edge server --data-dir ./test-chain-1 --chain genesis.json --grpc-address :5001 --libp2p :30301 --jsonrpc :9545 \
--log-level DEBUG
--seal --log-level DEBUG

$ polygon-edge server --data-dir ./test-chain-2 --chain genesis.json --grpc-address :5002 --libp2p :30302 --jsonrpc :10002 \
--log-level DEBUG
--seal --log-level DEBUG

$ polygon-edge server --data-dir ./test-chain-3 --chain genesis.json --grpc-address :5003 --libp2p :30303 --jsonrpc :10003 \
--log-level DEBUG
--seal --log-level DEBUG

$ polygon-edge server --data-dir ./test-chain-4 --chain genesis.json --grpc-address :5004 --libp2p :30304 --jsonrpc :10004 \
--log-level DEBUG
--seal --log-level DEBUG
```

It is possible to run child chain nodes in "relayer" mode. It allows automatic execution of deposit events on behalf of users.
In order to start node in relayer mode, it is necessary to supply `--relayer` flag:

```bash
$ polygon-edge server --data-dir ./test-chain-1 --chain genesis.json --grpc-address :5001 --libp2p :30301 --jsonrpc :9545 \
--log-level DEBUG --relayer
--seal --log-level DEBUG --relayer
```
9 changes: 6 additions & 3 deletions docker/local/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,8 @@ services:
"--grpc-address", "0.0.0.0:9632",
"--libp2p", "0.0.0.0:1478",
"--jsonrpc", "0.0.0.0:8545",
"--prometheus", "0.0.0.0:5001"
"--prometheus", "0.0.0.0:5001",
"--seal"
]
depends_on:
init:
Expand All @@ -98,7 +99,8 @@ services:
"--grpc-address", "0.0.0.0:9632",
"--libp2p", "0.0.0.0:1478",
"--jsonrpc", "0.0.0.0:8545",
"--prometheus", "0.0.0.0:5001"
"--prometheus", "0.0.0.0:5001",
"--seal"
]
depends_on:
init:
Expand All @@ -125,7 +127,8 @@ services:
"--grpc-address", "0.0.0.0:9632",
"--libp2p", "0.0.0.0:1478",
"--jsonrpc", "0.0.0.0:8545",
"--prometheus", "0.0.0.0:5001"
"--prometheus", "0.0.0.0:5001",
"--seal"
]
depends_on:
init:
Expand Down

0 comments on commit fa8c777

Please sign in to comment.