Documentation ¶
Index ¶
- type AcceptCandidacyAccountUpdateArgs
- type ActivateCandidacyArgs
- type AddrLocker
- type Backend
- func (b *Backend) APIs() []rpc.API
- func (b *Backend) AccumulateRewards(config *params.ChainConfig, strategy *emtTypes.Strategy)
- 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) DeliverTxState() *state.StateDB
- func (b *Backend) EndBlock()
- func (b *Backend) Ethereum() *eth.Ethereum
- func (b *Backend) GasLimit() uint64
- func (b *Backend) GetLocalClient() *rpcClient.Local
- func (b *Backend) InitEthState(receiver common.Address) error
- func (b *Backend) ManagedState() *state.ManagedState
- func (b *Backend) PeerCount() int
- 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, blockHash []byte)
- type CmtRPCService
- func (s *CmtRPCService) AcceptCandidacyAccountUpdate(args AcceptCandidacyAccountUpdateArgs) (*ctypes.ResultBroadcastTxCommit, error)
- func (s *CmtRPCService) ActivateCandidacy(args ActivateCandidacyArgs) (*ctypes.ResultBroadcastTxCommit, error)
- func (s *CmtRPCService) DeactivateCandidacy(args DeactivateCandidacyArgs) (*ctypes.ResultBroadcastTxCommit, error)
- func (s *CmtRPCService) DeclareCandidacy(args DeclareCandidacyArgs) (*ctypes.ResultBroadcastTxCommit, error)
- func (s *CmtRPCService) DecodeRawTxs(rawTxs []string) ([]*RPCTransaction, error)
- func (s *CmtRPCService) Delegate(args DelegateArgs) (*ctypes.ResultBroadcastTxCommit, error)
- func (s *CmtRPCService) GetBlockByNumber(height uint64, decodeTx bool) (*ctypes.ResultBlock, error)
- func (s *CmtRPCService) GetPendingTransactions(limit int) ([]*RPCTransaction, error)
- func (s *CmtRPCService) GetTransactionByHash(hash string) (*RPCTransaction, error)
- func (s *CmtRPCService) GetTransactionFromBlock(height uint64, index uint64) (*RPCTransaction, error)
- func (s *CmtRPCService) PendingTransactionCount() (*hexutil.Uint64, error)
- func (s *CmtRPCService) ProposeChangeParam(args GovernanceChangeParamProposalArgs) (*ctypes.ResultBroadcastTxCommit, error)
- func (s *CmtRPCService) ProposeDeployLibEni(args GovernanceDeployLibEniProposalArgs) (*ctypes.ResultBroadcastTxCommit, error)
- func (s *CmtRPCService) ProposeRetireProgram(args GovernanceRetireProgramProposalArgs) (*ctypes.ResultBroadcastTxCommit, error)
- func (s *CmtRPCService) ProposeTransferFund(args GovernanceTransferFundProposalArgs) (*ctypes.ResultBroadcastTxCommit, error)
- func (s *CmtRPCService) ProposeUpgradeProgram(args GovernanceUpgradeProgramProposalArgs) (*ctypes.ResultBroadcastTxCommit, error)
- func (s *CmtRPCService) QueryAbsentValidators(height uint64) (*StakeQueryResult, error)
- func (s *CmtRPCService) QueryAwardInfos(height uint64) (*StakeQueryResult, error)
- func (s *CmtRPCService) QueryDelegator(address common.Address, height uint64) (*StakeQueryResult, error)
- func (s *CmtRPCService) QueryParams(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) SendRawTx(encodedTx hexutil.Bytes) (*ctypes.ResultBroadcastTxCommit, error)
- func (s *CmtRPCService) SetCompRate(args SetCompRateArgs) (*ctypes.ResultBroadcastTxCommit, error)
- func (s *CmtRPCService) Syncing() (*ctypes.SyncInfo, error)
- func (s *CmtRPCService) UpdateCandidacy(args UpdateCandidacyArgs) (*ctypes.ResultBroadcastTxCommit, error)
- func (s *CmtRPCService) UpdateCandidacyAccount(args UpdateCandidacyAccountArgs) (*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 DeactivateCandidacyArgs
- type DeclareCandidacyArgs
- type DelegateArgs
- type EthRPCService
- func (s *EthRPCService) GetTransactionByHash(hash common.Hash) *RPCTransaction
- func (s *EthRPCService) GetTransactionCount(address common.Address, blockNr rpc.BlockNumber) (*hexutil.Uint64, error)
- func (s *EthRPCService) SendRawTransaction(encodedTx hexutil.Bytes) (string, error)
- func (s *EthRPCService) SendTransaction(args SendTxArgs) (common.Hash, error)
- func (s *EthRPCService) SendTx(args SendTxArgs) (string, error)
- type EthUmbrella
- type GovernanceChangeParamProposalArgs
- type GovernanceDeployLibEniProposalArgs
- type GovernanceRetireProgramProposalArgs
- type GovernanceTransferFundProposalArgs
- type GovernanceUpgradeProgramProposalArgs
- type GovernanceVoteArgs
- type NetRPCService
- type NullBlockProcessor
- type PrivateAccountAPI
- type RPCTransaction
- type SendTxArgs
- type SetCompRateArgs
- type StakeQueryResult
- type UpdateCandidacyAccountArgs
- 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 ActivateCandidacyArgs ¶
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 ¶
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 ¶
func (b *Backend) AccumulateRewards(config *params.ChainConfig, strategy *emtTypes.Strategy)
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) DeliverTxState ¶
func (*Backend) GetLocalClient ¶
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
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) AcceptCandidacyAccountUpdate ¶
func (s *CmtRPCService) AcceptCandidacyAccountUpdate(args AcceptCandidacyAccountUpdateArgs) (*ctypes.ResultBroadcastTxCommit, error)
func (*CmtRPCService) ActivateCandidacy ¶
func (s *CmtRPCService) ActivateCandidacy(args ActivateCandidacyArgs) (*ctypes.ResultBroadcastTxCommit, error)
func (*CmtRPCService) DeactivateCandidacy ¶
func (s *CmtRPCService) DeactivateCandidacy(args DeactivateCandidacyArgs) (*ctypes.ResultBroadcastTxCommit, error)
func (*CmtRPCService) DeclareCandidacy ¶
func (s *CmtRPCService) DeclareCandidacy(args DeclareCandidacyArgs) (*ctypes.ResultBroadcastTxCommit, error)
func (*CmtRPCService) DecodeRawTxs ¶
func (s *CmtRPCService) DecodeRawTxs(rawTxs []string) ([]*RPCTransaction, error)
DecodeRawTxs returns the transactions from the raw tx array in the block data
func (*CmtRPCService) Delegate ¶
func (s *CmtRPCService) Delegate(args DelegateArgs) (*ctypes.ResultBroadcastTxCommit, error)
func (*CmtRPCService) GetBlockByNumber ¶
func (s *CmtRPCService) GetBlockByNumber(height uint64, decodeTx bool) (*ctypes.ResultBlock, error)
GetBlockByNumber returns the requested block by height.
func (*CmtRPCService) GetPendingTransactions ¶
func (s *CmtRPCService) GetPendingTransactions(limit int) ([]*RPCTransaction, error)
Get unconfirmed transactions in the mempool(limit default=30, max=100).
func (*CmtRPCService) GetTransactionByHash ¶
func (s *CmtRPCService) GetTransactionByHash(hash string) (*RPCTransaction, error)
GetTransactionByHash returns the transaction for the given hash
func (*CmtRPCService) GetTransactionFromBlock ¶
func (s *CmtRPCService) GetTransactionFromBlock(height uint64, index uint64) (*RPCTransaction, error)
GetTransactionFromBlock returns the transaction for the given block number and index.
func (*CmtRPCService) PendingTransactionCount ¶
func (s *CmtRPCService) PendingTransactionCount() (*hexutil.Uint64, error)
Get number of unconfirmed transactions in the mempool.
func (*CmtRPCService) ProposeChangeParam ¶
func (s *CmtRPCService) ProposeChangeParam(args GovernanceChangeParamProposalArgs) (*ctypes.ResultBroadcastTxCommit, error)
func (*CmtRPCService) ProposeDeployLibEni ¶
func (s *CmtRPCService) ProposeDeployLibEni(args GovernanceDeployLibEniProposalArgs) (*ctypes.ResultBroadcastTxCommit, error)
func (*CmtRPCService) ProposeRetireProgram ¶
func (s *CmtRPCService) ProposeRetireProgram(args GovernanceRetireProgramProposalArgs) (*ctypes.ResultBroadcastTxCommit, error)
func (*CmtRPCService) ProposeTransferFund ¶
func (s *CmtRPCService) ProposeTransferFund(args GovernanceTransferFundProposalArgs) (*ctypes.ResultBroadcastTxCommit, error)
func (*CmtRPCService) ProposeUpgradeProgram ¶
func (s *CmtRPCService) ProposeUpgradeProgram(args GovernanceUpgradeProgramProposalArgs) (*ctypes.ResultBroadcastTxCommit, error)
func (*CmtRPCService) QueryAbsentValidators ¶
func (s *CmtRPCService) QueryAbsentValidators(height uint64) (*StakeQueryResult, error)
func (*CmtRPCService) QueryAwardInfos ¶
func (s *CmtRPCService) QueryAwardInfos(height uint64) (*StakeQueryResult, error)
func (*CmtRPCService) QueryDelegator ¶
func (s *CmtRPCService) QueryDelegator(address common.Address, height uint64) (*StakeQueryResult, error)
func (*CmtRPCService) QueryParams ¶
func (s *CmtRPCService) QueryParams(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) SendRawTx ¶
func (s *CmtRPCService) SendRawTx(encodedTx hexutil.Bytes) (*ctypes.ResultBroadcastTxCommit, error)
SendRawTx will broadcast the signed transaction to tendermint. The sender is responsible for signing the transaction and using the correct nonce.
func (*CmtRPCService) SetCompRate ¶
func (s *CmtRPCService) SetCompRate(args SetCompRateArgs) (*ctypes.ResultBroadcastTxCommit, error)
func (*CmtRPCService) Syncing ¶
func (s *CmtRPCService) Syncing() (*ctypes.SyncInfo, error)
Info about the node's syncing state
func (*CmtRPCService) UpdateCandidacy ¶
func (s *CmtRPCService) UpdateCandidacy(args UpdateCandidacyArgs) (*ctypes.ResultBroadcastTxCommit, error)
func (*CmtRPCService) UpdateCandidacyAccount ¶
func (s *CmtRPCService) UpdateCandidacyAccount(args UpdateCandidacyAccountArgs) (*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 DeactivateCandidacyArgs ¶
type DeclareCandidacyArgs ¶
type DelegateArgs ¶
type EthRPCService ¶
type EthRPCService struct {
// contains filtered or unexported fields
}
CmtRPCService offers cmt related RPC methods
func NewEthRPCService ¶
func NewEthRPCService(b *Backend, nonceLock *AddrLocker) *EthRPCService
func (*EthRPCService) GetTransactionByHash ¶
func (s *EthRPCService) GetTransactionByHash(hash common.Hash) *RPCTransaction
GetTransactionByHash returns the transaction for the given hash
func (*EthRPCService) GetTransactionCount ¶
func (s *EthRPCService) GetTransactionCount(address common.Address, blockNr rpc.BlockNumber) (*hexutil.Uint64, error)
GetTransactionCount returns the number of transactions sent from the given address. blockNr is useless, be compatible with eth call
func (*EthRPCService) SendRawTransaction ¶
func (s *EthRPCService) 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 (*EthRPCService) SendTransaction ¶
func (s *EthRPCService) SendTransaction(args SendTxArgs) (common.Hash, error)
SendTransaction is compatible with Ethereum, return eth transaction hash
func (*EthRPCService) SendTx ¶
func (s *EthRPCService) SendTx(args SendTxArgs) (string, error)
SendTx is same as SendTransaction, but return cmt transaction hash
type EthUmbrella ¶
type EthUmbrella struct { }
func (*EthUmbrella) DefaultGasPrice ¶
func (eu *EthUmbrella) DefaultGasPrice() *big.Int
func (*EthUmbrella) EmitScheduleTx ¶
func (eu *EthUmbrella) EmitScheduleTx(stx um.ScheduleTx)
func (*EthUmbrella) FreeGasLimit ¶
func (eu *EthUmbrella) FreeGasLimit() *big.Int
func (*EthUmbrella) GetDueTxs ¶
func (eu *EthUmbrella) GetDueTxs() []um.ScheduleTx
func (*EthUmbrella) GetValidators ¶
func (eu *EthUmbrella) GetValidators() []common.Address
type GovernanceChangeParamProposalArgs ¶
type GovernanceChangeParamProposalArgs struct { Nonce *hexutil.Uint64 `json:"nonce"` From common.Address `json:"from"` Name string `json:"name"` Value string `json:"value"` Reason string `json:"reason"` ExpireTimestamp *int64 `json:"expireTimestamp"` ExpireBlockHeight *int64 `json:"expireBlockHeight"` }
type GovernanceDeployLibEniProposalArgs ¶
type GovernanceDeployLibEniProposalArgs struct { Nonce *hexutil.Uint64 `json:"nonce"` From common.Address `json:"from"` Name string `json:"name"` Version string `json:"version"` FileUrl string `json:"fileUrl"` Md5 string `json:"md5"` Reason string `json:"reason"` DeployTimestamp *int64 `json:"deployTimestamp"` DeployBlockHeight *int64 `json:"deployBlockHeight"` }
type GovernanceTransferFundProposalArgs ¶
type GovernanceTransferFundProposalArgs struct { Nonce *hexutil.Uint64 `json:"nonce"` From common.Address `json:"from"` TransferFrom common.Address `json:"transferFrom"` TransferTo common.Address `json:"transferTo"` Amount hexutil.Big `json:"amount"` Reason string `json:"reason"` ExpireTimestamp *int64 `json:"expireTimestamp"` ExpireBlockHeight *int64 `json:"expireBlockHeight"` }
type GovernanceUpgradeProgramProposalArgs ¶
type GovernanceUpgradeProgramProposalArgs struct { Nonce *hexutil.Uint64 `json:"nonce"` From common.Address `json:"from"` Name string `json:"name"` Version string `json:"version"` FileUrl string `json:"fileUrl"` Md5 string `json:"md5"` Reason string `json:"reason"` UpgradeBlockHeight *int64 `json:"upgradeBlockHeight"` }
type GovernanceVoteArgs ¶
type NetRPCService ¶
type NetRPCService struct {
// contains filtered or unexported fields
}
NetRPCService mirrors the implementation of `internal/ethapi` #unstable
func NewNetRPCService ¶
func NewNetRPCService(b *Backend) *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
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 PrivateAccountAPI ¶
type PrivateAccountAPI struct {
// contains filtered or unexported fields
}
PrivateAccountAPI provides an API to access accounts managed by this node. It offers methods to create, (un)lock en list accounts. Some methods accept passwords and are therefore considered private by default.
func NewPrivateAccountAPI ¶
func NewPrivateAccountAPI(b *Backend, nonceLock *AddrLocker) *PrivateAccountAPI
NewPrivateAccountAPI create a new PrivateAccountAPI.
func (*PrivateAccountAPI) SendTransaction ¶
func (s *PrivateAccountAPI) SendTransaction(args SendTxArgs, passwd string) (common.Hash, error)
SendTransaction is compatible with Ethereum, return eth transaction hash. It will create a transaction from the given arguments and try to sign it with the key associated with args.From. If the given passwd isn't able to decrypt the key it fails.
type RPCTransaction ¶
type RPCTransaction struct { BlockNumber *hexutil.Big `json:"blockNumber"` From common.Address `json:"from"` Gas hexutil.Uint64 `json:"gas"` GasPrice *hexutil.Big `json:"gasPrice"` Hash common.Hash `json:"hash"` CmtHash tmcmn.HexBytes `json:"cmtHash"` Input hexutil.Bytes `json:"input"` CmtInput interface{} `json:"cmtInput"` Nonce hexutil.Uint64 `json:"nonce"` To *common.Address `json:"to"` TransactionIndex hexutil.Uint `json:"transactionIndex"` Value *hexutil.Big `json:"value"` V *hexutil.Big `json:"v"` R *hexutil.Big `json:"r"` S *hexutil.Big `json:"s"` TxResult abci.ResponseDeliverTx `json:"txResult"` }
RPCTransaction represents a transaction that will serialize to the RPC representation of a transaction
type SendTxArgs ¶
type SendTxArgs struct { From common.Address `json:"from"` To *common.Address `json:"to"` Gas *hexutil.Uint64 `json:"gas"` GasPrice *hexutil.Big `json:"gasPrice"` Value *hexutil.Big `json:"value"` Nonce *hexutil.Uint64 `json:"nonce"` // We accept "data" and "input" for backwards-compatibility reasons. "input" is the // newer name and should be preferred by clients. Data *hexutil.Bytes `json:"data"` Input *hexutil.Bytes `json:"input"` }
SendTxArgs represents the arguments to sumbit a new transaction
type SetCompRateArgs ¶
type StakeQueryResult ¶
type StakeQueryResult struct { Height int64 `json:"height"` Data interface{} `json:"data"` }