Documentation
¶
Index ¶
- Constants
- Variables
- func AccountPrefix() []byte
- func AddressFromKey(k []byte) (crypto.AddressI, lib.ErrorI)
- func CanopyIdsToEVMChainId(chainId, networkId uint64) uint64
- func CheckNetAddress(netAddress string, isDelegate bool) lib.ErrorI
- func CommitteePrefix(id uint64) []byte
- func CommitteesDataPrefix() []byte
- func DelegatePrefix(id uint64) []byte
- func DownscaleTo6Decimals(amount *big.Int) uint64
- func ErrAddressEmpty() lib.ErrorI
- func ErrAddressSize() lib.ErrorI
- func ErrDuplicateLockOrder() lib.ErrorI
- func ErrEmptyCertificateResults() lib.ErrorI
- func ErrEmptyConsParams() lib.ErrorI
- func ErrEmptyFeeParams() lib.ErrorI
- func ErrEmptyGovParams() lib.ErrorI
- func ErrEmptySignature() lib.ErrorI
- func ErrEmptyValParams() lib.ErrorI
- func ErrInsufficientFunds() lib.ErrorI
- func ErrInsufficientSupply() lib.ErrorI
- func ErrInvalidAmount() lib.ErrorI
- func ErrInvalidBlockRange() lib.ErrorI
- func ErrInvalidBuyerDeadline() lib.ErrorI
- func ErrInvalidCertificateResults() lib.ErrorI
- func ErrInvalidChainId() lib.ErrorI
- func ErrInvalidCheckpoint() lib.ErrorI
- func ErrInvalidCloseOrder() lib.ErrorI
- func ErrInvalidERC20Tx(err error) lib.ErrorI
- func ErrInvalidKey(key []byte) lib.ErrorI
- func ErrInvalidLockOrder() lib.ErrorI
- func ErrInvalidNetAddressLen() lib.ErrorI
- func ErrInvalidNumCommittees() lib.ErrorI
- func ErrInvalidNumOfSamples() lib.ErrorI
- func ErrInvalidOpcode() lib.ErrorI
- func ErrInvalidParam(paramName string) lib.ErrorI
- func ErrInvalidProposalHash() lib.ErrorI
- func ErrInvalidProtocolVersion() lib.ErrorI
- func ErrInvalidPublicKey(err error) lib.ErrorI
- func ErrInvalidRLPTx(err error) lib.ErrorI
- func ErrInvalidSignature() lib.ErrorI
- func ErrInvalidStartPollHeight() lib.ErrorI
- func ErrInvalidSubisdy() lib.ErrorI
- func ErrInvalidTxMessage() lib.ErrorI
- func ErrMaxBlockSize() lib.ErrorI
- func ErrMinimumOrderSize() lib.ErrorI
- func ErrMismatchCertResults() lib.ErrorI
- func ErrNonSubsidizedCommittee() lib.ErrorI
- func ErrNotEmpty() lib.ErrorI
- func ErrOutputAddressEmpty() lib.ErrorI
- func ErrOutputAddressSize() lib.ErrorI
- func ErrParamKeyEmpty() lib.ErrorI
- func ErrParamValueEmpty() lib.ErrorI
- func ErrPublicKeyEmpty() lib.ErrorI
- func ErrPublicKeySize() lib.ErrorI
- func ErrReadGenesisFile(err error) lib.ErrorI
- func ErrRecipientAddressEmpty() lib.ErrorI
- func ErrRecipientAddressSize() lib.ErrorI
- func ErrRejectProposal() lib.ErrorI
- func ErrSlashNonExistentValidator() lib.ErrorI
- func ErrStakeBelowMininum() lib.ErrorI
- func ErrTxFeeBelowStateLimit() lib.ErrorI
- func ErrTxSignBytes(err error) lib.ErrorI
- func ErrUnauthorizedTx() lib.ErrorI
- func ErrUnknownMessage(x lib.MessageI) lib.ErrorI
- func ErrUnknownParam() lib.ErrorI
- func ErrUnknownParamSpace() lib.ErrorI
- func ErrUnknownParamType(t any) lib.ErrorI
- func ErrUnmarshalGenesis(err error) lib.ErrorI
- func ErrValidatorExists() lib.ErrorI
- func ErrValidatorIsADelegate() lib.ErrorI
- func ErrValidatorNotExists() lib.ErrorI
- func ErrValidatorNotPaused() lib.ErrorI
- func ErrValidatorPaused() lib.ErrorI
- func ErrValidatorUnstaking() lib.ErrorI
- func ErrWrongStoreType() lib.ErrorI
- func EvmChainIdToCanopyIds(evmChainId uint64) (chainId, networkId uint64)
- func FilterAndSortPool(x *[]*Pool)
- func FormatParamSpace(paramSpace string) string
- func IdFromKey(k []byte) (uint64, lib.ErrorI)
- func InvalidSellOrder() lib.ErrorI
- func KeyForAccount(addr crypto.AddressI) []byte
- func KeyForCommittee(chainId uint64, addr crypto.AddressI, stake uint64) []byte
- func KeyForDelegate(chainId uint64, addr crypto.AddressI, stake uint64) []byte
- func KeyForNonSigner(a []byte) []byte
- func KeyForOrder(chainId uint64, orderId []byte) []byte
- func KeyForParams(s string) []byte
- func KeyForPaused(maxPausedHeight uint64, address crypto.AddressI) []byte
- func KeyForPool(n uint64) []byte
- func KeyForRetiredCommittee(cId uint64) []byte
- func KeyForUnstaking(height uint64, address crypto.AddressI) []byte
- func KeyForValidator(addr crypto.AddressI) []byte
- func LastProposersPrefix() []byte
- func NewCertificateResultsTx(from crypto.PrivateKeyI, qc *lib.QuorumCertificate, ...) (lib.TransactionI, lib.ErrorI)
- func NewChangeParamTxString(from crypto.PrivateKeyI, space, key, value string, ...) (lib.TransactionI, lib.ErrorI)
- func NewChangeParamTxUint64(from crypto.PrivateKeyI, space, key string, ...) (lib.TransactionI, lib.ErrorI)
- func NewCloseOrderTx(from crypto.PrivateKeyI, order lib.CloseOrder, ...) (lib.TransactionI, lib.ErrorI)
- func NewCreateOrderTx(from crypto.PrivateKeyI, sellAmount, requestAmount, committeeId uint64, ...) (lib.TransactionI, lib.ErrorI)
- func NewDAOTransferTx(from crypto.PrivateKeyI, ...) (lib.TransactionI, lib.ErrorI)
- func NewDeleteOrderTx(from crypto.PrivateKeyI, orderId string, committeeId uint64, ...) (lib.TransactionI, lib.ErrorI)
- func NewEditOrderTx(from crypto.PrivateKeyI, orderId string, ...) (lib.TransactionI, lib.ErrorI)
- func NewEditStakeTx(signer crypto.PrivateKeyI, from, outputAddress crypto.AddressI, ...) (lib.TransactionI, lib.ErrorI)
- func NewLockOrderTx(from crypto.PrivateKeyI, order lib.LockOrder, ...) (lib.TransactionI, lib.ErrorI)
- func NewPauseTx(signer crypto.PrivateKeyI, from crypto.AddressI, ...) (lib.TransactionI, lib.ErrorI)
- func NewProtocolVersion(height uint64, version uint64) string
- func NewSendTransaction(from crypto.PrivateKeyI, to crypto.AddressI, ...) (lib.TransactionI, lib.ErrorI)
- func NewStakeTx(signer crypto.PrivateKeyI, from lib.HexBytes, outputAddress crypto.AddressI, ...) (lib.TransactionI, lib.ErrorI)
- func NewStartPollTransaction(from crypto.PrivateKeyI, pollJSON json.RawMessage, ...) (lib.TransactionI, lib.ErrorI)
- func NewSubsidyTx(from crypto.PrivateKeyI, amount, committeeId uint64, opCode lib.HexBytes, ...) (lib.TransactionI, lib.ErrorI)
- func NewTransaction(pk crypto.PrivateKeyI, msg lib.MessageI, ...) (lib.TransactionI, lib.ErrorI)
- func NewUnpauseTx(signer crypto.PrivateKeyI, from crypto.AddressI, ...) (lib.TransactionI, lib.ErrorI)
- func NewUnstakeTx(signer crypto.PrivateKeyI, from crypto.AddressI, ...) (lib.TransactionI, lib.ErrorI)
- func NewVotePollTransaction(from crypto.PrivateKeyI, pollJSON json.RawMessage, approve bool, ...) (lib.TransactionI, lib.ErrorI)
- func NonSignerPrefix() []byte
- func OrderBookPrefix(cId uint64) []byte
- func PausedPrefix(height uint64) []byte
- func PoolPrefix() []byte
- func RLPToCanopyTransaction(txBytes []byte) (transaction *lib.Transaction, e lib.ErrorI)
- func RetiredCommitteesPrefix() []byte
- func SupplyPrefix() []byte
- func TxHashFromJSON(transactionJSON json.RawMessage) (txHash string, err lib.ErrorI)
- func UnstakingPrefix(h uint64) []byte
- func UpscaleTo18Decimals(amount uint64) *big.Int
- func ValidatorPrefix() []byte
- type Account
- func (*Account) Descriptor() ([]byte, []int)deprecated
- func (x *Account) GetAddress() []byte
- func (x *Account) GetAmount() uint64
- func (x *Account) MarshalJSON() ([]byte, error)
- func (*Account) ProtoMessage()
- func (x *Account) ProtoReflect() protoreflect.Message
- func (x *Account) Reset()
- func (x *Account) String() string
- func (x *Account) UnmarshalJSON(bz []byte) (err error)
- type AccountPage
- type ActivePolls
- func (p *ActivePolls) CheckForPollTransaction(sender crypto.AddressI, memo string, height uint64) lib.ErrorI
- func (p *ActivePolls) Cleanup(height uint64)
- func (p *ActivePolls) NewFromFile(dataDirPath string) lib.ErrorI
- func (p *ActivePolls) NewPoll(startPoll *StartPoll)
- func (p *ActivePolls) SaveToFile(dataDirPath string) lib.ErrorI
- func (p *ActivePolls) VotePoll(sender crypto.AddressI, votePoll *VotePoll, height uint64)
- type CheckTxResult
- type ConsValidatorPage
- type ConsensusParams
- func (x *ConsensusParams) Check() lib.ErrorI
- func (*ConsensusParams) Descriptor() ([]byte, []int)deprecated
- func (x *ConsensusParams) GetBlockSize() uint64
- func (x *ConsensusParams) GetProtocolVersion() string
- func (x *ConsensusParams) GetRetired() uint64
- func (x *ConsensusParams) GetRootChainId() uint64
- func (x *ConsensusParams) ParseProtocolVersion() (*ProtocolVersion, lib.ErrorI)
- func (*ConsensusParams) ProtoMessage()
- func (x *ConsensusParams) ProtoReflect() protoreflect.Message
- func (x *ConsensusParams) Reset()
- func (x *ConsensusParams) SetString(paramName string, value string) lib.ErrorI
- func (x *ConsensusParams) SetUint64(paramName string, value uint64) lib.ErrorI
- func (x *ConsensusParams) String() string
- type FeeParams
- func (x *FeeParams) Check() lib.ErrorI
- func (*FeeParams) Descriptor() ([]byte, []int)deprecated
- func (x *FeeParams) GetCertificateResultsFee() uint64
- func (x *FeeParams) GetChangeParameterFee() uint64
- func (x *FeeParams) GetCreateOrderFee() uint64
- func (x *FeeParams) GetDaoTransferFee() uint64
- func (x *FeeParams) GetDeleteOrderFee() uint64
- func (x *FeeParams) GetEditOrderFee() uint64
- func (x *FeeParams) GetEditStakeFee() uint64
- func (x *FeeParams) GetPauseFee() uint64
- func (x *FeeParams) GetSendFee() uint64
- func (x *FeeParams) GetStakeFee() uint64
- func (x *FeeParams) GetSubsidyFee() uint64
- func (x *FeeParams) GetUnpauseFee() uint64
- func (x *FeeParams) GetUnstakeFee() uint64
- func (*FeeParams) ProtoMessage()
- func (x *FeeParams) ProtoReflect() protoreflect.Message
- func (x *FeeParams) Reset()
- func (x *FeeParams) SetString(_ string, _ string) lib.ErrorI
- func (x *FeeParams) SetUint64(paramName string, value uint64) lib.ErrorI
- func (x *FeeParams) String() string
- type GenesisState
- func (*GenesisState) Descriptor() ([]byte, []int)deprecated
- func (x *GenesisState) GetAccounts() []*Account
- func (x *GenesisState) GetCommittees() *lib.CommitteesData
- func (x *GenesisState) GetDoubleSigners() []*lib.DoubleSigner
- func (x *GenesisState) GetNonSigners() []*NonSigner
- func (x *GenesisState) GetOrderBooks() *lib.OrderBooks
- func (x *GenesisState) GetParams() *Params
- func (x *GenesisState) GetPools() []*Pool
- func (x *GenesisState) GetRetiredCommittees() []uint64
- func (x *GenesisState) GetSupply() *Supply
- func (x *GenesisState) GetTime() uint64
- func (x *GenesisState) GetValidators() []*Validator
- func (x *GenesisState) MarshalJSON() ([]byte, error)
- func (*GenesisState) ProtoMessage()
- func (x *GenesisState) ProtoReflect() protoreflect.Message
- func (x *GenesisState) Reset()
- func (x *GenesisState) String() string
- func (x *GenesisState) UnmarshalJSON(bz []byte) (err error)
- type GovProposal
- type GovProposalVoteConfig
- func (GovProposalVoteConfig) Descriptor() protoreflect.EnumDescriptor
- func (x GovProposalVoteConfig) Enum() *GovProposalVoteConfig
- func (GovProposalVoteConfig) EnumDescriptor() ([]byte, []int)deprecated
- func (x GovProposalVoteConfig) Number() protoreflect.EnumNumber
- func (x GovProposalVoteConfig) String() string
- func (GovProposalVoteConfig) Type() protoreflect.EnumType
- type GovProposalWithVote
- type GovProposals
- type GovernanceParams
- func (x *GovernanceParams) Check() lib.ErrorI
- func (*GovernanceParams) Descriptor() ([]byte, []int)deprecated
- func (x *GovernanceParams) GetDaoRewardPercentage() uint64
- func (*GovernanceParams) ProtoMessage()
- func (x *GovernanceParams) ProtoReflect() protoreflect.Message
- func (x *GovernanceParams) Reset()
- func (x *GovernanceParams) SetString(_ string, _ string) lib.ErrorI
- func (x *GovernanceParams) SetUint64(paramName string, value uint64) lib.ErrorI
- func (x *GovernanceParams) String() string
- type MessageCertificateResults
- func (x *MessageCertificateResults) Check() lib.ErrorI
- func (*MessageCertificateResults) Descriptor() ([]byte, []int)deprecated
- func (x *MessageCertificateResults) GetQc() *lib.QuorumCertificate
- func (x MessageCertificateResults) MarshalJSON() ([]byte, error)
- func (x *MessageCertificateResults) Name() string
- func (x *MessageCertificateResults) New() lib.MessageI
- func (*MessageCertificateResults) ProtoMessage()
- func (x *MessageCertificateResults) ProtoReflect() protoreflect.Message
- func (x *MessageCertificateResults) Recipient() []byte
- func (x *MessageCertificateResults) Reset()
- func (x *MessageCertificateResults) String() string
- func (x *MessageCertificateResults) UnmarshalJSON(b []byte) (err error)
- type MessageChangeParameter
- func (x *MessageChangeParameter) Check() lib.ErrorI
- func (*MessageChangeParameter) Descriptor() ([]byte, []int)deprecated
- func (x *MessageChangeParameter) GetEndHeight() uint64
- func (x *MessageChangeParameter) GetParameterKey() string
- func (x *MessageChangeParameter) GetParameterSpace() string
- func (x *MessageChangeParameter) GetParameterValue() *anypb.Any
- func (x *MessageChangeParameter) GetProposalHash() string
- func (x *MessageChangeParameter) GetSigner() []byte
- func (x *MessageChangeParameter) GetStartHeight() uint64
- func (x MessageChangeParameter) MarshalJSON() ([]byte, error)
- func (x *MessageChangeParameter) Name() string
- func (x *MessageChangeParameter) New() lib.MessageI
- func (*MessageChangeParameter) ProtoMessage()
- func (x *MessageChangeParameter) ProtoReflect() protoreflect.Message
- func (x *MessageChangeParameter) Recipient() []byte
- func (x *MessageChangeParameter) Reset()
- func (x *MessageChangeParameter) String() string
- func (x *MessageChangeParameter) UnmarshalJSON(b []byte) (err error)
- type MessageCreateOrder
- func (x *MessageCreateOrder) Check() lib.ErrorI
- func (*MessageCreateOrder) Descriptor() ([]byte, []int)deprecated
- func (x *MessageCreateOrder) GetAmountForSale() uint64
- func (x *MessageCreateOrder) GetChainId() uint64
- func (x *MessageCreateOrder) GetData() []byte
- func (x *MessageCreateOrder) GetOrderId() []byte
- func (x *MessageCreateOrder) GetRequestedAmount() uint64
- func (x *MessageCreateOrder) GetSellerReceiveAddress() []byte
- func (x *MessageCreateOrder) GetSellersSendAddress() []byte
- func (x *MessageCreateOrder) MarshalJSON() ([]byte, error)
- func (x *MessageCreateOrder) Name() string
- func (x *MessageCreateOrder) New() lib.MessageI
- func (*MessageCreateOrder) ProtoMessage()
- func (x *MessageCreateOrder) ProtoReflect() protoreflect.Message
- func (x *MessageCreateOrder) Recipient() []byte
- func (x *MessageCreateOrder) Reset()
- func (x *MessageCreateOrder) String() string
- func (x *MessageCreateOrder) UnmarshalJSON(b []byte) (err error)
- type MessageDAOTransfer
- func (x *MessageDAOTransfer) Check() lib.ErrorI
- func (*MessageDAOTransfer) Descriptor() ([]byte, []int)deprecated
- func (x *MessageDAOTransfer) GetAddress() []byte
- func (x *MessageDAOTransfer) GetAmount() uint64
- func (x *MessageDAOTransfer) GetEndHeight() uint64
- func (x *MessageDAOTransfer) GetProposalHash() string
- func (x *MessageDAOTransfer) GetStartHeight() uint64
- func (x MessageDAOTransfer) MarshalJSON() ([]byte, error)
- func (x *MessageDAOTransfer) Name() string
- func (x *MessageDAOTransfer) New() lib.MessageI
- func (*MessageDAOTransfer) ProtoMessage()
- func (x *MessageDAOTransfer) ProtoReflect() protoreflect.Message
- func (x *MessageDAOTransfer) Recipient() []byte
- func (x *MessageDAOTransfer) Reset()
- func (x *MessageDAOTransfer) String() string
- func (x *MessageDAOTransfer) UnmarshalJSON(b []byte) (err error)
- type MessageDeleteOrder
- func (x *MessageDeleteOrder) Check() lib.ErrorI
- func (*MessageDeleteOrder) Descriptor() ([]byte, []int)deprecated
- func (x *MessageDeleteOrder) GetChainId() uint64
- func (x *MessageDeleteOrder) GetOrderId() []byte
- func (x *MessageDeleteOrder) MarshalJSON() ([]byte, error)
- func (x *MessageDeleteOrder) Name() string
- func (x *MessageDeleteOrder) New() lib.MessageI
- func (*MessageDeleteOrder) ProtoMessage()
- func (x *MessageDeleteOrder) ProtoReflect() protoreflect.Message
- func (x *MessageDeleteOrder) Recipient() []byte
- func (x *MessageDeleteOrder) Reset()
- func (x *MessageDeleteOrder) String() string
- func (x *MessageDeleteOrder) UnmarshalJSON(b []byte) (err error)
- type MessageEditOrder
- func (x *MessageEditOrder) Check() lib.ErrorI
- func (*MessageEditOrder) Descriptor() ([]byte, []int)deprecated
- func (x *MessageEditOrder) GetAmountForSale() uint64
- func (x *MessageEditOrder) GetChainId() uint64
- func (x *MessageEditOrder) GetData() []byte
- func (x *MessageEditOrder) GetOrderId() []byte
- func (x *MessageEditOrder) GetRequestedAmount() uint64
- func (x *MessageEditOrder) GetSellerReceiveAddress() []byte
- func (x *MessageEditOrder) MarshalJSON() ([]byte, error)
- func (x *MessageEditOrder) Name() string
- func (x *MessageEditOrder) New() lib.MessageI
- func (*MessageEditOrder) ProtoMessage()
- func (x *MessageEditOrder) ProtoReflect() protoreflect.Message
- func (x *MessageEditOrder) Recipient() []byte
- func (x *MessageEditOrder) Reset()
- func (x *MessageEditOrder) String() string
- func (x *MessageEditOrder) UnmarshalJSON(b []byte) (err error)
- type MessageEditStake
- func (x *MessageEditStake) Check() lib.ErrorI
- func (*MessageEditStake) Descriptor() ([]byte, []int)deprecated
- func (x *MessageEditStake) GetAddress() []byte
- func (x *MessageEditStake) GetAmount() uint64
- func (x *MessageEditStake) GetCommittees() []uint64
- func (x *MessageEditStake) GetCompound() bool
- func (x *MessageEditStake) GetNetAddress() string
- func (x *MessageEditStake) GetOutputAddress() []byte
- func (x *MessageEditStake) GetSigner() []byte
- func (x MessageEditStake) MarshalJSON() ([]byte, error)
- func (x *MessageEditStake) Name() string
- func (x *MessageEditStake) New() lib.MessageI
- func (*MessageEditStake) ProtoMessage()
- func (x *MessageEditStake) ProtoReflect() protoreflect.Message
- func (x *MessageEditStake) Recipient() []byte
- func (x *MessageEditStake) Reset()
- func (x *MessageEditStake) String() string
- func (x *MessageEditStake) UnmarshalJSON(b []byte) (err error)
- type MessagePause
- func (x *MessagePause) Check() lib.ErrorI
- func (*MessagePause) Descriptor() ([]byte, []int)deprecated
- func (x *MessagePause) GetAddress() []byte
- func (x MessagePause) MarshalJSON() ([]byte, error)
- func (x *MessagePause) Name() string
- func (x *MessagePause) New() lib.MessageI
- func (*MessagePause) ProtoMessage()
- func (x *MessagePause) ProtoReflect() protoreflect.Message
- func (x *MessagePause) Recipient() []byte
- func (x *MessagePause) Reset()
- func (x *MessagePause) String() string
- func (x *MessagePause) UnmarshalJSON(b []byte) (err error)
- type MessageSend
- func (x *MessageSend) Check() lib.ErrorI
- func (*MessageSend) Descriptor() ([]byte, []int)deprecated
- func (x *MessageSend) GetAmount() uint64
- func (x *MessageSend) GetFromAddress() []byte
- func (x *MessageSend) GetToAddress() []byte
- func (x MessageSend) MarshalJSON() ([]byte, error)
- func (x *MessageSend) Name() string
- func (x *MessageSend) New() lib.MessageI
- func (*MessageSend) ProtoMessage()
- func (x *MessageSend) ProtoReflect() protoreflect.Message
- func (x *MessageSend) Recipient() []byte
- func (x *MessageSend) Reset()
- func (x *MessageSend) String() string
- func (x *MessageSend) UnmarshalJSON(b []byte) (err error)
- type MessageStake
- func (x *MessageStake) Check() lib.ErrorI
- func (*MessageStake) Descriptor() ([]byte, []int)deprecated
- func (x *MessageStake) GetAmount() uint64
- func (x *MessageStake) GetCommittees() []uint64
- func (x *MessageStake) GetCompound() bool
- func (x *MessageStake) GetDelegate() bool
- func (x *MessageStake) GetNetAddress() string
- func (x *MessageStake) GetOutputAddress() []byte
- func (x *MessageStake) GetPublicKey() []byte
- func (x *MessageStake) GetSigner() []byte
- func (x MessageStake) MarshalJSON() ([]byte, error)
- func (x *MessageStake) Name() string
- func (x *MessageStake) New() lib.MessageI
- func (*MessageStake) ProtoMessage()
- func (x *MessageStake) ProtoReflect() protoreflect.Message
- func (x *MessageStake) Recipient() []byte
- func (x *MessageStake) Reset()
- func (x *MessageStake) String() string
- func (x *MessageStake) UnmarshalJSON(b []byte) (err error)
- type MessageSubsidy
- func (x *MessageSubsidy) Check() lib.ErrorI
- func (*MessageSubsidy) Descriptor() ([]byte, []int)deprecated
- func (x *MessageSubsidy) GetAddress() []byte
- func (x *MessageSubsidy) GetAmount() uint64
- func (x *MessageSubsidy) GetChainId() uint64
- func (x *MessageSubsidy) GetOpcode() []byte
- func (x MessageSubsidy) MarshalJSON() ([]byte, error)
- func (x *MessageSubsidy) Name() string
- func (x *MessageSubsidy) New() lib.MessageI
- func (*MessageSubsidy) ProtoMessage()
- func (x *MessageSubsidy) ProtoReflect() protoreflect.Message
- func (x *MessageSubsidy) Recipient() []byte
- func (x *MessageSubsidy) Reset()
- func (x *MessageSubsidy) String() string
- func (x *MessageSubsidy) UnmarshalJSON(b []byte) (err error)
- type MessageUnpause
- func (x *MessageUnpause) Check() lib.ErrorI
- func (*MessageUnpause) Descriptor() ([]byte, []int)deprecated
- func (x *MessageUnpause) GetAddress() []byte
- func (x MessageUnpause) MarshalJSON() ([]byte, error)
- func (x *MessageUnpause) Name() string
- func (x *MessageUnpause) New() lib.MessageI
- func (*MessageUnpause) ProtoMessage()
- func (x *MessageUnpause) ProtoReflect() protoreflect.Message
- func (x *MessageUnpause) Recipient() []byte
- func (x *MessageUnpause) Reset()
- func (x *MessageUnpause) String() string
- func (x *MessageUnpause) UnmarshalJSON(b []byte) (err error)
- type MessageUnstake
- func (x *MessageUnstake) Check() lib.ErrorI
- func (*MessageUnstake) Descriptor() ([]byte, []int)deprecated
- func (x *MessageUnstake) GetAddress() []byte
- func (x MessageUnstake) MarshalJSON() ([]byte, error)
- func (x *MessageUnstake) Name() string
- func (x *MessageUnstake) New() lib.MessageI
- func (*MessageUnstake) ProtoMessage()
- func (x *MessageUnstake) ProtoReflect() protoreflect.Message
- func (x *MessageUnstake) Recipient() []byte
- func (x *MessageUnstake) Reset()
- func (x *MessageUnstake) String() string
- func (x *MessageUnstake) UnmarshalJSON(b []byte) (err error)
- type NonSigner
- type NonSignerList
- type NonSigners
- type ParamSpace
- type Params
- func (x *Params) Check() lib.ErrorI
- func (*Params) Descriptor() ([]byte, []int)deprecated
- func (x *Params) GetConsensus() *ConsensusParams
- func (x *Params) GetFee() *FeeParams
- func (x *Params) GetGovernance() *GovernanceParams
- func (x *Params) GetValidator() *ValidatorParams
- func (*Params) ProtoMessage()
- func (x *Params) ProtoReflect() protoreflect.Message
- func (x *Params) Reset()
- func (x *Params) String() string
- type Poll
- type PollResult
- type Pool
- func (*Pool) Descriptor() ([]byte, []int)deprecated
- func (x *Pool) GetAmount() uint64
- func (x *Pool) GetId() uint64
- func (x *Pool) MarshalJSON() ([]byte, error)
- func (*Pool) ProtoMessage()
- func (x *Pool) ProtoReflect() protoreflect.Message
- func (x *Pool) Reset()
- func (x *Pool) String() string
- func (x *Pool) UnmarshalJSON(bz []byte) (err error)
- type PoolPage
- type ProtocolVersion
- func (*ProtocolVersion) Descriptor() ([]byte, []int)deprecated
- func (x *ProtocolVersion) GetHeight() uint64
- func (x *ProtocolVersion) GetVersion() uint64
- func (*ProtocolVersion) ProtoMessage()
- func (x *ProtocolVersion) ProtoReflect() protoreflect.Message
- func (x *ProtocolVersion) Reset()
- func (x *ProtocolVersion) String() string
- type SlashTracker
- type StartPoll
- type StateMachine
- func (s *StateMachine) AccountAdd(address crypto.AddressI, amountToAdd uint64) lib.ErrorI
- func (s *StateMachine) AccountDeductFees(address crypto.AddressI, fee uint64) lib.ErrorI
- func (s *StateMachine) AccountSub(address crypto.AddressI, amountToSub uint64) lib.ErrorI
- func (s *StateMachine) AddToCommitteeSupplyForChain(chainId uint64, amount uint64) lib.ErrorI
- func (s *StateMachine) AddToDelegateSupply(amount uint64) lib.ErrorI
- func (s *StateMachine) AddToDelegateSupplyForChain(chainId uint64, amount uint64) lib.ErrorI
- func (s *StateMachine) AddToStakedSupply(amount uint64) lib.ErrorI
- func (s *StateMachine) AddToTotalSupply(amount uint64) lib.ErrorI
- func (s *StateMachine) ApplyBlock(ctx context.Context, b *lib.Block, lastValidatorSet *lib.ValidatorSet, ...) (header *lib.BlockHeader, txResults, oversized []*lib.TxResult, ...)
- func (s *StateMachine) ApplyTransaction(index uint64, transaction []byte, txHash string, ...) (*lib.TxResult, lib.ErrorI)
- func (s *StateMachine) ApplyTransactions(ctx context.Context, txs [][]byte, allowOversize bool) (results, oversized []*lib.TxResult, root []byte, blockTxs [][]byte, ...)
- func (s *StateMachine) ApproveProposal(msg GovProposal) lib.ErrorI
- func (s *StateMachine) BeginBlock(lastValidatorSet *lib.ValidatorSet) lib.ErrorI
- func (s *StateMachine) CheckFee(fee uint64, msg lib.MessageI) (err lib.ErrorI)
- func (s *StateMachine) CheckMessage(msg *anypb.Any) (message lib.MessageI, err lib.ErrorI)
- func (s *StateMachine) CheckProtocolVersion() (err lib.ErrorI)
- func (s *StateMachine) CheckReplay(tx *lib.Transaction, txHash string) lib.ErrorI
- func (s *StateMachine) CheckSignature(msg lib.MessageI, tx *lib.Transaction, ...) (crypto.AddressI, lib.ErrorI)
- func (s *StateMachine) CheckTx(transaction []byte, txHash string, batchVerifier *crypto.BatchVerifier) (result *CheckTxResult, err lib.ErrorI)
- func (s *StateMachine) CloseOrder(orderId []byte, chainId uint64) (err lib.ErrorI)
- func (s *StateMachine) CommitteeIsRetired(chainId uint64) (bool, lib.ErrorI)
- func (s *StateMachine) ConformStateToParamUpdate(previousParams *Params) lib.ErrorI
- func (s *StateMachine) Copy() (*StateMachine, lib.ErrorI)
- func (s *StateMachine) Delete(key []byte) lib.ErrorI
- func (s *StateMachine) DeleteAll(keys [][]byte) (err lib.ErrorI)
- func (s *StateMachine) DeleteCommitteeMember(address crypto.AddressI, chainId, stakeForCommittee uint64) lib.ErrorI
- func (s *StateMachine) DeleteCommittees(address crypto.AddressI, totalStake uint64, committees []uint64) (err lib.ErrorI)
- func (s *StateMachine) DeleteDelegate(address crypto.AddressI, chainId, stakeForCommittee uint64) lib.ErrorI
- func (s *StateMachine) DeleteDelegations(address crypto.AddressI, totalStake uint64, committees []uint64) lib.ErrorI
- func (s *StateMachine) DeleteFinishedUnstaking() lib.ErrorI
- func (s *StateMachine) DeleteOrder(orderId []byte, chainId uint64) (err lib.ErrorI)
- func (s *StateMachine) DeleteValidator(validator *Validator) lib.ErrorI
- func (s *StateMachine) Discard()
- func (s *StateMachine) DistributeCommitteeReward(stub *lib.PaymentPercents, rewardPoolAmount, numberOfSamples uint64, ...) (distributed uint64, err lib.ErrorI)
- func (s *StateMachine) DistributeCommitteeRewards() lib.ErrorI
- func (s *StateMachine) EndBlock(proposerAddress []byte) (err lib.ErrorI)
- func (s *StateMachine) ExportState() (genesis *GenesisState, err lib.ErrorI)
- func (s *StateMachine) ForceUnstakeMaxPaused() lib.ErrorI
- func (s *StateMachine) ForceUnstakeValidator(address crypto.AddressI) lib.ErrorI
- func (s *StateMachine) FundCommitteeRewardPools() lib.ErrorI
- func (s *StateMachine) Get(key []byte) (bz []byte, err lib.ErrorI)
- func (s *StateMachine) GetAccount(address crypto.AddressI) (*Account, lib.ErrorI)
- func (s *StateMachine) GetAccountBalance(address crypto.AddressI) (uint64, lib.ErrorI)
- func (s *StateMachine) GetAccounts() (result []*Account, err lib.ErrorI)
- func (s *StateMachine) GetAccountsPaginated(p lib.PageParams) (page *lib.Page, err lib.ErrorI)
- func (s *StateMachine) GetAuthorizedSignersFor(msg lib.MessageI) (signers [][]byte, err lib.ErrorI)
- func (s *StateMachine) GetAuthorizedSignersForValidator(address []byte) (signers [][]byte, err lib.ErrorI)
- func (s *StateMachine) GetBlockMintStats(chainId uint64) (daoCut uint64, totalMint uint64, mintAmountPerCommittee uint64, err lib.ErrorI)
- func (s *StateMachine) GetCommitteeData(targetChainId uint64) (*lib.CommitteeData, lib.ErrorI)
- func (s *StateMachine) GetCommitteeMembers(chainId uint64) (vs lib.ValidatorSet, err lib.ErrorI)
- func (s *StateMachine) GetCommitteePaginated(p lib.PageParams, chainId uint64) (page *lib.Page, err lib.ErrorI)
- func (s *StateMachine) GetCommitteeStakedSupplyForChain(chainId uint64) (p *Pool, err lib.ErrorI)
- func (s *StateMachine) GetCommitteesData() (list *lib.CommitteesData, err lib.ErrorI)
- func (s *StateMachine) GetDelegateStakedSupplyForChain(chainId uint64) (p *Pool, err lib.ErrorI)
- func (s *StateMachine) GetDelegates(chainId uint64) (vs lib.ValidatorSet, err lib.ErrorI)
- func (s *StateMachine) GetDelegatesPaginated(p lib.PageParams, chainId uint64) (page *lib.Page, err lib.ErrorI)
- func (s *StateMachine) GetDoubleSigners() (results []*lib.DoubleSigner, e lib.ErrorI)
- func (s *StateMachine) GetFeeForMessageName(name string) (fee uint64, err lib.ErrorI)
- func (s *StateMachine) GetLastProposers() (*lib.Proposers, lib.ErrorI)
- func (s *StateMachine) GetMaxBlockSize() (uint64, lib.ErrorI)
- func (s *StateMachine) GetMaxValidators() (uint64, lib.ErrorI)
- func (s *StateMachine) GetNonSigners() (results NonSigners, e lib.ErrorI)
- func (s *StateMachine) GetOrder(orderId []byte, chainId uint64) (order *lib.SellOrder, err lib.ErrorI)
- func (s *StateMachine) GetOrderBook(chainId uint64) (b *lib.OrderBook, err lib.ErrorI)
- func (s *StateMachine) GetOrderBooks() (b *lib.OrderBooks, err lib.ErrorI)
- func (s *StateMachine) GetParams() (*Params, lib.ErrorI)
- func (s *StateMachine) GetParamsCons() (ptr *ConsensusParams, err lib.ErrorI)
- func (s *StateMachine) GetParamsFee() (ptr *FeeParams, err lib.ErrorI)
- func (s *StateMachine) GetParamsGov() (ptr *GovernanceParams, err lib.ErrorI)
- func (s *StateMachine) GetParamsVal() (ptr *ValidatorParams, err lib.ErrorI)
- func (s *StateMachine) GetPool(id uint64) (*Pool, lib.ErrorI)
- func (s *StateMachine) GetPoolBalance(id uint64) (uint64, lib.ErrorI)
- func (s *StateMachine) GetPools() (result []*Pool, err lib.ErrorI)
- func (s *StateMachine) GetPoolsPaginated(p lib.PageParams) (page *lib.Page, err lib.ErrorI)
- func (s *StateMachine) GetRetiredCommittees() (list []uint64, err lib.ErrorI)
- func (s *StateMachine) GetRootChainId() (uint64, lib.ErrorI)
- func (s *StateMachine) GetSubsidizedCommittees() (paidIDs []uint64, err lib.ErrorI)
- func (s *StateMachine) GetSupply() (*Supply, lib.ErrorI)
- func (s *StateMachine) GetTotalEscrowed(address crypto.AddressI) (total uint64, err lib.ErrorI)
- func (s *StateMachine) GetValidator(address crypto.AddressI) (*Validator, lib.ErrorI)
- func (s *StateMachine) GetValidatorExists(address crypto.AddressI) (bool, lib.ErrorI)
- func (s *StateMachine) GetValidators() (result []*Validator, err lib.ErrorI)
- func (s *StateMachine) GetValidatorsPaginated(p lib.PageParams, f lib.ValidatorFilters) (page *lib.Page, err lib.ErrorI)
- func (s *StateMachine) HandleByzantine(qc *lib.QuorumCertificate, vs *lib.ValidatorSet) (nonSignerPercent int, err lib.ErrorI)
- func (s *StateMachine) HandleCertificateResults(qc *lib.QuorumCertificate, committee *lib.ValidatorSet) lib.ErrorI
- func (s *StateMachine) HandleCheckpoint(chainId uint64, results *lib.CertificateResult) (err lib.ErrorI)
- func (s *StateMachine) HandleCommitteeSwaps(orders *lib.Orders, chainId uint64)
- func (s *StateMachine) HandleDoubleSigners(chainId uint64, params *ValidatorParams, doubleSigners []*lib.DoubleSigner) lib.ErrorI
- func (s *StateMachine) HandleMessage(msg lib.MessageI) lib.ErrorI
- func (s *StateMachine) HandleMessageCertificateResults(msg *MessageCertificateResults) lib.ErrorI
- func (s *StateMachine) HandleMessageChangeParameter(msg *MessageChangeParameter) lib.ErrorI
- func (s *StateMachine) HandleMessageCreateOrder(msg *MessageCreateOrder) (err lib.ErrorI)
- func (s *StateMachine) HandleMessageDAOTransfer(msg *MessageDAOTransfer) lib.ErrorI
- func (s *StateMachine) HandleMessageDeleteOrder(msg *MessageDeleteOrder) (err lib.ErrorI)
- func (s *StateMachine) HandleMessageEditOrder(msg *MessageEditOrder) (err lib.ErrorI)
- func (s *StateMachine) HandleMessageEditStake(msg *MessageEditStake) lib.ErrorI
- func (s *StateMachine) HandleMessagePause(msg *MessagePause) lib.ErrorI
- func (s *StateMachine) HandleMessageSend(msg *MessageSend) lib.ErrorI
- func (s *StateMachine) HandleMessageStake(msg *MessageStake) lib.ErrorI
- func (s *StateMachine) HandleMessageSubsidy(msg *MessageSubsidy) lib.ErrorI
- func (s *StateMachine) HandleMessageUnpause(msg *MessageUnpause) lib.ErrorI
- func (s *StateMachine) HandleMessageUnstake(msg *MessageUnstake) lib.ErrorI
- func (s *StateMachine) Height() uint64
- func (s *StateMachine) IncrementNonSigners(nonSignerPubKeys [][]byte) lib.ErrorI
- func (s *StateMachine) Initialize(store lib.StoreI) (genesis bool, err lib.ErrorI)
- func (s *StateMachine) IsFeatureEnabled(requiredVersion uint64) bool
- func (s *StateMachine) IterateAndExecute(prefix []byte, callback func(key, value []byte) lib.ErrorI) (err lib.ErrorI)
- func (s *StateMachine) Iterator(key []byte) (lib.IteratorI, lib.ErrorI)
- func (s *StateMachine) LoadBlock(height uint64) (*lib.BlockResult, lib.ErrorI)
- func (s *StateMachine) LoadBlockAndCertificate(height uint64) (cert *lib.QuorumCertificate, block *lib.BlockResult, err lib.ErrorI)
- func (s *StateMachine) LoadCertificate(height uint64) (*lib.QuorumCertificate, lib.ErrorI)
- func (s *StateMachine) LoadCertificateHashesOnly(height uint64) (*lib.QuorumCertificate, lib.ErrorI)
- func (s *StateMachine) LoadCommittee(chainId uint64, height uint64) (lib.ValidatorSet, lib.ErrorI)
- func (s *StateMachine) LoadCommitteeData(height, targetChainId uint64) (*lib.CommitteeData, lib.ErrorI)
- func (s *StateMachine) LoadIsOwnRoot() (bool, lib.ErrorI)
- func (s *StateMachine) LoadLastProposers(height uint64) (*lib.Proposers, lib.ErrorI)
- func (s *StateMachine) LoadMinimumEvidenceHeight() (uint64, lib.ErrorI)
- func (s *StateMachine) LoadRootChainId(height uint64) (uint64, lib.ErrorI)
- func (s *StateMachine) LoadRootChainInfo(id, height uint64, lastValidatorSet ...*lib.ValidatorSet) (*lib.RootChainInfo, lib.ErrorI)
- func (s *StateMachine) LockOrder(lock *lib.LockOrder, chainId uint64) (err lib.ErrorI)
- func (s *StateMachine) LotteryWinner(id uint64, validators ...bool) (lottery *lib.LotteryWinner, err lib.ErrorI)
- func (s *StateMachine) MintToPool(id uint64, amount uint64) lib.ErrorI
- func (s *StateMachine) NewFromGenesisFile() (err lib.ErrorI)
- func (s *StateMachine) NewStateFromGenesis(genesis *GenesisState) (err lib.ErrorI)
- func (s *StateMachine) OverwriteCommitteeData(d *lib.CommitteeData) lib.ErrorI
- func (s *StateMachine) ParseBlockForLockAndCloseOrders(blocks ...*lib.BlockResult) (lockOrders map[string]*lib.LockOrder, closeOrders map[string]*lib.CloseOrder, ...)
- func (s *StateMachine) ParseCloseOrder(tx *lib.Transaction) (co *lib.CloseOrder, ok bool)
- func (s *StateMachine) ParseLockOrder(tx *lib.Transaction, deadlineBlocks uint64) (bo *lib.LockOrder, ok bool)
- func (s *StateMachine) ParsePollTransactions(b *lib.BlockResult)
- func (s *StateMachine) PollsToResults(polls *ActivePolls) (result Poll, err lib.ErrorI)
- func (s *StateMachine) PoolAdd(id uint64, amountToAdd uint64) lib.ErrorI
- func (s *StateMachine) PoolSub(id uint64, amountToSub uint64) lib.ErrorI
- func (s *StateMachine) ProcessRootChainOrderBook(book *lib.OrderBook, proposalBlock *lib.BlockResult) (lockOrders []*lib.LockOrder, closedOrders, resetOrders [][]byte)
- func (s *StateMachine) ReadGenesisFromFile() (genesis *GenesisState, e lib.ErrorI)
- func (s *StateMachine) Reset()
- func (s *StateMachine) ResetCaches()
- func (s *StateMachine) ResetOrder(orderId []byte, chainId uint64) (err lib.ErrorI)
- func (s *StateMachine) RetireCommittee(chainId uint64) lib.ErrorI
- func (s *StateMachine) RevIterator(key []byte) (lib.IteratorI, lib.ErrorI)
- func (s *StateMachine) Set(k, v []byte) (err lib.ErrorI)
- func (s *StateMachine) SetAccount(account *Account) lib.ErrorI
- func (s *StateMachine) SetAccounts(accounts []*Account, supply *Supply) (err lib.ErrorI)
- func (s *StateMachine) SetCommitteeMember(address crypto.AddressI, chainId, stakeForCommittee uint64) lib.ErrorI
- func (s *StateMachine) SetCommittees(address crypto.AddressI, totalStake uint64, committees []uint64) (err lib.ErrorI)
- func (s *StateMachine) SetCommitteesData(list *lib.CommitteesData) lib.ErrorI
- func (s *StateMachine) SetDelegate(address crypto.AddressI, chainId, stakeForCommittee uint64) lib.ErrorI
- func (s *StateMachine) SetDelegations(address crypto.AddressI, totalStake uint64, committees []uint64) lib.ErrorI
- func (s *StateMachine) SetLastProposers(keys *lib.Proposers) lib.ErrorI
- func (s *StateMachine) SetOrder(order *lib.SellOrder, chainId uint64) (err lib.ErrorI)
- func (s *StateMachine) SetOrderBook(b *lib.OrderBook) lib.ErrorI
- func (s *StateMachine) SetOrderBooks(list *lib.OrderBooks, supply *Supply) lib.ErrorI
- func (s *StateMachine) SetParams(p *Params) lib.ErrorI
- func (s *StateMachine) SetParamsCons(c *ConsensusParams) lib.ErrorI
- func (s *StateMachine) SetParamsFee(f *FeeParams) lib.ErrorI
- func (s *StateMachine) SetParamsGov(g *GovernanceParams) lib.ErrorI
- func (s *StateMachine) SetParamsVal(v *ValidatorParams) lib.ErrorI
- func (s *StateMachine) SetPool(pool *Pool) (err lib.ErrorI)
- func (s *StateMachine) SetPools(pools []*Pool, supply *Supply) (err lib.ErrorI)
- func (s *StateMachine) SetProposalVoteConfig(c GovProposalVoteConfig)
- func (s *StateMachine) SetRetiredCommittees(chainIds []uint64) (err lib.ErrorI)
- func (s *StateMachine) SetStore(store lib.RWStoreI)
- func (s *StateMachine) SetSupply(supply *Supply) lib.ErrorI
- func (s *StateMachine) SetValidator(validator *Validator) (err lib.ErrorI)
- func (s *StateMachine) SetValidatorPaused(address crypto.AddressI, validator *Validator, maxPausedHeight uint64) lib.ErrorI
- func (s *StateMachine) SetValidatorUnpaused(address crypto.AddressI, validator *Validator) lib.ErrorI
- func (s *StateMachine) SetValidatorUnstaking(address crypto.AddressI, validator *Validator, finishUnstakingHeight uint64) lib.ErrorI
- func (s *StateMachine) SetValidatorUnstakingIfBelowMinimum(validator *Validator, params *ValidatorParams) (bool, lib.ErrorI)
- func (s *StateMachine) SetValidators(validators []*Validator, supply *Supply) lib.ErrorI
- func (s *StateMachine) SetValidatorsPaused(chainId uint64, addresses [][]byte)
- func (s *StateMachine) SlashAndResetNonSigners(chainId uint64, params *ValidatorParams) (err lib.ErrorI)
- func (s *StateMachine) SlashDoubleSigners(chainId uint64, params *ValidatorParams, doubleSignerAddrs [][]byte) lib.ErrorI
- func (s *StateMachine) SlashNonSigners(chainId uint64, params *ValidatorParams, nonSignerAddrs [][]byte) lib.ErrorI
- func (s *StateMachine) SlashValidator(validator *Validator, chainId, percent uint64, p *ValidatorParams) (err lib.ErrorI)
- func (s *StateMachine) SlashValidators(addresses [][]byte, chainId, percent uint64, p *ValidatorParams) lib.ErrorI
- func (s *StateMachine) Store() lib.RWStoreI
- func (s *StateMachine) SubFromCommitteeStakedSupplyForChain(chainId uint64, amount uint64) lib.ErrorI
- func (s *StateMachine) SubFromDelegateStakedSupplyForChain(chainId uint64, amount uint64) lib.ErrorI
- func (s *StateMachine) SubFromDelegateSupply(amount uint64) lib.ErrorI
- func (s *StateMachine) SubFromStakedSupply(amount uint64) lib.ErrorI
- func (s *StateMachine) SubFromTotalSupply(amount uint64) lib.ErrorI
- func (s *StateMachine) TimeMachine(height uint64) (*StateMachine, lib.ErrorI)
- func (s *StateMachine) TotalVDFIterations() uint64
- func (s *StateMachine) TxnWrap() (lib.StoreI, lib.ErrorI)
- func (s *StateMachine) UpdateCommittees(address crypto.AddressI, oldValidator *Validator, newStakedAmount uint64, ...) lib.ErrorI
- func (s *StateMachine) UpdateDelegations(address crypto.AddressI, oldValidator *Validator, newStakedAmount uint64, ...) lib.ErrorI
- func (s *StateMachine) UpdateLastProposers(address []byte) lib.ErrorI
- func (s *StateMachine) UpdateParam(paramSpace, paramName string, value proto.Message) (err lib.ErrorI)
- func (s *StateMachine) UpdateValidatorStake(val *Validator, newCommittees []uint64, amountToAdd uint64) (err lib.ErrorI)
- func (s *StateMachine) UpsertCommitteeData(new *lib.CommitteeData) lib.ErrorI
- func (s *StateMachine) ValidateGenesisState(genesis *GenesisState) (err lib.ErrorI)
- func (s *StateMachine) VerifyRLPBytes(tx *lib.Transaction) lib.ErrorI
- type Supply
- func (*Supply) Descriptor() ([]byte, []int)deprecated
- func (x *Supply) GetCommitteeDelegatedOnly() []*Pool
- func (x *Supply) GetCommitteeStaked() []*Pool
- func (x *Supply) GetDelegatedOnly() uint64
- func (x *Supply) GetStaked() uint64
- func (x *Supply) GetTotal() uint64
- func (*Supply) ProtoMessage()
- func (x *Supply) ProtoReflect() protoreflect.Message
- func (x *Supply) Reset()
- func (x *Supply) Sort()
- func (x *Supply) SortCommittees()
- func (x *Supply) SortDelegations()
- func (x *Supply) String() string
- type SupplyPoolType
- type Validator
- func (*Validator) Descriptor() ([]byte, []int)deprecated
- func (x *Validator) GetAddress() []byte
- func (x *Validator) GetCommittees() []uint64
- func (x *Validator) GetCompound() bool
- func (x *Validator) GetDelegate() bool
- func (x *Validator) GetMaxPausedHeight() uint64
- func (x *Validator) GetNetAddress() string
- func (x *Validator) GetOutput() []byte
- func (x *Validator) GetPublicKey() []byte
- func (x *Validator) GetStakedAmount() uint64
- func (x *Validator) GetUnstakingHeight() uint64
- func (x *Validator) MarshalJSON() ([]byte, error)
- func (x *Validator) PassesFilter(f lib.ValidatorFilters) (ok bool)
- func (*Validator) ProtoMessage()
- func (x *Validator) ProtoReflect() protoreflect.Message
- func (x *Validator) Reset()
- func (x *Validator) String() string
- func (x *Validator) UnmarshalJSON(bz []byte) error
- type ValidatorPage
- type ValidatorParams
- func (x *ValidatorParams) Check() lib.ErrorI
- func (*ValidatorParams) Descriptor() ([]byte, []int)deprecated
- func (x *ValidatorParams) GetBuyDeadlineBlocks() uint64
- func (x *ValidatorParams) GetDelegateRewardPercentage() uint64
- func (x *ValidatorParams) GetDelegateUnstakingBlocks() uint64
- func (x *ValidatorParams) GetDoubleSignSlashPercentage() uint64
- func (x *ValidatorParams) GetEarlyWithdrawalPenalty() uint64
- func (x *ValidatorParams) GetLockOrderFeeMultiplier() uint64
- func (x *ValidatorParams) GetMaxCommitteeSize() uint64
- func (x *ValidatorParams) GetMaxCommittees() uint64
- func (x *ValidatorParams) GetMaxNonSign() uint64
- func (x *ValidatorParams) GetMaxPauseBlocks() uint64
- func (x *ValidatorParams) GetMaxSlashPerCommittee() uint64
- func (x *ValidatorParams) GetMaximumDelegatesPerCommittee() uint64
- func (x *ValidatorParams) GetMinimumOrderSize() uint64
- func (x *ValidatorParams) GetMinimumStakeForDelegates() uint64
- func (x *ValidatorParams) GetMinimumStakeForValidators() uint64
- func (x *ValidatorParams) GetNonSignSlashPercentage() uint64
- func (x *ValidatorParams) GetNonSignWindow() uint64
- func (x *ValidatorParams) GetStakePercentForSubsidizedCommittee() uint64
- func (x *ValidatorParams) GetUnstakingBlocks() uint64
- func (*ValidatorParams) ProtoMessage()
- func (x *ValidatorParams) ProtoReflect() protoreflect.Message
- func (x *ValidatorParams) Reset()
- func (x *ValidatorParams) SetString(_ string, _ string) lib.ErrorI
- func (x *ValidatorParams) SetUint64(paramName string, value uint64) lib.ErrorI
- func (x *ValidatorParams) String() string
- type ValidatorsList
- type VotePoll
- type VoteStats
Constants ¶
const ( PoolPageName = "pools" // name for page of 'Pools' AccountsPageName = "accounts" // name for page of 'Accounts' )
const ( ParamPrefixCons = "/c/" // store key prefix for Consensus param space ParamPrefixVal = "/v/" // store key prefix for Validators param space ParamPrefixFee = "/f/" // store key prefix for Fee param space ParamPrefixGov = "/g/" // store key prefix for Gov param space ParamSpaceCons = "cons" // name of Consensus param space ParamSpaceVal = "val" // name of Validator param space ParamSpaceFee = "fee" // name of Fee param space ParamSpaceGov = "gov" // name of Governance param space Delimiter = "/" // standard delimiter for protocol version AcceptAllProposals = GovProposalVoteConfig_ACCEPT_ALL ProposalApproveList = GovProposalVoteConfig_APPROVE_LIST RejectAllProposals = GovProposalVoteConfig_REJECT_ALL )
const ( ParamBlockSize = "blockSize" // size of the block - header ParamProtocolVersion = "protocolVersion" // current protocol version (upgrade enforcement) ParamRetired = "retired" // if the chain is marking itself as 'retired' to the root-chain making it forever un-subsidized ParamRootChainId = "rootChainID" // the chain id of the root chain (source of the validator set) )
const ( ParamUnstakingBlocks = "unstakingBlocks" // number of blocks a committee member must be 'unstaking' for ParamMaxPauseBlocks = "maxPauseBlocks" // maximum blocks a validator may be paused for before force-unstaking ParamNonSignSlashPercentage = "nonSignSlashPercentage" // how much a non-signer is slashed if exceeds threshold in window (% of stake) ParamMaxNonSign = "maxNonSign" // how much a committee member can not sign before being slashed ParamNonSignWindow = "nonSignWindow" // how frequently the non-sign-count is reset ParamDoubleSignSlashPercentage = "doubleSignSlashPercentage" // how much a double signer is slashed (% of stake) ParamMaxCommittees = "maxCommittees" // maximum number of committees a single validator may participate in ParamMaxCommitteeSize = "maxCommitteeSize" // maximum number of members a committee may have ParamEarlyWithdrawalPenalty = "earlyWithdrawalPenalty" // reduction percentage of non-compounded rewards ParamDelegateUnstakingBlocks = "delegateUnstakingBlocks" // number of blocks a delegator must be 'unstaking' for ParamMinimumOrderSize = "minimumOrderSize" // minimum sell tokens in a sell order ParamStakePercentForSubsidizedCommittee = "stakePercentForSubsidizedCommittee" // the minimum percentage of total stake needed to be a 'paid committee' ParamMaxSlashPerCommittee = "maxSlashPerCommittee" // the maximum validator slash per committee per block ParamDelegateRewardPercentage = "delegateRewardPercentage" // the percentage of the block reward that is awarded to the delegates ParamBuyDeadlineBlocks = "buyDeadlineBlocks" // the amount of blocks a 'buyer' has to complete an order they reserved ParamLockOrderFeeMultiplier = "lockOrderFeeMultiplier" // the fee multiplier of the 'send' fee that is required to execute a lock order ParamMinimumStakeForValidators = "minimumStakeForValidators" // minimum stake required to be a validator ParamMinimumStakeForDelegates = "minimumStakeForDelegates" // minimum stake required to be a delegate ParamMaximumDelegatesPerCommittee = "maximumDelegatesPerCommittee" // maximum number of delegates per committee )
const ( ParamSendFee = "sendFee" // transaction fee for MessageSend ParamStakeFee = "stakeFee" // transaction fee for MessageStake ParamEditStakeFee = "editStakeFee" // transaction fee for MessageEditStake ParamUnstakeFee = "unstakeFee" // transaction fee for MessageUnstake ParamPauseFee = "pauseFee" // transaction fee for MessagePause ParamUnpauseFee = "unpauseFee" // transaction fee for MessageUnpause ParamChangeParameterFee = "changeParameterFee" // transaction fee for MessageChangeParameter ParamDAOTransferFee = "daoTransferFee" // transaction fee for MessageDAOTransfer ParamCertificateResultsFee = "certificateResultsFee" // transaction fee for MessageCertificateResults ParamSubsidyFee = "subsidyFee" // transaction fee for MessageSubsidy ParamCreateOrderFee = "createOrderFee" // transaction fee for MessageCreateOrder ParamEditOrderFee = "editOrderFee" // transaction fee for MessageEditOrder ParamDeleteOrderFee = "deleteOrderFee" // transaction fee for MessageDeleteOrder )
const ( // Names for each Transaction Message (payload) type MessageSendName = "send" MessageStakeName = "stake" MessageUnstakeName = "unstake" MessageEditStakeName = "editStake" MessagePauseName = "pause" MessageUnpauseName = "unpause" MessageChangeParameterName = "changeParameter" MessageDAOTransferName = "daoTransfer" MessageCertificateResultsName = "certificateResults" MessageSubsidyName = "subsidy" MessageCreateOrderName = "createOrder" MessageEditOrderName = "editOrder" MessageDeleteOrderName = "deleteOrder" )
const ( ValidatorsPageName = "validators" // name for page of 'Validators' ConsValidatorsPageName = "consensus_validators" // name for page of 'Consensus Validators' (only essential val info needed for consensus) )
const BlockAcceptanceRange = 4320
define some safe +/- tx indexer prune height
const CNPYContractAddress = `0x0000000000000000000000000000000000000001`
CNPYContractAddress: (CNPY) a fake contract address that allows tools to send/receive CNPY as if it's an ERC20
const CreateOrderSelector = "bc2e8e5f" // while the signature is createOrder(bytes), Canopy expects (selector + proto-bytes)
const (
CurrentProtocolVersion = 1
)
const DeleteOrderSelector = "6c4650e7" // while the signature is deleteOrder(bytes), Canopy expects (selector + proto-bytes)
const EditOrderSelector = "74e78d6f" // while the signature is editOrder(bytes), Canopy expects (selector + proto-bytes)
const EditStakeSelector = "8c71a515" // while the signature is editStake(bytes), Canopy expects (selector + proto-bytes)
const EscrowPoolAddend = math.MaxUint16
EscrowPoolAddend is used to translate a chainId into the id for the 'swap' escrow pool Example: pools[chainId] -> stake pool && pools[chainId+EscrowPoolAddend] -> escrow pool for token swaps
const (
ParamDAORewardPercentage = "daoRewardPercentage" // percent of rewards the DAO fund receives
)
const RLPIndicator = "RLP"
RLPIndicator is a human-readable indicator the tx is translated from RLP
const SendSelector = "a9059cbb" // transfer(address,uint256) # Canopy expects valid ABI encoding to be 100% compatible with send tooling
const StakeSelector = "2d1e0c02" // while the signature is stake(bytes), Canopy expects (selector + proto-bytes)
const StakedCNPYContractAddress = `0x0000000000000000000000000000000000000002`
StakedCNPYContractAddress: (stCNPY) a fake contract address that allows tools to stake, edit, and unstake CNPY as a delegator
const SubsidySelector = "16d68b09" // while the signature is subsidy(bytes), Canopy expects (selector + proto-bytes)
const SwapCNPYContractAddress = `0x0000000000000000000000000000000000000003`
SwapCNPYContractAddress: (swCNPY) a fake contract address that allows tools to create a sell order, edit a sell order, and delete a sell order
const UnstakeSelector = "3c3653e2" // while the signature is unstake(bytes), Canopy expects (selector + proto-bytes)
Variables ¶
var ( GovProposalVoteConfig_name = map[int32]string{ 0: "ACCEPT_ALL", 1: "APPROVE_LIST", 2: "REJECT_ALL", } GovProposalVoteConfig_value = map[string]int32{ "ACCEPT_ALL": 0, "APPROVE_LIST": 1, "REJECT_ALL": 2, } )
Enum value maps for GovProposalVoteConfig.
var ( // the number of tokens in micro denomination that are initially (before halvenings) minted per block InitialTokensPerBlock = 80 * 1000000 // 80 CNPY // the number of blocks between each halvening (block reward is cut in half) event BlocksPerHalvening = 3150000 // ~ 2 years - 20 second blocks )
var File_account_proto protoreflect.FileDescriptor
var File_genesis_proto protoreflect.FileDescriptor
var File_gov_proto protoreflect.FileDescriptor
var File_message_proto protoreflect.FileDescriptor
var File_validator_proto protoreflect.FileDescriptor
var ReservedIDs = []uint64{ lib.UnknownChainId, lib.DAOPoolID, }
ReservedIds ensures Validators can't stake for 'reserved ids'
Functions ¶
func AccountPrefix ¶
func AccountPrefix() []byte
- Prefixes are used to allow 'grouping' and organization in a schemaless key-value database environment
- Segments are used to allow 'sub-groupings' ex. CommitteeKey allows iteration over all committees (CommitteePrefix) or a specific committee (CommitteePrefix+CommitteeId)
- Iterating over a prefix enables operations over groups of similar datastructures (accounts, validators, params etc.)
- Length prefixed append is used to be able to easily separate the segments of a key
- BigEndianEncoding is used for uint64 to accommodate the 'lexicographical' sorting nature of the key-value database
func CanopyIdsToEVMChainId ¶
CanopyIdsToEVMChainId() converts a chainId and networkId to an evm chain ID
func CheckNetAddress ¶
CheckNetAddress() validates the p2p address in the Message
func CommitteePrefix ¶
func CommitteesDataPrefix ¶
func CommitteesDataPrefix() []byte
func DelegatePrefix ¶
func DownscaleTo6Decimals ¶
DownscaleTo6Decimals converts from 18-decimal unit (Ethereum RPC) to 6-decimal (Canopy native)
func ErrAddressEmpty ¶
func ErrAddressSize ¶
func ErrDuplicateLockOrder ¶
func ErrEmptyConsParams ¶
func ErrEmptyFeeParams ¶
func ErrEmptyGovParams ¶
func ErrEmptySignature ¶
func ErrEmptyValParams ¶
func ErrInsufficientFunds ¶
func ErrInsufficientSupply ¶
func ErrInvalidAmount ¶
func ErrInvalidBlockRange ¶
func ErrInvalidBuyerDeadline ¶
func ErrInvalidChainId ¶
func ErrInvalidCheckpoint ¶
func ErrInvalidCloseOrder ¶
func ErrInvalidERC20Tx ¶
func ErrInvalidKey ¶
func ErrInvalidLockOrder ¶
func ErrInvalidNetAddressLen ¶
func ErrInvalidNumCommittees ¶
func ErrInvalidNumOfSamples ¶
func ErrInvalidOpcode ¶
func ErrInvalidParam ¶
func ErrInvalidProposalHash ¶
func ErrInvalidPublicKey ¶
func ErrInvalidRLPTx ¶
func ErrInvalidSignature ¶
func ErrInvalidSubisdy ¶
func ErrInvalidTxMessage ¶
func ErrMaxBlockSize ¶
func ErrMinimumOrderSize ¶
func ErrMismatchCertResults ¶
func ErrNotEmpty ¶
func ErrOutputAddressEmpty ¶
func ErrOutputAddressSize ¶
func ErrParamKeyEmpty ¶
func ErrParamValueEmpty ¶
func ErrPublicKeyEmpty ¶
func ErrPublicKeySize ¶
func ErrReadGenesisFile ¶
func ErrRecipientAddressSize ¶
func ErrRejectProposal ¶
func ErrStakeBelowMininum ¶
func ErrTxFeeBelowStateLimit ¶
func ErrTxSignBytes ¶
func ErrUnauthorizedTx ¶
func ErrUnknownParam ¶
func ErrUnknownParamSpace ¶
func ErrUnknownParamType ¶
func ErrUnmarshalGenesis ¶
func ErrValidatorExists ¶
func ErrValidatorIsADelegate ¶
func ErrValidatorNotExists ¶
func ErrValidatorNotPaused ¶
func ErrValidatorPaused ¶
func ErrValidatorUnstaking ¶
func ErrWrongStoreType ¶
func EvmChainIdToCanopyIds ¶
EvmChainIdToCanopyIds() converts an EVM chainId to a Canopy chain id
func FilterAndSortPool ¶
func FilterAndSortPool(x *[]*Pool)
filterAndSort() removes zero and nil elements from the pool slice and then sorts the slice by amount finally setting the result to the pointer from the parameter
func FormatParamSpace ¶
FormatParamSpace() converts a user inputted ParamSpace string into the proper ParamSpace name
func InvalidSellOrder ¶
func KeyForAccount ¶
func KeyForCommittee ¶
func KeyForDelegate ¶
func KeyForNonSigner ¶
func KeyForOrder ¶
func KeyForParams ¶
func KeyForPool ¶
func KeyForRetiredCommittee ¶
func KeyForValidator ¶
func LastProposersPrefix ¶
func LastProposersPrefix() []byte
func NewCertificateResultsTx ¶
func NewCertificateResultsTx(from crypto.PrivateKeyI, qc *lib.QuorumCertificate, rootChainId, networkId, fee, height uint64, memo string) (lib.TransactionI, lib.ErrorI)
NewCertificateResultsTx() creates a CertificateResultsTransaction object in the interface form of TransactionI
func NewChangeParamTxString ¶
func NewChangeParamTxString(from crypto.PrivateKeyI, space, key, value string, start, end, networkId, chainId, fee, height uint64, memo string) (lib.TransactionI, lib.ErrorI)
NewChangeParamTxString() creates a ChangeParamTransaction object (for strings) in the interface form of TransactionI
func NewChangeParamTxUint64 ¶
func NewChangeParamTxUint64(from crypto.PrivateKeyI, space, key string, value, start, end, networkId, chainId, fee, height uint64, memo string) (lib.TransactionI, lib.ErrorI)
NewChangeParamTxUint64() creates a ChangeParamTransaction object (for uint64s) in the interface form of TransactionI
func NewCloseOrderTx ¶
func NewCloseOrderTx(from crypto.PrivateKeyI, order lib.CloseOrder, buyersReceiveAddress crypto.AddressI, amount, networkId, chainId, fee, height uint64) (lib.TransactionI, lib.ErrorI)
NewCloseOrderTx() completes the purchase of a sell order using a send-tx and the memo field
func NewCreateOrderTx ¶
func NewCreateOrderTx(from crypto.PrivateKeyI, sellAmount, requestAmount, committeeId uint64, data lib.HexBytes, receiveAddress []byte, networkId, chainId, fee, height uint64, memo string) (lib.TransactionI, lib.ErrorI)
NewCreateOrderTx() creates a CreateOrderTransaction object in the interface form of TransactionI
func NewDAOTransferTx ¶
func NewDAOTransferTx(from crypto.PrivateKeyI, amount, start, end, networkId, chainId, fee, height uint64, memo string) (lib.TransactionI, lib.ErrorI)
NewDAOTransferTx() creates a DAOTransferTransaction object in the interface form of TransactionI
func NewDeleteOrderTx ¶
func NewDeleteOrderTx(from crypto.PrivateKeyI, orderId string, committeeId uint64, networkId, chainId, fee, height uint64, memo string) (lib.TransactionI, lib.ErrorI)
NewDeleteOrderTx() creates an DeleteOrderTransaction object in the interface form of TransactionI
func NewEditOrderTx ¶
func NewEditOrderTx(from crypto.PrivateKeyI, orderId string, sellAmount, requestAmount, committeeId uint64, data lib.HexBytes, receiveAddress []byte, networkId, chainId, fee, height uint64, memo string) (lib.TransactionI, lib.ErrorI)
NewEditOrderTx() creates an EditOrderTransaction object in the interface form of TransactionI
func NewEditStakeTx ¶
func NewEditStakeTx(signer crypto.PrivateKeyI, from, outputAddress crypto.AddressI, netAddress string, committees []uint64, amount, networkId, chainId, fee, height uint64, earlyWithdrawal bool, memo string) (lib.TransactionI, lib.ErrorI)
NewEditStakeTx() creates a EditStakeTransaction object in the interface form of TransactionI
func NewLockOrderTx ¶
func NewLockOrderTx(from crypto.PrivateKeyI, order lib.LockOrder, networkId, chainId, fee, height uint64) (lib.TransactionI, lib.ErrorI)
NewLockOrderTx() reserves a sell order using a send-tx and the memo field
func NewPauseTx ¶
func NewPauseTx(signer crypto.PrivateKeyI, from crypto.AddressI, networkId, chainId, fee, height uint64, memo string) (lib.TransactionI, lib.ErrorI)
NewPauseTx() creates a PauseTransaction object in the interface form of TransactionI
func NewProtocolVersion ¶
NewProtocolVersion() creates a properly formatted protocol version string
func NewSendTransaction ¶
func NewSendTransaction(from crypto.PrivateKeyI, to crypto.AddressI, amount, networkId, chainId, fee, height uint64, memo string) (lib.TransactionI, lib.ErrorI)
NewSendTransaction() creates a SendTransaction object in the interface form of TransactionI
func NewStakeTx ¶
func NewStakeTx(signer crypto.PrivateKeyI, from lib.HexBytes, outputAddress crypto.AddressI, netAddress string, committees []uint64, amount, networkId, chainId, fee, height uint64, delegate, earlyWithdrawal bool, memo string) (lib.TransactionI, lib.ErrorI)
NewStakeTx() creates a StakeTransaction object in the interface form of TransactionI
func NewStartPollTransaction ¶
func NewStartPollTransaction(from crypto.PrivateKeyI, pollJSON json.RawMessage, networkId, chainId, fee, height uint64) (lib.TransactionI, lib.ErrorI)
NewStartPollTransaction() isn't an actual transaction type - rather it's a protocol built on top of send transactions to allow simple straw polling on Canopy. This model is plugin specific and does not need to be followed for other chains.
func NewSubsidyTx ¶
func NewSubsidyTx(from crypto.PrivateKeyI, amount, committeeId uint64, opCode lib.HexBytes, networkId, chainId, fee, height uint64, memo string) (lib.TransactionI, lib.ErrorI)
NewSubsidyTx() creates a SubsidyTransaction object in the interface form of TransactionI
func NewTransaction ¶
func NewTransaction(pk crypto.PrivateKeyI, msg lib.MessageI, networkId, chainId, fee, height uint64, memo string) (lib.TransactionI, lib.ErrorI)
NewTransaction() creates a Transaction object from a message in the interface form of TransactionI
func NewUnpauseTx ¶
func NewUnpauseTx(signer crypto.PrivateKeyI, from crypto.AddressI, networkId, chainId, fee, height uint64, memo string) (lib.TransactionI, lib.ErrorI)
NewUnpauseTx() creates a UnpauseTransaction object in the interface form of TransactionI
func NewUnstakeTx ¶
func NewUnstakeTx(signer crypto.PrivateKeyI, from crypto.AddressI, networkId, chainId, fee, height uint64, memo string) (lib.TransactionI, lib.ErrorI)
NewUnstakeTx() creates a UnstakeTransaction object in the interface form of TransactionI
func NewVotePollTransaction ¶
func NewVotePollTransaction(from crypto.PrivateKeyI, pollJSON json.RawMessage, approve bool, networkId, chainId, fee, height uint64) (lib.TransactionI, lib.ErrorI)
NewVotePollTransaction() isn't an actual transaction type - rather it's a protocol built on top of send transactions to allow simple straw polling on Canopy. This model is plugin specific and does not need to be followed for other chains.
func NonSignerPrefix ¶
func NonSignerPrefix() []byte
func OrderBookPrefix ¶
func PausedPrefix ¶
func PoolPrefix ¶
func PoolPrefix() []byte
func RLPToCanopyTransaction ¶
func RLPToCanopyTransaction(txBytes []byte) (transaction *lib.Transaction, e lib.ErrorI)
RLPToCanopyTransaction() converts an RLP encoded transaction into a Canopy transaction
func RetiredCommitteesPrefix ¶
func RetiredCommitteesPrefix() []byte
func SupplyPrefix ¶
func SupplyPrefix() []byte
func TxHashFromJSON ¶
func TxHashFromJSON(transactionJSON json.RawMessage) (txHash string, err lib.ErrorI)
TxHashFromJSON converts the json transaction into a proto tx hash
func UnstakingPrefix ¶
func UpscaleTo18Decimals ¶
UpscaleTo18Decimals converts a 6-decimal unit (Canopy native) to 18-decimal (Ethereum RPC)
func ValidatorPrefix ¶
func ValidatorPrefix() []byte
Types ¶
type Account ¶
type Account struct {
// address: the short version of a public key
Address []byte `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"`
// amount: the balance of funds the account has
Amount uint64 `protobuf:"varint,2,opt,name=amount,proto3" json:"amount,omitempty"`
// contains filtered or unexported fields
}
***************************************************************************************************** This file is auto-generated from source files in `/lib/.proto/*` using Protocol Buffers (protobuf)
Protobuf is a language-neutral, platform-neutral serialization format. It allows users to define objects in a way that’s both efficient to store and fast to transmit over the network. These definitions are compiled into code that *enables different systems and programming languages to communicate in a byte-perfect manner*
To update these structures, make changes to the source .proto files, then recompile to regenerate this file. These auto-generated files are easily recognized by checking for a `.pb.go` ending ***************************************************************************************************** _ _ _ An account is a structure that holds funds and can send or receive transactions using a crypto key pair Each account has a unique address and a balance, think a bank account - but managed by the blockchain instead of a bank
func (*Account) Descriptor
deprecated
func (*Account) GetAddress ¶
func (*Account) MarshalJSON ¶
MarshalJSON() is the json.Marshaller implementation for the Account object
func (*Account) ProtoMessage ¶
func (*Account) ProtoMessage()
func (*Account) ProtoReflect ¶
func (x *Account) ProtoReflect() protoreflect.Message
func (*Account) UnmarshalJSON ¶
UnmarshalJSON() is the json.Unmarshaler implementation for the Account object
type AccountPage ¶
type AccountPage []*Account
func (*AccountPage) New ¶
func (p *AccountPage) New() lib.Pageable
AccountPage satisfies the Page interface
type ActivePolls ¶
type ActivePolls struct {
Polls map[string]map[string]bool `json:"activePolls"` // [poll_hash] -> [address hex] -> Vote
PollMeta map[string]*StartPoll `json:"pollMeta"` // [poll_hash] -> StartPoll structure
}
ActivePolls is the in-memory representation of the polls.json file Contains a list of all active polls
func (*ActivePolls) CheckForPollTransaction ¶
func (p *ActivePolls) CheckForPollTransaction(sender crypto.AddressI, memo string, height uint64) lib.ErrorI
CheckForPollTransaction() populates the poll.json file from embeds if the embed exists in the memo field
func (*ActivePolls) Cleanup ¶
func (p *ActivePolls) Cleanup(height uint64)
Cleanup() adds polls to 'closed' section if past end height and removes any polls that are older than 4 weeks
func (*ActivePolls) NewFromFile ¶
func (p *ActivePolls) NewFromFile(dataDirPath string) lib.ErrorI
NewFromFile() creates a new polls object from a file
func (*ActivePolls) NewPoll ¶
func (p *ActivePolls) NewPoll(startPoll *StartPoll)
NewPoll() creates a new poll from the start poll embed
func (*ActivePolls) SaveToFile ¶
func (p *ActivePolls) SaveToFile(dataDirPath string) lib.ErrorI
SaveToFile() persists the polls object to a json file
type CheckTxResult ¶
type CheckTxResult struct {
// contains filtered or unexported fields
}
CheckTxResult is the result object from CheckTx()
type ConsValidatorPage ¶
type ConsValidatorPage []*lib.ConsensusValidator
func (*ConsValidatorPage) New ¶
func (p *ConsValidatorPage) New() lib.Pageable
ConsValidatorPage satisfies the Page interface
type ConsensusParams ¶
type ConsensusParams struct {
// block_size: is the maximum allowed size of a block (not including the header)
BlockSize uint64 `protobuf:"varint,1,opt,name=block_size,json=blockSize,proto3" json:"blockSize"` // @gotags: json:"blockSize"
// protocol_version: is the minimum protocol standard that nodes must run to participate in the network
ProtocolVersion string `protobuf:"bytes,2,opt,name=protocol_version,json=protocolVersion,proto3" json:"protocolVersion"` // @gotags: json:"protocolVersion"
// root_chain_id: the identifier of the root chain (source of the validator set)
RootChainId uint64 `protobuf:"varint,3,opt,name=root_chain_id,json=rootChainId,proto3" json:"rootChainID"` // @gotags: json:"rootChainID"
// retired: have the validators agreed to stop this chain and mark it as 'forever un-subsidized' in the base chain
Retired uint64 `protobuf:"varint,4,opt,name=retired,proto3" json:"retired,omitempty"`
// contains filtered or unexported fields
}
ConsensusParams is the parameter space that defines how nodes in the blockchain agree on the state of the ledger
func (*ConsensusParams) Check ¶
func (x *ConsensusParams) Check() lib.ErrorI
Check() validates the consensus params
func (*ConsensusParams) Descriptor
deprecated
func (*ConsensusParams) Descriptor() ([]byte, []int)
Deprecated: Use ConsensusParams.ProtoReflect.Descriptor instead.
func (*ConsensusParams) GetBlockSize ¶
func (x *ConsensusParams) GetBlockSize() uint64
func (*ConsensusParams) GetProtocolVersion ¶
func (x *ConsensusParams) GetProtocolVersion() string
func (*ConsensusParams) GetRetired ¶
func (x *ConsensusParams) GetRetired() uint64
func (*ConsensusParams) GetRootChainId ¶
func (x *ConsensusParams) GetRootChainId() uint64
func (*ConsensusParams) ParseProtocolVersion ¶
func (x *ConsensusParams) ParseProtocolVersion() (*ProtocolVersion, lib.ErrorI)
ParseProtocolVersion() validates the format of the Protocol version string and returns the ProtocolVersion object
func (*ConsensusParams) ProtoMessage ¶
func (*ConsensusParams) ProtoMessage()
func (*ConsensusParams) ProtoReflect ¶
func (x *ConsensusParams) ProtoReflect() protoreflect.Message
func (*ConsensusParams) Reset ¶
func (x *ConsensusParams) Reset()
func (*ConsensusParams) SetString ¶
func (x *ConsensusParams) SetString(paramName string, value string) lib.ErrorI
SetString() update a string parameter in the structure
func (*ConsensusParams) SetUint64 ¶
func (x *ConsensusParams) SetUint64(paramName string, value uint64) lib.ErrorI
SetUint64() update a uint64 parameter in the structure
func (*ConsensusParams) String ¶
func (x *ConsensusParams) String() string
type FeeParams ¶
type FeeParams struct {
// send_fee: is the fee amount (in uCNPY) for Message Send
SendFee uint64 `protobuf:"varint,1,opt,name=send_fee,json=sendFee,proto3" json:"sendFee"` // @gotags: json:"sendFee"
// stake_fee: is the fee amount (in uCNPY) for Message Stake
StakeFee uint64 `protobuf:"varint,2,opt,name=stake_fee,json=stakeFee,proto3" json:"stakeFee"` // @gotags: json:"stakeFee"
// edit_stake_fee: is the fee amount (in uCNPY) for Message Edit-Stake
EditStakeFee uint64 `protobuf:"varint,3,opt,name=edit_stake_fee,json=editStakeFee,proto3" json:"editStakeFee"` // @gotags: json:"editStakeFee"
// unstake_stake_fee: is the fee amount (in uCNPY) for Message Unstake
UnstakeFee uint64 `protobuf:"varint,4,opt,name=unstake_fee,json=unstakeFee,proto3" json:"unstakeFee"` // @gotags: json:"unstakeFee"
// pause_fee: is the fee amount (in uCNPY) for Message Pause
PauseFee uint64 `protobuf:"varint,5,opt,name=pause_fee,json=pauseFee,proto3" json:"pauseFee"` // @gotags: json:"pauseFee"
// unpause_fee: is the fee amount (in uCNPY) for Message Unpause
UnpauseFee uint64 `protobuf:"varint,6,opt,name=unpause_fee,json=unpauseFee,proto3" json:"unpauseFee"` // @gotags: json:"unpauseFee"
// change_parameter_fee: is the fee amount (in uCNPY) for Message Change Parameter
ChangeParameterFee uint64 `protobuf:"varint,7,opt,name=change_parameter_fee,json=changeParameterFee,proto3" json:"changeParameterFee"` // @gotags: json:"changeParameterFee"
// dao_transfer: is the fee amount (in uCNPY) for Message DAO transfer
DaoTransferFee uint64 `protobuf:"varint,8,opt,name=dao_transfer_fee,json=daoTransferFee,proto3" json:"daoTransferFee"` // @gotags: json:"daoTransferFee"
// certificate_results_fee: is the fee amount (in uCNPY) for Message Certificate Results
CertificateResultsFee uint64 `protobuf:"varint,9,opt,name=certificate_results_fee,json=certificateResultsFee,proto3" json:"certificateResultsFee"` // @gotags: json:"certificateResultsFee"
// subsidy_fee: is the fee amount (in uCNPY) for Message Subsidy
SubsidyFee uint64 `protobuf:"varint,10,opt,name=subsidy_fee,json=subsidyFee,proto3" json:"subsidyFee"` // @gotags: json:"subsidyFee"
// create_order_fee: is the fee amount (in uCNPY) for Message Create Order
CreateOrderFee uint64 `protobuf:"varint,11,opt,name=create_order_fee,json=createOrderFee,proto3" json:"createOrderFee"` // @gotags: json:"createOrderFee"
// edit_order_fee: is the fee amount (in uCNPY) for Message Edit Order
EditOrderFee uint64 `protobuf:"varint,12,opt,name=edit_order_fee,json=editOrderFee,proto3" json:"editOrderFee"` // @gotags: json:"editOrderFee"
// delete_order_fee: is the fee amount (in uCNPY) for Message Delete Order
DeleteOrderFee uint64 `protobuf:"varint,13,opt,name=delete_order_fee,json=deleteOrderFee,proto3" json:"deleteOrderFee"` // @gotags: json:"deleteOrderFee"
// contains filtered or unexported fields
}
FeeParams is the parameter space that defines various amounts for transaction fees
func (*FeeParams) Descriptor
deprecated
func (*FeeParams) GetCertificateResultsFee ¶
func (*FeeParams) GetChangeParameterFee ¶
func (*FeeParams) GetCreateOrderFee ¶
func (*FeeParams) GetDaoTransferFee ¶
func (*FeeParams) GetDeleteOrderFee ¶
func (*FeeParams) GetEditOrderFee ¶
func (*FeeParams) GetEditStakeFee ¶
func (*FeeParams) GetPauseFee ¶
func (*FeeParams) GetSendFee ¶
func (*FeeParams) GetStakeFee ¶
func (*FeeParams) GetSubsidyFee ¶
func (*FeeParams) GetUnpauseFee ¶
func (*FeeParams) GetUnstakeFee ¶
func (*FeeParams) ProtoMessage ¶
func (*FeeParams) ProtoMessage()
func (*FeeParams) ProtoReflect ¶
func (x *FeeParams) ProtoReflect() protoreflect.Message
type GenesisState ¶
type GenesisState struct {
// time: the start time of the blockchain network
Time uint64 `protobuf:"varint,1,opt,name=time,proto3" json:"time,omitempty"`
// pools: a list of all the auto controlled accounts
Pools []*Pool `protobuf:"bytes,2,rep,name=pools,proto3" json:"pools,omitempty"`
// accounts: a list of all the user controlled accounts
Accounts []*Account `protobuf:"bytes,3,rep,name=accounts,proto3" json:"accounts,omitempty"`
// validators: a list of all the staked validators
Validators []*Validator `protobuf:"bytes,4,rep,name=validators,proto3" json:"validators,omitempty"`
// non_signers: a count of validators who haven't signed in some 'non-sign-window' of blocks
// this field is not importable
NonSigners []*NonSigner `protobuf:"bytes,5,rep,name=non_signers,json=nonSigners,proto3" json:"nonSigners"` // @gotags: json:"nonSigners"
// double_signers: a list of those who 'double-signed' and the heights they double signed on
// this field is not importable
DoubleSigners []*lib.DoubleSigner `protobuf:"bytes,6,rep,name=double_signers,json=doubleSigners,proto3" json:"doubleSigners"` // @gotags: json:"doubleSigners"
// order_books: is a list of active sell orders
OrderBooks *lib.OrderBooks `protobuf:"bytes,7,opt,name=order_books,json=orderBooks,proto3" json:"orderBooks"` // @gotags: json:"orderBooks"
// params: is a list of governance parameters and their respective values
Params *Params `protobuf:"bytes,8,opt,name=params,proto3" json:"params,omitempty"`
// supply: keeps track of the total amount of tokens or funds available across the entire blockchain
// this field is not importable (auto generated using pools, accounts, validators etc.)
Supply *Supply `protobuf:"bytes,9,opt,name=supply,proto3" json:"supply,omitempty"`
// committees_data: is current status information about the current status of all committees
// this field is not importable
Committees *lib.CommitteesData `protobuf:"bytes,10,opt,name=committees,proto3" json:"committees,omitempty"`
// retired committees: a list of the chain ids that are permanently retired
RetiredCommittees []uint64 `protobuf:"varint,11,rep,packed,name=retired_committees,json=retiredCommittees,proto3" json:"retiredComittees"` // @gotags: json:"retiredComittees"
// contains filtered or unexported fields
}
***************************************************************************************************** This file is auto-generated from source files in `/lib/.proto/*` using Protocol Buffers (protobuf)
Protobuf is a language-neutral, platform-neutral serialization format. It allows users to define objects in a way that’s both efficient to store and fast to transmit over the network. These definitions are compiled into code that *enables different systems and programming languages to communicate in a byte-perfect manner*
To update these structures, make changes to the source .proto files, then recompile to regenerate this file. These auto-generated files are easily recognized by checking for a `.pb.go` ending ***************************************************************************************************** _ _ _ GenesisState is an importable and exportable structure that is representative of the blockchain state at a certain height. The main use-cases for the Genesis state are acting as block 0 and analyzing the state db in json form. Please note that Block 0 is ofter referred to as the 'genesis' block
func (*GenesisState) Descriptor
deprecated
func (*GenesisState) Descriptor() ([]byte, []int)
Deprecated: Use GenesisState.ProtoReflect.Descriptor instead.
func (*GenesisState) GetAccounts ¶
func (x *GenesisState) GetAccounts() []*Account
func (*GenesisState) GetCommittees ¶
func (x *GenesisState) GetCommittees() *lib.CommitteesData
func (*GenesisState) GetDoubleSigners ¶
func (x *GenesisState) GetDoubleSigners() []*lib.DoubleSigner
func (*GenesisState) GetNonSigners ¶
func (x *GenesisState) GetNonSigners() []*NonSigner
func (*GenesisState) GetOrderBooks ¶
func (x *GenesisState) GetOrderBooks() *lib.OrderBooks
func (*GenesisState) GetParams ¶
func (x *GenesisState) GetParams() *Params
func (*GenesisState) GetPools ¶
func (x *GenesisState) GetPools() []*Pool
func (*GenesisState) GetRetiredCommittees ¶
func (x *GenesisState) GetRetiredCommittees() []uint64
func (*GenesisState) GetSupply ¶
func (x *GenesisState) GetSupply() *Supply
func (*GenesisState) GetTime ¶
func (x *GenesisState) GetTime() uint64
func (*GenesisState) GetValidators ¶
func (x *GenesisState) GetValidators() []*Validator
func (*GenesisState) MarshalJSON ¶
func (x *GenesisState) MarshalJSON() ([]byte, error)
MarshalJSON() is the json.Marshaller implementation for the GenesisState object
func (*GenesisState) ProtoMessage ¶
func (*GenesisState) ProtoMessage()
func (*GenesisState) ProtoReflect ¶
func (x *GenesisState) ProtoReflect() protoreflect.Message
func (*GenesisState) Reset ¶
func (x *GenesisState) Reset()
func (*GenesisState) String ¶
func (x *GenesisState) String() string
func (*GenesisState) UnmarshalJSON ¶
func (x *GenesisState) UnmarshalJSON(bz []byte) (err error)
UnmarshalJSON() is the json.Unmarshaler implementation for the GenesisState object
type GovProposal ¶
type GovProposal interface {
proto.Message
GetStartHeight() uint64
GetEndHeight() uint64
GetProposalHash() string
}
GovProposal is an interface that all proposals that may be polled for and voted on must conform to
type GovProposalVoteConfig ¶
type GovProposalVoteConfig int32
***************************************************************************************************** This file is auto-generated from source files in `/lib/.proto/*` using Protocol Buffers (protobuf)
Protobuf is a language-neutral, platform-neutral serialization format. It allows users to define objects in a way that’s both efficient to store and fast to transmit over the network. These definitions are compiled into code that *enables different systems and programming languages to communicate in a byte-perfect manner*
To update these structures, make changes to the source .proto files, then recompile to regenerate this file. These auto-generated files are easily recognized by checking for a `.pb.go` ending ***************************************************************************************************** _ _ _ GovProposalVoteConfig is the configuration for nodes to handle 'governance proposal transactions' like DAO Transfer or Change Parameter
const ( // accept_all is the default mode for 'non-consensus' where all inbound governance proposals are accepted GovProposalVoteConfig_ACCEPT_ALL GovProposalVoteConfig = 0 // approve_list is the default mode for Validators who are active in BFT. This refers to their local approve list in // their data directory GovProposalVoteConfig_APPROVE_LIST GovProposalVoteConfig = 1 // reject_all is a mode that turns on if problems are detected during the consensus process, ensuring the proposal // process doesn't contribute to a chain halt GovProposalVoteConfig_REJECT_ALL GovProposalVoteConfig = 2 )
func (GovProposalVoteConfig) Descriptor ¶
func (GovProposalVoteConfig) Descriptor() protoreflect.EnumDescriptor
func (GovProposalVoteConfig) Enum ¶
func (x GovProposalVoteConfig) Enum() *GovProposalVoteConfig
func (GovProposalVoteConfig) EnumDescriptor
deprecated
func (GovProposalVoteConfig) EnumDescriptor() ([]byte, []int)
Deprecated: Use GovProposalVoteConfig.Descriptor instead.
func (GovProposalVoteConfig) Number ¶
func (x GovProposalVoteConfig) Number() protoreflect.EnumNumber
func (GovProposalVoteConfig) String ¶
func (x GovProposalVoteConfig) String() string
func (GovProposalVoteConfig) Type ¶
func (GovProposalVoteConfig) Type() protoreflect.EnumType
type GovProposalWithVote ¶
type GovProposalWithVote struct {
Proposal json.RawMessage `json:"proposal"`
Approve bool `json:"approve"`
}
GovProposalWithVote is a wrapper over a GovProposal but contains an approval / disapproval boolean
type GovProposals ¶
type GovProposals map[string]GovProposalWithVote
GovProposals is a list of GovProposalsWithVote keyed by the transaction hash of the underlying proposal transaction
func (GovProposals) Add ¶
func (p GovProposals) Add(proposalTransaction json.RawMessage, approve bool) (err lib.ErrorI)
Add() adds a GovProposalWithVote to the list
func (GovProposals) Del ¶
func (p GovProposals) Del(proposalTransaction json.RawMessage) (err error)
Del() removes a GovProposalWithVote from the list
func (*GovProposals) NewFromFile ¶
func (p *GovProposals) NewFromFile(dataDirPath string) lib.ErrorI
NewFromFile() creates a new polls object from a file
func (*GovProposals) SaveToFile ¶
func (p *GovProposals) SaveToFile(dataDirPath string) lib.ErrorI
SaveToFile() persists the polls object to a json file
type GovernanceParams ¶
type GovernanceParams struct {
// dao_reward_percent: is the percent of the block reward that is sent to the DAO
DaoRewardPercentage uint64 `protobuf:"varint,1,opt,name=dao_reward_percentage,json=daoRewardPercentage,proto3" json:"daoRewardPercentage"` // @gotags: json:"daoRewardPercentage"
// contains filtered or unexported fields
}
GovernanceParams is the parameter space that define the rules that enable decentralized and autonomous governing of the network
func (*GovernanceParams) Check ¶
func (x *GovernanceParams) Check() lib.ErrorI
Check() validates the Governance params
func (*GovernanceParams) Descriptor
deprecated
func (*GovernanceParams) Descriptor() ([]byte, []int)
Deprecated: Use GovernanceParams.ProtoReflect.Descriptor instead.
func (*GovernanceParams) GetDaoRewardPercentage ¶
func (x *GovernanceParams) GetDaoRewardPercentage() uint64
func (*GovernanceParams) ProtoMessage ¶
func (*GovernanceParams) ProtoMessage()
func (*GovernanceParams) ProtoReflect ¶
func (x *GovernanceParams) ProtoReflect() protoreflect.Message
func (*GovernanceParams) Reset ¶
func (x *GovernanceParams) Reset()
func (*GovernanceParams) SetString ¶
func (x *GovernanceParams) SetString(_ string, _ string) lib.ErrorI
SetString() update a string parameter in the structure
func (*GovernanceParams) SetUint64 ¶
func (x *GovernanceParams) SetUint64(paramName string, value uint64) lib.ErrorI
SetUint64() update a uint64 parameter in the structure
func (*GovernanceParams) String ¶
func (x *GovernanceParams) String() string
type MessageCertificateResults ¶
type MessageCertificateResults struct {
// qc: a super-majority signed quorum certificate from a recently completed BFT process (COMMIT_PROCESS phase)
Qc *lib.QuorumCertificate `protobuf:"bytes,1,opt,name=qc,proto3" json:"qc,omitempty"`
// contains filtered or unexported fields
}
MessageCertificateResults is a summary from the Leader of a recently completed BFT process in the form of a Quorum Certificate signed by a super-majority of the committee members at a given height. This message defines committee treasury pool recipients, slash recipients, sell orders actions, and checkpoints
func (*MessageCertificateResults) Check ¶
func (x *MessageCertificateResults) Check() lib.ErrorI
Check() validates the Message structure
func (*MessageCertificateResults) Descriptor
deprecated
func (*MessageCertificateResults) Descriptor() ([]byte, []int)
Deprecated: Use MessageCertificateResults.ProtoReflect.Descriptor instead.
func (*MessageCertificateResults) GetQc ¶
func (x *MessageCertificateResults) GetQc() *lib.QuorumCertificate
func (MessageCertificateResults) MarshalJSON ¶
func (x MessageCertificateResults) MarshalJSON() ([]byte, error)
MarshalJSON() is the json.Marshaller implementation for MessageProposal
func (*MessageCertificateResults) Name ¶
func (x *MessageCertificateResults) Name() string
func (*MessageCertificateResults) New ¶
func (x *MessageCertificateResults) New() lib.MessageI
func (*MessageCertificateResults) ProtoMessage ¶
func (*MessageCertificateResults) ProtoMessage()
func (*MessageCertificateResults) ProtoReflect ¶
func (x *MessageCertificateResults) ProtoReflect() protoreflect.Message
func (*MessageCertificateResults) Recipient ¶
func (x *MessageCertificateResults) Recipient() []byte
func (*MessageCertificateResults) Reset ¶
func (x *MessageCertificateResults) Reset()
func (*MessageCertificateResults) String ¶
func (x *MessageCertificateResults) String() string
func (*MessageCertificateResults) UnmarshalJSON ¶
func (x *MessageCertificateResults) UnmarshalJSON(b []byte) (err error)
UnmarshalJSON() is the json.Unmarshaler implementation for MessageProposal
type MessageChangeParameter ¶
type MessageChangeParameter struct {
// parameter_space: is the organization path where the parameter is found (val, cons, fee, gov)
ParameterSpace string `protobuf:"bytes,1,opt,name=parameter_space,json=parameterSpace,proto3" json:"parameterSpace"` // @gotags: json:"parameterSpace"
// parameter_key: is the name of the parameter
ParameterKey string `protobuf:"bytes,2,opt,name=parameter_key,json=parameterKey,proto3" json:"parameterKey"` // @gotags: json:"parameterKey"
// parameter_value: is the uint64 or string value of the parameter
ParameterValue *anypb.Any `protobuf:"bytes,3,opt,name=parameter_value,json=parameterValue,proto3" json:"parameterValue"` // @gotags: json:"parameterValue"
// start_height: is the beginning height where the parameter must be sent
// this field locks in a block-range when it's converted to JSON and allows Validators a deadline to vote
StartHeight uint64 `protobuf:"varint,4,opt,name=start_height,json=startHeight,proto3" json:"startHeight"` // @gotags: json:"startHeight"
// end_height: is the ending height where the parameter must be sent
// this field locks in a block-range when it's converted to JSON and allows Validators a deadline to vote
EndHeight uint64 `protobuf:"varint,5,opt,name=end_height,json=endHeight,proto3" json:"endHeight"` // @gotags: json:"endHeight"
// signer: is the address of the sender / creator of the proposal
// this field locks in an author of the transaction when it's converted to JSON
Signer []byte `protobuf:"bytes,6,opt,name=signer,proto3" json:"signer,omitempty"`
// proposal_hash: internal use only, tracks the hash of the proposal to check against the proposals.json file
ProposalHash string `protobuf:"bytes,7,opt,name=proposal_hash,json=proposalHash,proto3" json:"proposalHash"` // @gotags: json:"proposalHash"
// contains filtered or unexported fields
}
MessageChangeParameter is a governance proposal message used to modify a governance parameter This type of message must be manually pre-approved by +2/3rds of the Validators via their APPROVE_LIST In short, a 'proposer' generates the message JSON, communicates the JSON to Validators, Validators vote by populating their APPROVE_LIST which configures how they'll vote during the consensus process when a block includes this transaction in it.
func (*MessageChangeParameter) Check ¶
func (x *MessageChangeParameter) Check() lib.ErrorI
Check() validates the Message structure
func (*MessageChangeParameter) Descriptor
deprecated
func (*MessageChangeParameter) Descriptor() ([]byte, []int)
Deprecated: Use MessageChangeParameter.ProtoReflect.Descriptor instead.
func (*MessageChangeParameter) GetEndHeight ¶
func (x *MessageChangeParameter) GetEndHeight() uint64
func (*MessageChangeParameter) GetParameterKey ¶
func (x *MessageChangeParameter) GetParameterKey() string
func (*MessageChangeParameter) GetParameterSpace ¶
func (x *MessageChangeParameter) GetParameterSpace() string
func (*MessageChangeParameter) GetParameterValue ¶
func (x *MessageChangeParameter) GetParameterValue() *anypb.Any
func (*MessageChangeParameter) GetProposalHash ¶
func (x *MessageChangeParameter) GetProposalHash() string
func (*MessageChangeParameter) GetSigner ¶
func (x *MessageChangeParameter) GetSigner() []byte
func (*MessageChangeParameter) GetStartHeight ¶
func (x *MessageChangeParameter) GetStartHeight() uint64
func (MessageChangeParameter) MarshalJSON ¶
func (x MessageChangeParameter) MarshalJSON() ([]byte, error)
MarshalJSON() is the json.Marshaller implementation for MessageChangeParameter
func (*MessageChangeParameter) Name ¶
func (x *MessageChangeParameter) Name() string
func (*MessageChangeParameter) New ¶
func (x *MessageChangeParameter) New() lib.MessageI
func (*MessageChangeParameter) ProtoMessage ¶
func (*MessageChangeParameter) ProtoMessage()
func (*MessageChangeParameter) ProtoReflect ¶
func (x *MessageChangeParameter) ProtoReflect() protoreflect.Message
func (*MessageChangeParameter) Recipient ¶
func (x *MessageChangeParameter) Recipient() []byte
func (*MessageChangeParameter) Reset ¶
func (x *MessageChangeParameter) Reset()
func (*MessageChangeParameter) String ¶
func (x *MessageChangeParameter) String() string
func (*MessageChangeParameter) UnmarshalJSON ¶
func (x *MessageChangeParameter) UnmarshalJSON(b []byte) (err error)
UnmarshalJSON() is the json.Unmarshaler implementation for MessageChangeParameter
type MessageCreateOrder ¶
type MessageCreateOrder struct {
// chain_id: the id of the committee that is responsible for the 'counter asset' the uCNPY will swapped for
ChainId uint64 `protobuf:"varint,1,opt,name=ChainId,proto3" json:"chainID"` // @gotags: json:"chainID"
// data: a generic data field which can allow a committee to execute specific functionality for the swap
Data []byte `protobuf:"bytes,2,opt,name=data,proto3" json:"data"` // @gotags: json:"data"
// amount_for_sale: the amount of uCNPY listed for sale, transferred to escrow
AmountForSale uint64 `protobuf:"varint,3,opt,name=AmountForSale,proto3" json:"amountForSale"` // @gotags: json:"amountForSale"
// requested_amount: the amount of the 'counter asset' the buyer must send in order to complete a swap
RequestedAmount uint64 `protobuf:"varint,4,opt,name=RequestedAmount,proto3" json:"requestAmount"` // @gotags: json:"requestAmount"
// sellers_receive_address: the address of the seller where the 'counter asset' will be received
SellerReceiveAddress []byte `protobuf:"bytes,5,opt,name=SellerReceiveAddress,proto3" json:"sellerReceiveAddress"` // @gotags: json:"sellerReceiveAddress"
// sellers_send_address: the Canopy address the seller is selling and signing from
SellersSendAddress []byte `protobuf:"bytes,6,opt,name=SellersSendAddress,proto3" json:"sellersSendAddress"` // @gotags: json:"sellersSendAddress"
// OrderId: auto-populated by the state machine to assign the unique bytes to the order
OrderId []byte `protobuf:"bytes,7,opt,name=OrderId,proto3" json:"OrderId,omitempty"`
// contains filtered or unexported fields
}
MessageCreateOrder creates a new token swap 'sell order', removing tokens from the sender account and transferring them to an escrow pool while awaiting a buyer
func (*MessageCreateOrder) Check ¶
func (x *MessageCreateOrder) Check() lib.ErrorI
Check() validates the Message structure
func (*MessageCreateOrder) Descriptor
deprecated
func (*MessageCreateOrder) Descriptor() ([]byte, []int)
Deprecated: Use MessageCreateOrder.ProtoReflect.Descriptor instead.
func (*MessageCreateOrder) GetAmountForSale ¶
func (x *MessageCreateOrder) GetAmountForSale() uint64
func (*MessageCreateOrder) GetChainId ¶
func (x *MessageCreateOrder) GetChainId() uint64
func (*MessageCreateOrder) GetData ¶
func (x *MessageCreateOrder) GetData() []byte
func (*MessageCreateOrder) GetOrderId ¶
func (x *MessageCreateOrder) GetOrderId() []byte
func (*MessageCreateOrder) GetRequestedAmount ¶
func (x *MessageCreateOrder) GetRequestedAmount() uint64
func (*MessageCreateOrder) GetSellerReceiveAddress ¶
func (x *MessageCreateOrder) GetSellerReceiveAddress() []byte
func (*MessageCreateOrder) GetSellersSendAddress ¶
func (x *MessageCreateOrder) GetSellersSendAddress() []byte
func (*MessageCreateOrder) MarshalJSON ¶
func (x *MessageCreateOrder) MarshalJSON() ([]byte, error)
MarshalJSON() is the json.Marshaller implementation for MessageCreateOrder
func (*MessageCreateOrder) Name ¶
func (x *MessageCreateOrder) Name() string
func (*MessageCreateOrder) New ¶
func (x *MessageCreateOrder) New() lib.MessageI
func (*MessageCreateOrder) ProtoMessage ¶
func (*MessageCreateOrder) ProtoMessage()
func (*MessageCreateOrder) ProtoReflect ¶
func (x *MessageCreateOrder) ProtoReflect() protoreflect.Message
func (*MessageCreateOrder) Recipient ¶
func (x *MessageCreateOrder) Recipient() []byte
func (*MessageCreateOrder) Reset ¶
func (x *MessageCreateOrder) Reset()
func (*MessageCreateOrder) String ¶
func (x *MessageCreateOrder) String() string
func (*MessageCreateOrder) UnmarshalJSON ¶
func (x *MessageCreateOrder) UnmarshalJSON(b []byte) (err error)
UnmarshalJSON() is the json.Unmarshaler implementation for MessageCreateOrder
type MessageDAOTransfer ¶
type MessageDAOTransfer struct {
// address: is the recipient address and sender of this message
Address []byte `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"`
// amount: is the amount of
Amount uint64 `protobuf:"varint,2,opt,name=amount,proto3" json:"amount,omitempty"`
// start_height: is the beginning height where the parameter must be sent
// this field locks in a block-range when it's converted to JSON and allows Validators a deadline to vote
StartHeight uint64 `protobuf:"varint,4,opt,name=start_height,json=startHeight,proto3" json:"startHeight"` // @gotags: json:"startHeight"
// end_height: is the ending height where the parameter must be sent
// this field locks in a block-range when it's converted to JSON and allows Validators a deadline to vote
EndHeight uint64 `protobuf:"varint,5,opt,name=end_height,json=endHeight,proto3" json:"startHeight"` // @gotags: json:"startHeight"
// proposal_hash: internal use only, tracks the hash of the proposal to check against the proposals.json file
ProposalHash string `protobuf:"bytes,6,opt,name=proposal_hash,json=proposalHash,proto3" json:"proposalHash"` // @gotags: json:"proposalHash"
// contains filtered or unexported fields
}
MessageDAOTransfer is a governance proposal message used to send funds from the DAO pool to an account This type of message must be manually pre-approved by +2/3rds of the Validators via their APPROVE_LIST In short, a 'proposer' generates the message JSON, communicates the JSON to Validators, Validators vote by populating their APPROVE_LIST which configures how they'll vote during the consensus process when a block includes this transaction in it.
func (*MessageDAOTransfer) Check ¶
func (x *MessageDAOTransfer) Check() lib.ErrorI
Check() validates the Message structure
func (*MessageDAOTransfer) Descriptor
deprecated
func (*MessageDAOTransfer) Descriptor() ([]byte, []int)
Deprecated: Use MessageDAOTransfer.ProtoReflect.Descriptor instead.
func (*MessageDAOTransfer) GetAddress ¶
func (x *MessageDAOTransfer) GetAddress() []byte
func (*MessageDAOTransfer) GetAmount ¶
func (x *MessageDAOTransfer) GetAmount() uint64
func (*MessageDAOTransfer) GetEndHeight ¶
func (x *MessageDAOTransfer) GetEndHeight() uint64
func (*MessageDAOTransfer) GetProposalHash ¶
func (x *MessageDAOTransfer) GetProposalHash() string
func (*MessageDAOTransfer) GetStartHeight ¶
func (x *MessageDAOTransfer) GetStartHeight() uint64
func (MessageDAOTransfer) MarshalJSON ¶
func (x MessageDAOTransfer) MarshalJSON() ([]byte, error)
MarshalJSON() is the json.Marshaller implementation for MessageDAOTransfer
func (*MessageDAOTransfer) Name ¶
func (x *MessageDAOTransfer) Name() string
func (*MessageDAOTransfer) New ¶
func (x *MessageDAOTransfer) New() lib.MessageI
func (*MessageDAOTransfer) ProtoMessage ¶
func (*MessageDAOTransfer) ProtoMessage()
func (*MessageDAOTransfer) ProtoReflect ¶
func (x *MessageDAOTransfer) ProtoReflect() protoreflect.Message
func (*MessageDAOTransfer) Recipient ¶
func (x *MessageDAOTransfer) Recipient() []byte
func (*MessageDAOTransfer) Reset ¶
func (x *MessageDAOTransfer) Reset()
func (*MessageDAOTransfer) String ¶
func (x *MessageDAOTransfer) String() string
func (*MessageDAOTransfer) UnmarshalJSON ¶
func (x *MessageDAOTransfer) UnmarshalJSON(b []byte) (err error)
UnmarshalJSON() is the json.Unmarshaler implementation for MessageDAOTransfer
type MessageDeleteOrder ¶
type MessageDeleteOrder struct {
// order_id: is the number id that is unique to this committee to identify the order
OrderId []byte `protobuf:"bytes,1,opt,name=OrderId,proto3" json:"orderID"` // @gotags: json:"orderID"
// chain_id: the id of the committee that is responsible for the 'counter asset' the uCNPY will swapped for
ChainId uint64 `protobuf:"varint,2,opt,name=ChainId,proto3" json:"chainID"` // @gotags: json:"chainID"
// contains filtered or unexported fields
}
MessageDeleteOrder: deletes an un-claimed token swap 'sell order' If an order is already 'claimed' or 'bought', the order may not be deleted
func (*MessageDeleteOrder) Check ¶
func (x *MessageDeleteOrder) Check() lib.ErrorI
Check() validates the Message structure
func (*MessageDeleteOrder) Descriptor
deprecated
func (*MessageDeleteOrder) Descriptor() ([]byte, []int)
Deprecated: Use MessageDeleteOrder.ProtoReflect.Descriptor instead.
func (*MessageDeleteOrder) GetChainId ¶
func (x *MessageDeleteOrder) GetChainId() uint64
func (*MessageDeleteOrder) GetOrderId ¶
func (x *MessageDeleteOrder) GetOrderId() []byte
func (*MessageDeleteOrder) MarshalJSON ¶
func (x *MessageDeleteOrder) MarshalJSON() ([]byte, error)
MarshalJSON() is the json.Marshaller implementation for MessageEditOrder
func (*MessageDeleteOrder) Name ¶
func (x *MessageDeleteOrder) Name() string
func (*MessageDeleteOrder) New ¶
func (x *MessageDeleteOrder) New() lib.MessageI
func (*MessageDeleteOrder) ProtoMessage ¶
func (*MessageDeleteOrder) ProtoMessage()
func (*MessageDeleteOrder) ProtoReflect ¶
func (x *MessageDeleteOrder) ProtoReflect() protoreflect.Message
func (*MessageDeleteOrder) Recipient ¶
func (x *MessageDeleteOrder) Recipient() []byte
func (*MessageDeleteOrder) Reset ¶
func (x *MessageDeleteOrder) Reset()
func (*MessageDeleteOrder) String ¶
func (x *MessageDeleteOrder) String() string
func (*MessageDeleteOrder) UnmarshalJSON ¶
func (x *MessageDeleteOrder) UnmarshalJSON(b []byte) (err error)
UnmarshalJSON() is the json.Unmarshaler implementation for MessageEditOrder
type MessageEditOrder ¶
type MessageEditOrder struct {
// order_id: is the number id that is unique to this committee to identify the order
// not modifiable, used for order identification only
OrderId []byte `protobuf:"bytes,1,opt,name=OrderId,proto3" json:"orderID"` // @gotags: json:"orderID"
// chain_id: the id of the committee that is responsible for the 'counter asset' the uCNPY will swapped for
// not modifiable, used for order identification only
ChainId uint64 `protobuf:"varint,2,opt,name=ChainId,proto3" json:"chainID"` // @gotags: json:"chainID"
// data: a generic data field which can allow a committee to execute specific functionality for the swap
Data []byte `protobuf:"bytes,3,opt,name=data,proto3" json:"data"` // @gotags: json:"data"
// amount_for_sale: the updated amount of uCNPY listed for sale, a reduction will return escrowed tokens to the seller's
// send address
AmountForSale uint64 `protobuf:"varint,4,opt,name=AmountForSale,proto3" json:"amountForSale"` // @gotags: json:"amountForSale"
// requested_amount: the updated amount of the 'counter asset' the buyer must send in order to complete a swap
RequestedAmount uint64 `protobuf:"varint,5,opt,name=RequestedAmount,proto3" json:"requestedAmount"` // @gotags: json:"requestedAmount"
// sellers_receive_address: the address of the seller where the 'counter asset' will be received
SellerReceiveAddress []byte `protobuf:"bytes,6,opt,name=SellerReceiveAddress,proto3" json:"sellerReceiveAddress"` // @gotags: json:"sellerReceiveAddress"
// contains filtered or unexported fields
}
MessageEditOrder modifies an un-claimed token swap 'sell order', token amount may be increased or decreased as well as the recipient address If an order is already 'claimed' or 'bought', the order may not be modified
func (*MessageEditOrder) Check ¶
func (x *MessageEditOrder) Check() lib.ErrorI
Check() validates the Message structure
func (*MessageEditOrder) Descriptor
deprecated
func (*MessageEditOrder) Descriptor() ([]byte, []int)
Deprecated: Use MessageEditOrder.ProtoReflect.Descriptor instead.
func (*MessageEditOrder) GetAmountForSale ¶
func (x *MessageEditOrder) GetAmountForSale() uint64
func (*MessageEditOrder) GetChainId ¶
func (x *MessageEditOrder) GetChainId() uint64
func (*MessageEditOrder) GetData ¶
func (x *MessageEditOrder) GetData() []byte
func (*MessageEditOrder) GetOrderId ¶
func (x *MessageEditOrder) GetOrderId() []byte
func (*MessageEditOrder) GetRequestedAmount ¶
func (x *MessageEditOrder) GetRequestedAmount() uint64
func (*MessageEditOrder) GetSellerReceiveAddress ¶
func (x *MessageEditOrder) GetSellerReceiveAddress() []byte
func (*MessageEditOrder) MarshalJSON ¶
func (x *MessageEditOrder) MarshalJSON() ([]byte, error)
MarshalJSON() is the json.Marshaller implementation for MessageEditOrder
func (*MessageEditOrder) Name ¶
func (x *MessageEditOrder) Name() string
func (*MessageEditOrder) New ¶
func (x *MessageEditOrder) New() lib.MessageI
func (*MessageEditOrder) ProtoMessage ¶
func (*MessageEditOrder) ProtoMessage()
func (*MessageEditOrder) ProtoReflect ¶
func (x *MessageEditOrder) ProtoReflect() protoreflect.Message
func (*MessageEditOrder) Recipient ¶
func (x *MessageEditOrder) Recipient() []byte
func (*MessageEditOrder) Reset ¶
func (x *MessageEditOrder) Reset()
func (*MessageEditOrder) String ¶
func (x *MessageEditOrder) String() string
func (*MessageEditOrder) UnmarshalJSON ¶
func (x *MessageEditOrder) UnmarshalJSON(b []byte) (err error)
UnmarshalJSON() is the json.Unmarshaler implementation for MessageEditOrder
type MessageEditStake ¶
type MessageEditStake struct {
// address: the short version of the public key, acting as a unique identify linked to the Validator structure
Address []byte `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"`
// amount: the updated amount of tokens being staked. This must be greater than or equal to the previous staked amount
// The user's account balance is reduced by the difference between the old and new staked amounts
// (old.Staked_Tokens - message.amount)
Amount uint64 `protobuf:"varint,2,opt,name=amount,proto3" json:"amount,omitempty"`
// committees: the update to the committees the validator is restaking their tokens for
Committees []uint64 `protobuf:"varint,3,rep,packed,name=committees,proto3" json:"committees,omitempty"`
// net_address: the update to the tcp peer-to-peer address of the peer
NetAddress string `protobuf:"bytes,4,opt,name=net_address,json=netAddress,proto3" json:"netAddress"` // @gotags: json:"netAddress"
// output_address: the update to the reward address, only the output address may edit this
OutputAddress []byte `protobuf:"bytes,5,opt,name=output_address,json=outputAddress,proto3" json:"outputAddress"` // @gotags: json:"outputAddress"
// compound: the update to the auto-compounding status
Compound bool `protobuf:"varint,6,opt,name=compound,proto3" json:"compound,omitempty"`
// signer: this field is needed so that the protocol may save the signer once they're identified by their public key
// this is necessary because only the output address may edit the output field.
Signer []byte `protobuf:"bytes,7,opt,name=signer,proto3" json:"signer,omitempty"`
// contains filtered or unexported fields
}
MessageStake is the Validator modification message, it allows an increase locking up a certain amount of tokens, a change to the committees, the p2p address, the output address, and auto-compounding status To leave fields un-edited, simply use the previous value
func (*MessageEditStake) Check ¶
func (x *MessageEditStake) Check() lib.ErrorI
Check() validates the Message structure
func (*MessageEditStake) Descriptor
deprecated
func (*MessageEditStake) Descriptor() ([]byte, []int)
Deprecated: Use MessageEditStake.ProtoReflect.Descriptor instead.
func (*MessageEditStake) GetAddress ¶
func (x *MessageEditStake) GetAddress() []byte
func (*MessageEditStake) GetAmount ¶
func (x *MessageEditStake) GetAmount() uint64
func (*MessageEditStake) GetCommittees ¶
func (x *MessageEditStake) GetCommittees() []uint64
func (*MessageEditStake) GetCompound ¶
func (x *MessageEditStake) GetCompound() bool
func (*MessageEditStake) GetNetAddress ¶
func (x *MessageEditStake) GetNetAddress() string
func (*MessageEditStake) GetOutputAddress ¶
func (x *MessageEditStake) GetOutputAddress() []byte
func (*MessageEditStake) GetSigner ¶
func (x *MessageEditStake) GetSigner() []byte
func (MessageEditStake) MarshalJSON ¶
func (x MessageEditStake) MarshalJSON() ([]byte, error)
MarshalJSON() is the json.Marshaller implementation for MessageEditStake
func (*MessageEditStake) Name ¶
func (x *MessageEditStake) Name() string
func (*MessageEditStake) New ¶
func (x *MessageEditStake) New() lib.MessageI
func (*MessageEditStake) ProtoMessage ¶
func (*MessageEditStake) ProtoMessage()
func (*MessageEditStake) ProtoReflect ¶
func (x *MessageEditStake) ProtoReflect() protoreflect.Message
func (*MessageEditStake) Recipient ¶
func (x *MessageEditStake) Recipient() []byte
func (*MessageEditStake) Reset ¶
func (x *MessageEditStake) Reset()
func (*MessageEditStake) String ¶
func (x *MessageEditStake) String() string
func (*MessageEditStake) UnmarshalJSON ¶
func (x *MessageEditStake) UnmarshalJSON(b []byte) (err error)
UnmarshalJSON() is the json.Unmarshaler implementation for MessageEditStake
type MessagePause ¶
type MessagePause struct {
// address: the short version of the public key, acting as a unique identify linked to the Validator structure
Address []byte `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"`
// contains filtered or unexported fields
}
MessagePause is the Validator break message, it temporarily removes the Validator from active duty This allows operators a path to gracefully maintain their Validators without fully exiting
func (*MessagePause) Check ¶
func (x *MessagePause) Check() lib.ErrorI
Check() validates the Message structure
func (*MessagePause) Descriptor
deprecated
func (*MessagePause) Descriptor() ([]byte, []int)
Deprecated: Use MessagePause.ProtoReflect.Descriptor instead.
func (*MessagePause) GetAddress ¶
func (x *MessagePause) GetAddress() []byte
func (MessagePause) MarshalJSON ¶
func (x MessagePause) MarshalJSON() ([]byte, error)
MarshalJSON() is the json.Marshaller implementation for MessagePause
func (*MessagePause) Name ¶
func (x *MessagePause) Name() string
func (*MessagePause) New ¶
func (x *MessagePause) New() lib.MessageI
func (*MessagePause) ProtoMessage ¶
func (*MessagePause) ProtoMessage()
func (*MessagePause) ProtoReflect ¶
func (x *MessagePause) ProtoReflect() protoreflect.Message
func (*MessagePause) Recipient ¶
func (x *MessagePause) Recipient() []byte
func (*MessagePause) Reset ¶
func (x *MessagePause) Reset()
func (*MessagePause) String ¶
func (x *MessagePause) String() string
func (*MessagePause) UnmarshalJSON ¶
func (x *MessagePause) UnmarshalJSON(b []byte) (err error)
UnmarshalJSON() is the json.Unmarshaler implementation for MessagePause
type MessageSend ¶
type MessageSend struct {
// from_address: is the sender of the funds
FromAddress []byte `protobuf:"bytes,1,opt,name=from_address,json=fromAddress,proto3" json:"fromAddress"` // @gotags: json:"fromAddress"
// to_address: is the recipient of the funds
ToAddress []byte `protobuf:"bytes,2,opt,name=to_address,json=toAddress,proto3" json:"toAddress"` // @gotags: json:"toAddress"
// amount: is the amount of tokens in micro-denomination (uCNPY)
Amount uint64 `protobuf:"varint,3,opt,name=amount,proto3" json:"amount,omitempty"`
// contains filtered or unexported fields
}
***************************************************************************************************** This file is auto-generated from source files in `/lib/.proto/*` using Protocol Buffers (protobuf)
Protobuf is a language-neutral, platform-neutral serialization format. It allows users to define objects in a way that’s both efficient to store and fast to transmit over the network. These definitions are compiled into code that *enables different systems and programming languages to communicate in a byte-perfect manner*
To update these structures, make changes to the source .proto files, then recompile to regenerate this file. These auto-generated files are easily recognized by checking for a `.pb.go` ending ***************************************************************************************************** _ _ _ MessageSend is a standard transfer transaction, taking tokens from the sender and transferring them to the recipient
func (*MessageSend) Check ¶
func (x *MessageSend) Check() lib.ErrorI
Check() validates the Message structure
func (*MessageSend) Descriptor
deprecated
func (*MessageSend) Descriptor() ([]byte, []int)
Deprecated: Use MessageSend.ProtoReflect.Descriptor instead.
func (*MessageSend) GetAmount ¶
func (x *MessageSend) GetAmount() uint64
func (*MessageSend) GetFromAddress ¶
func (x *MessageSend) GetFromAddress() []byte
func (*MessageSend) GetToAddress ¶
func (x *MessageSend) GetToAddress() []byte
func (MessageSend) MarshalJSON ¶
func (x MessageSend) MarshalJSON() ([]byte, error)
MarshalJSON() is the json.Marshaller implementation for MessageSend
func (*MessageSend) Name ¶
func (x *MessageSend) Name() string
func (*MessageSend) New ¶
func (x *MessageSend) New() lib.MessageI
func (*MessageSend) ProtoMessage ¶
func (*MessageSend) ProtoMessage()
func (*MessageSend) ProtoReflect ¶
func (x *MessageSend) ProtoReflect() protoreflect.Message
func (*MessageSend) Recipient ¶
func (x *MessageSend) Recipient() []byte
func (*MessageSend) Reset ¶
func (x *MessageSend) Reset()
func (*MessageSend) String ¶
func (x *MessageSend) String() string
func (*MessageSend) UnmarshalJSON ¶
func (x *MessageSend) UnmarshalJSON(b []byte) (err error)
UnmarshalJSON() is the json.Unmarshaler implementation for MessageSend
type MessageStake ¶
type MessageStake struct {
// public_key: the public cryptographic identity of the Validator operator that is unique to a users
// secret private key
PublicKey []byte `protobuf:"bytes,1,opt,name=public_key,json=publicKey,proto3" json:"publicKey"` // @gotags: json:"publicKey"
// amount: is the amount of tokens to be removed from the sender account and locked as a surety bond against bad
// behavior
Amount uint64 `protobuf:"varint,2,opt,name=amount,proto3" json:"amount,omitempty"`
// committees: is the list of committees the validator is restaking their tokens towards
Committees []uint64 `protobuf:"varint,3,rep,packed,name=committees,proto3" json:"committees,omitempty"`
// net_address: is the tcp peer-to-peer address of the peer
NetAddress string `protobuf:"bytes,4,opt,name=net_address,json=netAddress,proto3" json:"netAddress"` // @gotags: json:"netAddress"
// output_address: is the short version of the public key where reward and unstaking funds will be distributed to
OutputAddress []byte `protobuf:"bytes,5,opt,name=output_address,json=outputAddress,proto3" json:"outputAddress"` // @gotags: json:"outputAddress"
// delegate: signals whether the Validator is a delegate or not
Delegate bool `protobuf:"varint,6,opt,name=delegate,proto3" json:"delegate,omitempty"`
// compound: signals whether the Validator is auto-compounding or not
Compound bool `protobuf:"varint,7,opt,name=compound,proto3" json:"compound,omitempty"`
// signer: auto-populated by the state machine to assign the authorized signer who executed the transaction
Signer []byte `protobuf:"bytes,8,opt,name=signer,proto3" json:"signer,omitempty"`
// contains filtered or unexported fields
}
MessageStake is the Validator registration message, locking up a certain amount of tokens. Staking as a non-delegate is registering for active participation in the committee(s) consensus process(es), whereas delegate is passive participation that acts as a contribution to which committees are subsidized by the protocol. Either the operator or the sender may originate the stake transaction, but the funds are removed from the sender's account
func (*MessageStake) Check ¶
func (x *MessageStake) Check() lib.ErrorI
Check() validates the Message structure
func (*MessageStake) Descriptor
deprecated
func (*MessageStake) Descriptor() ([]byte, []int)
Deprecated: Use MessageStake.ProtoReflect.Descriptor instead.
func (*MessageStake) GetAmount ¶
func (x *MessageStake) GetAmount() uint64
func (*MessageStake) GetCommittees ¶
func (x *MessageStake) GetCommittees() []uint64
func (*MessageStake) GetCompound ¶
func (x *MessageStake) GetCompound() bool
func (*MessageStake) GetDelegate ¶
func (x *MessageStake) GetDelegate() bool
func (*MessageStake) GetNetAddress ¶
func (x *MessageStake) GetNetAddress() string
func (*MessageStake) GetOutputAddress ¶
func (x *MessageStake) GetOutputAddress() []byte
func (*MessageStake) GetPublicKey ¶
func (x *MessageStake) GetPublicKey() []byte
func (*MessageStake) GetSigner ¶
func (x *MessageStake) GetSigner() []byte
func (MessageStake) MarshalJSON ¶
func (x MessageStake) MarshalJSON() ([]byte, error)
MarshalJSON() is the json.Marshaller implementation for MessageStake
func (*MessageStake) Name ¶
func (x *MessageStake) Name() string
func (*MessageStake) New ¶
func (x *MessageStake) New() lib.MessageI
func (*MessageStake) ProtoMessage ¶
func (*MessageStake) ProtoMessage()
func (*MessageStake) ProtoReflect ¶
func (x *MessageStake) ProtoReflect() protoreflect.Message
func (*MessageStake) Recipient ¶
func (x *MessageStake) Recipient() []byte
func (*MessageStake) Reset ¶
func (x *MessageStake) Reset()
func (*MessageStake) String ¶
func (x *MessageStake) String() string
func (*MessageStake) UnmarshalJSON ¶
func (x *MessageStake) UnmarshalJSON(b []byte) (err error)
UnmarshalJSON() is the json.Unmarshaler implementation for MessageStake
type MessageSubsidy ¶
type MessageSubsidy struct {
// address: is the sender of the funds
Address []byte `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"`
// chain_id: is the id of the committee the funds are being sent to
ChainId uint64 `protobuf:"varint,2,opt,name=chain_id,json=chainId,proto3" json:"chainID"` // @gotags: json:"chainID"
// amount: is the amount of funds that are taken from the sender and transferred to the recipient pool
Amount uint64 `protobuf:"varint,3,opt,name=amount,proto3" json:"amount,omitempty"`
// opcode: a generic code field to allow fund designation instructions
Opcode []byte `protobuf:"bytes,4,opt,name=opcode,proto3" json:"opcode,omitempty"`
// contains filtered or unexported fields
}
MessageSubsidy is an account to committee treasury pool transfer transaction At economic maturity without inflation, this is how the network continues to offer its Validation services
func (*MessageSubsidy) Check ¶
func (x *MessageSubsidy) Check() lib.ErrorI
Check() validates the Message structure
func (*MessageSubsidy) Descriptor
deprecated
func (*MessageSubsidy) Descriptor() ([]byte, []int)
Deprecated: Use MessageSubsidy.ProtoReflect.Descriptor instead.
func (*MessageSubsidy) GetAddress ¶
func (x *MessageSubsidy) GetAddress() []byte
func (*MessageSubsidy) GetAmount ¶
func (x *MessageSubsidy) GetAmount() uint64
func (*MessageSubsidy) GetChainId ¶
func (x *MessageSubsidy) GetChainId() uint64
func (*MessageSubsidy) GetOpcode ¶
func (x *MessageSubsidy) GetOpcode() []byte
func (MessageSubsidy) MarshalJSON ¶
func (x MessageSubsidy) MarshalJSON() ([]byte, error)
MarshalJSON() is the json.Marshaller implementation for MessageSubsidy
func (*MessageSubsidy) Name ¶
func (x *MessageSubsidy) Name() string
func (*MessageSubsidy) New ¶
func (x *MessageSubsidy) New() lib.MessageI
func (*MessageSubsidy) ProtoMessage ¶
func (*MessageSubsidy) ProtoMessage()
func (*MessageSubsidy) ProtoReflect ¶
func (x *MessageSubsidy) ProtoReflect() protoreflect.Message
func (*MessageSubsidy) Recipient ¶
func (x *MessageSubsidy) Recipient() []byte
func (*MessageSubsidy) Reset ¶
func (x *MessageSubsidy) Reset()
func (*MessageSubsidy) String ¶
func (x *MessageSubsidy) String() string
func (*MessageSubsidy) UnmarshalJSON ¶
func (x *MessageSubsidy) UnmarshalJSON(b []byte) (err error)
UnmarshalJSON() is the json.Unmarshaler implementation for MessageSubsidy
type MessageUnpause ¶
type MessageUnpause struct {
// address: the short version of the public key, acting as a unique identify linked to the Validator structure
Address []byte `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"`
// contains filtered or unexported fields
}
MessageUnpause is the Validator return message, it re-enlists the Validator to active duty
func (*MessageUnpause) Check ¶
func (x *MessageUnpause) Check() lib.ErrorI
Check() validates the Message structure
func (*MessageUnpause) Descriptor
deprecated
func (*MessageUnpause) Descriptor() ([]byte, []int)
Deprecated: Use MessageUnpause.ProtoReflect.Descriptor instead.
func (*MessageUnpause) GetAddress ¶
func (x *MessageUnpause) GetAddress() []byte
func (MessageUnpause) MarshalJSON ¶
func (x MessageUnpause) MarshalJSON() ([]byte, error)
MarshalJSON() is the json.Marshaller implementation for MessageUnpause
func (*MessageUnpause) Name ¶
func (x *MessageUnpause) Name() string
func (*MessageUnpause) New ¶
func (x *MessageUnpause) New() lib.MessageI
func (*MessageUnpause) ProtoMessage ¶
func (*MessageUnpause) ProtoMessage()
func (*MessageUnpause) ProtoReflect ¶
func (x *MessageUnpause) ProtoReflect() protoreflect.Message
func (*MessageUnpause) Recipient ¶
func (x *MessageUnpause) Recipient() []byte
func (*MessageUnpause) Reset ¶
func (x *MessageUnpause) Reset()
func (*MessageUnpause) String ¶
func (x *MessageUnpause) String() string
func (*MessageUnpause) UnmarshalJSON ¶
func (x *MessageUnpause) UnmarshalJSON(b []byte) (err error)
UnmarshalJSON() is the json.Unmarshaler implementation for MessageUnpause
type MessageUnstake ¶
type MessageUnstake struct {
// address: the short version of the public key, acting as a unique identify linked to the Validator structure
Address []byte `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"`
// contains filtered or unexported fields
}
MessageUnstake is the Validator leave message, it begins the process of a Validator exiting the network The block when the funds will be returned may be found in the Validator structure after submitting this transaction
func (*MessageUnstake) Check ¶
func (x *MessageUnstake) Check() lib.ErrorI
Check() validates the Message structure
func (*MessageUnstake) Descriptor
deprecated
func (*MessageUnstake) Descriptor() ([]byte, []int)
Deprecated: Use MessageUnstake.ProtoReflect.Descriptor instead.
func (*MessageUnstake) GetAddress ¶
func (x *MessageUnstake) GetAddress() []byte
func (MessageUnstake) MarshalJSON ¶
func (x MessageUnstake) MarshalJSON() ([]byte, error)
MarshalJSON() is the json.Marshaller implementation for MessageUnstake
func (*MessageUnstake) Name ¶
func (x *MessageUnstake) Name() string
func (*MessageUnstake) New ¶
func (x *MessageUnstake) New() lib.MessageI
func (*MessageUnstake) ProtoMessage ¶
func (*MessageUnstake) ProtoMessage()
func (*MessageUnstake) ProtoReflect ¶
func (x *MessageUnstake) ProtoReflect() protoreflect.Message
func (*MessageUnstake) Recipient ¶
func (x *MessageUnstake) Recipient() []byte
func (*MessageUnstake) Reset ¶
func (x *MessageUnstake) Reset()
func (*MessageUnstake) String ¶
func (x *MessageUnstake) String() string
func (*MessageUnstake) UnmarshalJSON ¶
func (x *MessageUnstake) UnmarshalJSON(b []byte) (err error)
UnmarshalJSON() is the json.Unmarshaler implementation for MessageUnstake
type NonSigner ¶
type NonSigner struct {
// address: shorter version of the operator public key of the non signer
Address []byte `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"`
// counter: increments when a Validator doesn't sign a block and resets every non-sign-window
Counter uint64 `protobuf:"varint,2,opt,name=counter,proto3" json:"counter,omitempty"`
// contains filtered or unexported fields
}
NonSignerInfo is information that tracks the number of blocks not signed by the Validator within the Non-Sign-Window
func (*NonSigner) Descriptor
deprecated
func (*NonSigner) GetAddress ¶
func (*NonSigner) GetCounter ¶
func (*NonSigner) ProtoMessage ¶
func (*NonSigner) ProtoMessage()
func (*NonSigner) ProtoReflect ¶
func (x *NonSigner) ProtoReflect() protoreflect.Message
type NonSignerList ¶
type NonSignerList struct {
List []*NonSigner `protobuf:"bytes,1,rep,name=List,proto3" json:"List,omitempty"`
// contains filtered or unexported fields
}
NonSignerList is a list of information that tracks the number of blocks not signed by the Validator within the Non-Sign-Window
func (*NonSignerList) Descriptor
deprecated
func (*NonSignerList) Descriptor() ([]byte, []int)
Deprecated: Use NonSignerList.ProtoReflect.Descriptor instead.
func (*NonSignerList) GetList ¶
func (x *NonSignerList) GetList() []*NonSigner
func (*NonSignerList) ProtoMessage ¶
func (*NonSignerList) ProtoMessage()
func (*NonSignerList) ProtoReflect ¶
func (x *NonSignerList) ProtoReflect() protoreflect.Message
func (*NonSignerList) Reset ¶
func (x *NonSignerList) Reset()
func (*NonSignerList) String ¶
func (x *NonSignerList) String() string
type NonSigners ¶
type NonSigners []*NonSigner
type ParamSpace ¶
type ParamSpace interface {
Check() lib.ErrorI
SetString(paramName string, value string) lib.ErrorI // SetString() update a string parameter in the structure
SetUint64(paramName string, value uint64) lib.ErrorI // SetUint64() update a uint64 parameter in the structure
}
ParamSpace is a distinct, isolated category within the overarching Params structure
type Params ¶
type Params struct {
// consensus: are parameters in the 'consensus' space
// settings that define how nodes in the blockchain agree on the state of the ledger
Consensus *ConsensusParams `protobuf:"bytes,1,opt,name=Consensus,proto3" json:"consensus"` // @gotags: json:"consensus"
// validator: are parameters in the 'validator' space
// settings that define the rules and criteria for validators in the blockchain network
Validator *ValidatorParams `protobuf:"bytes,2,opt,name=Validator,proto3" json:"validator"` // @gotags: json:"validator"
// fee: are parameters in the 'fee' space
// settings that define the various amounts of transaction fees
Fee *FeeParams `protobuf:"bytes,3,opt,name=Fee,proto3" json:"fee"` // @gotags: json:"fee"
// governance: are parameters in the 'gov' space
// settings that define the rules that enable decentralized and autonomous governing of the network
Governance *GovernanceParams `protobuf:"bytes,4,opt,name=Governance,proto3" json:"governance"` // @gotags: json:"governance"
// contains filtered or unexported fields
}
Params are are configurable settings in a blockchain or decentralized network that control various aspects of the system's operation and rules, such as transaction fees, block sizes, and validator behaviors. These parameters can be adjusted through validator consensus to adapt the network as needs change. Parameters are organized into 4 'parameter spaces' that are purely for organization and i/o optimization.
func (*Params) Descriptor
deprecated
func (*Params) GetConsensus ¶
func (x *Params) GetConsensus() *ConsensusParams
func (*Params) GetGovernance ¶
func (x *Params) GetGovernance() *GovernanceParams
func (*Params) GetValidator ¶
func (x *Params) GetValidator() *ValidatorParams
func (*Params) ProtoMessage ¶
func (*Params) ProtoMessage()
func (*Params) ProtoReflect ¶
func (x *Params) ProtoReflect() protoreflect.Message
type Poll ¶
type Poll map[string]PollResult
Poll is a list of PollResults keyed by the hash of the proposal
type PollResult ¶
type PollResult struct {
ProposalHash string `json:"proposalHash"` // the hash of the proposal
ProposalURL string `json:"proposalURL"` // the url of the proposal
Accounts VoteStats `json:"accounts"` // vote statistics for accounts
Validators VoteStats `json:"validators"` // vote statistics for validators
}
PollResult is a structure that represents the current state of a 'Poll' for a 'Proposal'
type Pool ¶
type Pool struct {
// id: the unique identifier of the pool
Id uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
// amount: the balance of funds the pool has
Amount uint64 `protobuf:"varint,2,opt,name=amount,proto3" json:"amount,omitempty"`
// contains filtered or unexported fields
}
A pool is like an account without an owner, holding funds that are managed directly by the blockchain protocol It's very similar to an account but instead of an address it has a unique ID and operates based on predefined blockchain rules rather than individual control
func (*Pool) Descriptor
deprecated
func (*Pool) MarshalJSON ¶
MarshalJSON() is the json.Marshaller implementation for the Pool object
func (*Pool) ProtoMessage ¶
func (*Pool) ProtoMessage()
func (*Pool) ProtoReflect ¶
func (x *Pool) ProtoReflect() protoreflect.Message
func (*Pool) UnmarshalJSON ¶
UnmarshalJSON() is the json.Unmarshaler implementation for the Pool object
type ProtocolVersion ¶
type ProtocolVersion struct {
// height: the block number the protocol version becomes live
Height uint64 `protobuf:"varint,1,opt,name=height,proto3" json:"height,omitempty"`
// version: is an identifier for a specific set of rules and features in a blockchain or network protocol
Version uint64 `protobuf:"varint,2,opt,name=version,proto3" json:"version,omitempty"`
// contains filtered or unexported fields
}
The ProtocolVersion is a string that marks the particular version of rules governing how nodes communicate and validate data in a network. It enables nodes to stay synchronized, ensuring they follow the same standards
func (*ProtocolVersion) Descriptor
deprecated
func (*ProtocolVersion) Descriptor() ([]byte, []int)
Deprecated: Use ProtocolVersion.ProtoReflect.Descriptor instead.
func (*ProtocolVersion) GetHeight ¶
func (x *ProtocolVersion) GetHeight() uint64
func (*ProtocolVersion) GetVersion ¶
func (x *ProtocolVersion) GetVersion() uint64
func (*ProtocolVersion) ProtoMessage ¶
func (*ProtocolVersion) ProtoMessage()
func (*ProtocolVersion) ProtoReflect ¶
func (x *ProtocolVersion) ProtoReflect() protoreflect.Message
func (*ProtocolVersion) Reset ¶
func (x *ProtocolVersion) Reset()
func (*ProtocolVersion) String ¶
func (x *ProtocolVersion) String() string
type SlashTracker ¶
SlashTracker is a map of address -> committee -> slash percentage which is used to ensure no committee exceeds max slash within a single block NOTE: this slash tracker is naive and doesn't account for the consecutive reduction of a slash percentage impact i.e. two 10% slashes = 20%, but technically it's 19%
func NewSlashTracker ¶
func NewSlashTracker() *SlashTracker
func (*SlashTracker) AddSlash ¶
func (s *SlashTracker) AddSlash(address []byte, chainId, percent uint64)
AddSlash() adds a slash for an address at by a committee for a certain percent
func (*SlashTracker) GetTotalSlashPercent ¶
func (s *SlashTracker) GetTotalSlashPercent(address []byte, chainId uint64) (percent uint64)
GetTotalSlashPercent() returns the total percent for a slash
type StartPoll ¶
type StartPoll struct {
StartPoll string `json:"startPoll"`
Url string `json:"url,omitempty"`
EndHeight uint64 `json:"endHeight"`
}
StartPoll represents the structure for initiating a new poll It is used to encode data into JSON format for storing in memo fields
type StateMachine ¶
type StateMachine struct {
ProtocolVersion uint64 // the version of the protocol this node is running
NetworkID uint32 // the id of the network this node is configured to be on
Config lib.Config // the main configuration as defined by the 'config.json' file
Metrics *lib.Metrics // the telemetry module
LastValidatorSet map[uint64]map[uint64]*lib.ValidatorSet // reference to the last validator set saved in the controller
// contains filtered or unexported fields
}
StateMachine the core protocol component responsible for maintaining and updating the state of the blockchain as it progresses it represents the collective state of all accounts, validators, and other relevant data stored on the blockchain
func New ¶
func New(c lib.Config, store lib.StoreI, metrics *lib.Metrics, log lib.LoggerI) (*StateMachine, lib.ErrorI)
New() creates a new instance of a StateMachine
func (*StateMachine) AccountAdd ¶
AccountAdd() adds tokens to an Account
func (*StateMachine) AccountDeductFees ¶
AccountDeductFees() removes fees from a specific address and adds them to the Canopy reward pool
func (*StateMachine) AccountSub ¶
AccountSub() removes tokens from an Account
func (*StateMachine) AddToCommitteeSupplyForChain ¶
func (s *StateMachine) AddToCommitteeSupplyForChain(chainId uint64, amount uint64) lib.ErrorI
AddToCommitteeSupplyForChain() adds to the committee staked supply count
func (*StateMachine) AddToDelegateSupply ¶
func (s *StateMachine) AddToDelegateSupply(amount uint64) lib.ErrorI
AddToStakedSupply() adds to the staked supply count
func (*StateMachine) AddToDelegateSupplyForChain ¶
func (s *StateMachine) AddToDelegateSupplyForChain(chainId uint64, amount uint64) lib.ErrorI
AddToDelegateSupplyForChain() adds to the delegate staked supply count
func (*StateMachine) AddToStakedSupply ¶
func (s *StateMachine) AddToStakedSupply(amount uint64) lib.ErrorI
AddToStakedSupply() adds to the staked supply count (staked + delegated)
func (*StateMachine) AddToTotalSupply ¶
func (s *StateMachine) AddToTotalSupply(amount uint64) lib.ErrorI
AddToTotalSupply() adds to the total supply count
func (*StateMachine) ApplyBlock ¶
func (s *StateMachine) ApplyBlock(ctx context.Context, b *lib.Block, lastValidatorSet *lib.ValidatorSet, allowOversize bool) ( header *lib.BlockHeader, txResults, oversized []*lib.TxResult, failed []*lib.FailedTx, err lib.ErrorI)
ApplyBlock processes a given block, updating the state machine's state accordingly The function: - executes `BeginBlock` - applies all transactions within the block, generating transaction results nad a root hash - executes `EndBlock` - constructs and returns the block header, and the transaction results NOTES: - this function may be used to validate 'additional' transactions outside the normal block size as if they were to be included - a list of failed transactions are returned
func (*StateMachine) ApplyTransaction ¶
func (s *StateMachine) ApplyTransaction(index uint64, transaction []byte, txHash string, batchVerifier *crypto.BatchVerifier) (*lib.TxResult, lib.ErrorI)
ApplyTransaction() processes the transaction within the state machine, returning the corresponding TxResult.
func (*StateMachine) ApplyTransactions ¶
func (s *StateMachine) ApplyTransactions( ctx context.Context, txs [][]byte, allowOversize bool) (results, oversized []*lib.TxResult, root []byte, blockTxs [][]byte, failed []*lib.FailedTx, n int, er lib.ErrorI)
ApplyTransactions() 1. Batch validate signatures for every transaction provided 2. Processes all transactions provided against the state machine 3. Allows ephemeral 'oversize' transaction processing without applying 'oversize txn' changes to the state 4. Returns the following for successful transactions within a block: <results, tx-list, root, count> 5. Returns all transactions that failed during processing
func (*StateMachine) ApproveProposal ¶
func (s *StateMachine) ApproveProposal(msg GovProposal) lib.ErrorI
ApproveProposal() validates a 'GovProposal' message (ex. MsgChangeParameter or MsgDAOTransfer) - checks message sent between start height and end height - if APPROVE_ALL set or proposal on the APPROVE_LIST then no error - else return ErrRejectProposal
func (*StateMachine) BeginBlock ¶
func (s *StateMachine) BeginBlock(lastValidatorSet *lib.ValidatorSet) lib.ErrorI
BeginBlock() is code that is executed at the start of `applying` the block
func (*StateMachine) CheckFee ¶
CheckFee() validates the fee amount is sufficient to pay for a transaction
func (*StateMachine) CheckMessage ¶
CheckMessage() performs basic validations on the msg payload
func (*StateMachine) CheckProtocolVersion ¶
func (s *StateMachine) CheckProtocolVersion() (err lib.ErrorI)
CheckProtocolVersion() compares the protocol version against the governance enforced version
func (*StateMachine) CheckReplay ¶
func (s *StateMachine) CheckReplay(tx *lib.Transaction, txHash string) lib.ErrorI
CheckReplay() validates the timestamp of the transaction Instead of using an increasing 'sequence number' Canopy uses timestamp + created block to act as a prune-friendly, replay attack / hash collision prevention mechanism
- Canopy searches the transaction indexer for the transaction using its hash to prevent 'replay attacks'
- The timestamp protects against hash collisions as it injects 'micro-second level entropy' into the hash of the transaction, ensuring no transactions will 'accidentally collide'
- The created block acceptance policy for transactions maintains an acceptable bound of 'time' to support database pruning
func (*StateMachine) CheckSignature ¶
func (s *StateMachine) CheckSignature(msg lib.MessageI, tx *lib.Transaction, batchSignatureVerifier *crypto.BatchVerifier) (crypto.AddressI, lib.ErrorI)
CheckSignature() validates the signer and the digital signature associated with the transaction object
func (*StateMachine) CheckTx ¶
func (s *StateMachine) CheckTx(transaction []byte, txHash string, batchVerifier *crypto.BatchVerifier) (result *CheckTxResult, err lib.ErrorI)
CheckTx() validates the transaction object
func (*StateMachine) CloseOrder ¶
func (s *StateMachine) CloseOrder(orderId []byte, chainId uint64) (err lib.ErrorI)
CloseOrder() sends the tokens from escrow to the 'buyer address' and deletes the order
func (*StateMachine) CommitteeIsRetired ¶
func (s *StateMachine) CommitteeIsRetired(chainId uint64) (bool, lib.ErrorI)
CommitteeIsRetired checks if a committee is marked as 'retired' which prevents it from being subsidized for eternity
func (*StateMachine) ConformStateToParamUpdate ¶
func (s *StateMachine) ConformStateToParamUpdate(previousParams *Params) lib.ErrorI
ConformStateToParamUpdate() ensures the state does not violate the new values of the governance parameters - Only MaxCommitteeSize, RootChainId, MinimumStakeForValidators & MinimumStakeForDelegates require an adjustment - MinSellOrderSize is purposefully allowed to violate new updates
func (*StateMachine) Copy ¶
func (s *StateMachine) Copy() (*StateMachine, lib.ErrorI)
Copy() makes a clone of the state machine this feature is used in mempool operation to be able to maintain a parallel ephemeral state without affecting the underlying state machine
func (*StateMachine) Delete ¶
func (s *StateMachine) Delete(key []byte) lib.ErrorI
Delete() deletes a key-value pair under a key
func (*StateMachine) DeleteAll ¶
func (s *StateMachine) DeleteAll(keys [][]byte) (err lib.ErrorI)
DeleteAll() deletes all key-value pairs under a set of keys
func (*StateMachine) DeleteCommitteeMember ¶
func (s *StateMachine) DeleteCommitteeMember(address crypto.AddressI, chainId, stakeForCommittee uint64) lib.ErrorI
DeleteCommitteeMember() removes the address from being a 'member' of the committee in the state
func (*StateMachine) DeleteCommittees ¶
func (s *StateMachine) DeleteCommittees(address crypto.AddressI, totalStake uint64, committees []uint64) (err lib.ErrorI)
DeleteCommittees() deletes the membership and staked supply for each of an address' committees
func (*StateMachine) DeleteDelegate ¶
func (s *StateMachine) DeleteDelegate(address crypto.AddressI, chainId, stakeForCommittee uint64) lib.ErrorI
DeleteDelegate() removes a delegate from the state using the delegate prefix
func (*StateMachine) DeleteDelegations ¶
func (s *StateMachine) DeleteDelegations(address crypto.AddressI, totalStake uint64, committees []uint64) lib.ErrorI
DeleteDelegations() removes the delegate 'membership' for an address, removing from the list and updating the supply pools
func (*StateMachine) DeleteFinishedUnstaking ¶
func (s *StateMachine) DeleteFinishedUnstaking() lib.ErrorI
DeleteFinishedUnstaking() deletes the Validator structure and unstaking keys for those who have finished unstaking
func (*StateMachine) DeleteOrder ¶
func (s *StateMachine) DeleteOrder(orderId []byte, chainId uint64) (err lib.ErrorI)
DeleteOrder() deletes an existing order in the order book for a committee in the state db
func (*StateMachine) DeleteValidator ¶
func (s *StateMachine) DeleteValidator(validator *Validator) lib.ErrorI
DeleteValidator() completely removes a validator from the state
func (*StateMachine) Discard ¶
func (s *StateMachine) Discard()
func (*StateMachine) DistributeCommitteeReward ¶
func (s *StateMachine) DistributeCommitteeReward(stub *lib.PaymentPercents, rewardPoolAmount, numberOfSamples uint64, valParams *ValidatorParams) (distributed uint64, err lib.ErrorI)
DistributeCommitteeReward() issues a single committee reward unit based on an individual 'Payment Stub'
func (*StateMachine) DistributeCommitteeRewards ¶
func (s *StateMachine) DistributeCommitteeRewards() lib.ErrorI
DistributeCommitteeRewards() distributes the committee mint based on the PaymentPercents from the result of the QuorumCertificate
func (*StateMachine) EndBlock ¶
func (s *StateMachine) EndBlock(proposerAddress []byte) (err lib.ErrorI)
EndBlock() is code that is executed at the end of `applying` the block
func (*StateMachine) ExportState ¶
func (s *StateMachine) ExportState() (genesis *GenesisState, err lib.ErrorI)
ExportState() creates a GenesisState object from the current state
func (*StateMachine) ForceUnstakeMaxPaused ¶
func (s *StateMachine) ForceUnstakeMaxPaused() lib.ErrorI
ForceUnstakeMaxPaused() forcefully unstakes validators who have reached MaxPauseHeight and removes their 'paused' key EXPLAINER: Addresses under the (max) paused prefix for the latest height indicate the validator has hit their 'max paused height' This key was set at an earlier height when the validators were initially paused Note: These validators remain paused because the key is not deleted unless they are un-paused
func (*StateMachine) ForceUnstakeValidator ¶
func (s *StateMachine) ForceUnstakeValidator(address crypto.AddressI) lib.ErrorI
ForceUnstakeValidator() automatically begins unstaking the validator
func (*StateMachine) FundCommitteeRewardPools ¶
func (s *StateMachine) FundCommitteeRewardPools() lib.ErrorI
FundCommitteeRewardPools() mints newly created tokens to protocol subsidized committees
func (*StateMachine) Get ¶
func (s *StateMachine) Get(key []byte) (bz []byte, err lib.ErrorI)
Get() retrieves a key-value pair under a key NOTE: returns (nil, nil) if no value is found for that key
func (*StateMachine) GetAccount ¶
GetAccount() returns an Account structure for a specific address
func (*StateMachine) GetAccountBalance ¶
GetAccountBalance() returns the balance of an Account at a specific address
func (*StateMachine) GetAccounts ¶
func (s *StateMachine) GetAccounts() (result []*Account, err lib.ErrorI)
GetAccounts() returns all Account structures in the state
func (*StateMachine) GetAccountsPaginated ¶
func (s *StateMachine) GetAccountsPaginated(p lib.PageParams) (page *lib.Page, err lib.ErrorI)
GetAccountsPaginated() returns a page of Account structures in the state
func (*StateMachine) GetAuthorizedSignersFor ¶
GetAuthorizedSignersFor() returns the addresses that are authorized to sign for this message
func (*StateMachine) GetAuthorizedSignersForValidator ¶
func (s *StateMachine) GetAuthorizedSignersForValidator(address []byte) (signers [][]byte, err lib.ErrorI)
GetAuthorizedSignersForValidator() returns the addresses that are able to sign messages on behalf of the validator
func (*StateMachine) GetBlockMintStats ¶
func (s *StateMachine) GetBlockMintStats(chainId uint64) (daoCut uint64, totalMint uint64, mintAmountPerCommittee uint64, err lib.ErrorI)
GetBlockMintStats() gets the latest minting information for the blockchain
func (*StateMachine) GetCommitteeData ¶
func (s *StateMachine) GetCommitteeData(targetChainId uint64) (*lib.CommitteeData, lib.ErrorI)
GetCommitteeData() is a convenience function to retrieve the committee data from the master list
func (*StateMachine) GetCommitteeMembers ¶
func (s *StateMachine) GetCommitteeMembers(chainId uint64) (vs lib.ValidatorSet, err lib.ErrorI)
GetCommitteeMembers() retrieves the ValidatorSet that is responsible for the 'chainId'
func (*StateMachine) GetCommitteePaginated ¶
func (s *StateMachine) GetCommitteePaginated(p lib.PageParams, chainId uint64) (page *lib.Page, err lib.ErrorI)
GetCommitteePaginated() returns a 'page' of committee members ordered from the highest stake to lowest
func (*StateMachine) GetCommitteeStakedSupplyForChain ¶
func (s *StateMachine) GetCommitteeStakedSupplyForChain(chainId uint64) (p *Pool, err lib.ErrorI)
GetCommitteeStakedSupplyForChain() retrieves the committee staked supply count
func (*StateMachine) GetCommitteesData ¶
func (s *StateMachine) GetCommitteesData() (list *lib.CommitteesData, err lib.ErrorI)
GetCommitteesData() gets a list of List from the state
func (*StateMachine) GetDelegateStakedSupplyForChain ¶
func (s *StateMachine) GetDelegateStakedSupplyForChain(chainId uint64) (p *Pool, err lib.ErrorI)
GetFromDelegateStakedSupply() retrieves the delegate committee staked supply count
func (*StateMachine) GetDelegates ¶
func (s *StateMachine) GetDelegates(chainId uint64) (vs lib.ValidatorSet, err lib.ErrorI)
GetDelegates returns the active delegates for a given chainId. If MaximumDelegatesPerCommittee (from governance params) is 0, it will return all delegates; otherwise it returns only the top N.
func (*StateMachine) GetDelegatesPaginated ¶
func (s *StateMachine) GetDelegatesPaginated(p lib.PageParams, chainId uint64) (page *lib.Page, err lib.ErrorI)
GetDelegatesPaginated() returns a page of delegates
func (*StateMachine) GetDoubleSigners ¶
func (s *StateMachine) GetDoubleSigners() (results []*lib.DoubleSigner, e lib.ErrorI)
GetDoubleSigners() returns all double signers save in the state IMPORTANT NOTE: this returns <address> -> <heights> NOT <pubic_key> -> <heights> CONTRACT: Querying uncommitted double signers is not supported
func (*StateMachine) GetFeeForMessageName ¶
func (s *StateMachine) GetFeeForMessageName(name string) (fee uint64, err lib.ErrorI)
GetFeeForMessageName() returns the associated cost for processing a specific type of message based on the name
func (*StateMachine) GetLastProposers ¶
func (s *StateMachine) GetLastProposers() (*lib.Proposers, lib.ErrorI)
GetLastProposers() returns the last Proposer addresses saved in the state
func (*StateMachine) GetMaxBlockSize ¶
func (s *StateMachine) GetMaxBlockSize() (uint64, lib.ErrorI)
GetMaxBlockSize() returns the maximum size of a block
func (*StateMachine) GetMaxValidators ¶
func (s *StateMachine) GetMaxValidators() (uint64, lib.ErrorI)
GetMaxValidators() returns the max validators per committee
func (*StateMachine) GetNonSigners ¶
func (s *StateMachine) GetNonSigners() (results NonSigners, e lib.ErrorI)
GetNonSigners() returns all non-quorum-certificate-signers save in the state
func (*StateMachine) GetOrder ¶
func (s *StateMachine) GetOrder(orderId []byte, chainId uint64) (order *lib.SellOrder, err lib.ErrorI)
GetOrder() gets the sell order from state
func (*StateMachine) GetOrderBook ¶
GetOrderBook() retrieves the order book for a committee from the state db
func (*StateMachine) GetOrderBooks ¶
func (s *StateMachine) GetOrderBooks() (b *lib.OrderBooks, err lib.ErrorI)
GetOrderBooks() retrieves the lists for all chainIds of open 'sell orders' from the state
func (*StateMachine) GetParams ¶
func (s *StateMachine) GetParams() (*Params, lib.ErrorI)
GetParams() returns the aggregated ParamSpaces in a single Params object
func (*StateMachine) GetParamsCons ¶
func (s *StateMachine) GetParamsCons() (ptr *ConsensusParams, err lib.ErrorI)
GetParamsCons() returns the current state of the governance params in the Consensus space
func (*StateMachine) GetParamsFee ¶
func (s *StateMachine) GetParamsFee() (ptr *FeeParams, err lib.ErrorI)
GetParamsFee() returns the current state of the governance params in the Fee space
func (*StateMachine) GetParamsGov ¶
func (s *StateMachine) GetParamsGov() (ptr *GovernanceParams, err lib.ErrorI)
GetParamsGov() returns the current state of the governance params in the Governance space
func (*StateMachine) GetParamsVal ¶
func (s *StateMachine) GetParamsVal() (ptr *ValidatorParams, err lib.ErrorI)
GetParamsVal() returns the current state of the governance params in the Validator space
func (*StateMachine) GetPool ¶
func (s *StateMachine) GetPool(id uint64) (*Pool, lib.ErrorI)
GetPool() returns a Pool structure for a specific ID
func (*StateMachine) GetPoolBalance ¶
func (s *StateMachine) GetPoolBalance(id uint64) (uint64, lib.ErrorI)
GetPoolBalance() returns the balance of a Pool at an ID
func (*StateMachine) GetPools ¶
func (s *StateMachine) GetPools() (result []*Pool, err lib.ErrorI)
GetPools() returns all Pool structures in the state
func (*StateMachine) GetPoolsPaginated ¶
func (s *StateMachine) GetPoolsPaginated(p lib.PageParams) (page *lib.Page, err lib.ErrorI)
GetPoolsPaginated() returns a particular page of Pool structures in the state
func (*StateMachine) GetRetiredCommittees ¶
func (s *StateMachine) GetRetiredCommittees() (list []uint64, err lib.ErrorI)
GetRetiredCommittees() returns a list of the retired chainIds
func (*StateMachine) GetRootChainId ¶
func (s *StateMachine) GetRootChainId() (uint64, lib.ErrorI)
GetRootChainId() gets the latest root chain id from the state
func (*StateMachine) GetSubsidizedCommittees ¶
func (s *StateMachine) GetSubsidizedCommittees() (paidIDs []uint64, err lib.ErrorI)
GetSubsidizedCommittees() returns a list of chainIds that receive a portion of the 'block reward' Think of these committees as 'automatically subsidized' by the protocol
func (*StateMachine) GetSupply ¶
func (s *StateMachine) GetSupply() (*Supply, lib.ErrorI)
GetSupply() returns the Supply structure held in the state
func (*StateMachine) GetTotalEscrowed ¶
GetTotalEscrowed() checks all order books for escrowed funds for a specific address
func (*StateMachine) GetValidator ¶
GetValidator() gets the validator from the store via the address
func (*StateMachine) GetValidatorExists ¶
GetValidatorExists() checks if the Validator already exists in the state
func (*StateMachine) GetValidators ¶
func (s *StateMachine) GetValidators() (result []*Validator, err lib.ErrorI)
GetValidators() returns a slice of all validators
func (*StateMachine) GetValidatorsPaginated ¶
func (s *StateMachine) GetValidatorsPaginated(p lib.PageParams, f lib.ValidatorFilters) (page *lib.Page, err lib.ErrorI)
GetValidatorsPaginated() returns a page of filtered validators
func (*StateMachine) HandleByzantine ¶
func (s *StateMachine) HandleByzantine(qc *lib.QuorumCertificate, vs *lib.ValidatorSet) (nonSignerPercent int, err lib.ErrorI)
HandleByzantine() handles the byzantine (faulty/malicious) participants from a QuorumCertificate
func (*StateMachine) HandleCertificateResults ¶
func (s *StateMachine) HandleCertificateResults(qc *lib.QuorumCertificate, committee *lib.ValidatorSet) lib.ErrorI
HandleCertificateResults() is a handler for the results of a quorum certificate
func (*StateMachine) HandleCheckpoint ¶
func (s *StateMachine) HandleCheckpoint(chainId uint64, results *lib.CertificateResult) (err lib.ErrorI)
HandleCheckpoint() handles the `checkpoint-as-a-service` root-chain functionality NOTE: this will index self checkpoints - but allows for nested-chain checkpointing too
func (*StateMachine) HandleCommitteeSwaps ¶
func (s *StateMachine) HandleCommitteeSwaps(orders *lib.Orders, chainId uint64)
HandleCommitteeSwaps() when the committee submits a 'certificate results transaction', it informs the chain of various actions over sell orders - 'buy' is an actor 'claiming / reserving' the sell order - 'reset' is a 'claimed' order whose 'buyer' did not send the tokens to the seller before the deadline, thus the order is re-opened for sale - 'close' is a 'claimed' order whose 'buyer' sent the tokens to the seller before the deadline, thus the order is 'closed' and the tokens are moved from escrow to the buyer
func (*StateMachine) HandleDoubleSigners ¶
func (s *StateMachine) HandleDoubleSigners(chainId uint64, params *ValidatorParams, doubleSigners []*lib.DoubleSigner) lib.ErrorI
HandleDoubleSigners() validates, sets, and slashes the list of doubleSigners
func (*StateMachine) HandleMessage ¶
func (s *StateMachine) HandleMessage(msg lib.MessageI) lib.ErrorI
HandleMessage() routes the MessageI to the correct `handler` based on its `type`
func (*StateMachine) HandleMessageCertificateResults ¶
func (s *StateMachine) HandleMessageCertificateResults(msg *MessageCertificateResults) lib.ErrorI
HandleMessageCertificateResults() is the proper handler for a `CertificateResults` message
func (*StateMachine) HandleMessageChangeParameter ¶
func (s *StateMachine) HandleMessageChangeParameter(msg *MessageChangeParameter) lib.ErrorI
HandleMessageChangeParameter() is the proper handler for an `Change-Parameter` message
func (*StateMachine) HandleMessageCreateOrder ¶
func (s *StateMachine) HandleMessageCreateOrder(msg *MessageCreateOrder) (err lib.ErrorI)
HandleMessageCreateOrder() is the proper handler for a `CreateOrder` message
func (*StateMachine) HandleMessageDAOTransfer ¶
func (s *StateMachine) HandleMessageDAOTransfer(msg *MessageDAOTransfer) lib.ErrorI
HandleMessageDAOTransfer() is the proper handler for a `DAO-Transfer` message
func (*StateMachine) HandleMessageDeleteOrder ¶
func (s *StateMachine) HandleMessageDeleteOrder(msg *MessageDeleteOrder) (err lib.ErrorI)
HandleMessageDeleteOrder() is the proper handler for a `DeleteOrder` message
func (*StateMachine) HandleMessageEditOrder ¶
func (s *StateMachine) HandleMessageEditOrder(msg *MessageEditOrder) (err lib.ErrorI)
HandleMessageEditOrder() is the proper handler for a `EditOrder` message
func (*StateMachine) HandleMessageEditStake ¶
func (s *StateMachine) HandleMessageEditStake(msg *MessageEditStake) lib.ErrorI
HandleMessageEditStake() is the proper handler for a `Edit-Stake` message (Validator already exists in the state)
func (*StateMachine) HandleMessagePause ¶
func (s *StateMachine) HandleMessagePause(msg *MessagePause) lib.ErrorI
HandleMessagePause() is the proper handler for an `Pause` message
func (*StateMachine) HandleMessageSend ¶
func (s *StateMachine) HandleMessageSend(msg *MessageSend) lib.ErrorI
HandleMessageSend() is the proper handler for a `Send` message
func (*StateMachine) HandleMessageStake ¶
func (s *StateMachine) HandleMessageStake(msg *MessageStake) lib.ErrorI
HandleMessageStake() is the proper handler for a `Stake` message (Validator does not yet exist in the state)
func (*StateMachine) HandleMessageSubsidy ¶
func (s *StateMachine) HandleMessageSubsidy(msg *MessageSubsidy) lib.ErrorI
HandleMessageSubsidy() is the proper handler for a `Subsidy` message
func (*StateMachine) HandleMessageUnpause ¶
func (s *StateMachine) HandleMessageUnpause(msg *MessageUnpause) lib.ErrorI
HandleMessageUnpause() is the proper handler for an `Unpause` message
func (*StateMachine) HandleMessageUnstake ¶
func (s *StateMachine) HandleMessageUnstake(msg *MessageUnstake) lib.ErrorI
HandleMessageUnstake() is the proper handler for an `Unstake` message
func (*StateMachine) Height ¶
func (s *StateMachine) Height() uint64
func (*StateMachine) IncrementNonSigners ¶
func (s *StateMachine) IncrementNonSigners(nonSignerPubKeys [][]byte) lib.ErrorI
IncrementNonSigners() upserts non-(QC)-signers by incrementing the non-signer count for the list
func (*StateMachine) Initialize ¶
Initialize() initializes a StateMachine object using the StoreI
func (*StateMachine) IsFeatureEnabled ¶
func (s *StateMachine) IsFeatureEnabled(requiredVersion uint64) bool
IsFeatureEnabled() checks if a feature is enabled based on the protocol version stored in the state compared to the required activation version
func (*StateMachine) IterateAndExecute ¶
func (s *StateMachine) IterateAndExecute(prefix []byte, callback func(key, value []byte) lib.ErrorI) (err lib.ErrorI)
IterateAndExecute() creates an iterator and executes a callback function for each key-value pair
func (*StateMachine) Iterator ¶
Iterator() creates and returns an iterator for the state machine's underlying store starting at the specified key and iterating lexicographically
func (*StateMachine) LoadBlock ¶
func (s *StateMachine) LoadBlock(height uint64) (*lib.BlockResult, lib.ErrorI)
LoadBlock() loads an indexed block at a specific height
func (*StateMachine) LoadBlockAndCertificate ¶
func (s *StateMachine) LoadBlockAndCertificate(height uint64) (cert *lib.QuorumCertificate, block *lib.BlockResult, err lib.ErrorI)
LoadBlock() loads an indexed block at a specific height
func (*StateMachine) LoadCertificate ¶
func (s *StateMachine) LoadCertificate(height uint64) (*lib.QuorumCertificate, lib.ErrorI)
LoadCertificate() loads a quorum certificate (block, results + 2/3rd committee signatures)
func (*StateMachine) LoadCertificateHashesOnly ¶
func (s *StateMachine) LoadCertificateHashesOnly(height uint64) (*lib.QuorumCertificate, lib.ErrorI)
LoadCertificateHashesOnly() loads a quorum certificate but nullifies the block
func (*StateMachine) LoadCommittee ¶
func (s *StateMachine) LoadCommittee(chainId uint64, height uint64) (lib.ValidatorSet, lib.ErrorI)
LoadCommittee() loads the committee validators for a particular committee at a particular height
func (*StateMachine) LoadCommitteeData ¶
func (s *StateMachine) LoadCommitteeData(height, targetChainId uint64) (*lib.CommitteeData, lib.ErrorI)
LoadCommitteeData() loads a historical (or clean latest) committee data from the master list
func (*StateMachine) LoadIsOwnRoot ¶
func (s *StateMachine) LoadIsOwnRoot() (bool, lib.ErrorI)
LoadIsOwnRoot() returns if this chain is its own root (base)
func (*StateMachine) LoadLastProposers ¶
LoadLastProposers() returns the last Proposer addresses saved in the state for a particular height
func (*StateMachine) LoadMinimumEvidenceHeight ¶
func (s *StateMachine) LoadMinimumEvidenceHeight() (uint64, lib.ErrorI)
LoadMinimumEvidenceHeight() loads the minimum height the evidence must be to still be usable
func (*StateMachine) LoadRootChainId ¶
func (s *StateMachine) LoadRootChainId(height uint64) (uint64, lib.ErrorI)
LoadRootChainId() loads the root chain id from the state at a certain height
func (*StateMachine) LoadRootChainInfo ¶
func (s *StateMachine) LoadRootChainInfo(id, height uint64, lastValidatorSet ...*lib.ValidatorSet) (*lib.RootChainInfo, lib.ErrorI)
LoadRootChainInfo() returns the 'need-to-know' information for a nested chain
func (*StateMachine) LockOrder ¶
LockOrder() adds a recipient and a deadline height to an existing order and saves it to the state
func (*StateMachine) LotteryWinner ¶
func (s *StateMachine) LotteryWinner(id uint64, validators ...bool) (lottery *lib.LotteryWinner, err lib.ErrorI)
LotteryWinner() selects a validator/delegate randomly weighted based on their stake within a committee
func (*StateMachine) MintToPool ¶
func (s *StateMachine) MintToPool(id uint64, amount uint64) lib.ErrorI
MintToPool() adds newly created tokens to the Pool structure
func (*StateMachine) NewFromGenesisFile ¶
func (s *StateMachine) NewFromGenesisFile() (err lib.ErrorI)
NewFromGenesisFile() creates a new beginning state from a file
func (*StateMachine) NewStateFromGenesis ¶
func (s *StateMachine) NewStateFromGenesis(genesis *GenesisState) (err lib.ErrorI)
NewStateFromGenesis() creates a new beginning state using a GenesisState object There are purposefully non-included fields that are 'export only'
func (*StateMachine) OverwriteCommitteeData ¶
func (s *StateMachine) OverwriteCommitteeData(d *lib.CommitteeData) lib.ErrorI
OverwriteCommitteeData() overwrites the committee data in state note: use UpsertCommitteeData for the safe committee upsert
func (*StateMachine) ParseBlockForLockAndCloseOrders ¶
func (s *StateMachine) ParseBlockForLockAndCloseOrders(blocks ...*lib.BlockResult) (lockOrders map[string]*lib.LockOrder, closeOrders map[string]*lib.CloseOrder, coSends map[string]*MessageSend)
ParseCloseOrders() parses the blocks for memo commands to execute specialized 'close order' functionality
func (*StateMachine) ParseCloseOrder ¶
func (s *StateMachine) ParseCloseOrder(tx *lib.Transaction) (co *lib.CloseOrder, ok bool)
ParseCloseOrder() parses a transaction for an embedded close order messages in the memo field
func (*StateMachine) ParseLockOrder ¶
func (s *StateMachine) ParseLockOrder(tx *lib.Transaction, deadlineBlocks uint64) (bo *lib.LockOrder, ok bool)
ParseLockOrder() parses a transaction for an embedded lock order messages in the memo field
func (*StateMachine) ParsePollTransactions ¶
func (s *StateMachine) ParsePollTransactions(b *lib.BlockResult)
ParsePollTransactions() parses the last valid block for memo commands to execute specialized 'straw polling' functionality
func (*StateMachine) PollsToResults ¶
func (s *StateMachine) PollsToResults(polls *ActivePolls) (result Poll, err lib.ErrorI)
PollsToResults() coverts the polling objects to a compressed result based on the voting power
func (*StateMachine) PoolAdd ¶
func (s *StateMachine) PoolAdd(id uint64, amountToAdd uint64) lib.ErrorI
PoolAdd() adds tokens to the Pool structure
func (*StateMachine) PoolSub ¶
func (s *StateMachine) PoolSub(id uint64, amountToSub uint64) lib.ErrorI
PoolSub() removes tokens from the Pool structure
func (*StateMachine) ProcessRootChainOrderBook ¶
func (s *StateMachine) ProcessRootChainOrderBook(book *lib.OrderBook, proposalBlock *lib.BlockResult) (lockOrders []*lib.LockOrder, closedOrders, resetOrders [][]byte)
ProcessRootChainOrderBook() processes the order book from the root-chain and cross-references blocks on this chain to determine actions that warrant committee level changes to the root-chain order book like: LockOrder, ResetOrder and CloseOrder
func (*StateMachine) ReadGenesisFromFile ¶
func (s *StateMachine) ReadGenesisFromFile() (genesis *GenesisState, e lib.ErrorI)
ReadGenesisFromFile() reads a GenesisState object from a file
func (*StateMachine) Reset ¶
func (s *StateMachine) Reset()
Reset() resets the state store and the slash tracker
func (*StateMachine) ResetCaches ¶
func (s *StateMachine) ResetCaches()
ResetCaches() dumps the state machine caches
func (*StateMachine) ResetOrder ¶
func (s *StateMachine) ResetOrder(orderId []byte, chainId uint64) (err lib.ErrorI)
ResetOrder() removes the recipient and deadline height from an existing order and saves it to the state
func (*StateMachine) RetireCommittee ¶
func (s *StateMachine) RetireCommittee(chainId uint64) lib.ErrorI
RetireCommittee marks a committee as non-subsidized for eternity This is a useful mechanism to gracefully 'end' a committee
func (*StateMachine) RevIterator ¶
RevIterator() creates and returns an iterator for the state machine's underlying store starting at the end-prefix of the specified key and iterating reverse lexicographically
func (*StateMachine) Set ¶
func (s *StateMachine) Set(k, v []byte) (err lib.ErrorI)
Set() upserts a key-value pair under a key
func (*StateMachine) SetAccount ¶
func (s *StateMachine) SetAccount(account *Account) lib.ErrorI
SetAccount() upserts an account into the state
func (*StateMachine) SetAccounts ¶
func (s *StateMachine) SetAccounts(accounts []*Account, supply *Supply) (err lib.ErrorI)
SetAccount() upserts multiple accounts into the state
func (*StateMachine) SetCommitteeMember ¶
func (s *StateMachine) SetCommitteeMember(address crypto.AddressI, chainId, stakeForCommittee uint64) lib.ErrorI
SetCommitteeMember() sets the address as a 'member' of the committee in the state
func (*StateMachine) SetCommittees ¶
func (s *StateMachine) SetCommittees(address crypto.AddressI, totalStake uint64, committees []uint64) (err lib.ErrorI)
SetCommittees() sets the membership and staked supply for all an addresses' committees
func (*StateMachine) SetCommitteesData ¶
func (s *StateMachine) SetCommitteesData(list *lib.CommitteesData) lib.ErrorI
SetCommitteesData() sets a list of committee data in the state
func (*StateMachine) SetDelegate ¶
func (s *StateMachine) SetDelegate(address crypto.AddressI, chainId, stakeForCommittee uint64) lib.ErrorI
SetDelegate() sets a delegate in state using the delegate prefix
func (*StateMachine) SetDelegations ¶
func (s *StateMachine) SetDelegations(address crypto.AddressI, totalStake uint64, committees []uint64) lib.ErrorI
SetDelegations() sets the delegate 'membership' for an address, adding to the list and updating the supply pools
func (*StateMachine) SetLastProposers ¶
func (s *StateMachine) SetLastProposers(keys *lib.Proposers) lib.ErrorI
SetLastProposers() saves the last Proposer addresses in the state
func (*StateMachine) SetOrderBook ¶
func (s *StateMachine) SetOrderBook(b *lib.OrderBook) lib.ErrorI
SetOrderBook() sets the order book for a committee in the state db
func (*StateMachine) SetOrderBooks ¶
func (s *StateMachine) SetOrderBooks(list *lib.OrderBooks, supply *Supply) lib.ErrorI
SetOrderBooks() sets a series of OrderBooks in the state db
func (*StateMachine) SetParams ¶
func (s *StateMachine) SetParams(p *Params) lib.ErrorI
SetParams() writes an entire Params object into state
func (*StateMachine) SetParamsCons ¶
func (s *StateMachine) SetParamsCons(c *ConsensusParams) lib.ErrorI
SetParamsCons() sets Consensus params into state
func (*StateMachine) SetParamsFee ¶
func (s *StateMachine) SetParamsFee(f *FeeParams) lib.ErrorI
SetParamsFee() sets Fee params into state
func (*StateMachine) SetParamsGov ¶
func (s *StateMachine) SetParamsGov(g *GovernanceParams) lib.ErrorI
SetParamsGov() sets Governance params into state
func (*StateMachine) SetParamsVal ¶
func (s *StateMachine) SetParamsVal(v *ValidatorParams) lib.ErrorI
SetParamsVal() sets Validator params into state
func (*StateMachine) SetPool ¶
func (s *StateMachine) SetPool(pool *Pool) (err lib.ErrorI)
SetPool() upserts a Pool structure into the state
func (*StateMachine) SetPools ¶
func (s *StateMachine) SetPools(pools []*Pool, supply *Supply) (err lib.ErrorI)
SetPools() upserts multiple Pool structures into the state
func (*StateMachine) SetProposalVoteConfig ¶
func (s *StateMachine) SetProposalVoteConfig(c GovProposalVoteConfig)
func (*StateMachine) SetRetiredCommittees ¶
func (s *StateMachine) SetRetiredCommittees(chainIds []uint64) (err lib.ErrorI)
SetRetiredCommittees() sets a list of chainIds as retired
func (*StateMachine) SetStore ¶
func (s *StateMachine) SetStore(store lib.RWStoreI)
func (*StateMachine) SetSupply ¶
func (s *StateMachine) SetSupply(supply *Supply) lib.ErrorI
SetSupply() upserts the Supply structure into the state
func (*StateMachine) SetValidator ¶
func (s *StateMachine) SetValidator(validator *Validator) (err lib.ErrorI)
SetValidator() upserts a Validator object into the state
func (*StateMachine) SetValidatorPaused ¶
func (s *StateMachine) SetValidatorPaused(address crypto.AddressI, validator *Validator, maxPausedHeight uint64) lib.ErrorI
SetValidatorPaused() updates a Validator as 'paused' with a MaxPausedHeight (height at which the Validator is force-unstaked for being paused too long)
func (*StateMachine) SetValidatorUnpaused ¶
func (s *StateMachine) SetValidatorUnpaused(address crypto.AddressI, validator *Validator) lib.ErrorI
SetValidatorUnpaused() updates a Validator as 'unpaused'
func (*StateMachine) SetValidatorUnstaking ¶
func (s *StateMachine) SetValidatorUnstaking(address crypto.AddressI, validator *Validator, finishUnstakingHeight uint64) lib.ErrorI
SetValidatorUnstaking() updates a Validator as 'unstaking' and removes it from its respective committees NOTE: finish unstaking height is the height in the future when the validator will be deleted and their funds be returned
func (*StateMachine) SetValidatorUnstakingIfBelowMinimum ¶
func (s *StateMachine) SetValidatorUnstakingIfBelowMinimum(validator *Validator, params *ValidatorParams) (bool, lib.ErrorI)
SetValidatorUnstakingIfBelowMinimum() updates a validator as 'unstaking' and removes it from its respective committees if it is below the minimum stake according to saved params
func (*StateMachine) SetValidators ¶
func (s *StateMachine) SetValidators(validators []*Validator, supply *Supply) lib.ErrorI
SetValidators() upserts multiple Validators into the state and updates the supply tracker
func (*StateMachine) SetValidatorsPaused ¶
func (s *StateMachine) SetValidatorsPaused(chainId uint64, addresses [][]byte)
SetValidatorsPaused() automatically updates all validators as if they'd submitted a MessagePause
func (*StateMachine) SlashAndResetNonSigners ¶
func (s *StateMachine) SlashAndResetNonSigners(chainId uint64, params *ValidatorParams) (err lib.ErrorI)
SlashAndResetNonSigners() resets the non-signer tracking and slashes those who exceeded the MaxNonSign threshold
func (*StateMachine) SlashDoubleSigners ¶
func (s *StateMachine) SlashDoubleSigners(chainId uint64, params *ValidatorParams, doubleSignerAddrs [][]byte) lib.ErrorI
SlashDoubleSigners() burns the staked tokens of double signers
func (*StateMachine) SlashNonSigners ¶
func (s *StateMachine) SlashNonSigners(chainId uint64, params *ValidatorParams, nonSignerAddrs [][]byte) lib.ErrorI
SlashNonSigners() burns the staked tokens of non-quorum-certificate-signers
func (*StateMachine) SlashValidator ¶
func (s *StateMachine) SlashValidator(validator *Validator, chainId, percent uint64, p *ValidatorParams) (err lib.ErrorI)
SlashValidator() burns a specified percentage of a validator's staked tokens
func (*StateMachine) SlashValidators ¶
func (s *StateMachine) SlashValidators(addresses [][]byte, chainId, percent uint64, p *ValidatorParams) lib.ErrorI
SlashValidators() burns a specified percentage of multiple validator's staked tokens
func (*StateMachine) Store ¶
func (s *StateMachine) Store() lib.RWStoreI
various self-explanatory 1 line functions below
func (*StateMachine) SubFromCommitteeStakedSupplyForChain ¶
func (s *StateMachine) SubFromCommitteeStakedSupplyForChain(chainId uint64, amount uint64) lib.ErrorI
SubFromCommitteeStakedSupplyForChain() removes from the committee staked supply count
func (*StateMachine) SubFromDelegateStakedSupplyForChain ¶
func (s *StateMachine) SubFromDelegateStakedSupplyForChain(chainId uint64, amount uint64) lib.ErrorI
SubFromDelegateStakedSupplyForChain() removes from the delegate committee staked supply count
func (*StateMachine) SubFromDelegateSupply ¶
func (s *StateMachine) SubFromDelegateSupply(amount uint64) lib.ErrorI
SubFromDelegateSupply() removes from the delegated supply count
func (*StateMachine) SubFromStakedSupply ¶
func (s *StateMachine) SubFromStakedSupply(amount uint64) lib.ErrorI
SubFromStakedSupply() removes from the staked supply count (staked + delegated)
func (*StateMachine) SubFromTotalSupply ¶
func (s *StateMachine) SubFromTotalSupply(amount uint64) lib.ErrorI
SubFromTotalSupply() removes from the total supply count
func (*StateMachine) TimeMachine ¶
func (s *StateMachine) TimeMachine(height uint64) (*StateMachine, lib.ErrorI)
TimeMachine() creates a new StateMachine instance representing the blockchain state at a specified block height, allowing for a read-only view of the past state
func (*StateMachine) TotalVDFIterations ¶
func (s *StateMachine) TotalVDFIterations() uint64
func (*StateMachine) TxnWrap ¶
func (s *StateMachine) TxnWrap() (lib.StoreI, lib.ErrorI)
TxnWrap() is an atomicity and consistency feature that enables easy rollback of changes by discarding the transaction if an error occurs
func (*StateMachine) UpdateCommittees ¶
func (s *StateMachine) UpdateCommittees(address crypto.AddressI, oldValidator *Validator, newStakedAmount uint64, newCommittees []uint64) lib.ErrorI
UpdateCommittees() updates the committee information in state for a specific validator
func (*StateMachine) UpdateDelegations ¶
func (s *StateMachine) UpdateDelegations(address crypto.AddressI, oldValidator *Validator, newStakedAmount uint64, newCommittees []uint64) lib.ErrorI
UpdateDelegations() updates the delegate information for an address, first removing the outdated delegation information and then setting the new info
func (*StateMachine) UpdateLastProposers ¶
func (s *StateMachine) UpdateLastProposers(address []byte) lib.ErrorI
UpdateLastProposers() adds an address to the 'last proposers'
func (*StateMachine) UpdateParam ¶
func (s *StateMachine) UpdateParam(paramSpace, paramName string, value proto.Message) (err lib.ErrorI)
UpdateParam() updates a governance parameter keyed by space and name
func (*StateMachine) UpdateValidatorStake ¶
func (s *StateMachine) UpdateValidatorStake(val *Validator, newCommittees []uint64, amountToAdd uint64) (err lib.ErrorI)
UpdateValidatorStake() updates the stake of the validator object in state - updating the corresponding committees and supply NOTE: new stake amount must be GTE the previous stake amount
func (*StateMachine) UpsertCommitteeData ¶
func (s *StateMachine) UpsertCommitteeData(new *lib.CommitteeData) lib.ErrorI
UpsertCommitteeData() updates or inserts a committee data to the committees data list
func (*StateMachine) ValidateGenesisState ¶
func (s *StateMachine) ValidateGenesisState(genesis *GenesisState) (err lib.ErrorI)
ValidateGenesisState() validates a GenesisState object
func (*StateMachine) VerifyRLPBytes ¶
func (s *StateMachine) VerifyRLPBytes(tx *lib.Transaction) lib.ErrorI
VerifyRLPBytes() implements special 'signature verification logic' that allows a MessageSend to be authenticated using a signed RLP transaction
type Supply ¶
type Supply struct {
// total: the total tokens existing in the system - minted tokens are added, burned tokens are removed
Total uint64 `protobuf:"varint,1,opt,name=total,proto3" json:"total,omitempty"`
// staked: the total locked tokens in the protocol - this includes delegated
Staked uint64 `protobuf:"varint,2,opt,name=staked,proto3" json:"staked,omitempty"`
// delegated_only: the total locked tokens that are delegated only
DelegatedOnly uint64 `protobuf:"varint,3,opt,name=delegated_only,json=delegatedOnly,proto3" json:"delegatedOnly"` // @gotags: json:"delegatedOnly"
// committee_staked: a list of committees and their 'committed (staked + delegated)' tokens, sorted by stake
CommitteeStaked []*Pool `protobuf:"bytes,4,rep,name=committee_staked,json=committeeStaked,proto3" json:"committeeStaked"` // @gotags: json:"committeeStaked"
// committee_delegated_only: a list of committees and their 'delegated only' tokens, sorted by stake
CommitteeDelegatedOnly []*Pool `protobuf:"bytes,5,rep,name=committee_delegated_only,json=committeeDelegatedOnly,proto3" json:"committeeDelegatedOnly"` // @gotags: json:"committeeDelegatedOnly"
// contains filtered or unexported fields
}
A supply structure keeps track of the total amount of tokens or funds available across the entire blockchain It provides a single source of truth for the overall token supply managed by the network It conveniently buckets the tokens into useful categories allowing transparency and consistency NOTE: 'staked' includes delegations, to calculate stake without delegations, simply staked - delegated_only
func (*Supply) Descriptor
deprecated
func (*Supply) GetCommitteeDelegatedOnly ¶
func (*Supply) GetCommitteeStaked ¶
func (*Supply) GetDelegatedOnly ¶
func (*Supply) ProtoMessage ¶
func (*Supply) ProtoMessage()
func (*Supply) ProtoReflect ¶
func (x *Supply) ProtoReflect() protoreflect.Message
func (*Supply) Sort ¶
func (x *Supply) Sort()
Sort() sorts the list of Pools for committees and delegations by amount (stake) high to low
func (*Supply) SortCommittees ¶
func (x *Supply) SortCommittees()
SortCommittees() sorts the committees list by amount (stake) high to low
func (*Supply) SortDelegations ¶
func (x *Supply) SortDelegations()
SortCommittees() sorts the delegations list by amount (stake) high to low
type SupplyPoolType ¶
type SupplyPoolType int
const ( CommitteesWithDelegations SupplyPoolType = 0 DelegationsOnly SupplyPoolType = 1 )
type Validator ¶
type Validator struct {
// address: the short version of the public key of the operator of the service, corresponding to the 2
Address []byte `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"`
// public_key: the public cryptographic identity of the operator of the service. This key must be an aggregable BLS
// key for efficiency in the BFT process.
PublicKey []byte `protobuf:"bytes,2,opt,name=public_key,json=publicKey,proto3" json:"publicKey"` // @gotags: json:"publicKey"
// net_address: the tcp peer-to-peer address of the node to enable easy discovery of the peer for multi-consensus
NetAddress string `protobuf:"bytes,3,opt,name=net_address,json=netAddress,proto3" json:"netAddress"` // @gotags: json:"netAddress"
// staked_amount: the amount of tokens locked as a surety bond against malicious behavior. These tokens may be
// increased by auto-compounding rewards or by an edit-stake command. This bond is returned to the output address
// after executing an unstake command and waiting the unstaking period.
StakedAmount uint64 `protobuf:"varint,4,opt,name=staked_amount,json=stakedAmount,proto3" json:"stakedAmount"` // @gotags: json:"stakedAmount"
// committees: a list of ids of the committees the validator is offering Validation or Delegation services for
Committees []uint64 `protobuf:"varint,5,rep,packed,name=committees,proto3" json:"committees,omitempty"`
// max_paused_height: if the Validator is paused, this value tracks the maximum height it may be paused before it
// automatically begins unstaking
MaxPausedHeight uint64 `protobuf:"varint,6,opt,name=max_paused_height,json=maxPausedHeight,proto3" json:"maxPausedHeight"` // @gotags: json:"maxPausedHeight"
// unstaking_height: if the Validator is unstaking, this value tracks the future block height a Validator's surety
// bond will be returned
UnstakingHeight uint64 `protobuf:"varint,7,opt,name=unstaking_height,json=unstakingHeight,proto3" json:"unstakingHeight"` // @gotags: json:"unstakingHeight"
// output: the address where early-withdrawal rewards and the unstaking surety bond are transferred to
Output []byte `protobuf:"bytes,8,opt,name=output,proto3" json:"output,omitempty"`
// delegate: signals whether the Validator is a Delegate or not. If true, the Validator only passively participates
// in Validation-as-a-Service by dedicating their funds to help the chain qualify for protocol subsidisation
Delegate bool `protobuf:"varint,9,opt,name=delegate,proto3" json:"delegate,omitempty"`
// compound: signals whether the Validator is auto-compounding (increasing their stake with new rewards) or
// withdrawing rewards early to their output address as they come in
Compound bool `protobuf:"varint,10,opt,name=compound,proto3" json:"compound,omitempty"`
// contains filtered or unexported fields
}
***************************************************************************************************** This file is auto-generated from source files in `/lib/.proto/*` using Protocol Buffers (protobuf)
Protobuf is a language-neutral, platform-neutral serialization format. It allows users to define objects in a way that’s both efficient to store and fast to transmit over the network. These definitions are compiled into code that *enables different systems and programming languages to communicate in a byte-perfect manner*
To update these structures, make changes to the source .proto files, then recompile to regenerate this file. These auto-generated files are easily recognized by checking for a `.pb.go` ending ***************************************************************************************************** _ _ _
A Validator is an actor in the blockchain network responsible for verifying transactions, creating new blocks, and maintaining the blockchain's integrity and security. In Canopy, Validators provide this service for multiple chains by restaking their tokens across multiple 'committees' and run a blockchain client for each Both the Operator and the Output private key may sign transactions on behalf of the Validator, but only the Output private key may change the Output address.
func (*Validator) Descriptor
deprecated
func (*Validator) GetAddress ¶
func (*Validator) GetCommittees ¶
func (*Validator) GetCompound ¶
func (*Validator) GetDelegate ¶
func (*Validator) GetMaxPausedHeight ¶
func (*Validator) GetNetAddress ¶
func (*Validator) GetPublicKey ¶
func (*Validator) GetStakedAmount ¶
func (*Validator) GetUnstakingHeight ¶
func (*Validator) MarshalJSON ¶
MarshalJSON() is the json.Marshaller implementation for the Validator object
func (*Validator) PassesFilter ¶
func (x *Validator) PassesFilter(f lib.ValidatorFilters) (ok bool)
PassesFilter() returns if the Validator object passes the filter (true) or is filtered out (false)
func (*Validator) ProtoMessage ¶
func (*Validator) ProtoMessage()
func (*Validator) ProtoReflect ¶
func (x *Validator) ProtoReflect() protoreflect.Message
func (*Validator) UnmarshalJSON ¶
UnmarshalJSON() is the json.Unmarshaler implementation for the Validator object
type ValidatorPage ¶
type ValidatorPage []*Validator
func (*ValidatorPage) New ¶
func (p *ValidatorPage) New() lib.Pageable
ValidatorPage satisfies the Page interface
type ValidatorParams ¶
type ValidatorParams struct {
// unstaking_blocks: is the number of blocks a validator's staked tokens must remain locked and slashable after
// sending 'unstake_validator'. Without unstaking blocks, validators could withdraw their stake right after attempting
// malicious behavior, like double-signing or failing to validate correctly
UnstakingBlocks uint64 `protobuf:"varint,1,opt,name=unstaking_blocks,json=unstakingBlocks,proto3" json:"unstakingBlocks"` // @gotags: json:"unstakingBlocks"
// max_pause_blocks: is the maximum number of blocks a validator may be paused before being 'force unstaked'.
// This is necessary to prevent dead validators from forever existing in the state
MaxPauseBlocks uint64 `protobuf:"varint,2,opt,name=max_pause_blocks,json=maxPauseBlocks,proto3" json:"maxPauseBlocks"` // @gotags: json:"maxPauseBlocks"
// double_sign_slash_percentage: is the percentage of staked tokens that are slashed when a Validator is caught
// performing a double-sign (signing two different blocks for the same block height and round,
// supporting conflicting versions of the blockchain)
DoubleSignSlashPercentage uint64 `` // @gotags: json:"doubleSignSlashPercentage"
/* 128-byte string literal not displayed */
// non_sign_slash_percentage: is the percentage of staked tokens that are slashed when a Validator doesn't sign a
// number of blocks over the max_non_sign threshold within the non_sign_window blocks.
NonSignSlashPercentage uint64 `protobuf:"varint,4,opt,name=non_sign_slash_percentage,json=nonSignSlashPercentage,proto3" json:"nonSignSlashPercentage"` // @gotags: json:"nonSignSlashPercentage"
// max_non_sign: is the maximum number of blocks a Validator may not sign before being slashed, a threshold system
// provides lee-way for accidental non-sign faults
MaxNonSign uint64 `protobuf:"varint,5,opt,name=max_non_sign,json=maxNonSign,proto3" json:"maxNonSign"` // @gotags: json:"maxNonSign"
// non_sign_window: is the period of blocks in which a validator’s count of missed signatures (non-signs) is tracked
// before it is reset. During this window, if a validator fails to sign blocks, the missed count is incremented
// Once the window expires, the non-sign count is reset, providing the validator a chance to recover without immediate
// penalties
NonSignWindow uint64 `protobuf:"varint,6,opt,name=non_sign_window,json=nonSignWindow,proto3" json:"nonSignWindow"` // @gotags: json:"nonSignWindow"
// max_committees: is the maximum number of committees a validator is allowed to stake for
MaxCommittees uint64 `protobuf:"varint,7,opt,name=max_committees,json=maxCommittees,proto3" json:"maxCommittees"` // @gotags: json:"maxCommittees"
// max_committee_size: is the maximum number of active validators a committee may have participating in BFT at any
// one view
MaxCommitteeSize uint64 `protobuf:"varint,8,opt,name=max_committee_size,json=maxCommitteeSize,proto3" json:"maxCommitteeSize"` // @gotags: json:"maxCommitteeSize"
// early_withdrawal_penalty: is the percent reward deduction if NOT compounding validator rewards
EarlyWithdrawalPenalty uint64 `protobuf:"varint,9,opt,name=early_withdrawal_penalty,json=earlyWithdrawalPenalty,proto3" json:"earlyWithdrawalPenalty"` // @gotags: json:"earlyWithdrawalPenalty"
// delegate_unstaking_blocks: is the number of blocks a delegate validator's staked tokens must remain locked.
// Since there's no slashing of delegates, this variable affects economic stability more than security
DelegateUnstakingBlocks uint64 `protobuf:"varint,10,opt,name=delegate_unstaking_blocks,json=delegateUnstakingBlocks,proto3" json:"delegateUnstakingBlocks"` // @gotags: json:"delegateUnstakingBlocks"
// minimum_order_size: is the minimum amount a 'sell order' must sell in order to be valid
MinimumOrderSize uint64 `protobuf:"varint,11,opt,name=minimum_order_size,json=minimumOrderSize,proto3" json:"minimumOrderSize"` // @gotags: json:"minimumOrderSize"
// stake_percent_for_subsidized_committee: is the minimum percentage of total stake that a committee must have
// committed to it in order to be considered "subsidized" by the protocol
StakePercentForSubsidizedCommittee uint64 `` // @gotags: json:"stakePercentForSubsidizedCommittee"
/* 157-byte string literal not displayed */
// max_slash_per_committee: is the maximum slash per committee per block that a validator may receive.
// If the slash exceeds maximum, the validator will be auto-removed from the committee to protect all parties from
// cascading failures.
MaxSlashPerCommittee uint64 `protobuf:"varint,13,opt,name=max_slash_per_committee,json=maxSlashPerCommittee,proto3" json:"maxSlashPerCommittee"` // @gotags: json:"maxSlashPerCommittee"
// delegate_reward_percentage: is the percentage of the block reward that is awarded to the delegates
DelegateRewardPercentage uint64 `protobuf:"varint,14,opt,name=delegate_reward_percentage,json=delegateRewardPercentage,proto3" json:"delegateRewardPercentage"` // @gotags: json:"delegateRewardPercentage"
// buy_deadline_blocks: amount of blocks a 'buyer' has to complete an order they 'reserved'
BuyDeadlineBlocks uint64 `protobuf:"varint,15,opt,name=buy_deadline_blocks,json=buyDeadlineBlocks,proto3" json:"buyDeadlineBlocks"` // @gotags: json:"buyDeadlineBlocks"
// lock_order_fee_multiplier: the fee multiplier of the 'send' fee that is required to execute a lock order
LockOrderFeeMultiplier uint64 `protobuf:"varint,16,opt,name=lock_order_fee_multiplier,json=lockOrderFeeMultiplier,proto3" json:"lockOrderFeeMultiplier"` // @gotags: json:"lockOrderFeeMultiplier"
// minimum_stake_for_validators: is the least amount a validator must stake to qualify as staked
MinimumStakeForValidators uint64 `` // @gotags: json:"minimumStakeForValidators"
/* 129-byte string literal not displayed */
// minimum_stake_for_delegates: is the least amount a delegator must stake to qualify as staked
MinimumStakeForDelegates uint64 `` // @gotags: json:"minimumStakeForDelegates"
/* 126-byte string literal not displayed */
// maximum_delegates_per_committee: is the maximum number of delegates that can be chose as lottery winners
MaximumDelegatesPerCommittee uint64 `` // @gotags: json:"maximumDelegatesPerCommittee"
/* 138-byte string literal not displayed */
// contains filtered or unexported fields
}
ValidatorParams is the parameter space that defines the rules and criteria for validators in the blockchain
func (*ValidatorParams) Check ¶
func (x *ValidatorParams) Check() lib.ErrorI
Check() validates the Validator params
func (*ValidatorParams) Descriptor
deprecated
func (*ValidatorParams) Descriptor() ([]byte, []int)
Deprecated: Use ValidatorParams.ProtoReflect.Descriptor instead.
func (*ValidatorParams) GetBuyDeadlineBlocks ¶
func (x *ValidatorParams) GetBuyDeadlineBlocks() uint64
func (*ValidatorParams) GetDelegateRewardPercentage ¶
func (x *ValidatorParams) GetDelegateRewardPercentage() uint64
func (*ValidatorParams) GetDelegateUnstakingBlocks ¶
func (x *ValidatorParams) GetDelegateUnstakingBlocks() uint64
func (*ValidatorParams) GetDoubleSignSlashPercentage ¶
func (x *ValidatorParams) GetDoubleSignSlashPercentage() uint64
func (*ValidatorParams) GetEarlyWithdrawalPenalty ¶
func (x *ValidatorParams) GetEarlyWithdrawalPenalty() uint64
func (*ValidatorParams) GetLockOrderFeeMultiplier ¶
func (x *ValidatorParams) GetLockOrderFeeMultiplier() uint64
func (*ValidatorParams) GetMaxCommitteeSize ¶
func (x *ValidatorParams) GetMaxCommitteeSize() uint64
func (*ValidatorParams) GetMaxCommittees ¶
func (x *ValidatorParams) GetMaxCommittees() uint64
func (*ValidatorParams) GetMaxNonSign ¶
func (x *ValidatorParams) GetMaxNonSign() uint64
func (*ValidatorParams) GetMaxPauseBlocks ¶
func (x *ValidatorParams) GetMaxPauseBlocks() uint64
func (*ValidatorParams) GetMaxSlashPerCommittee ¶
func (x *ValidatorParams) GetMaxSlashPerCommittee() uint64
func (*ValidatorParams) GetMaximumDelegatesPerCommittee ¶
func (x *ValidatorParams) GetMaximumDelegatesPerCommittee() uint64
func (*ValidatorParams) GetMinimumOrderSize ¶
func (x *ValidatorParams) GetMinimumOrderSize() uint64
func (*ValidatorParams) GetMinimumStakeForDelegates ¶
func (x *ValidatorParams) GetMinimumStakeForDelegates() uint64
func (*ValidatorParams) GetMinimumStakeForValidators ¶
func (x *ValidatorParams) GetMinimumStakeForValidators() uint64
func (*ValidatorParams) GetNonSignSlashPercentage ¶
func (x *ValidatorParams) GetNonSignSlashPercentage() uint64
func (*ValidatorParams) GetNonSignWindow ¶
func (x *ValidatorParams) GetNonSignWindow() uint64
func (*ValidatorParams) GetStakePercentForSubsidizedCommittee ¶
func (x *ValidatorParams) GetStakePercentForSubsidizedCommittee() uint64
func (*ValidatorParams) GetUnstakingBlocks ¶
func (x *ValidatorParams) GetUnstakingBlocks() uint64
func (*ValidatorParams) ProtoMessage ¶
func (*ValidatorParams) ProtoMessage()
func (*ValidatorParams) ProtoReflect ¶
func (x *ValidatorParams) ProtoReflect() protoreflect.Message
func (*ValidatorParams) Reset ¶
func (x *ValidatorParams) Reset()
func (*ValidatorParams) SetString ¶
func (x *ValidatorParams) SetString(_ string, _ string) lib.ErrorI
SetString() update a string parameter in the structure
func (*ValidatorParams) SetUint64 ¶
func (x *ValidatorParams) SetUint64(paramName string, value uint64) lib.ErrorI
SetUint64() update a uint64 parameter in the structure
func (*ValidatorParams) String ¶
func (x *ValidatorParams) String() string
type ValidatorsList ¶
type ValidatorsList struct {
List []*Validator `protobuf:"bytes,1,rep,name=List,proto3" json:"List,omitempty"`
// contains filtered or unexported fields
}
ValidatorsList is stored as a single blob (instead of using prefixed keys) for the following reasons:
Filesystem database iterators (e.g., in LevelDB/BadgerDB) introduce significant overhead and are often slow, especially when reading or updating large sets of keys every block.
The total number of validators is expected to remain below 100,000, and each entry is relatively small (~200 bytes), making a full in-memory deserialization manageable and performant.
Validators are expected to participate in most committees, so the majority of the list is relevant to each context, and filtering from a single list is faster than multiple disk reads.
Storing separate, per-committee lists (especially if sorted and updated every block) would create substantial additional write and storage overhead compared to maintaining a single, compact list.
func (*ValidatorsList) Descriptor
deprecated
func (*ValidatorsList) Descriptor() ([]byte, []int)
Deprecated: Use ValidatorsList.ProtoReflect.Descriptor instead.
func (*ValidatorsList) GetList ¶
func (x *ValidatorsList) GetList() []*Validator
func (*ValidatorsList) ProtoMessage ¶
func (*ValidatorsList) ProtoMessage()
func (*ValidatorsList) ProtoReflect ¶
func (x *ValidatorsList) ProtoReflect() protoreflect.Message
func (*ValidatorsList) Reset ¶
func (x *ValidatorsList) Reset()
func (*ValidatorsList) String ¶
func (x *ValidatorsList) String() string
type VotePoll ¶
VotePoll represents the structure of a voting action on a poll It is used to encode data into JSON format for storing in memo fields
type VoteStats ¶
type VoteStats struct {
ApproveTokens uint64 `json:"approveTokens"` // power (tokens) that voted 'yay'
RejectTokens uint64 `json:"rejectTokens"` // power (tokens) that voted 'nay'
TotalVotedTokens uint64 `json:"totalVotedTokens"` // total power (tokens) that already voted
TotalTokens uint64 `json:"totalTokens"` // total power (tokens) that could possibly vote
ApprovePercentage uint64 `json:"approvedPercent"` // percent representation of power (tokens) that voted 'yay' out of total power
RejectPercentage uint64 `json:"rejectPercent"` // percent representation of power (tokens) that voted 'nay' out of total power
VotedPercentage uint64 `json:"votedPercent"` // percent representation of power (tokens) voted out of total power
}
VoteStats: are demonstrative statistics about poll voting