public static EthProtocolManager create(final TimeoutPolicy timeoutPolicy) { final ProtocolSchedule<Void> protocolSchedule = MainnetProtocolSchedule.create(); final GenesisConfigFile config = GenesisConfigFile.mainnet(); final GenesisState genesisState = GenesisState.fromConfig(config, protocolSchedule); final Blockchain blockchain = createInMemoryBlockchain(genesisState.getBlock()); final WorldStateArchive worldStateArchive = createInMemoryWorldStateArchive(); return create(blockchain, worldStateArchive, timeoutPolicy); }
@Before public void setup() { protocolSchedule = CliqueProtocolSchedule.create( GenesisConfigFile.DEFAULT.getConfigOptions(), proposerKeyPair); final Address otherAddress = Util.publicKeyToAddress(otherKeyPair.getPublicKey()); validatorList.add(otherAddress); final VoteTallyCache voteTallyCache = mock(VoteTallyCache.class); when(voteTallyCache.getVoteTallyAfterBlock(any())).thenReturn(new VoteTally(validatorList)); voteProposer = new VoteProposer(); final CliqueContext cliqueContext = new CliqueContext(voteTallyCache, voteProposer, null); final Block genesis = GenesisState.fromConfig(GenesisConfigFile.mainnet(), protocolSchedule).getBlock(); blockchain = createInMemoryBlockchain(genesis); protocolContext = new ProtocolContext<>(blockchain, stateArchive, cliqueContext); // Add a block above the genesis final BlockHeaderTestFixture headerTestFixture = new BlockHeaderTestFixture(); headerTestFixture.number(1).parentHash(genesis.getHeader().getHash()); final Block emptyBlock = new Block( TestHelpers.createCliqueSignedBlockHeader( headerTestFixture, otherKeyPair, validatorList), new BlockBody(Lists.newArrayList(), Lists.newArrayList())); blockchain.appendBlock(emptyBlock, Lists.newArrayList()); }
final PrivacyParameters privacyParameters) { final GenesisState genesisState = GenesisState.fromConfig(genesisConfig, protocolSchedule); final BlockchainStorage blockchainStorage = storageProvider.createBlockchainStorage(protocolSchedule);
final ProtocolSchedule<IbftContext> protocolSchedule = IbftProtocolSchedule.create(genesisConfig.getConfigOptions()); final GenesisState genesisState = GenesisState.fromConfig(genesisConfig, protocolSchedule); final BlockchainStorage blockchainStorage = storageProvider.createBlockchainStorage(protocolSchedule);
final ProtocolSchedule<CliqueContext> protocolSchedule = CliqueProtocolSchedule.create(genesisConfig.getConfigOptions(), nodeKeys); final GenesisState genesisState = GenesisState.fromConfig(genesisConfig, protocolSchedule); final BlockchainStorage blockchainStorage = storageProvider.createBlockchainStorage(protocolSchedule);
final ProtocolSchedule<IbftContext> protocolSchedule = IbftProtocolSchedule.create(genesisConfig.getConfigOptions()); final GenesisState genesisState = GenesisState.fromConfig(genesisConfig, protocolSchedule); final BlockchainStorage blockchainStorage = storageProvider.createBlockchainStorage(protocolSchedule);
GenesisConfigFile.development().getConfigOptions(), PrivacyParameters.noPrivacy()); final GenesisState genesisState = GenesisState.fromConfig(genesisConfigFile, protocolSchedule); final BlockHashFunction blockHashFunction = ScheduleBasedBlockHashFunction.create(protocolSchedule);