0

can one please advise how to include transactions in the genesis block of private ethereum network ?

can it be done via genesis.json similarly to contract using code: parameter ?

  • Why do you need this? – Ha ĐANG Oct 31 '18 at 14:50
  • testing purposes and expending my knowledge – m1k3y3 Oct 31 '18 at 14:55
  • so you can drill down into the source code :) – Ha ĐANG Oct 31 '18 at 14:59
1

base on the current source code of ethereum, you cannot include tnx in the genesis block

type Genesis struct {
    Config     *params.ChainConfig `json:"config"`
    Nonce      uint64              `json:"nonce"`
    Timestamp  uint64              `json:"timestamp"`
    ExtraData  []byte              `json:"extraData"`
    GasLimit   uint64              `json:"gasLimit"   gencodec:"required"`
    Difficulty *big.Int            `json:"difficulty" gencodec:"required"`
    Mixhash    common.Hash         `json:"mixHash"`
    Coinbase   common.Address      `json:"coinbase"`
    Alloc      GenesisAlloc        `json:"alloc"      gencodec:"required"`

    // These fields are used for consensus tests. Please don't use them
    // in actual genesis blocks.
    Number     uint64      `json:"number"`
    GasUsed    uint64      `json:"gasUsed"`
    ParentHash common.Hash `json:"parentHash"`
}

Hope this help!

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.