Documentation
¶
Index ¶
- Constants
- func CalculateValidatorDistributionAmount(prev uint64, curr uint64) (distributionAmt uint64)
- type DistributionService
- func (ds *DistributionService) DistributeToAdvisories()
- func (ds *DistributionService) DistributeToAdvisoriesOnce() (err error)
- func (ds *DistributionService) DistributeToValidators()
- func (ds *DistributionService) GetLastOccurrence() (occurrence *Occurrence, err error)
- func (ds *DistributionService) GetOccurrence(timestamp int64) (occurrence *Occurrence, err error)
- func (ds *DistributionService) ReadLastBlockHeight() (blockHeight int64, err error)
- func (ds *DistributionService) Run() (err error)
- func (ds *DistributionService) RunDistribution(currentBlockHeight int64, lastWrittenBlockHeight int64) (run bool)
- func (ds *DistributionService) StoreOccurrence(timestamp int64, amount uint64) (err error)
- func (ds *DistributionService) WriteLastBlockHeight(blockHeight int64) error
- type ElementsClient
- type IElementsClient
- type IPlanetmintClient
- type Occurrence
- type PlanetmintClient
Constants ¶
View Source
const (
OccurrencePrefix = "Occurrence/"
)
Variables ¶
This section is empty.
Functions ¶
func CalculateValidatorDistributionAmount ¶ added in v0.4.0
Types ¶
type DistributionService ¶
type DistributionService struct {
// contains filtered or unexported fields
}
func NewDistributionService ¶
func NewDistributionService(pmClient IPlanetmintClient, eClient IElementsClient, r2pClient r2p.IR2PClient, shamirClient shamir.ISCClient, db *leveldb.DB) *DistributionService
func (*DistributionService) DistributeToAdvisories ¶ added in v0.4.0
func (ds *DistributionService) DistributeToAdvisories()
func (*DistributionService) DistributeToAdvisoriesOnce ¶ added in v0.4.0
func (ds *DistributionService) DistributeToAdvisoriesOnce() (err error)
func (*DistributionService) DistributeToValidators ¶ added in v0.4.0
func (ds *DistributionService) DistributeToValidators()
Distributes 10% of received funds to all validators
func (*DistributionService) GetLastOccurrence ¶
func (ds *DistributionService) GetLastOccurrence() (occurrence *Occurrence, err error)
func (*DistributionService) GetOccurrence ¶
func (ds *DistributionService) GetOccurrence(timestamp int64) (occurrence *Occurrence, err error)
func (*DistributionService) ReadLastBlockHeight ¶ added in v0.4.0
func (ds *DistributionService) ReadLastBlockHeight() (blockHeight int64, err error)
func (*DistributionService) Run ¶
func (ds *DistributionService) Run() (err error)
Run starts cronjob like thread to periodically check for DAO rewards to distribute to validators
func (*DistributionService) RunDistribution ¶ added in v0.4.0
func (ds *DistributionService) RunDistribution(currentBlockHeight int64, lastWrittenBlockHeight int64) (run bool)
func (*DistributionService) StoreOccurrence ¶
func (ds *DistributionService) StoreOccurrence(timestamp int64, amount uint64) (err error)
func (*DistributionService) WriteLastBlockHeight ¶ added in v0.4.0
func (ds *DistributionService) WriteLastBlockHeight(blockHeight int64) error
type ElementsClient ¶
type ElementsClient struct{}
func NewElementsClient ¶
func NewElementsClient() *ElementsClient
func (*ElementsClient) ListReceivedByAddress ¶
func (ec *ElementsClient) ListReceivedByAddress(url string, params []string) (receivedTx []types.ListReceivedByAddressResult, err error)
type IElementsClient ¶
type IElementsClient interface {
ListReceivedByAddress(url string, params []string) (receivedTx []types.ListReceivedByAddressResult, err error)
}
type IPlanetmintClient ¶
type Occurrence ¶
type PlanetmintClient ¶
type PlanetmintClient struct {
// contains filtered or unexported fields
}
func NewPlanetmintClient ¶
func NewPlanetmintClient(host string) *PlanetmintClient
func (*PlanetmintClient) GetBlockHeight ¶ added in v0.4.0
func (pmc *PlanetmintClient) GetBlockHeight() (height int64, err error)
func (*PlanetmintClient) GetValidatorAddresses ¶
func (pmc *PlanetmintClient) GetValidatorAddresses() (addresses []string, err error)
func (*PlanetmintClient) GetValidatorDelegationAddresses ¶
func (pmc *PlanetmintClient) GetValidatorDelegationAddresses(validatorAddress string) (addresses []string, err error)
Click to show internal directories.
Click to hide internal directories.