Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Config ¶
type Config struct { // Wallet - Wallet to use for genesis. // Default wallet is used if empty. Wallet *wallet.Wallet // Power - Initial power distribution. Power []*Distribution // Database - State database to use. Database *trie.Database }
Config - Genesis config.
func (*Config) Assign ¶
func (config *Config) Assign(power *Distribution)
Assign - Assign power distribution.
func (*Config) WalletKeys ¶
WalletKeys - Unique wallet keys requiring unlocking.
type Distribution ¶
type Distribution struct { // Address - Usually public key hash. Address *cells.CID // WalletKeyPath - Wallet key path. WalletKeyPath *wallet.KeyPath // AssignQuantity - Quantity of power to assign. AssignQuantity uint64 // DelegateQuantity - Quantity of power to delegate. // Only possible if wallet key path is set. DelegateQuantity uint64 }
Distribution - Genesis power distribution.
func MustParsePowerString ¶
func MustParsePowerString(keyPath string) (res *Distribution)
MustParsePowerString - Parses power distribution string. Panics on error.
func ParsePowerString ¶
func ParsePowerString(keyPath string) (res *Distribution, err error)
ParsePowerString - Parses power distribution string.
Following formats are allowed:
- `<wallet-key-path>:<assign-power>:<delegate-power>`
- `<pubkeyhash-addr>:<assign-power>`
If delegate value is `-1` it's equal to assign power.
Click to show internal directories.
Click to hide internal directories.