0xPolygon / polygon-edge

A Framework for Building Ethereum-compatible Blockchain Networks
https://polygon.technology/solutions/polygon-edge/
Apache License 2.0
1.01k stars 533 forks source link

expected one consensus engine but found 2 #1995

Closed EverestSmartChain closed 1 year ago

EverestSmartChain commented 1 year ago

Deploying Root Contracts

While Deploying root contracts , after genesis data is created started the geth node using command ./polygon-edge rootchain server once this container is running , deployed the staking manager using the test flag

./polygon-edge polybft stake-manager-deploy \ --proxy-contracts-admin 0x156012dEbc7834742A27C2b67E9bDBBEC8d1c6A9 \ --genesis ./genesis_data \ --jsonrpc http://127.0.0.1:8545 \ --test

Succeds

I grabbed the staking manager address and token address from genesis data

then deploy the root contract ./polygon-edge rootchain deploy \ --stake-manager \ --stake-token 0xaddressOfStakeToken \ --proxy-contracts-admin 0xaddressOfProxyContractsAdmin \ --genesis ./genesis.json \ --json-rpc http://127.0.0.1:8545 \ --test

Then it throws error

expected one consensus engine but found 2

No Idea where i am wrong

The genesis data was created using the below , i dont care about any keys as i can create other accounts later

./evt genesis --block-gas-limit 10000000 \ --block-time 3s \ --bootnode /ip4/158.69.35.30/tcp/30301/p2p/16Uiu2HAm7PDNYDAcAz3vVSiyFfgycBNENASydX79eGaak5p9hs9C \ --chain-id 8848 \ --consensus ibft \ --dir ./genesis_data \ --epoch-reward 5000000000000000000 \ --epoch-size 100 \ --ibft-validator-type ecdsa \ --max-validator-count 100 \ --min-validator-count 1 \ --name "Everest Smart Chain" \ --native-token-config "EverestSmartChait:EVT:18:true/false" \ --pos \ --premine 0x156012dEbc7834742A27C2b67E9bDBBEC8d1c6A9:1000000000000000000000000000000 \ --reward-wallet 0x156012dEbc7834742A27C2b67E9bDBBEC8d1c6A9:50000000000000000000000000000 \ --sprint-size 10 \ --validators "/ip4/158.69.35.30/tcp/30301/p2p/16Uiu2HAm7PDNYDAcAz3vVSiyFfgycBNENASydX79eGaak5p9hs9C:0x156012dEbc7834742A27C2b67E9bDBBEC8d1c6A9:0c8af17825ff86ba3d28dc89d492b4df45d34fc98d436d6d3aff7ebcd8b7f0271ba03a5b1090fb9042b360ef255200269fc199b20b277e17e629c22a00da033a050a4b6acc1ff09ccb1df538544962b932ae4aa83b0e5acf307b1e03b2f886de08f52baf5b5e21d689ecc06a2fff1208730560596d7691d84b0ea3f42109149e" \ --ibft-validator 0x156012dEbc7834742A27C2b67E9bDBBEC8d1c6A9

goran-ethernal commented 1 year ago

Well, you are trying to use the old --consensus ibft, but you are doing deployment steps for --consensus polybft, that is why in the genesis file you have configurations for both consensus, hence the error.

Deploying stake manager, and root contracts is the deployment step for polybft and creates configuration in genesis.json specific to it.

You need to change the consensus to polybft or if you specifically want ibft then, do not do the before mentioned steps for deploying stake manager and other root contracts in deploy command.

EverestSmartChain commented 1 year ago

Thanks