Documentation
¶
Overview ¶
Package eth client is the go client for the Livepeer Ethereum smart contract. Contracts here are generated.
Index ¶
- Variables
- func CheckRoundAndInit(client LivepeerEthClient) error
- func IsNullAddress(addr common.Address) bool
- func NewTransactOptsForAccount(account accounts.Account, passphrase string, keyStore *keystore.KeyStore) (*bind.TransactOpts, error)
- func NextBlockMultiple(blockNum *big.Int, blockMultiple *big.Int) *big.Int
- func ParseNewJobLog(log types.Log) (broadcasterAddr common.Address, jid *big.Int, streamID string, ...)
- func Wait(backend *ethclient.Client, rpcTimeout time.Duration, blocks *big.Int) error
- func WaitForMinedTx(backend *ethclient.Client, rpcTimeout time.Duration, ...) (*types.Receipt, error)
- func WaitUntilBlockMultiple(backend *ethclient.Client, rpcTimeout time.Duration, blockMultiple *big.Int) error
- type Claim
- type Client
- func (c *Client) Account() accounts.Account
- func (c *Client) Approve(toAddr common.Address, amount *big.Int) (<-chan types.Receipt, <-chan error)
- func (c *Client) ApproveAndTransact(toAddr common.Address, amount *big.Int, ...) (<-chan types.Receipt, <-chan error)
- func (c *Client) Backend() *ethclient.Client
- func (c *Client) BatchDistributeFees(jobId *big.Int, claimIds []*big.Int) (<-chan types.Receipt, <-chan error)
- func (c *Client) Bond(amount *big.Int, toAddr common.Address) (<-chan types.Receipt, <-chan error)
- func (c *Client) ClaimWork(jobId *big.Int, segmentRange [2]*big.Int, claimRoot [32]byte) (<-chan types.Receipt, <-chan error)
- func (c *Client) CurrentRoundInitialized() (bool, error)
- func (c *Client) DelegatorStake() (*big.Int, error)
- func (c *Client) DelegatorStatus() (string, error)
- func (c *Client) Deposit(amount *big.Int) (<-chan types.Receipt, <-chan error)
- func (c *Client) DistributeFees(jobId *big.Int, claimId *big.Int) (<-chan types.Receipt, <-chan error)
- func (c *Client) GetBlockHashByNumber(ctx context.Context, num *big.Int) (common.Hash, error)
- func (c *Client) GetBlockInfoByTxHash(ctx context.Context, hash common.Hash) (blkNum *big.Int, blkHash common.Hash, err error)
- func (c *Client) GetBondingManagerAddr() string
- func (c *Client) GetBroadcasterDeposit(broadcaster common.Address) (*big.Int, error)
- func (c *Client) GetCandidateTranscodersStats() ([]TranscoderStats, error)
- func (c *Client) GetClaim(jobID *big.Int, claimID *big.Int) (*Claim, error)
- func (c *Client) GetControllerAddr() string
- func (c *Client) GetFaucetAddr() string
- func (c *Client) GetJob(jobID *big.Int) (*Job, error)
- func (c *Client) GetJobsManagerAddr() string
- func (c *Client) GetReceipt(tx *types.Transaction) (*types.Receipt, error)
- func (c *Client) GetRoundsManagerAddr() string
- func (c *Client) GetTokenAddr() string
- func (c *Client) GetTranscoderPendingPricingInfo(addr common.Address) (*big.Int, *big.Int, *big.Int, error)
- func (c *Client) GetTranscoderPricingInfo(addr common.Address) (*big.Int, *big.Int, *big.Int, error)
- func (c *Client) InitializeRound() (<-chan types.Receipt, <-chan error)
- func (c *Client) IsActiveTranscoder() (bool, error)
- func (c *Client) IsAssignedTranscoder(maxPricePerSegment *big.Int) bool
- func (c *Client) IsRegisteredTranscoder() (bool, error)
- func (c *Client) Job(streamId string, transcodingOptions string, maxPricePerSegment *big.Int, ...) (<-chan types.Receipt, <-chan error)
- func (c *Client) LastRewardRound() (*big.Int, error)
- func (c *Client) RequestTokens() (<-chan types.Receipt, <-chan error)
- func (c *Client) Reward() (<-chan types.Receipt, <-chan error)
- func (c *Client) RoundInfo() (*big.Int, *big.Int, *big.Int, error)
- func (c *Client) RoundLength() (*big.Int, error)
- func (c *Client) RpcTimeout() time.Duration
- func (c *Client) SetManagers() error
- func (c *Client) SignSegmentHash(passphrase string, hash []byte) ([]byte, error)
- func (c *Client) SlashingPeriod() (*big.Int, error)
- func (c *Client) SubscribeToApproval() (chan types.Log, ethereum.Subscription, error)
- func (c *Client) SubscribeToJobEvent(ctx context.Context, logsCh chan types.Log, broadcasterAddr common.Address) (ethereum.Subscription, error)
- func (c *Client) TokenBalance() (*big.Int, error)
- func (c *Client) Transcoder(blockRewardCut *big.Int, feeShare *big.Int, pricePerSegment *big.Int) (<-chan types.Receipt, <-chan error)
- func (c *Client) TranscoderBond() (*big.Int, error)
- func (c *Client) TranscoderPendingPricingInfo() (*big.Int, *big.Int, *big.Int, error)
- func (c *Client) TranscoderPricingInfo() (*big.Int, *big.Int, *big.Int, error)
- func (c *Client) TranscoderStake() (*big.Int, error)
- func (c *Client) TranscoderStatus() (string, error)
- func (c *Client) Transfer(toAddr common.Address, amount *big.Int) (<-chan types.Receipt, <-chan error)
- func (c *Client) Unbond() (<-chan types.Receipt, <-chan error)
- func (c *Client) VerificationPeriod() (*big.Int, error)
- func (c *Client) VerificationRate() (uint64, error)
- func (c *Client) Verify(jobId *big.Int, claimId *big.Int, segmentNumber *big.Int, ...) (<-chan types.Receipt, <-chan error)
- func (c *Client) WaitForReceipt(txFunc func() (*types.Transaction, error)) (<-chan types.Receipt, <-chan error)
- func (c *Client) WithdrawBond() (<-chan types.Receipt, <-chan error)
- func (c *Client) WithdrawDeposit() (<-chan types.Receipt, <-chan error)
- type Job
- type LivepeerEthClient
- type LogMonitor
- type StubClient
- func (e *StubClient) Account() accounts.Account
- func (e *StubClient) Backend() *ethclient.Client
- func (e *StubClient) Bond(amount *big.Int, toAddr common.Address) (<-chan types.Receipt, <-chan error)
- func (e *StubClient) ClaimWork(jobId *big.Int, segmentRange [2]*big.Int, transcodeClaimsRoot [32]byte) (<-chan types.Receipt, <-chan error)
- func (e *StubClient) CurrentRoundInitialized() (bool, error)
- func (e *StubClient) DelegatorStake() (*big.Int, error)
- func (e *StubClient) DelegatorStatus() (string, error)
- func (c *StubClient) Deposit(amount *big.Int) (<-chan types.Receipt, <-chan error)
- func (e *StubClient) DistributeFees(jobId *big.Int, claimId *big.Int) (<-chan types.Receipt, <-chan error)
- func (c *StubClient) GetBlockHashByNumber(ctx context.Context, num *big.Int) (common.Hash, error)
- func (e *StubClient) GetBlockInfoByTxHash(ctx context.Context, hash common.Hash) (blkNum *big.Int, blkHash common.Hash, err error)
- func (e *StubClient) GetBondingManagerAddr() string
- func (c *StubClient) GetBroadcasterDeposit(broadcaster common.Address) (*big.Int, error)
- func (e *StubClient) GetCandidateTranscodersStats() ([]TranscoderStats, error)
- func (c *StubClient) GetClaim(jobID *big.Int, claimID *big.Int) (*Claim, error)
- func (e *StubClient) GetControllerAddr() string
- func (e *StubClient) GetFaucetAddr() string
- func (e *StubClient) GetJob(jobID *big.Int) (*Job, error)
- func (e *StubClient) GetJobsManagerAddr() string
- func (e *StubClient) GetReserveTranscodersStats() ([]TranscoderStats, error)
- func (e *StubClient) GetRoundsManagerAddr() string
- func (e *StubClient) GetTokenAddr() string
- func (e *StubClient) InitializeRound() (<-chan types.Receipt, <-chan error)
- func (e *StubClient) IsActiveTranscoder() (bool, error)
- func (c *StubClient) IsAssignedTranscoder(maxPricePerSegment *big.Int) bool
- func (c *StubClient) IsRegisteredTranscoder() (bool, error)
- func (e *StubClient) Job(streamId string, transcodingOptions string, maxPricePerSegment *big.Int, ...) (<-chan types.Receipt, <-chan error)
- func (e *StubClient) JobDetails(id *big.Int) (*big.Int, [32]byte, *big.Int, common.Address, common.Address, *big.Int, error)
- func (e *StubClient) LastRewardRound() (*big.Int, error)
- func (e *StubClient) RequestTokens() (<-chan types.Receipt, <-chan error)
- func (e *StubClient) Reward() (<-chan types.Receipt, <-chan error)
- func (e *StubClient) RoundInfo() (*big.Int, *big.Int, *big.Int, error)
- func (c *StubClient) RpcTimeout() time.Duration
- func (e *StubClient) SignSegmentHash(passphrase string, hash []byte) ([]byte, error)
- func (e *StubClient) SlashingPeriod() (*big.Int, error)
- func (e *StubClient) SubscribeToJobEvent(ctx context.Context, logsCh chan types.Log, broadcasterAddr common.Address) (ethereum.Subscription, error)
- func (e *StubClient) TokenBalance() (*big.Int, error)
- func (e *StubClient) Transcoder(blockRewardCut *big.Int, feeShare *big.Int, pricePerSegment *big.Int) (<-chan types.Receipt, <-chan error)
- func (c *StubClient) TranscoderBond() (*big.Int, error)
- func (e *StubClient) TranscoderPendingPricingInfo() (*big.Int, *big.Int, *big.Int, error)
- func (e *StubClient) TranscoderPricingInfo() (*big.Int, *big.Int, *big.Int, error)
- func (e *StubClient) TranscoderStake() (*big.Int, error)
- func (e *StubClient) TranscoderStatus() (string, error)
- func (e *StubClient) Transfer(toAddr common.Address, amount *big.Int) (<-chan types.Receipt, <-chan error)
- func (e *StubClient) Unbond() (<-chan types.Receipt, <-chan error)
- func (e *StubClient) ValidRewardTimeWindow() (bool, error)
- func (e *StubClient) VerificationPeriod() (*big.Int, error)
- func (e *StubClient) VerificationRate() (uint64, error)
- func (e *StubClient) Verify(jobId *big.Int, claimId *big.Int, segmentNumber *big.Int, ...) (<-chan types.Receipt, <-chan error)
- func (e *StubClient) WaitUntilNextRound() error
- func (e *StubClient) WatchEvent(logsCh <-chan types.Log) (types.Log, error)
- func (e *StubClient) WithdrawBond() (<-chan types.Receipt, <-chan error)
- func (c *StubClient) WithdrawDeposit() (<-chan types.Receipt, <-chan error)
- type StubSubscription
- type TranscoderStats
Constants ¶
This section is empty.
Variables ¶
View Source
var ProtocolBlockPerRound = big.NewInt(20)
View Source
var ProtocolCyclesPerRound = 2
Functions ¶
func CheckRoundAndInit ¶
func CheckRoundAndInit(client LivepeerEthClient) error
func IsNullAddress ¶
func ParseNewJobLog ¶
func WaitForMinedTx ¶
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) ApproveAndTransact ¶
func (*Client) BatchDistributeFees ¶
func (*Client) CurrentRoundInitialized ¶
func (*Client) DelegatorStatus ¶
func (*Client) DistributeFees ¶
func (*Client) GetBlockHashByNumber ¶
func (*Client) GetBlockInfoByTxHash ¶
func (*Client) GetBondingManagerAddr ¶
func (*Client) GetBroadcasterDeposit ¶
func (*Client) GetCandidateTranscodersStats ¶
func (c *Client) GetCandidateTranscodersStats() ([]TranscoderStats, error)
func (*Client) GetControllerAddr ¶
func (*Client) GetFaucetAddr ¶
func (*Client) GetJobsManagerAddr ¶
func (*Client) GetReceipt ¶
func (*Client) GetRoundsManagerAddr ¶
func (*Client) GetTokenAddr ¶
func (*Client) GetTranscoderPendingPricingInfo ¶
func (*Client) GetTranscoderPricingInfo ¶
func (*Client) InitializeRound ¶
func (*Client) IsActiveTranscoder ¶
func (*Client) IsAssignedTranscoder ¶
func (*Client) IsRegisteredTranscoder ¶
func (*Client) RequestTokens ¶
func (*Client) RoundInfo ¶
RoundInfo returns the current round, start block of current round and current block of the protocol
func (*Client) RpcTimeout ¶
func (*Client) SetManagers ¶
func (*Client) SignSegmentHash ¶
func (*Client) SubscribeToApproval ¶
func (*Client) SubscribeToJobEvent ¶
func (*Client) Transcoder ¶
func (*Client) TranscoderPendingPricingInfo ¶
func (*Client) TranscoderPricingInfo ¶
func (*Client) TranscoderStatus ¶
func (*Client) VerificationRate ¶
func (*Client) WaitForReceipt ¶
type LivepeerEthClient ¶
type LivepeerEthClient interface {
Backend() *ethclient.Client
Account() accounts.Account
RpcTimeout() time.Duration
SubscribeToJobEvent(ctx context.Context, logsCh chan types.Log, broadcasterAddr common.Address) (ethereum.Subscription, error)
RoundInfo() (*big.Int, *big.Int, *big.Int, error)
InitializeRound() (<-chan types.Receipt, <-chan error)
Transcoder(blockRewardCut *big.Int, feeShare *big.Int, pricePerSegment *big.Int) (<-chan types.Receipt, <-chan error)
Bond(amount *big.Int, toAddr common.Address) (<-chan types.Receipt, <-chan error)
Unbond() (<-chan types.Receipt, <-chan error)
WithdrawBond() (<-chan types.Receipt, <-chan error)
Reward() (<-chan types.Receipt, <-chan error)
Deposit(amount *big.Int) (<-chan types.Receipt, <-chan error)
GetBroadcasterDeposit(broadcaster common.Address) (*big.Int, error)
WithdrawDeposit() (<-chan types.Receipt, <-chan error)
Job(streamId string, transcodingOptions string, maxPricePerSegment *big.Int, endBlock *big.Int) (<-chan types.Receipt, <-chan error)
ClaimWork(jobId *big.Int, segmentRange [2]*big.Int, claimRoot [32]byte) (<-chan types.Receipt, <-chan error)
Verify(jobId *big.Int, claimId *big.Int, segmentNumber *big.Int, dataStorageHash string, dataHashes [2][32]byte, broadcasterSig []byte, proof []byte) (<-chan types.Receipt, <-chan error)
DistributeFees(jobId *big.Int, claimId *big.Int) (<-chan types.Receipt, <-chan error)
Transfer(toAddr common.Address, amount *big.Int) (<-chan types.Receipt, <-chan error)
RequestTokens() (<-chan types.Receipt, <-chan error)
CurrentRoundInitialized() (bool, error)
IsActiveTranscoder() (bool, error)
TranscoderStatus() (string, error)
TranscoderStake() (*big.Int, error)
TranscoderPendingPricingInfo() (*big.Int, *big.Int, *big.Int, error)
TranscoderPricingInfo() (*big.Int, *big.Int, *big.Int, error)
DelegatorStatus() (string, error)
DelegatorStake() (*big.Int, error)
TokenBalance() (*big.Int, error)
GetJob(jobID *big.Int) (*Job, error)
GetClaim(jobID *big.Int, claimID *big.Int) (*Claim, error)
VerificationRate() (uint64, error)
VerificationPeriod() (*big.Int, error)
SlashingPeriod() (*big.Int, error)
LastRewardRound() (*big.Int, error)
IsRegisteredTranscoder() (bool, error)
TranscoderBond() (*big.Int, error)
GetCandidateTranscodersStats() ([]TranscoderStats, error)
GetControllerAddr() string
GetTokenAddr() string
GetFaucetAddr() string
GetBondingManagerAddr() string
GetJobsManagerAddr() string
GetRoundsManagerAddr() string
GetBlockInfoByTxHash(ctx context.Context, hash common.Hash) (blkNum *big.Int, blkHash common.Hash, err error)
GetBlockHashByNumber(ctx context.Context, num *big.Int) (common.Hash, error)
IsAssignedTranscoder(maxPricePerSegment *big.Int) bool
}
type LogMonitor ¶
type LogMonitor struct {
// contains filtered or unexported fields
}
func NewLogMonitor ¶
func NewLogMonitor(eth LivepeerEthClient, broadcasterAddr common.Address) *LogMonitor
func (*LogMonitor) SubscribeToJobEvents ¶
func (m *LogMonitor) SubscribeToJobEvents(callback func(j *Job))
type StubClient ¶
type StubClient struct {
StrmID string
TOpts string
MaxPrice *big.Int
Jid *big.Int
SegSeqNum *big.Int
VeriRate uint64
DStorageHash string
DHash [32]byte
TDHash [32]byte
BSig []byte
Proof []byte
VerifyCounter int
ClaimJid []*big.Int
ClaimStart []*big.Int
ClaimEnd []*big.Int
ClaimRoot map[[32]byte]bool
ClaimCounter int
SubLogsCh chan types.Log
JobsMap map[string]*Job
BlockNum *big.Int
BlockHashToReturn common.Hash
}
func (*StubClient) Account ¶
func (e *StubClient) Account() accounts.Account
func (*StubClient) Backend ¶
func (e *StubClient) Backend() *ethclient.Client
func (*StubClient) CurrentRoundInitialized ¶
func (e *StubClient) CurrentRoundInitialized() (bool, error)
func (*StubClient) DelegatorStake ¶
func (e *StubClient) DelegatorStake() (*big.Int, error)
func (*StubClient) DelegatorStatus ¶
func (e *StubClient) DelegatorStatus() (string, error)
func (*StubClient) DistributeFees ¶
func (*StubClient) GetBlockHashByNumber ¶
func (*StubClient) GetBlockInfoByTxHash ¶
func (*StubClient) GetBondingManagerAddr ¶
func (e *StubClient) GetBondingManagerAddr() string
func (*StubClient) GetBroadcasterDeposit ¶
func (*StubClient) GetCandidateTranscodersStats ¶
func (e *StubClient) GetCandidateTranscodersStats() ([]TranscoderStats, error)
func (*StubClient) GetControllerAddr ¶
func (e *StubClient) GetControllerAddr() string
func (*StubClient) GetFaucetAddr ¶
func (e *StubClient) GetFaucetAddr() string
func (*StubClient) GetJobsManagerAddr ¶
func (e *StubClient) GetJobsManagerAddr() string
func (*StubClient) GetReserveTranscodersStats ¶
func (e *StubClient) GetReserveTranscodersStats() ([]TranscoderStats, error)
func (*StubClient) GetRoundsManagerAddr ¶
func (e *StubClient) GetRoundsManagerAddr() string
func (*StubClient) GetTokenAddr ¶
func (e *StubClient) GetTokenAddr() string
func (*StubClient) InitializeRound ¶
func (e *StubClient) InitializeRound() (<-chan types.Receipt, <-chan error)
func (*StubClient) IsActiveTranscoder ¶
func (e *StubClient) IsActiveTranscoder() (bool, error)
func (*StubClient) IsAssignedTranscoder ¶
func (c *StubClient) IsAssignedTranscoder(maxPricePerSegment *big.Int) bool
func (*StubClient) IsRegisteredTranscoder ¶
func (c *StubClient) IsRegisteredTranscoder() (bool, error)
func (*StubClient) JobDetails ¶
func (*StubClient) LastRewardRound ¶
func (e *StubClient) LastRewardRound() (*big.Int, error)
func (*StubClient) RequestTokens ¶
func (e *StubClient) RequestTokens() (<-chan types.Receipt, <-chan error)
func (*StubClient) RpcTimeout ¶
func (c *StubClient) RpcTimeout() time.Duration
func (*StubClient) SignSegmentHash ¶
func (e *StubClient) SignSegmentHash(passphrase string, hash []byte) ([]byte, error)
func (*StubClient) SlashingPeriod ¶
func (e *StubClient) SlashingPeriod() (*big.Int, error)
func (*StubClient) SubscribeToJobEvent ¶
func (e *StubClient) SubscribeToJobEvent(ctx context.Context, logsCh chan types.Log, broadcasterAddr common.Address) (ethereum.Subscription, error)
func (*StubClient) TokenBalance ¶
func (e *StubClient) TokenBalance() (*big.Int, error)
func (*StubClient) Transcoder ¶
func (*StubClient) TranscoderBond ¶
func (c *StubClient) TranscoderBond() (*big.Int, error)
func (*StubClient) TranscoderPendingPricingInfo ¶
func (*StubClient) TranscoderPricingInfo ¶
func (*StubClient) TranscoderStake ¶
func (e *StubClient) TranscoderStake() (*big.Int, error)
func (*StubClient) TranscoderStatus ¶
func (e *StubClient) TranscoderStatus() (string, error)
func (*StubClient) ValidRewardTimeWindow ¶
func (e *StubClient) ValidRewardTimeWindow() (bool, error)
func (*StubClient) VerificationPeriod ¶
func (e *StubClient) VerificationPeriod() (*big.Int, error)
func (*StubClient) VerificationRate ¶
func (e *StubClient) VerificationRate() (uint64, error)
func (*StubClient) WaitUntilNextRound ¶
func (e *StubClient) WaitUntilNextRound() error
func (*StubClient) WatchEvent ¶
func (*StubClient) WithdrawBond ¶
func (e *StubClient) WithdrawBond() (<-chan types.Receipt, <-chan error)
func (*StubClient) WithdrawDeposit ¶
func (c *StubClient) WithdrawDeposit() (<-chan types.Receipt, <-chan error)
type StubSubscription ¶
type StubSubscription struct{}
func (*StubSubscription) Err ¶
func (s *StubSubscription) Err() <-chan error
func (*StubSubscription) Unsubscribe ¶
func (s *StubSubscription) Unsubscribe()
Click to show internal directories.
Click to hide internal directories.