Documentation
¶
Index ¶
- Constants
- type ChainInfo
- type EthereumAPI
- func (n EthereumAPI) ClaimReward(claim *entities.ClaimData) (hash []byte, err error)
- func (n EthereumAPI) Claimed(validator []byte, cycle *big.Int, index *big.Int) (bool, error)
- func (n EthereumAPI) GetChainInfo() (info *ChainInfo, err error)
- func (n EthereumAPI) GetCurrentBlockNumber() (*big.Int, error)
- func (n EthereumAPI) GetCurrentCycle() (*big.Int, error)
- func (n EthereumAPI) GetCurrentEpoch() (*big.Int, error)
- func (n EthereumAPI) GetCurrentMessagePrice() (*big.Int, error)
- func (n EthereumAPI) GetCurrentYear() (*big.Int, error)
- func (n EthereumAPI) GetCycle(blockNumber *big.Int) (*big.Int, error)
- func (n EthereumAPI) GetEpoch(blockNumber *big.Int) (*big.Int, error)
- func (n EthereumAPI) GetMessagePrice(cycle *big.Int) (*big.Int, error)
- func (n EthereumAPI) GetMinStakeAmountForSentry() (*big.Int, error)
- func (n EthereumAPI) GetSentryActiveLicenseCount(cycle *big.Int) (*big.Int, error)
- func (n EthereumAPI) GetSentryLicenseOperator(license *big.Int) ([]byte, error)
- func (n EthereumAPI) GetSentryLicenseOwnerAddress(publicKey []byte) ([]byte, error)
- func (n EthereumAPI) GetSentryLicenses(operator []byte, cycle *big.Int) ([]*big.Int, error)
- func (n EthereumAPI) GetSentryNodeOperators(page *big.Int, perPage *big.Int) ([]OperatorInfo, error)
- func (n EthereumAPI) GetSentryOperatorCycleLicenseCount(operator []byte, cycle *big.Int) (*big.Int, error)
- func (n EthereumAPI) GetStartBlock() (*big.Int, error)
- func (n EthereumAPI) GetStartTime() (*big.Int, error)
- func (n EthereumAPI) GetSubnetBalance(id [16]byte) (*big.Int, error)
- func (n EthereumAPI) GetValidatorActiveLicenseCount(cycle *big.Int) (*big.Int, error)
- func (n EthereumAPI) GetValidatorLicenseOperator(license *big.Int) ([]byte, error)
- func (n EthereumAPI) GetValidatorLicenseOwnerAddress(publicKey []byte) ([]byte, error)
- func (n EthereumAPI) GetValidatorLicenses(operator []byte, cycle *big.Int) ([]*big.Int, error)
- func (n EthereumAPI) GetValidatorNodeOperators(page *big.Int, perPage *big.Int) ([]OperatorInfo, error)
- func (n EthereumAPI) GetValidatorOperatorCycleLicenseCount(operator []byte, cycle *big.Int) (*big.Int, error)
- func (n EthereumAPI) IsSentryLicenseOwner(address string) (bool, error)
- func (n EthereumAPI) IsSentryNodeOperator(publicKey []byte, cycle *big.Int) (bool, error)
- func (n EthereumAPI) IsValidatorLicenseOwner(address string) (bool, error)
- func (n EthereumAPI) IsValidatorNodeOperator(publicKey []byte, cycle *big.Int) (bool, error)
- func (n *EthereumAPI) LicenseOperator(license *big.Int) ([]byte, error)
- type GenericAPI
- func (n GenericAPI) ClaimReward(claim *entities.ClaimData) (hash []byte, err error)
- func (n GenericAPI) Claimed(validator []byte, cycle *big.Int, index *big.Int) (bool, error)
- func (n GenericAPI) GetChainInfo() (*ChainInfo, error)
- func (n GenericAPI) GetCurrentBlockNumber() (*big.Int, error)
- func (n GenericAPI) GetCurrentCycle() (*big.Int, error)
- func (n GenericAPI) GetCurrentEpoch() (*big.Int, error)
- func (n GenericAPI) GetCurrentMessagePrice() (*big.Int, error)
- func (n GenericAPI) GetCurrentYear() (*big.Int, error)
- func (n GenericAPI) GetCycle(blockNumber *big.Int) (*big.Int, error)
- func (n GenericAPI) GetEpoch(blockNumber *big.Int) (*big.Int, error)
- func (n GenericAPI) GetMessagePrice(cycle *big.Int) (*big.Int, error)
- func (n GenericAPI) GetMinStakeAmountForSentry() (*big.Int, error)
- func (n GenericAPI) GetSentryActiveLicenseCount(cycle *big.Int) (*big.Int, error)
- func (n GenericAPI) GetSentryLicenseOperator(license *big.Int) ([]byte, error)
- func (n GenericAPI) GetSentryLicenseOwnerAddress(publicKey []byte) ([]byte, error)
- func (n GenericAPI) GetSentryLicenses(operator []byte, cycle *big.Int) ([]*big.Int, error)
- func (n GenericAPI) GetSentryNodeOperators(page *big.Int, perPage *big.Int) ([]OperatorInfo, error)
- func (n GenericAPI) GetSentryOperatorCycleLicenseCount(operator []byte, cycle *big.Int) (*big.Int, error)
- func (n GenericAPI) GetStakeBalance(address entities.DIDString) big.Int
- func (n GenericAPI) GetStartBlock() (*big.Int, error)
- func (n GenericAPI) GetStartTime() (*big.Int, error)
- func (n GenericAPI) GetSubnetBalance(id [16]byte) (*big.Int, error)
- func (n GenericAPI) GetValidatorActiveLicenseCount(cycle *big.Int) (*big.Int, error)
- func (n GenericAPI) GetValidatorLicenseOperator(license *big.Int) ([]byte, error)
- func (n GenericAPI) GetValidatorLicenseOwnerAddress(publicKey []byte) ([]byte, error)
- func (n GenericAPI) GetValidatorLicenses(operator []byte, cycle *big.Int) ([]*big.Int, error)
- func (n GenericAPI) GetValidatorNodeOperators(page *big.Int, perPage *big.Int) ([]OperatorInfo, error)
- func (n GenericAPI) GetValidatorOperatorCycleLicenseCount(operator []byte, cycle *big.Int) (*big.Int, error)
- func (n GenericAPI) IsSentryLicenseOwner(address string) (bool, error)
- func (n GenericAPI) IsSentryNodeOperator(publicKey []byte, cycle *big.Int) (bool, error)
- func (n GenericAPI) IsValidatorLicenseOwner(address string) (bool, error)
- func (n GenericAPI) IsValidatorNodeOperator(publicKey []byte, cycle *big.Int) (bool, error)
- func (n *GenericAPI) LicenseOperator(license *big.Int) ([]byte, error)
- type IChainAPI
- type OperatorInfo
- type Protocol
Constants ¶
View Source
const NetworkStartDate = int64(1706468787000)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type EthereumAPI ¶
type EthereumAPI struct {
// Protocol Protocol
EthConfig configs.EthConfig
// contains filtered or unexported fields
}
func (EthereumAPI) ClaimReward ¶
func (n EthereumAPI) ClaimReward(claim *entities.ClaimData) (hash []byte, err error)
func (EthereumAPI) GetChainInfo ¶
func (n EthereumAPI) GetChainInfo() (info *ChainInfo, err error)
func (EthereumAPI) GetCurrentBlockNumber ¶
func (n EthereumAPI) GetCurrentBlockNumber() (*big.Int, error)
func (EthereumAPI) GetCurrentCycle ¶
func (n EthereumAPI) GetCurrentCycle() (*big.Int, error)
func (EthereumAPI) GetCurrentEpoch ¶
func (n EthereumAPI) GetCurrentEpoch() (*big.Int, error)
func (EthereumAPI) GetCurrentMessagePrice ¶
func (n EthereumAPI) GetCurrentMessagePrice() (*big.Int, error)
func (EthereumAPI) GetCurrentYear ¶
func (n EthereumAPI) GetCurrentYear() (*big.Int, error)
func (EthereumAPI) GetMessagePrice ¶
func (EthereumAPI) GetMinStakeAmountForSentry ¶
func (n EthereumAPI) GetMinStakeAmountForSentry() (*big.Int, error)
func (EthereumAPI) GetSentryActiveLicenseCount ¶
func (EthereumAPI) GetSentryLicenseOperator ¶
func (n EthereumAPI) GetSentryLicenseOperator(license *big.Int) ([]byte, error)
func (EthereumAPI) GetSentryLicenseOwnerAddress ¶
func (n EthereumAPI) GetSentryLicenseOwnerAddress(publicKey []byte) ([]byte, error)
func (EthereumAPI) GetSentryLicenses ¶
func (EthereumAPI) GetSentryNodeOperators ¶
func (n EthereumAPI) GetSentryNodeOperators(page *big.Int, perPage *big.Int) ([]OperatorInfo, error)
func (EthereumAPI) GetSentryOperatorCycleLicenseCount ¶
func (EthereumAPI) GetStartBlock ¶
func (n EthereumAPI) GetStartBlock() (*big.Int, error)
func (EthereumAPI) GetStartTime ¶
func (n EthereumAPI) GetStartTime() (*big.Int, error)
func (EthereumAPI) GetSubnetBalance ¶
func (n EthereumAPI) GetSubnetBalance(id [16]byte) (*big.Int, error)
func (EthereumAPI) GetValidatorActiveLicenseCount ¶
func (EthereumAPI) GetValidatorLicenseOperator ¶
func (n EthereumAPI) GetValidatorLicenseOperator(license *big.Int) ([]byte, error)
func (EthereumAPI) GetValidatorLicenseOwnerAddress ¶
func (n EthereumAPI) GetValidatorLicenseOwnerAddress(publicKey []byte) ([]byte, error)
func (EthereumAPI) GetValidatorLicenses ¶
func (EthereumAPI) GetValidatorNodeOperators ¶
func (n EthereumAPI) GetValidatorNodeOperators(page *big.Int, perPage *big.Int) ([]OperatorInfo, error)
func (EthereumAPI) GetValidatorOperatorCycleLicenseCount ¶
func (EthereumAPI) IsSentryLicenseOwner ¶
func (n EthereumAPI) IsSentryLicenseOwner(address string) (bool, error)
func (EthereumAPI) IsSentryNodeOperator ¶
func (EthereumAPI) IsValidatorLicenseOwner ¶
func (n EthereumAPI) IsValidatorLicenseOwner(address string) (bool, error)
func (EthereumAPI) IsValidatorNodeOperator ¶
func (*EthereumAPI) LicenseOperator ¶
func (n *EthereumAPI) LicenseOperator(license *big.Int) ([]byte, error)
type GenericAPI ¶
var API GenericAPI
func NewGenericAPI ¶
func NewGenericAPI() *GenericAPI
func Init(chainId configs.ChainId, api IChainAPI) {
// API = *NewGenericAPI(chainId)
ChainId configs.ChainId
}
func (GenericAPI) ClaimReward ¶
func (n GenericAPI) ClaimReward(claim *entities.ClaimData) (hash []byte, err error)
func (GenericAPI) GetChainInfo ¶
func (n GenericAPI) GetChainInfo() (*ChainInfo, error)
func (GenericAPI) GetCurrentBlockNumber ¶
func (n GenericAPI) GetCurrentBlockNumber() (*big.Int, error)
func (GenericAPI) GetCurrentCycle ¶
func (n GenericAPI) GetCurrentCycle() (*big.Int, error)
func (GenericAPI) GetCurrentEpoch ¶
func (n GenericAPI) GetCurrentEpoch() (*big.Int, error)
func (GenericAPI) GetCurrentMessagePrice ¶
func (n GenericAPI) GetCurrentMessagePrice() (*big.Int, error)
func (GenericAPI) GetCurrentYear ¶
func (n GenericAPI) GetCurrentYear() (*big.Int, error)
func (GenericAPI) GetMessagePrice ¶
func (GenericAPI) GetMinStakeAmountForSentry ¶
func (n GenericAPI) GetMinStakeAmountForSentry() (*big.Int, error)
func (GenericAPI) GetSentryActiveLicenseCount ¶
func (GenericAPI) GetSentryLicenseOperator ¶
func (n GenericAPI) GetSentryLicenseOperator(license *big.Int) ([]byte, error)
func (GenericAPI) GetSentryLicenseOwnerAddress ¶
func (n GenericAPI) GetSentryLicenseOwnerAddress(publicKey []byte) ([]byte, error)
func (GenericAPI) GetSentryLicenses ¶
func (GenericAPI) GetSentryNodeOperators ¶
func (n GenericAPI) GetSentryNodeOperators(page *big.Int, perPage *big.Int) ([]OperatorInfo, error)
func (GenericAPI) GetSentryOperatorCycleLicenseCount ¶
func (GenericAPI) GetStakeBalance ¶
func (n GenericAPI) GetStakeBalance(address entities.DIDString) big.Int
func (GenericAPI) GetStartBlock ¶
func (n GenericAPI) GetStartBlock() (*big.Int, error)
func (GenericAPI) GetStartTime ¶
func (n GenericAPI) GetStartTime() (*big.Int, error)
func (GenericAPI) GetSubnetBalance ¶
func (n GenericAPI) GetSubnetBalance(id [16]byte) (*big.Int, error)
func (GenericAPI) GetValidatorActiveLicenseCount ¶
func (GenericAPI) GetValidatorLicenseOperator ¶
func (n GenericAPI) GetValidatorLicenseOperator(license *big.Int) ([]byte, error)
func (GenericAPI) GetValidatorLicenseOwnerAddress ¶
func (n GenericAPI) GetValidatorLicenseOwnerAddress(publicKey []byte) ([]byte, error)
func (GenericAPI) GetValidatorLicenses ¶
func (GenericAPI) GetValidatorNodeOperators ¶
func (n GenericAPI) GetValidatorNodeOperators(page *big.Int, perPage *big.Int) ([]OperatorInfo, error)
func (GenericAPI) GetValidatorOperatorCycleLicenseCount ¶
func (GenericAPI) IsSentryLicenseOwner ¶
func (n GenericAPI) IsSentryLicenseOwner(address string) (bool, error)
func (GenericAPI) IsSentryNodeOperator ¶
func (GenericAPI) IsValidatorLicenseOwner ¶
func (n GenericAPI) IsValidatorLicenseOwner(address string) (bool, error)
func (GenericAPI) IsValidatorNodeOperator ¶
func (*GenericAPI) LicenseOperator ¶
func (n *GenericAPI) LicenseOperator(license *big.Int) ([]byte, error)
type IChainAPI ¶
type IChainAPI interface {
// general
GetChainInfo() (*ChainInfo, error)
GetStartTime() (*big.Int, error)
GetStartBlock() (*big.Int, error)
GetEpoch(blockNumber *big.Int) (*big.Int, error)
GetCycle(blockNumber *big.Int) (*big.Int, error)
GetCurrentCycle() (*big.Int, error)
GetCurrentBlockNumber() (*big.Int, error)
GetCurrentEpoch() (*big.Int, error)
GetCurrentYear() (*big.Int, error)
// license
GetSentryActiveLicenseCount(cycle *big.Int) (*big.Int, error)
GetValidatorActiveLicenseCount(cycle *big.Int) (*big.Int, error)
GetSentryOperatorCycleLicenseCount(operator []byte, cycle *big.Int) (*big.Int, error)
GetValidatorOperatorCycleLicenseCount(operator []byte, cycle *big.Int) (*big.Int, error)
GetSentryLicenseOperator(license *big.Int) ([]byte, error)
GetValidatorLicenseOperator(license *big.Int) ([]byte, error)
GetValidatorNodeOperators(page *big.Int, perPage *big.Int) ([]OperatorInfo, error)
GetSentryNodeOperators(page *big.Int, perPage *big.Int) ([]OperatorInfo, error)
IsValidatorLicenseOwner(address string) (bool, error)
IsSentryLicenseOwner(address string) (bool, error)
IsValidatorNodeOperator(publicKey []byte, cycle *big.Int) (bool, error)
IsSentryNodeOperator(publicKey []byte, cycle *big.Int) (bool, error)
GetValidatorLicenseOwnerAddress(publicKey []byte) ([]byte, error)
GetSentryLicenseOwnerAddress(publicKey []byte) ([]byte, error)
// subnet
GetSubnetBalance(id [16]byte) (*big.Int, error)
// sentry
// GetMinStakeAmountForValidators() (*big.Int, error)
GetMinStakeAmountForSentry() (*big.Int, error)
GetCurrentMessagePrice() (*big.Int, error)
GetMessagePrice(cycle *big.Int) (*big.Int, error)
// GetChannelBalance(address entities.DIDString) *big.Int
ClaimReward(claim *entities.ClaimData) ([]byte, error)
Claimed(validator []byte, cycle *big.Int, index *big.Int) (bool, error)
GetSentryLicenses(operator []byte, cycle *big.Int) ([]*big.Int, error)
GetValidatorLicenses(operator []byte, cycle *big.Int) ([]*big.Int, error)
}
type OperatorInfo ¶
Click to show internal directories.
Click to hide internal directories.