poanetwork / posdao-contracts

Smart contracts for POSDAO (Proof of Stake Decentralized Autonomous Organization consensus), a DPOS consensus implemented in Solidity and running within EVM with swappable BFT consensus
Other
106 stars 50 forks source link

Use a JSON file for specifying the parameters #20

Closed DemiMarie closed 5 years ago

DemiMarie commented 5 years ago

The initial parameters should be specified in a JSON file, rather than as environment variables passed to scripts/make_spec.js.

varasev commented 5 years ago

I think the parameters for spec.json should be initialized in pos-contracts repo.

Other parameters which are related to Parity should be initialized in the code in parity-ethereum repo.

So, the suggestion is not to mix those.

DemiMarie commented 5 years ago

@varasev What about parameters such as the initial validator set and the duration of the staking epoch?

Should those be in the bytecode of the initializer contract, or should they be in a separate place in spec.json?

varasev commented 5 years ago

Those params must be written to the state of the contracts, so let's leave them in the Initializer contract.

DemiMarie commented 5 years ago

@varasev Currently, those parameters are stored in a shell script and passed as environment variables. Would it be better to pass them in a JSON file instead? That would make it easier for other tools to read them.

varasev commented 5 years ago

No, I think it's enough to have them in a shell like this: https://github.com/poanetwork/pos-test-setup/blob/master/scripts/network-spec - this won't be used by other tools except our test setup.