Documentation ¶
Index ¶
- Constants
- func FundAccounts(genesisConfig *Config, accounts []env.Account)
- func GenerateGenesis(accounts *env.AccountsConfig, cfg *Config, contractsBuildPath string) (*core.Genesis, error)
- type AssetAllocation
- type AssetAllocationList
- type AttestationsParameters
- 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 ExchangeParameters
- type FeeHandlerParameters
- type GasPriceMinimumParameters
- type GasPriceMinimumParametersMarshaling
- type GoldTokenParameters
- type GovernanceParameters
- type GovernanceParametersMarshaling
- type GrandaMentoParameters
- type HardforkConfig
- type LockedGoldParameters
- type LockedGoldRequirements
- type LockedgoldRequirementsMarshaling
- type MultiSigParameters
- type RandomParameters
- type ReserveParameters
- type ReserveParametersMarshaling
- type SortedOraclesParameters
- type StableTokenExchangeLimit
- type StableTokenExchangeLimitsList
- type StableTokenExchangeLimitsMarshaling
- type StableTokenParameters
- type ValidatorsParameters
Constants ¶
const ( Second = 1 Minute = 60 * Second Hour = 60 * Minute Day = 24 * Hour Week = 7 * Day Year = 365 * Day )
durations in seconds
Variables ¶
This section is empty.
Functions ¶
func FundAccounts ¶ added in v1.4.0
func GenerateGenesis ¶
func GenerateGenesis(accounts *env.AccountsConfig, cfg *Config, contractsBuildPath string) (*core.Genesis, error)
GenerateGenesis will create a new genesis block with full celo blockchain already configured
Types ¶
type AssetAllocation ¶
AssetAllocation config for Reserve
type AssetAllocationList ¶
type AssetAllocationList []AssetAllocation
AssetAllocationList list of AssetAllocation
func (AssetAllocationList) SymbolsABI ¶
func (aa AssetAllocationList) SymbolsABI() []common.Hash
SymbolsABI returns symbols in ABI format for assets in list
func (AssetAllocationList) Weights ¶
func (aa AssetAllocationList) Weights() []*big.Int
Weights returns weights for assets in list
type AttestationsParameters ¶
type AttestationsParameters struct { AttestationExpiryBlocks uint64 `json:"attestationExpiryBlocks"` SelectIssuersWaitBlocks uint64 `json:"selectIssuersWaitBlocks"` MaxAttestations uint64 `json:"maxAttestations"` AttestationRequestFeeInDollars decimal.Decimal `json:"AttestationRequestFeeInDollars"` }
AttestationsParameters are the initial configuration parameters for Attestations
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 { 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"` SortedOracles SortedOraclesParameters GasPriceMinimum GasPriceMinimumParameters Reserve ReserveParameters StableToken StableTokenParameters StableTokenEUR StableTokenParameters StableTokenBRL StableTokenParameters Exchange ExchangeParameters ExchangeEUR ExchangeParameters ExchangeBRL ExchangeParameters LockedGold LockedGoldParameters GoldToken GoldTokenParameters Validators ValidatorsParameters Election ElectionParameters EpochRewards EpochRewardsParameters Blockchain BlockchainParameters Random RandomParameters Attestations AttestationsParameters ReserveSpenderMultiSig MultiSigParameters GovernanceApproverMultiSig MultiSigParameters DoubleSigningSlasher DoubleSigningSlasherParameters DowntimeSlasher DowntimeSlasherParameters Governance GovernanceParameters GrandaMento GrandaMentoParameters FeeHandler FeeHandlerParameters }
Config represent all celo-blockchain configuration options for the genesis block
func BaseConfig ¶
BaseConfig creates base parameters for celo Callers must complete missing pieces
func CreateCommonGenesisConfig ¶ added in v1.4.0
func CreateCommonGenesisConfig(chainID *big.Int, adminAccountAddress common.Address, istanbulConfig params.IstanbulConfig, gingerbreadBlock *big.Int) (*Config, error)
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"` CarbonOffsettingPartner 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 ExchangeParameters ¶
type ExchangeParameters struct { Frozen bool `json:"frozen"` Spread *fixed.Fixed `json:"spread"` ReserveFraction *fixed.Fixed `json:"reserveFraction"` UpdateFrequency uint64 `json:"updateFrequency"` MinimumReports uint64 `json:"minimumReports"` }
ExchangeParameters are the initial configuration parameters for Exchange
type FeeHandlerParameters ¶ added in v1.8.0
type FeeHandlerParameters struct { NewFeeBeneficiary common.Address `json:"newFeeBeneficiary"` NewBurnFraction *fixed.Fixed `json:"newBurnFraction"` Tokens []common.Address `json:"tokens"` Handlers []common.Address `json:"handlers"` NewLimits []*big.Int `json:"newLimits"` NewMaxSlippages []*big.Int `json:"newMaxSlippages"` }
FeeHandlerParameters are the initial configuration parameters for FeeHandler
type GasPriceMinimumParameters ¶
type GasPriceMinimumParameters struct { MinimumFloor *big.Int `json:"minimumFloor"` TargetDensity *fixed.Fixed `json:"targetDensity"` AdjustmentSpeed *fixed.Fixed `json:"adjustmentSpeed"` BaseFeeOpCodeActivationBlock *big.Int `json:"baseFeeOpCodeActivationBlock"` }
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"` 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 GrandaMentoParameters ¶ added in v1.7.3
type GrandaMentoParameters struct { Approver common.Address `json:"approver"` MaxApprovalExchangeRateChange *fixed.Fixed `json:"maxApprovalExchangeRateChange"` Spread *fixed.Fixed `json:"spread"` VetoPeriodSeconds uint64 `json:"vetoPeriodSeconds"` StableTokenExchangeLimits StableTokenExchangeLimitsList `json:"stableTokenExchangeLimits"` }
GrandaMentoParameters are the initial configuration parameters for GrandaMento
type HardforkConfig ¶
type HardforkConfig struct { ChurritoBlock *big.Int `json:"churritoBlock"` DonutBlock *big.Int `json:"donutBlock"` EspressoBlock *big.Int `json:"espressoBlock"` GingerbreadBlock *big.Int `json:"gingerbreadBlock"` GingerbreadP2Block *big.Int `json:"gingerbreadP2Block"` }
HardforkConfig contains celo 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 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 ReserveParameters ¶
type ReserveParameters struct { TobinTaxStalenessThreshold uint64 `json:"tobinTaxStalenessThreshold"` DailySpendingRatio *fixed.Fixed `json:"dailySpendingRatio"` AssetAllocations AssetAllocationList `json:"assetAllocations"` TobinTax *fixed.Fixed `json:"tobinTax"` TobinTaxReserveRatio *fixed.Fixed `json:"tobinTaxReserveRatio"` // Other parameters Spenders []common.Address `json:"spenders"` OtherAddresses []common.Address `json:"otherAddresses"` InitialBalance *big.Int `json:"initialBalance"` FrozenAssetsStartBalance *big.Int `json:"frozenAssetsStartBalance"` FrozenAssetsDays uint64 `json:"frozenAssetsDays"` }
ReserveParameters are the initial configuration parameters for Reserve
func (ReserveParameters) MarshalJSON ¶
func (r ReserveParameters) MarshalJSON() ([]byte, error)
MarshalJSON marshals as JSON.
func (*ReserveParameters) UnmarshalJSON ¶
func (r *ReserveParameters) UnmarshalJSON(input []byte) error
UnmarshalJSON unmarshals from JSON.
type SortedOraclesParameters ¶
type SortedOraclesParameters struct {
ReportExpirySeconds uint64 `json:"reportExpirySeconds"`
}
SortedOraclesParameters are the initial configuration parameters for SortedOracles
type StableTokenExchangeLimit ¶ added in v1.7.3
type StableTokenExchangeLimit struct { StableToken string `json:"stableToken"` MinExchangeAmount *big.Int `json:"minExchangeAmount"` MaxExchangeAmount *big.Int `json:"maxExchangeAmount"` }
StableTokenExchangeLimit represents the granda mento's exchange limit for a specific stable
func (StableTokenExchangeLimit) MarshalJSON ¶ added in v1.7.3
func (s StableTokenExchangeLimit) MarshalJSON() ([]byte, error)
MarshalJSON marshals as JSON.
func (*StableTokenExchangeLimit) UnmarshalJSON ¶ added in v1.7.3
func (s *StableTokenExchangeLimit) UnmarshalJSON(input []byte) error
UnmarshalJSON unmarshals from JSON.
type StableTokenExchangeLimitsList ¶ added in v1.7.3
type StableTokenExchangeLimitsList []StableTokenExchangeLimit
BalanceList list of balances
type StableTokenExchangeLimitsMarshaling ¶ added in v1.7.3
type StableTokenParameters ¶
type StableTokenParameters struct { Name string `json:"name"` Symbol string `json:"symbol"` Decimals uint8 `json:"decimals"` Rate *fixed.Fixed `json:"rate"` InflationFactorUpdatePeriod uint64 `json:"inflationFactorUpdatePeriod"` // How often the inflation factor is updated. InitialBalances BalanceList `json:"initialBalances"` Frozen bool `json:"frozen"` Oracles []common.Address `json:"oracles"` GoldPrice *fixed.Fixed `json:"goldPrice"` ExchangeIdentifier string `json:"exchangeIdentifier"` }
StableTokenParameters are the initial configuration parameters for StableToken
type ValidatorsParameters ¶
type ValidatorsParameters struct { GroupLockedGoldRequirements LockedGoldRequirements `json:"groupLockedGoldRequirements"` ValidatorLockedGoldRequirements LockedGoldRequirements `json:"validatorLockedGoldRequirements"` ValidatorScoreExponent uint64 `json:"validatorScoreExponent"` ValidatorScoreAdjustmentSpeed *fixed.Fixed `json:"validatorScoreAdjustmentSpeed"` MembershipHistoryLength uint64 `json:"membershipHistoryLength"` SlashingPenaltyResetPeriod uint64 `json:"slashingPenaltyResetPeriod"` MaxGroupSize uint64 `json:"maxGroupSize"` CommissionUpdateDelay uint64 `json:"commissionUpdateDelay"` DowntimeGracePeriod uint64 `json:"downtimeGracePeriod"` Commission *fixed.Fixed `json:"commission"` // commission for genesis registered validator groups }
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
- gen_reserve_parameters_json.go
- gen_stable_token_exchange_limit_json.go
- genesis.go
- genesis_state.go