Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

move genesis docs to genesis package and add note on initial staker handling #3574

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 2 additions & 17 deletions config/config.md
Original file line number Diff line number Diff line change
Expand Up @@ -429,23 +429,8 @@ Path to a JSON file containing the genesis data to use. Ignored when running
standard networks (Mainnet, Fuji Testnet), or when `--genesis-content` is
specified. If not given, uses default genesis data.

These are the main properties in the JSON file:

- `networkID`: A unique identifier for the blockchain, must be a number in the range [0, 2^32).
- `allocations`: The list of initial addresses, their initial balances and the unlock schedule for each.
- `startTime`: The time of the beginning of the blockchain, it must be a Unix
timestamp and it can't be a time in the future.
- `initialStakeDuration`: The stake duration, in seconds, of the validators that exist at network genesis.
- `initialStakeDurationOffset`: The offset, in seconds, between the start times
of the validators that exist at genesis.
- `initialStakedFunds`: A list of addresses that own the funds staked at genesis
(each address must be present in `allocations` as well)
- `initialStakers`: The validators that exist at genesis. Each element contains
the `rewardAddress`, NodeID and the `delegationFee` of the validator.
- `cChainGenesis`: The genesis info to be passed to the C-Chain.
- `message`: A message to include in the genesis. Not required.

For an example of a JSON representation of genesis data, see [genesis_local.json](https://github.com/ava-labs/avalanchego/blob/master/genesis/genesis_local.json).
See the documentation for the genesis JSON format [here](../genesis/README.md) and an example used for the local network genesis [here](https://github.com/ava-labs/avalanchego/blob/master/genesis/).


#### `--genesis-file-content` (string)

Expand Down
32 changes: 32 additions & 0 deletions genesis/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Genesis

The Genesis package converts formatted JSON files into the genesis of the Primary Network. For the simplest example, see the [Local Genesis](./genesis_local.json) JSON file.

The genesis JSON file contains the following properties:

- `networkID`: A unique identifier for the blockchain, must be a number in the range [0, 2^32).
- `allocations`: The list of initial addresses, their initial balances and the unlock schedule for each.
- `startTime`: The time of the beginning of the blockchain, it must be a Unix
timestamp and it can't be a time in the future.
- `initialStakeDuration`: The stake duration, in seconds, of the validators that exist at network genesis.
- `initialStakeDurationOffset`: The offset, in seconds, between the start times
of the validators that exist at genesis.
aaronbuchwald marked this conversation as resolved.
Show resolved Hide resolved
- `initialStakedFunds`: A list of addresses that own the funds staked at genesis
(each address must be present in `allocations` as well)
- `initialStakers`: The validators that exist at genesis. Each element contains
the `rewardAddress`, NodeID and the `delegationFee` of the validator.
- `cChainGenesis`: The genesis info to be passed to the C-Chain.
- `message`: A message to include in the genesis. Not required.

## Allocations and Genesis Stakers

Each allocation contains the following fields:

- `ethAddr`: Annotation of corresponding Ethereum address holding an ERC-20 token
- `avaxAddr`: X/P Chain address to receive the allocation
- `initialAmount`: Initial unlocked amount minted to the `avaxAddr` on the X-Chain
- `unlockSchedule`: List of locked, stakeable UTXOs minted to `avaxAddr` on the P-Chain

Note: if an `avaxAddr` from allocations is included in `initialStakers`, the genesis includes
all the UTXOs specified in the `unlockSchedule` as part of the locked stake of the corresponding
genesis validator. Otherwise, the locked UTXO is created directly on the P-Chain.
Loading