Documentation ¶
Index ¶
- Constants
- Variables
- func FundAccounts(genesisConfig *Config, accounts []env.Account)
- func GenerateGenesis(ctx *cli.Context, accounts *env.AccountsConfig, cfg *Config, ...) (*chain.Genesis, error)
- func UnmarshalMarkerConfig()
- type AccoutInfo
- type Balance
- type BalanceList
- type BalanceMarshaling
- type BlockchainParameters
- type Config
- type DoubleSigningSlasherParameters
- type DoubleSigningSlasherParametersMarshaling
- type DowntimeSlasherParameters
- type DowntimeSlasherParametersMarshaling
- type ElectionParameters
- type ElectionParametersMarshaling
- type EpochRewardsParameters
- type EpochRewardsParametersMarshaling
- type GasPriceMinimumParameters
- type GasPriceMinimumParametersMarshaling
- type GoldTokenParameters
- type GovernanceParameters
- type GovernanceParametersMarshaling
- type HardforkConfig
- type LockedGoldParameters
- type LockedGoldRequirements
- type LockedgoldRequirementsMarshaling
- type MarkerInfo
- type MultiSigParameters
- type RandomParameters
- type TransferWhitelistParameters
- type ValidatorsParameters
- type Version
Constants ¶
const ( Second = 1 Minute = 60 * Second Hour = 60 * Minute Day = 24 * Hour Week = 7 * Day Year = 365 * Day )
durations in seconds
Variables ¶
var AdminAT env.Account
var ValidatorsAT []env.Account
Functions ¶
func FundAccounts ¶
func GenerateGenesis ¶
func GenerateGenesis(ctx *cli.Context, accounts *env.AccountsConfig, cfg *Config, contractsBuildPath string) (*chain.Genesis, error)
GenerateGenesis will create a new genesis block with full atlas blockchain already configured
func UnmarshalMarkerConfig ¶
func UnmarshalMarkerConfig()
Types ¶
type AccoutInfo ¶
type Balance ¶
Balance represents an account and it's initial balance in wei
func (Balance) MarshalJSON ¶
MarshalJSON marshals as JSON.
func (*Balance) UnmarshalJSON ¶
UnmarshalJSON unmarshals from JSON.
type BalanceList ¶
type BalanceList []Balance
BalanceList list of balances
func (BalanceList) Accounts ¶
func (bl BalanceList) Accounts() []common.Address
Accounts returns all the addresses
func (BalanceList) Amounts ¶
func (bl BalanceList) Amounts() []*big.Int
Amounts returns all the amounts
type BalanceMarshaling ¶
type BlockchainParameters ¶
type BlockchainParameters struct { Version Version `json:"version"` GasForNonGoldCurrencies uint64 `json:"gasForNonGoldCurrencies"` BlockGasLimit uint64 `json:"blockGasLimit"` }
BlockchainParameters are the initial configuration parameters for Blockchain
type Config ¶
type Config struct { ChainID *big.Int `json:"chainId"` // chainId identifies the current chain and is used for replay protection Istanbul params.IstanbulConfig `json:"istanbul"` Hardforks HardforkConfig `json:"hardforks"` GenesisTimestamp uint64 `json:"genesisTimestamp"` GasPriceMinimum GasPriceMinimumParameters LockedGold LockedGoldParameters GoldToken GoldTokenParameters Validators ValidatorsParameters Election ElectionParameters EpochRewards EpochRewardsParameters Blockchain BlockchainParameters Random RandomParameters TransferWhitelist TransferWhitelistParameters ReserveSpenderMultiSig MultiSigParameters GovernanceApproverMultiSig MultiSigParameters DoubleSigningSlasher DoubleSigningSlasherParameters DowntimeSlasher DowntimeSlasherParameters Governance GovernanceParameters }
Config represent all atlas-blockchain configuration options for the genesis block
func BaseConfig ¶
func BaseConfig() *Config
BaseConfig creates base parameters for atlas Callers must complete missing pieces
func CreateCommonGenesisConfig ¶
func CreateCommonGenesisConfig(chainID *big.Int, adminAccountAddress common.Address, istanbulConfig params.IstanbulConfig) *Config
CreateCommonGenesisConfig generates a config starting point which templates can then customize further
func LoadConfig ¶
LoadConfig will read config from a json file
func (*Config) ChainConfig ¶
func (cfg *Config) ChainConfig() *params.ChainConfig
ChainConfig returns the chain config objt for the blockchain
type DoubleSigningSlasherParameters ¶
type DoubleSigningSlasherParameters struct { Penalty *big.Int `json:"penalty"` Reward *big.Int `json:"reward"` }
DoubleSigningSlasherParameters are the initial configuration parameters for DoubleSigningSlasher
func (DoubleSigningSlasherParameters) MarshalJSON ¶
func (d DoubleSigningSlasherParameters) MarshalJSON() ([]byte, error)
MarshalJSON marshals as JSON.
func (*DoubleSigningSlasherParameters) UnmarshalJSON ¶
func (d *DoubleSigningSlasherParameters) UnmarshalJSON(input []byte) error
UnmarshalJSON unmarshals from JSON.
type DowntimeSlasherParameters ¶
type DowntimeSlasherParameters struct { Penalty *big.Int `json:"penalty"` Reward *big.Int `json:"reward"` SlashableDowntime uint64 `json:"slashableDowntime"` }
DowntimeSlasherParameters are the initial configuration parameters for DowntimeSlasher
func (DowntimeSlasherParameters) MarshalJSON ¶
func (d DowntimeSlasherParameters) MarshalJSON() ([]byte, error)
MarshalJSON marshals as JSON.
func (*DowntimeSlasherParameters) UnmarshalJSON ¶
func (d *DowntimeSlasherParameters) UnmarshalJSON(input []byte) error
UnmarshalJSON unmarshals from JSON.
type ElectionParameters ¶
type ElectionParameters struct { MinElectableValidators uint64 `json:"minElectableValidators"` MaxElectableValidators uint64 `json:"maxElectableValidators"` MaxVotesPerAccount *big.Int `json:"maxVotesPerAccount"` ElectabilityThreshold *fixed.Fixed `json:"electabilityThreshold"` }
ElectionParameters are the initial configuration parameters for Elections
func (ElectionParameters) MarshalJSON ¶
func (e ElectionParameters) MarshalJSON() ([]byte, error)
MarshalJSON marshals as JSON.
func (*ElectionParameters) UnmarshalJSON ¶
func (e *ElectionParameters) UnmarshalJSON(input []byte) error
UnmarshalJSON unmarshals from JSON.
type EpochRewardsParameters ¶
type EpochRewardsParameters struct { TargetVotingYieldInitial *fixed.Fixed `json:"targetVotingYieldInitial"` TargetVotingYieldMax *fixed.Fixed `json:"targetVotingYieldMax"` TargetVotingYieldAdjustmentFactor *fixed.Fixed `json:"targetVotingYieldAdjustmentFactor"` RewardsMultiplierMax *fixed.Fixed `json:"rewardsMultiplierMax"` RewardsMultiplierAdjustmentFactorsUnderspend *fixed.Fixed `json:"rewardsMultiplierAdjustmentFactorsUnderspend"` RewardsMultiplierAdjustmentFactorsOverspend *fixed.Fixed `json:"rewardsMultiplierAdjustmentFactorsOverspend"` TargetVotingGoldFraction *fixed.Fixed `json:"targetVotingGoldFraction"` MaxValidatorEpochPayment *big.Int `json:"maxValidatorEpochPayment"` CommunityRewardFraction *fixed.Fixed `json:"communityRewardFraction"` CommunityPartnerPartner common.Address `json:"carbonOffsettingPartner"` //CarbonOffsettingFraction *fixed.Fixed `json:"carbonOffsettingFraction"` Frozen bool `json:"frozen"` }
EpochRewardsParameters are the initial configuration parameters for EpochRewards
func (EpochRewardsParameters) MarshalJSON ¶
func (e EpochRewardsParameters) MarshalJSON() ([]byte, error)
MarshalJSON marshals as JSON.
func (*EpochRewardsParameters) UnmarshalJSON ¶
func (e *EpochRewardsParameters) UnmarshalJSON(input []byte) error
UnmarshalJSON unmarshals from JSON.
type GasPriceMinimumParameters ¶
type GasPriceMinimumParameters struct { MinimumFloor *big.Int `json:"minimumFloor"` TargetDensity *fixed.Fixed `json:"targetDensity"` AdjustmentSpeed *fixed.Fixed `json:"adjustmentSpeed"` }
GasPriceMinimumParameters are the initial configuration parameters for GasPriceMinimum
func (GasPriceMinimumParameters) MarshalJSON ¶
func (g GasPriceMinimumParameters) MarshalJSON() ([]byte, error)
MarshalJSON marshals as JSON.
func (*GasPriceMinimumParameters) UnmarshalJSON ¶
func (g *GasPriceMinimumParameters) UnmarshalJSON(input []byte) error
UnmarshalJSON unmarshals from JSON.
type GoldTokenParameters ¶
type GoldTokenParameters struct { Frozen bool `json:"frozen"` InitialBalances BalanceList `json:"initialBalances"` }
GoldTokenParameters are the initial configuration parameters for GoldToken
type GovernanceParameters ¶
type GovernanceParameters struct { UseMultiSig bool `json:"useMultiSig"` // whether the approver should be the multisig (otherwise it's the admin) ConcurrentProposals uint64 `json:"concurrentProposals"` MinDeposit *big.Int `json:"minDeposit"` QueueExpiry uint64 `json:"queueExpiry"` DequeueFrequency uint64 `json:"dequeueFrequency"` ApprovalStageDuration uint64 `json:"approvalStageDuration"` ReferendumStageDuration uint64 `json:"referendumStageDuration"` ExecutionStageDuration uint64 `json:"executionStageDuration"` ParticipationBaseline *fixed.Fixed `json:"participationBaseline"` ParticipationFloor *fixed.Fixed `json:"participationFloor"` BaselineUpdateFactor *fixed.Fixed `json:"baselineUpdateFactor"` BaselineQuorumFactor *fixed.Fixed `json:"baselineQuorumFactor"` }
GovernanceParameters are the initial configuration parameters for Governance
func (GovernanceParameters) MarshalJSON ¶
func (g GovernanceParameters) MarshalJSON() ([]byte, error)
MarshalJSON marshals as JSON.
func (*GovernanceParameters) UnmarshalJSON ¶
func (g *GovernanceParameters) UnmarshalJSON(input []byte) error
UnmarshalJSON unmarshals from JSON.
type HardforkConfig ¶
type HardforkConfig struct { ChurritoBlock *big.Int `json:"churritoBlock"` DonutBlock *big.Int `json:"donutBlock"` }
HardforkConfig contains atlas hardforks activation blocks
type LockedGoldParameters ¶
type LockedGoldParameters struct {
UnlockingPeriod uint64 `json:"unlockingPeriod"`
}
LockedGoldParameters are the initial configuration parameters for LockedGold
type LockedGoldRequirements ¶
type LockedGoldRequirements struct { Value *big.Int `json:"value"` Duration uint64 `json:"duration"` }
LockedGoldRequirements represents value/duration requirments on locked gold
func (LockedGoldRequirements) MarshalJSON ¶
func (l LockedGoldRequirements) MarshalJSON() ([]byte, error)
MarshalJSON marshals as JSON.
func (*LockedGoldRequirements) UnmarshalJSON ¶
func (l *LockedGoldRequirements) UnmarshalJSON(input []byte) error
UnmarshalJSON unmarshals from JSON.
type MarkerInfo ¶
type MarkerInfo struct { AdminInfo AccoutInfo Validators []AccoutInfo }
type MultiSigParameters ¶
type MultiSigParameters struct { Signatories []common.Address `json:"signatories"` NumRequiredConfirmations uint64 `json:"numRequiredConfirmations"` NumInternalRequiredConfirmations uint64 `json:"numInternalRequiredConfirmations"` }
MultiSigParameters are the initial configuration parameters for a MultiSig contract
type RandomParameters ¶
type RandomParameters struct {
RandomnessBlockRetentionWindow uint64 `json:"randomnessBlockRetentionWindow"`
}
RandomParameters are the initial configuration parameters for Random
type TransferWhitelistParameters ¶
type TransferWhitelistParameters struct { Addresses []common.Address `json:"addresses"` RegistryIDs []common.Hash `json:"registryIds"` }
TransferWhitelistParameters are the initial configuration parameters for TransferWhitelist
type ValidatorsParameters ¶
type ValidatorsParameters struct { ValidatorLockedGoldRequirements LockedGoldRequirements `json:"validatorLockedGoldRequirements"` ValidatorScoreExponent uint64 `json:"validatorScoreExponent"` ValidatorScoreAdjustmentSpeed *fixed.Fixed `json:"validatorScoreAdjustmentSpeed"` MembershipHistoryLength uint64 `json:"membershipHistoryLength"` SlashingPenaltyResetPeriod uint64 `json:"slashingPenaltyResetPeriod"` CommissionUpdateDelay uint64 `json:"commissionUpdateDelay"` DowntimeGracePeriod uint64 `json:"downtimeGracePeriod"` Commission *fixed.Fixed `json:"commission"` // commission for genesis registered validator }
ValidatorsParameters are the initial configuration parameters for Validators
Source Files ¶
- base_config.go
- config.go
- gen_balance_json.go
- gen_double_signing_slasher_parameters_json.go
- gen_downtime_slasher_parameters_json.go
- gen_election_parameters_json.go
- gen_epoch_rewards_parameters_json.go
- gen_gas_price_minimum_parameters_json.go
- gen_governance_parameters_json.go
- gen_locked_gold_requirements_json.go
- genesis.go
- genesis_state.go