// ============================================================================================
//  THE PRODUCTION GENESIS. EDIT IT ONCE, HERE, BEFORE YOU PUBLISH.
//
//  The four addresses below are placeholders and are not addresses at all, so a node pointed at
//  this file refuses to start and says which field is wrong. That is deliberate: the alternative
//  failure - a genesis that parses and names validators whose keys nobody holds - is a chain
//  that starts, looks healthy, and never produces a block.
//
//  Editing it here rather than in the published folder is the whole point. `dotnet publish`
//  copies it into the output, so every server gets byte-identical bytes without anybody copying
//  a file four times and getting one of them wrong. Addresses are public; only keys are not, and
//  no key goes in this file.
//
//  A different network - a testnet, a second chain - gets its own file and its own chainId, not
//  an edit to this one.
// ============================================================================================
//
//  To fill it in:
//
//    1. Generate one key per node:   dotnet run --project Chain.Cli -- wallet new --words 24
//    2. Read each address back:      dotnet Chain.Node.dll --node:PrintValidatorAddress=true \
//                                        --node:ValidatorPrivateKey=0x<that node's key>
//    3. Replace the four placeholders below. EACH APPEARS TWICE - once in genesisStake and once
//       in alloc, so there are eight edits and four distinct addresses.
//    4. dotnet publish, and upload the output.
//
//  You do not have to check by eye, and a search is not the way either - these instructions
//  contain the placeholder text themselves, so a search always finds something. The node does
//  the checking: started on an unedited file it refuses to open at all and names the exact
//  field, because a placeholder is not a valid address.
//
//      InvalidChainSpecException: '0xREPLACE_...' in "consensus.genesisStake" is not an address.
//
{
  "name": "AloKadoE-pos",

  // Deliberately not 7332, which the old proof-of-work network used. A chain id is signed into
  // every transaction, so a wallet or an explorer still configured for the old network is
  // refused outright here rather than quietly connecting to a chain it knows nothing about.
  "chainId": 7340,

  "currency": { "name": "AloKadoE", "symbol": "AKE", "decimals": 18 },

  // Two seconds. There is no work to find, so the limit is how long a block takes to travel
  // between the nodes and be executed, not how long it takes to solve.
  "blockPeriodSeconds": 2,
  "gasLimit": 30000000,

  // 2026-09-01 00:00:00Z, deliberately in the PAST so the chain starts producing the moment the
  // first node comes up.
  //
  // A timestamp in the future is a trap worth knowing about: the node starts perfectly, logs
  // "Block production started", finds its peers, and sits at block 0 until that moment arrives.
  // Everything looks healthy and nothing happens.
  //
  //   date -d '2026-09-01 00:00:00 UTC' +%s
  "genesisTimestamp": 1788220800,

  "initialBaseFeePerGas": "1000000000",

  "consensus": {
    "type": "pos",

    // How long a backup waits before standing in for a validator that has not produced. Two
    // seconds: one node going down costs the network one step per block, not a halt.
    "slotStepSeconds": 2,

    // Four, matching the four founders below. Two thirds of four is 2.67, so THREE of the four
    // have to vote: one node can be restarted without finality stopping.
    //
    // It stays at four when a fifth validator joins, and then three of five suffices - more
    // headroom, not less. Lowering it is never the answer to an uptime problem; another
    // validator is.
    "minimumValidators": 4,

    // What a seat costs to keep. The bond minimum is checked once, when a bond is made; this is
    // the floor a validator has to keep standing on to stay in the electorate.
    "minimumVotingStake": "1000000000000000000",

    // The four founders. A thousand coins each: equal weight, so no two of them together reach
    // two thirds.
    //
    // A fifth validator does not go here. It joins later by bonding, which is a transaction on
    // the running chain and needs no new genesis - that is the difference between proof of stake
    // and the fixed list proof of authority would have given you.
    "genesisStake": {
      "0x295A54f3923223f2855f2c81641C2609D7aACcA8": "1000000000000000000000",
      "0xDD10DeB839Cf71fA3dfB8740d229e3B64903e80F":    "1000000000000000000000",
      "0x09D35b79D509BE374eCd248d585114f2Db5eE07B":  "1000000000000000000000",
      "0xf33CF2CcB572A029436B4e8E25Eac9CC9b0f362E":   "1000000000000000000000"
    }
  },

  "execution": { "mode": "parallel" },

  // 2 coins per block. At two seconds that is about 15.8 million blocks a year, so the halving
  // interval is a year's worth: issuance halves annually and the schedule is fixed here, because
  // issuance that can be changed later is issuance holders cannot reason about.
  "reward": { "type": "halving", "initial": "2000000000000000000", "halvingIntervalBlocks": 15768000 },

  // Founders need spending money as well as stake. Recording a vote on chain and reporting an
  // offence are both transactions; a validator with an empty balance can do neither, which would
  // mean it earns no staking rewards and cannot report anybody who misbehaves.
  //
  // Ten coins is years of vote records at this fee level. It is not a premine worth arguing
  // about, and it is not the stake - the stake is above.
  "alloc": {
    "0x295A54f3923223f2855f2c81641C2609D7aACcA8": "10000000000000000000",
    "0xDD10DeB839Cf71fA3dfB8740d229e3B64903e80F":    "10000000000000000000",
    "0x09D35b79D509BE374eCd248d585114f2Db5eE07B":  "10000000000000000000",
    "0xf33CF2CcB572A029436B4e8E25Eac9CC9b0f362E":   "10000000000000000000"
  }
}
