Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrSubscriptionNotSupported = errors.New("block subscription not supported")
ErrSubscriptionNotSupported return from BlockListener subscription if client doesn't support streaming (in-mem simulation)
Functions ¶
This section is empty.
Types ¶
type EthClient ¶
type EthClient interface { BlockNumber() (uint64, error) // retrieves the number of the head block BlockByHash(id gethcommon.Hash) (*types.Block, error) // retrieves a block given a hash BlockByNumber(n *big.Int) (*types.Block, error) // retrieves a block given a number - returns head block if n is nil SendTransaction(signedTx *types.Transaction) error // issues an ethereum transaction (expects signed tx) TransactionReceipt(hash gethcommon.Hash) (*types.Receipt, error) // fetches the ethereum transaction receipt Nonce(address gethcommon.Address) (uint64, error) // fetches the account nonce to use in the next transaction BalanceAt(account gethcommon.Address, blockNumber *big.Int) (*big.Int, error) // fetches the balance of the account GetLogs(q ethereum.FilterQuery) ([]types.Log, error) // fetches the logs for a given query Info() Info // retrieves the node Info FetchHeadBlock() (*types.Block, error) // retrieves the block at head height BlocksBetween(block *types.Block, head *types.Block) []*types.Block // returns the blocks between two blocks IsBlockAncestor(block *types.Block, proof common.L1BlockHash) bool // returns if the node considers a block the ancestor BlockListener() (chan *types.Header, ethereum.Subscription) // subscribes to new blocks and returns a listener with the blocks heads and the subscription handler CallContract(msg ethereum.CallMsg) ([]byte, error) // Runs the provided call message on the latest block. // PrepareTransactionToSend updates the tx with from address, current nonce and current estimates for the gas and the gas price PrepareTransactionToSend(txData types.TxData, from gethcommon.Address, nonce uint64) (types.TxData, error) PrepareTransactionToRetry(txData types.TxData, from gethcommon.Address, nonce uint64, retries int) (types.TxData, error) FetchLastBatchSeqNo(address gethcommon.Address) (*big.Int, error) Stop() // tries to cleanly stop the client and release any resources EthClient() *ethclient.Client // returns the underlying eth client ReconnectIfClosed() error // closes and creates a new connection Alive() bool // returns whether the connection is live or not }
EthClient defines the interface for RPC communications with the ethereum nodes todo (#1617) - some of these methods are composed calls that should be decoupled in the future (ie: BlocksBetween or IsBlockAncestor)
type Info ¶
type Info struct {
L2ID gethcommon.Address // the address of the Obscuro node this client is dedicated to
}
Info forces the RPC EthClient to return the data in the same format (independently of its implementation)
type L1DepositTx ¶
type L1DepositTx struct { Amount *big.Int // Amount to be deposited To *gethcommon.Address // Address the ERC20 Transfer was made to (always be the Management Contract Addr) Sender *gethcommon.Address // Address that issued the ERC20, the token holder or tx.origin TokenContract *gethcommon.Address // Address of the ERC20 Contract address that was executed }
type L1InitializeSecretTx ¶
type L1InitializeSecretTx struct { AggregatorID *gethcommon.Address InitialSecret []byte HostAddress string Attestation common.EncodedAttestationReport }
type L1RequestSecretTx ¶
type L1RequestSecretTx struct {
Attestation common.EncodedAttestationReport
}
type L1RespondSecretTx ¶
type L1RespondSecretTx struct { Secret []byte RequesterID gethcommon.Address AttesterID gethcommon.Address AttesterSig []byte HostAddress string }
func (*L1RespondSecretTx) Sign ¶
func (l *L1RespondSecretTx) Sign(privateKey *ecdsa.PrivateKey) *L1RespondSecretTx
Sign signs the payload with a given private key
type L1RollupTx ¶
type L1RollupTx struct {
Rollup common.EncodedRollup
}
type L1Transaction ¶
type L1Transaction interface{}
L1Transaction is an abstraction that transforms an Ethereum transaction into a format that can be consumed more easily by Obscuro.
Click to show internal directories.
Click to hide internal directories.