Documentation ¶
Index ¶
- type ChecksumFormattedObscuroNetworkConfig
- type EthereumAPI
- func (api *EthereumAPI) BlockNumber() hexutil.Uint64
- func (api *EthereumAPI) Call(_ context.Context, encryptedParams common.EncryptedParamsCall) (responses.EnclaveResponse, error)
- func (api *EthereumAPI) ChainId() (*hexutil.Big, error)
- func (api *EthereumAPI) EstimateGas(_ context.Context, encryptedParams common.EncryptedParamsEstimateGas) (responses.EnclaveResponse, error)
- func (api *EthereumAPI) FeeHistory(context.Context, []byte, rpc.BlockNumber, []float64) (*FeeHistoryResult, error)
- func (api *EthereumAPI) GasPrice(context.Context) (*hexutil.Big, error)
- func (api *EthereumAPI) GetBalance(_ context.Context, encryptedParams common.EncryptedParamsGetBalance) (responses.EnclaveResponse, error)
- func (api *EthereumAPI) GetBlockByHash(_ context.Context, hash gethcommon.Hash, _ bool) (*common.BatchHeader, error)
- func (api *EthereumAPI) GetBlockByNumber(ctx context.Context, number rpc.BlockNumber, _ bool) (*common.BatchHeader, error)
- func (api *EthereumAPI) GetCode(_ context.Context, address gethcommon.Address, ...) (hexutil.Bytes, error)
- func (api *EthereumAPI) GetStorageAt(_ context.Context, encryptedParams common.EncryptedParamsGetStorageAt) (*responses.Receipts, error)
- func (api *EthereumAPI) GetTransactionByHash(_ context.Context, encryptedParams common.EncryptedParamsGetTxByHash) (responses.EnclaveResponse, error)
- func (api *EthereumAPI) GetTransactionCount(_ context.Context, encryptedParams common.EncryptedParamsGetTxCount) (responses.EnclaveResponse, error)
- func (api *EthereumAPI) GetTransactionReceipt(_ context.Context, encryptedParams common.EncryptedParamsGetTxReceipt) (responses.EnclaveResponse, error)
- func (api *EthereumAPI) SendRawTransaction(_ context.Context, encryptedParams common.EncryptedParamsSendRawTx) (responses.EnclaveResponse, error)
- type FeeHistoryResult
- type FilterAPI
- type NetworkAPI
- type NetworkDebug
- type ObscuroAPI
- type ObscuroScanAPI
- func (api *ObscuroScanAPI) Attestation() (*common.AttestationReport, error)
- func (api *ObscuroScanAPI) GetBatch(batchHash gethcommon.Hash) (*common.ExtBatch, error)
- func (api *ObscuroScanAPI) GetBatchForTx(txHash gethcommon.Hash) (*common.ExtBatch, error)
- func (api *ObscuroScanAPI) GetBlockHeaderByHash(blockHash gethcommon.Hash) (*types.Header, error)
- func (api *ObscuroScanAPI) GetLatestTransactions(num int) ([]gethcommon.Hash, error)
- func (api *ObscuroScanAPI) GetTotalTransactions() (*big.Int, error)
- type ScanAPI
- func (s *ScanAPI) GetBatchByHash(hash gethcommon.Hash) (*common.ExtBatch, error)
- func (s *ScanAPI) GetBatchListing(pagination *common.QueryPagination) (*common.BatchListingResponse, error)
- func (s *ScanAPI) GetBlockListing(pagination *common.QueryPagination) (*common.BlockListingResponse, error)
- func (s *ScanAPI) GetLatestRollupHeader() (*common.RollupHeader, error)
- func (s *ScanAPI) GetPublicTransactionData(pagination *common.QueryPagination) (*common.TransactionListingResponse, error)
- func (s *ScanAPI) GetTotalContractCount() (*big.Int, error)
- func (s *ScanAPI) GetTotalTransactionCount() (*big.Int, error)
- type TestAPI
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ChecksumFormattedObscuroNetworkConfig ¶
type ChecksumFormattedObscuroNetworkConfig struct { ManagementContractAddress gethcommon.AddressEIP55 L1StartHash gethcommon.Hash SequencerID gethcommon.AddressEIP55 MessageBusAddress gethcommon.AddressEIP55 L2MessageBusAddress gethcommon.AddressEIP55 ImportantContracts map[string]gethcommon.AddressEIP55 // map of contract name to address }
ChecksumFormattedObscuroNetworkConfig serialises the addresses as EIP55 checksum addresses.
type EthereumAPI ¶
type EthereumAPI struct {
// contains filtered or unexported fields
}
EthereumAPI implements a subset of the Ethereum JSON RPC operations. All the method signatures are copied from the corresponding Geth implementations.
func NewEthereumAPI ¶
func NewEthereumAPI(host host.Host, logger gethlog.Logger) *EthereumAPI
func (*EthereumAPI) BlockNumber ¶
func (api *EthereumAPI) BlockNumber() hexutil.Uint64
BlockNumber returns the height of the current head batch.
func (*EthereumAPI) Call ¶
func (api *EthereumAPI) Call(_ context.Context, encryptedParams common.EncryptedParamsCall) (responses.EnclaveResponse, error)
Call returns the result of executing the smart contract as a user, encrypted with the viewing key corresponding to the `from` field and encoded as hex.
func (*EthereumAPI) ChainId ¶
func (api *EthereumAPI) ChainId() (*hexutil.Big, error)
ChainId returns the Obscuro chain ID.
func (*EthereumAPI) EstimateGas ¶
func (api *EthereumAPI) EstimateGas(_ context.Context, encryptedParams common.EncryptedParamsEstimateGas) (responses.EnclaveResponse, error)
EstimateGas requests the enclave the gas estimation based on the callMsg supplied params (encrypted)
func (*EthereumAPI) FeeHistory ¶
func (api *EthereumAPI) FeeHistory(context.Context, []byte, rpc.BlockNumber, []float64) (*FeeHistoryResult, error)
FeeHistory is a placeholder for an RPC method required by MetaMask/Remix. rpc.DecimalOrHex -> []byte
func (*EthereumAPI) GasPrice ¶
GasPrice is a placeholder for an RPC method required by MetaMask/Remix.
func (*EthereumAPI) GetBalance ¶
func (api *EthereumAPI) GetBalance(_ context.Context, encryptedParams common.EncryptedParamsGetBalance) (responses.EnclaveResponse, error)
GetBalance returns the address's balance on the Obscuro network, encrypted with the viewing key corresponding to the `address` field and encoded as hex.
func (*EthereumAPI) GetBlockByHash ¶
func (api *EthereumAPI) GetBlockByHash(_ context.Context, hash gethcommon.Hash, _ bool) (*common.BatchHeader, error)
GetBlockByHash returns the header of the batch with the given hash.
func (*EthereumAPI) GetBlockByNumber ¶
func (api *EthereumAPI) GetBlockByNumber(ctx context.Context, number rpc.BlockNumber, _ bool) (*common.BatchHeader, error)
GetBlockByNumber returns the header of the batch with the given height.
func (*EthereumAPI) GetCode ¶
func (api *EthereumAPI) GetCode(_ context.Context, address gethcommon.Address, blockNrOrHash rpc.BlockNumberOrHash) (hexutil.Bytes, error)
GetCode returns the code stored at the given address in the state for the given batch height or batch hash. todo (#1620) - instead of converting the block number of hash client-side, do it on the enclave
func (*EthereumAPI) GetStorageAt ¶
func (api *EthereumAPI) GetStorageAt(_ context.Context, encryptedParams common.EncryptedParamsGetStorageAt) (*responses.Receipts, error)
GetStorageAt is a reused method for listing the users transactions
func (*EthereumAPI) GetTransactionByHash ¶
func (api *EthereumAPI) GetTransactionByHash(_ context.Context, encryptedParams common.EncryptedParamsGetTxByHash) (responses.EnclaveResponse, error)
GetTransactionByHash returns the transaction with the given hash, encrypted with the viewing key corresponding to the `from` field and encoded as hex, or nil if no matching transaction exists.
func (*EthereumAPI) GetTransactionCount ¶
func (api *EthereumAPI) GetTransactionCount(_ context.Context, encryptedParams common.EncryptedParamsGetTxCount) (responses.EnclaveResponse, error)
func (*EthereumAPI) GetTransactionReceipt ¶
func (api *EthereumAPI) GetTransactionReceipt(_ context.Context, encryptedParams common.EncryptedParamsGetTxReceipt) (responses.EnclaveResponse, error)
GetTransactionReceipt returns the transaction receipt for the given transaction hash, encrypted with the viewing key corresponding to the original transaction submitter and encoded as hex, or nil if no matching transaction exists.
func (*EthereumAPI) SendRawTransaction ¶
func (api *EthereumAPI) SendRawTransaction(_ context.Context, encryptedParams common.EncryptedParamsSendRawTx) (responses.EnclaveResponse, error)
SendRawTransaction sends the encrypted transaction.
type FeeHistoryResult ¶
type FeeHistoryResult struct { OldestBlock *hexutil.Big `json:"oldestBlock"` Reward [][]*hexutil.Big `json:"reward,omitempty"` BaseFee []*hexutil.Big `json:"baseFeePerGas,omitempty"` GasUsedRatio []float64 `json:"gasUsedRatio"` }
FeeHistoryResult is the structure returned by Geth `eth_feeHistory` API.
type FilterAPI ¶
type FilterAPI struct {
// contains filtered or unexported fields
}
FilterAPI exposes a subset of Geth's PublicFilterAPI operations.
func (*FilterAPI) GetLogs ¶
func (api *FilterAPI) GetLogs(_ context.Context, encryptedParams common.EncryptedParamsGetLogs) (responses.EnclaveResponse, error)
GetLogs returns the logs matching the filter.
func (*FilterAPI) Logs ¶
func (api *FilterAPI) Logs(ctx context.Context, encryptedParams common.EncryptedParamsLogSubscription) (*rpc.Subscription, error)
Logs returns a log subscription.
type NetworkAPI ¶
type NetworkAPI struct {
// contains filtered or unexported fields
}
NetworkAPI implements a subset of the Ethereum network JSON RPC operations.
func NewNetworkAPI ¶
func NewNetworkAPI(host host.Host) *NetworkAPI
func (*NetworkAPI) Version ¶
func (api *NetworkAPI) Version() string
Version returns the protocol version of the Obscuro network.
type NetworkDebug ¶
type NetworkDebug struct {
// contains filtered or unexported fields
}
NetworkDebug implements a subset of the Ethereum network JSON RPC operations.
func NewNetworkDebug ¶
func NewNetworkDebug(host host.Host) *NetworkDebug
func (*NetworkDebug) EventLogRelevancy ¶
func (api *NetworkDebug) EventLogRelevancy(_ context.Context, hash gethcommon.Hash) (interface{}, error)
EventLogRelevancy returns the events for a given transactions and the revelancy params
func (*NetworkDebug) TraceTransaction ¶
func (api *NetworkDebug) TraceTransaction(_ context.Context, hash gethcommon.Hash, config *tracers.TraceConfig) (interface{}, error)
TraceTransaction returns the structured logs created during the execution of EVM and returns them as a JSON object.
type ObscuroAPI ¶
type ObscuroAPI struct {
// contains filtered or unexported fields
}
ObscuroAPI implements Obscuro-specific JSON RPC operations.
func NewObscuroAPI ¶
func NewObscuroAPI(host host.Host) *ObscuroAPI
func (*ObscuroAPI) Config ¶
func (api *ObscuroAPI) Config() (*ChecksumFormattedObscuroNetworkConfig, error)
Config returns the config status of obscuro host + enclave + db
func (*ObscuroAPI) Health ¶
func (api *ObscuroAPI) Health() (*host.HealthCheck, error)
Health returns the health status of obscuro host + enclave + db
type ObscuroScanAPI ¶
type ObscuroScanAPI struct {
// contains filtered or unexported fields
}
ObscuroScanAPI implements ObscuroScan-specific JSON RPC operations.
func NewObscuroScanAPI ¶
func NewObscuroScanAPI(host host.Host) *ObscuroScanAPI
func (*ObscuroScanAPI) Attestation ¶
func (api *ObscuroScanAPI) Attestation() (*common.AttestationReport, error)
Attestation returns the node's attestation details.
func (*ObscuroScanAPI) GetBatch ¶
func (api *ObscuroScanAPI) GetBatch(batchHash gethcommon.Hash) (*common.ExtBatch, error)
GetBatch returns the batch with the given hash. Unlike `EthereumAPI.GetBlockByHash()`, returns the full `ExtBatch`, and not just the header.
func (*ObscuroScanAPI) GetBatchForTx ¶
func (api *ObscuroScanAPI) GetBatchForTx(txHash gethcommon.Hash) (*common.ExtBatch, error)
GetBatchForTx returns the batch containing a given transaction hash.
func (*ObscuroScanAPI) GetBlockHeaderByHash ¶
func (api *ObscuroScanAPI) GetBlockHeaderByHash(blockHash gethcommon.Hash) (*types.Header, error)
GetBlockHeaderByHash returns the header for the block with the given hash.
func (*ObscuroScanAPI) GetLatestTransactions ¶
func (api *ObscuroScanAPI) GetLatestTransactions(num int) ([]gethcommon.Hash, error)
GetLatestTransactions returns the hashes of the latest `num` transactions confirmed in batches (or all the transactions if there are less than `num` total transactions).
func (*ObscuroScanAPI) GetTotalTransactions ¶
func (api *ObscuroScanAPI) GetTotalTransactions() (*big.Int, error)
GetTotalTransactions returns the number of recorded transactions on the network.
type ScanAPI ¶
type ScanAPI struct {
// contains filtered or unexported fields
}
ScanAPI implements metric specific RPC endpoints
func (*ScanAPI) GetBatchByHash ¶
func (*ScanAPI) GetBatchListing ¶
func (s *ScanAPI) GetBatchListing(pagination *common.QueryPagination) (*common.BatchListingResponse, error)
func (*ScanAPI) GetBlockListing ¶
func (s *ScanAPI) GetBlockListing(pagination *common.QueryPagination) (*common.BlockListingResponse, error)
func (*ScanAPI) GetLatestRollupHeader ¶
func (s *ScanAPI) GetLatestRollupHeader() (*common.RollupHeader, error)
func (*ScanAPI) GetPublicTransactionData ¶
func (s *ScanAPI) GetPublicTransactionData(pagination *common.QueryPagination) (*common.TransactionListingResponse, error)
func (*ScanAPI) GetTotalContractCount ¶
GetTotalContractCount returns the number of recorded contracts on the network.
type TestAPI ¶
type TestAPI struct {
// contains filtered or unexported fields
}
TestAPI implements JSON RPC operations required for testing.