Documentation ¶
Index ¶
- Constants
- type AuditRelaysRequest
- type GetEthAddrResponse
- type IClient
- type IRelay
- type RelayParams
- type RelayServer
- func (relay *RelayServer) Address() (relayAddress common.Address)
- func (relay *RelayServer) Balance() (balance *big.Int, err error)
- func (relay *RelayServer) ChainID() (chainID *big.Int, err error)
- func (relay *RelayServer) Close() (err error)
- func (relay *RelayServer) CreateRelayTransaction(request RelayTransactionRequest) (signedTx *types.Transaction, err error)
- func (relay *RelayServer) GasPrice() big.Int
- func (relay *RelayServer) GetPort() string
- func (relay *RelayServer) GetUrl() string
- func (relay *RelayServer) HubAddress() common.Address
- func (relay *RelayServer) IsRemoved() (removed bool, err error)
- func (relay *RelayServer) IsStaked() (staked bool, err error)
- func (relay *RelayServer) IsUnstaked() (removed bool, err error)
- func (relay *RelayServer) RefreshGasPrice() (err error)
- func (relay *RelayServer) RegisterRelay() (err error)
- func (relay *RelayServer) RegistrationDate() (when int64, err error)
- func (relay *RelayServer) RemoveRelay(ownerKey *ecdsa.PrivateKey) (err error)
- func (relay *RelayServer) SendBalanceToOwner() (err error)
- func (relay *RelayServer) UpdateUnconfirmedTransactions() (newTx *types.Transaction, err error)
- type RelayTransactionRequest
- type RelayTransactionResponse
- type SetHubRequest
- type TbkClient
Constants ¶
View Source
const TxReceiptTimeout = 60 * time.Second
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AuditRelaysRequest ¶
type AuditRelaysRequest struct {
SignedTx string
}
type GetEthAddrResponse ¶
type IClient ¶
type IClient interface { bind.ContractBackend ethereum.TransactionReader NetworkID(ctx context.Context) (*big.Int, error) //From: ChainReader BlockByNumber(ctx context.Context, number *big.Int) (*types.Block, error) HeaderByNumber(ctx context.Context, number *big.Int) (*types.Header, error) // From: ChainStateReader, minus CodeAt BalanceAt(ctx context.Context, account common.Address, blockNumber *big.Int) (*big.Int, error) StorageAt(ctx context.Context, account common.Address, key common.Hash, blockNumber *big.Int) ([]byte, error) NonceAt(ctx context.Context, account common.Address, blockNumber *big.Int) (uint64, error) }
type IRelay ¶
type IRelay interface { Balance() (balance *big.Int, err error) GasPrice() big.Int RefreshGasPrice() (err error) RegisterRelay() (err error) IsStaked() (staked bool, err error) IsUnstaked() (removed bool, err error) RegistrationDate() (when int64, err error) IsRemoved() (removed bool, err error) SendBalanceToOwner() (err error) CreateRelayTransaction(request RelayTransactionRequest) (signedTx *types.Transaction, err error) Address() (relayAddress common.Address) HubAddress() common.Address GetUrl() string GetPort() string UpdateUnconfirmedTransactions() (newTx *types.Transaction, err error) Close() (err error) // contains filtered or unexported methods }
type RelayParams ¶
type RelayParams struct { RelayServer DBFile string }
type RelayServer ¶
type RelayServer struct { OwnerAddress common.Address Fee *big.Int Url string Port string RelayHubAddress common.Address StakeAmount *big.Int GasLimit uint64 DefaultGasPrice int64 GasPricePercent *big.Int PrivateKey *ecdsa.PrivateKey UnstakeDelay *big.Int RegistrationBlockRate uint64 EthereumNodeURL string Client IClient TxStore txstore.ITxStore DevMode bool // contains filtered or unexported fields }
func NewRelayServer ¶
func NewRelayServer( OwnerAddress common.Address, Fee *big.Int, Url string, Port string, RelayHubAddress common.Address, StakeAmount *big.Int, GasLimit uint64, DefaultGasPrice int64, GasPricePercent *big.Int, PrivateKey *ecdsa.PrivateKey, UnstakeDelay *big.Int, RegistrationBlockRate uint64, EthereumNodeURL string, Client IClient, TxStore txstore.ITxStore, clk clock.Clock, DevMode bool) (*RelayServer, error)
func (*RelayServer) Address ¶
func (relay *RelayServer) Address() (relayAddress common.Address)
func (*RelayServer) Close ¶
func (relay *RelayServer) Close() (err error)
func (*RelayServer) CreateRelayTransaction ¶
func (relay *RelayServer) CreateRelayTransaction(request RelayTransactionRequest) (signedTx *types.Transaction, err error)
func (*RelayServer) GasPrice ¶
func (relay *RelayServer) GasPrice() big.Int
func (*RelayServer) GetPort ¶
func (relay *RelayServer) GetPort() string
func (*RelayServer) GetUrl ¶
func (relay *RelayServer) GetUrl() string
func (*RelayServer) HubAddress ¶
func (relay *RelayServer) HubAddress() common.Address
func (*RelayServer) IsRemoved ¶
func (relay *RelayServer) IsRemoved() (removed bool, err error)
func (*RelayServer) IsStaked ¶
func (relay *RelayServer) IsStaked() (staked bool, err error)
func (*RelayServer) IsUnstaked ¶
func (relay *RelayServer) IsUnstaked() (removed bool, err error)
func (*RelayServer) RefreshGasPrice ¶
func (relay *RelayServer) RefreshGasPrice() (err error)
func (*RelayServer) RegisterRelay ¶
func (relay *RelayServer) RegisterRelay() (err error)
func (*RelayServer) RegistrationDate ¶
func (relay *RelayServer) RegistrationDate() (when int64, err error)
func (*RelayServer) RemoveRelay ¶
func (relay *RelayServer) RemoveRelay(ownerKey *ecdsa.PrivateKey) (err error)
func (*RelayServer) SendBalanceToOwner ¶
func (relay *RelayServer) SendBalanceToOwner() (err error)
func (*RelayServer) UpdateUnconfirmedTransactions ¶
func (relay *RelayServer) UpdateUnconfirmedTransactions() (newTx *types.Transaction, err error)
type RelayTransactionRequest ¶
type RelayTransactionResponse ¶
type RelayTransactionResponse struct { SignedTx *types.Transaction RawTxBytes []byte }
func (*RelayTransactionResponse) MarshalJSON ¶
func (response *RelayTransactionResponse) MarshalJSON() ([]byte, error)
type SetHubRequest ¶
type TbkClient ¶
We hook ethclient since EstimateGas returns inaccurate estimation, due to state differences * of executing a tx locally through eth_call vs on the blockchain ( msg.sender.balance for example)
func (*TbkClient) EstimateGas ¶
Click to show internal directories.
Click to hide internal directories.