Documentation ¶
Index ¶
- Constants
- Variables
- func GenerateGenesis(_ *cli.Context, accounts *env.AccountsConfig, cfg *Config, ...) (*chain.Genesis, error)
- func UnmarshalMarkerConfig(ctx *cli.Context)
- type AccoutInfo
- func (a *AccoutInfo) BLSG1PublicKey() (blscrypto.SerializedG1PublicKey, error)
- func (a *AccoutInfo) BLSProofOfPossession_() ([]byte, error)
- func (a *AccoutInfo) BLSPublicKey() (blscrypto.SerializedPublicKey, error)
- func (a *AccoutInfo) ECDSASignature_() (v uint8, r common.Hash, s common.Hash)
- func (a *AccoutInfo) MustBLSProofOfPossession() []byte
- func (a *AccoutInfo) PublicKey() []byte
- func (a *AccoutInfo) SignerAddress_() common.Address
- 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 GasPriceMinimumParametersMarshaling
- type GoldTokenParameters
- type GovernanceParametersMarshaling
- type HardforkConfig
- type LockedGoldParameters
- type LockedGoldRequirements
- type LockedgoldRequirementsMarshaling
- type MarkerInfo
- type RandomParameters
- 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 AdminAddr common.Address
var ValidatorsAT []AccoutInfo
Functions ¶
func GenerateGenesis ¶
func GenerateGenesis(_ *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(ctx *cli.Context)
Types ¶
type AccoutInfo ¶
type AccoutInfo struct { Address string SignerAddress string ECDSASignature string PublicKeyHex string BLSPubKey string BLSG1PubKey string BLSProofOfPossession string }
From markerConfig.json used for validators and election contract
func (*AccoutInfo) BLSG1PublicKey ¶ added in v0.4.3
func (a *AccoutInfo) BLSG1PublicKey() (blscrypto.SerializedG1PublicKey, error)
BLSPublicKey returns the bls public key
func (*AccoutInfo) BLSProofOfPossession_ ¶ added in v0.4.1
func (a *AccoutInfo) BLSProofOfPossession_() ([]byte, error)
BLSProofOfPossession generates bls proof of possession
func (*AccoutInfo) BLSPublicKey ¶ added in v0.4.1
func (a *AccoutInfo) BLSPublicKey() (blscrypto.SerializedPublicKey, error)
BLSPublicKey returns the bls public key
func (*AccoutInfo) ECDSASignature_ ¶ added in v0.5.1
func (*AccoutInfo) MustBLSProofOfPossession ¶ added in v0.4.1
func (a *AccoutInfo) MustBLSProofOfPossession() []byte
MustBLSProofOfPossession variant of BLSProofOfPossession that panics on error
func (*AccoutInfo) PublicKey ¶ added in v0.4.1
func (a *AccoutInfo) PublicKey() []byte
PublicKeyHex hex representation of the public key
func (*AccoutInfo) SignerAddress_ ¶ added in v0.5.1
func (a *AccoutInfo) SignerAddress_() common.Address
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"` LockedGold LockedGoldParameters GoldToken GoldTokenParameters Validators ValidatorsParameters Election ElectionParameters EpochRewards EpochRewardsParameters Blockchain BlockchainParameters Random RandomParameters DoubleSigningSlasher DoubleSigningSlasherParameters DowntimeSlasher DowntimeSlasherParameters }
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() *Config
CreateCommonGenesisConfig generates a config starting point which templates can then customize further
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
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
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
type EpochRewardsParameters ¶
type EpochRewardsParameters struct { MaxEpochPayment *big.Int `json:"maxValidatorEpochPayment"` CommunityRewardFraction *fixed.Fixed `json:"communityRewardFraction"` EpochMaintainerPaymentFraction *fixed.Fixed `json:"epochRelayerPaymentFraction"` CommunityPartner common.Address `json:"communityPartner"` MgrMaintainerAddress common.Address `json:"mgrMaintainerAddress"` }
EpochRewardsParameters are the initial configuration parameters for EpochRewards
type GoldTokenParameters ¶
type GoldTokenParameters struct {
InitialBalances BalanceList `json:"initialBalances"`
}
GoldTokenParameters are the initial configuration parameters for GoldToken
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
type MarkerInfo ¶
type MarkerInfo struct { AdminAddress string Validators []AccoutInfo }
type RandomParameters ¶
type RandomParameters struct {
RandomnessBlockRetentionWindow uint64 `json:"randomnessBlockRetentionWindow"`
}
RandomParameters are the initial configuration parameters for Random
type ValidatorsParameters ¶
type ValidatorsParameters struct { ValidatorLockedGoldRequirements LockedGoldRequirements `json:"validatorLockedGoldRequirements"` ValidatorScoreExponent uint64 `json:"validatorScoreExponent"` ValidatorScoreAdjustmentSpeed *fixed.Fixed `json:"validatorScoreAdjustmentSpeed"` SlashingPenaltyResetPeriod uint64 `json:"slashingPenaltyResetPeriod"` CommissionUpdateDelay uint64 `json:"commissionUpdateDelay"` PledgeMultiplierInReward *fixed.Fixed `json:"pledgeMultiplierInReward"` DowntimeGracePeriod uint64 `json:"downtimeGracePeriod"` Commission *big.Int `json:"commission"` // commission for genesis registered validator }
ValidatorsParameters are the initial configuration parameters for Validators