1

I need some transactions with predefined data that needs to be added immediately after the genesis block. Apart from actually making those transactions through Geth, is there a way to automate these transactions to be added when I set up the private chain?

  • Are there any requirements that can't be addressed with a ceremonial approach to the network launch? What are you trying to accomplish, prevent or prove? What are the constraints and concerns the solution should address and why are they composed that way? – Rob Hitchens - B9lab Apr 26 at 9:34
  • So it's for a PKI implementation using a private chain and the first block strictly needs to contain 5 specified transactions – Haran Sivaram Apr 28 at 23:40
0

With a standard Ethereum client and a private chain, or possibly Quorum, you may be able to orchestrate this ceremonially.

Consider a process along these line for experimentation.

  1. Initialize the network with a Genesis block.
  2. Start one node, not mining or verifying.
  3. Deploy genesis contracts. They will not be verified because no node is doing that.
  4. Start a miner/validator.
  5. Confirm the transactions were included in the first block.
  6. Begin adding peer nodes.

Pegasys is Consensys's research arm focused on Enterprise Ethereum. Pantheon is a backward-compatible Ethereum node written in Java. Have a look at this doc for a description of a method for adding contracts to the first block. This might be what you are looking for:

https://docs.pantheon.pegasys.tech/en/latest/Configuring-Pantheon/Contracts-in-Genesis/#predeploying-contracts-in-the-genesis-file

Hope it helps.

1

Is it absolutely required to be in the first block? With some modifications to Geth you could theoretically apply the state changes at genesis. This would mean every node that has the genesis file you specified would have the contracts predeployed, similar to what Rob was referring to with Pegasys.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.