contracts

package
v1.12.4-0...-e320c17 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 20, 2023 License: MIT Imports: 30 Imported by: 0

Documentation

Index

Constants

View Source
const (
	XNS                        = "XNS"
	MigrationDaemonUnholdDate  = 1596456000 // 03.08.2020 12-00-00
	MigrationDaemonVesting     = 0
	MigrationDaemonVestingStep = 0

	NetworkIncentivesUnholdStartDate = 1583020800 // 01.03.2020 00-00-00
	NetworkIncentivesVesting         = 0
	NetworkIncentivesVestingStep     = 0

	ApplicationIncentivesUnholdStartDate = 1609459200 // 01.01.2021 00-00-00
	ApplicationIncentivesVesting         = 0
	ApplicationIncentivesVestingStep     = 0

	FoundationUnholdStartDate = 1609459200 // 01.01.2021 00-00-00
	FoundationVestingPeriod   = 0
	FoundationVestingStep     = 0
)

Variables

This section is empty.

Functions

func CreateGenesisContractsConfig

func CreateGenesisContractsConfig(ctx context.Context, configFile string) (map[string]interface{}, error)

CreateGenesisContractsConfig generates bootstrap data.

1. read application-related keys files. 2. generates genesis contracts config for heavy node.

func GetAccountGenesisContractState

func GetAccountGenesisContractState(balance string, name string, parent string) genesis.ContractState

func GetCostCenterGenesisContractState

func GetCostCenterGenesisContractState() genesis.ContractState

func GetDepositGenesisContractState

func GetDepositGenesisContractState(
	amount string,
	vesting int64,
	vestingStep int64,
	vestingType appfoundation.VestingType,
	pulseDepositUnHold insolar.PulseNumber,
	name string, parent string,
) genesis.ContractState

func GetFundPath

func GetFundPath(i int, prefix string) string

GetFundPath generate key file name for composite name

func GetMemberGenesisContractState

func GetMemberGenesisContractState(publicKey string, name string, parent string, walletRef insolar.Reference) genesis.ContractState

func GetMigrationAdminGenesisContractState

func GetMigrationAdminGenesisContractState(lockup int64, vesting int64, vestingStep int64, maShardCount int) genesis.ContractState

func GetMigrationDaemonGenesisContractState

func GetMigrationDaemonGenesisContractState(numberMigrationDaemon int) genesis.ContractState

func GetMigrationDaemonPath

func GetMigrationDaemonPath(i int) string

GetMigrationDaemonPath generate key file name for migration daemon

func GetMigrationShardGenesisContractState

func GetMigrationShardGenesisContractState(name string, migrationAddresses []string) genesis.ContractState

func GetPKShardGenesisContractState

func GetPKShardGenesisContractState(name string, members foundation.StableMap) genesis.ContractState

func GetPreWalletGenesisContractState

func GetPreWalletGenesisContractState(name string, parent string, accounts foundation.StableMap, deposits foundation.StableMap) genesis.ContractState

func GetWalletGenesisContractState

func GetWalletGenesisContractState(name string, parent string, accountRef insolar.Reference) genesis.ContractState

func InitStates

func InitStates(genesisConfigPath string) ([]genesis.ContractState, error)

Types

type ContractsConfig

type ContractsConfig struct {
	// MembersKeysDir is the root key place.
	MembersKeysDir string `mapstructure:"members_keys_dir" yaml:"members_keys_dir"`
	// RootBalance is a start balance for the root member's wallet.
	RootBalance string `mapstructure:"root_balance" yaml:"root_balance"`
	// MDBalance is a start balance for the migration admin member's wallet.
	MDBalance string `mapstructure:"md_balance" yaml:"md_balance"`
	// VestingPeriodInPulses - interval of count pulses for the full period of partial release.
	VestingPeriodInPulses int64 `mapstructure:"vesting_pulse_period" yaml:"vesting_pulse_period"`
	// VestingPeriodInPulses - interval of count pulses for one step of partial release.
	VestingStepInPulses int64 `mapstructure:"vesting_pulse_step" yaml:"vesting_pulse_step"`
	// LockupPeriodInPulses - interval of count pulses for the full period of hold.
	LockupPeriodInPulses int64 `mapstructure:"lockup_pulse_period" yaml:"lockup_pulse_period"`
	PKShardCount         int   `mapstructure:"pk_shard_count" yaml:"pk_shard_count"`
	MAShardCount         int   `mapstructure:"ma_shard_count" yaml:"ma_shard_count"`
}

ContractsConfig contains configuration required for bootstrap application logic.

func ParseContractsConfig

func ParseContractsConfig(path string) (*ContractsConfig, error)

ParseContractsConfig parse bootstrap contracts config.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL