Documentation
¶
Index ¶
- type AddrLocker
- type Backend
- func (b *Backend) APIs() []rpc.API
- func (b *Backend) AccumulateRewards(strategy *emtTypes.Strategy)
- func (b *Backend) AddNonce(addr common.Address)
- func (b *Backend) BroadcastTxCommit(tx *ethTypes.Transaction) (*ctypes.ResultBroadcastTxCommit, error)
- func (b *Backend) BroadcastTxSync(tx *ethTypes.Transaction) (*ctypes.ResultBroadcastTx, error)
- func (b *Backend) Commit(receiver common.Address) (common.Hash, error)
- func (b *Backend) Config() *eth.Config
- func (b *Backend) DeliverTx(tx *ethTypes.Transaction) abciTypes.ResponseDeliverTx
- func (b *Backend) EndBlock()
- func (b *Backend) Ethereum() *eth.Ethereum
- func (b *Backend) GasLimit() big.Int
- func (b *Backend) InitEthState(receiver common.Address) error
- func (b *Backend) ManagedState() *state.ManagedState
- func (b *Backend) Protocols() []p2p.Protocol
- func (b *Backend) ResetState() (*state.ManagedState, error)
- func (b *Backend) SetTMNode(tmNode *tmn.Node)
- func (b *Backend) Start(_ *p2p.Server) error
- func (b *Backend) Stop() error
- func (b *Backend) UpdateHeaderWithTimeInfo(tmHeader *abciTypes.Header)
- type CmtRPCService
- func (s *CmtRPCService) DeclareCandidacy(args DeclareCandidacyArgs) (*ctypes.ResultBroadcastTxCommit, error)
- func (s *CmtRPCService) Delegate(args DelegateArgs) (*ctypes.ResultBroadcastTxCommit, error)
- func (s *CmtRPCService) Propose(args GovernanceProposalArgs) (*ctypes.ResultBroadcastTxCommit, error)
- func (s *CmtRPCService) QueryDelegator(address common.Address, height uint64) (*StakeQueryResult, error)
- func (s *CmtRPCService) QueryProposals() (*StakeQueryResult, error)
- func (s *CmtRPCService) QueryValidator(address common.Address, height uint64) (*StakeQueryResult, error)
- func (s *CmtRPCService) QueryValidators(height uint64) (*StakeQueryResult, error)
- func (s *CmtRPCService) SendRawTransaction(encodedTx hexutil.Bytes) (string, error)
- func (s *CmtRPCService) SendRawTx(encodedTx hexutil.Bytes) (*ctypes.ResultBroadcastTxCommit, error)
- func (s *CmtRPCService) SendTransaction(args SendTxArgs) (common.Hash, error)
- func (s *CmtRPCService) UpdateCandidacy(args UpdateCandidacyArgs) (*ctypes.ResultBroadcastTxCommit, error)
- func (s *CmtRPCService) VerifyCandidacy(args VerifyCandidacyArgs) (*ctypes.ResultBroadcastTxCommit, error)
- func (s *CmtRPCService) Vote(args GovernanceVoteArgs) (*ctypes.ResultBroadcastTxCommit, error)
- func (s *CmtRPCService) Withdraw(args WithdrawArgs) (*ctypes.ResultBroadcastTxCommit, error)
- func (s *CmtRPCService) WithdrawCandidacy(args WithdrawCandidacyArgs) (*ctypes.ResultBroadcastTxCommit, error)
- type DeclareCandidacyArgs
- type DelegateArgs
- type GovernanceProposalArgs
- type GovernanceVoteArgs
- type NetRPCService
- type NullBlockProcessor
- type SendTxArgs
- type StakeQueryResult
- type UpdateCandidacyArgs
- type VerifyCandidacyArgs
- type WithdrawArgs
- type WithdrawCandidacyArgs
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AddrLocker ¶
type AddrLocker struct {
// contains filtered or unexported fields
}
func (*AddrLocker) LockAddr ¶
func (l *AddrLocker) LockAddr(address common.Address)
LockAddr locks an account's mutex. This is used to prevent another tx getting the same nonce until the lock is released. The mutex prevents the (an identical nonce) from being read again during the time that the first transaction is being signed.
func (*AddrLocker) UnlockAddr ¶
func (l *AddrLocker) UnlockAddr(address common.Address)
UnlockAddr unlocks the mutex of the given account.
type Backend ¶
type Backend struct {
// contains filtered or unexported fields
}
Backend handles the chain database and VM #stable - 0.4.0
func NewBackend ¶
func NewBackend(ctx *node.ServiceContext, ethConfig *eth.Config, client *rpcClient.HTTP) (*Backend, error)
NewBackend creates a new Backend #stable - 0.4.0
func (*Backend) APIs ¶
APIs returns the collection of RPC services the ethereum package offers. #stable - 0.4.0
func (*Backend) AccumulateRewards ¶
AccumulateRewards accumulates the rewards based on the given strategy #unstable
func (*Backend) BroadcastTxCommit ¶
func (b *Backend) BroadcastTxCommit(tx *ethTypes.Transaction) (*ctypes.ResultBroadcastTxCommit, error)
func (*Backend) BroadcastTxSync ¶
func (b *Backend) BroadcastTxSync(tx *ethTypes.Transaction) (*ctypes.ResultBroadcastTx, error)
BroadcastTx broadcasts a transaction to tendermint core #unstable
func (*Backend) DeliverTx ¶
func (b *Backend) DeliverTx(tx *ethTypes.Transaction) abciTypes.ResponseDeliverTx
DeliverTx appends a transaction to the current block #stable
func (*Backend) InitEthState ¶
InitEthState initializes the EthState #unstable
func (*Backend) ManagedState ¶
func (b *Backend) ManagedState() *state.ManagedState
func (*Backend) Protocols ¶
Protocols implements node.Service, returning all the currently configured network protocols to start. #stable
func (*Backend) ResetState ¶
func (b *Backend) ResetState() (*state.ManagedState, error)
func (*Backend) Start ¶
Start implements node.Service, starting all internal goroutines needed by the Ethereum protocol implementation. #stable
func (*Backend) Stop ¶
Stop implements node.Service, terminating all internal goroutines used by the Ethereum protocol. #stable
func (*Backend) UpdateHeaderWithTimeInfo ¶
UpdateHeaderWithTimeInfo uses the tendermint header to update the ethereum header #unstable
type CmtRPCService ¶
type CmtRPCService struct {
// contains filtered or unexported fields
}
CmtRPCService offers cmt related RPC methods
func NewCmtRPCService ¶
func NewCmtRPCService(b *Backend, nonceLock *AddrLocker) *CmtRPCService
func (*CmtRPCService) DeclareCandidacy ¶
func (s *CmtRPCService) DeclareCandidacy(args DeclareCandidacyArgs) (*ctypes.ResultBroadcastTxCommit, error)
func (*CmtRPCService) Delegate ¶
func (s *CmtRPCService) Delegate(args DelegateArgs) (*ctypes.ResultBroadcastTxCommit, error)
func (*CmtRPCService) Propose ¶
func (s *CmtRPCService) Propose(args GovernanceProposalArgs) (*ctypes.ResultBroadcastTxCommit, error)
func (*CmtRPCService) QueryDelegator ¶
func (s *CmtRPCService) QueryDelegator(address common.Address, height uint64) (*StakeQueryResult, error)
func (*CmtRPCService) QueryProposals ¶
func (s *CmtRPCService) QueryProposals() (*StakeQueryResult, error)
func (*CmtRPCService) QueryValidator ¶
func (s *CmtRPCService) QueryValidator(address common.Address, height uint64) (*StakeQueryResult, error)
func (*CmtRPCService) QueryValidators ¶
func (s *CmtRPCService) QueryValidators(height uint64) (*StakeQueryResult, error)
func (*CmtRPCService) SendRawTransaction ¶
func (s *CmtRPCService) SendRawTransaction(encodedTx hexutil.Bytes) (string, error)
SendRawTransaction will broadcast the signed transaction to tendermint. The sender is responsible for signing the transaction and using the correct nonce.
func (*CmtRPCService) SendRawTx ¶
func (s *CmtRPCService) SendRawTx(encodedTx hexutil.Bytes) (*ctypes.ResultBroadcastTxCommit, error)
func (*CmtRPCService) SendTransaction ¶
func (s *CmtRPCService) SendTransaction(args SendTxArgs) (common.Hash, error)
SendTransaction creates a transaction for the given argument, sign it and broardcast it to tendermint.
func (*CmtRPCService) UpdateCandidacy ¶
func (s *CmtRPCService) UpdateCandidacy(args UpdateCandidacyArgs) (*ctypes.ResultBroadcastTxCommit, error)
func (*CmtRPCService) VerifyCandidacy ¶
func (s *CmtRPCService) VerifyCandidacy(args VerifyCandidacyArgs) (*ctypes.ResultBroadcastTxCommit, error)
func (*CmtRPCService) Vote ¶
func (s *CmtRPCService) Vote(args GovernanceVoteArgs) (*ctypes.ResultBroadcastTxCommit, error)
func (*CmtRPCService) Withdraw ¶
func (s *CmtRPCService) Withdraw(args WithdrawArgs) (*ctypes.ResultBroadcastTxCommit, error)
func (*CmtRPCService) WithdrawCandidacy ¶
func (s *CmtRPCService) WithdrawCandidacy(args WithdrawCandidacyArgs) (*ctypes.ResultBroadcastTxCommit, error)
type DeclareCandidacyArgs ¶
type DelegateArgs ¶
type GovernanceProposalArgs ¶
type GovernanceVoteArgs ¶
type NetRPCService ¶
type NetRPCService struct {
// contains filtered or unexported fields
}
NetRPCService mirrors the implementation of `internal/ethapi` #unstable
func NewNetRPCService ¶
func NewNetRPCService(networkVersion uint64) *NetRPCService
NewNetRPCService creates a new net API instance. #unstable
func (*NetRPCService) Listening ¶
func (s *NetRPCService) Listening() bool
Listening returns an indication if the node is listening for network connections. #unstable
func (*NetRPCService) PeerCount ¶
func (s *NetRPCService) PeerCount() hexutil.Uint
PeerCount returns the number of connected peers #unstable
func (*NetRPCService) Version ¶
func (s *NetRPCService) Version() string
Version returns the current ethereum protocol version. #unstable
type NullBlockProcessor ¶
type NullBlockProcessor struct{}
NullBlockProcessor does not validate anything #unstable
func (NullBlockProcessor) ValidateBody ¶
func (NullBlockProcessor) ValidateBody(*ethTypes.Block) error
ValidateBody does not validate anything #unstable
type SendTxArgs ¶
type SendTxArgs struct {
From common.Address `json:"from"`
To *common.Address `json:"to"`
Gas *hexutil.Big `json:"gas"`
GasPrice *hexutil.Big `json:"gasPrice"`
Value *hexutil.Big `json:"value"`
Data hexutil.Bytes `json:"data"`
Nonce *hexutil.Uint64 `json:"nonce"`
}
SendTxArgs represents the arguments to sumbit a new transaction
type StakeQueryResult ¶
type StakeQueryResult struct {
Height int64 `json:"height"`
Data interface{} `json:"data"`
}