Documentation ¶
Index ¶
- Constants
- Variables
- func EthAddressFromSignature(hash []byte, signature []byte) (common.Address, error)
- func NewEthereumSignature(hash []byte, ks *keystore.KeyStore, acc accounts.Account) ([]byte, error)
- func SigToVRS(sigHex string) (v uint8, r, s ethcmn.Hash, err error)
- func ValidateEthereumSignature(hash []byte, signature []byte, ethAddress common.Address) error
- type Client
- func (ec *Client) DeployBlobstreamContract(opts *bind.TransactOpts, contractBackend bind.ContractBackend, ...) (gethcommon.Address, *coregethtypes.Transaction, *blobstreamwrapper.Wrappers, ...)
- func (ec *Client) DeployERC1867Proxy(opts *bind.TransactOpts, backend bind.ContractBackend, ...) (gethcommon.Address, *coregethtypes.Transaction, *proxywrapper.Wrappers, error)
- func (ec *Client) DeployImplementation(opts *bind.TransactOpts, backend bind.ContractBackend) (gethcommon.Address, *coregethtypes.Transaction, *blobstreamwrapper.Wrappers, ...)
- func (ec *Client) NewEthClient() (*ethclient.Client, error)
- func (ec *Client) NewTransactionOpts(ctx context.Context) (*bind.TransactOpts, error)
- func (ec *Client) StateLastEventNonce(opts *bind.CallOpts) (uint64, error)
- func (ec *Client) StateLastValidatorSetCheckpoint(opts *bind.CallOpts) ([32]byte, error)
- func (ec *Client) SubmitDataRootTupleRoot(opts *bind.TransactOpts, tupleRoot gethcommon.Hash, newNonce uint64, ...) (*coregethtypes.Transaction, error)
- func (ec *Client) UpdateValidatorSet(opts *bind.TransactOpts, newNonce, newThreshHold uint64, ...) (*coregethtypes.Transaction, error)
- func (ec *Client) WaitForTransaction(ctx context.Context, backend bind.DeployBackend, tx *coregethtypes.Transaction, ...) (*coregethtypes.Receipt, error)
Constants ¶
const ( MalleabilityThreshold = "0x7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0" ZeroSValue = "0x0000000000000000000000000000000000000000000000000000000000000000" )
const DefaultEVMGasLimit = uint64(2500000)
DefaultEVMGasLimit the default gas limit to use when sending transactions to the EVM chain.
Variables ¶
var ErrInvalid = errors.New("invalid")
Functions ¶
func EthAddressFromSignature ¶
func NewEthereumSignature ¶
NewEthereumSignature creates a new eip-191 signature over a given byte array. hash: digest to be signed over. ks: the keystore to use for the signature acc: the account in the keystore to use for the signature
func SigToVRS ¶
SigToVRS breaks apart a signature into its components to make it compatible with the contracts The validation done in here is defined under https://github.com/celestiaorg/orchestrator-relayer/issues/105
Types ¶
type Client ¶
type Client struct { Wrapper *blobstreamwrapper.Wrappers Ks *keystore.KeyStore Acc *accounts.Account EvmRPC string GasLimit uint64 // contains filtered or unexported fields }
func NewClient ¶
func NewClient( logger tmlog.Logger, wrapper *blobstreamwrapper.Wrappers, ks *keystore.KeyStore, acc *accounts.Account, evmRPC string, gasLimit uint64, ) *Client
NewClient Creates a new EVM Client that can be used to deploy the Blobstream contract and interact with it. The wrapper parameter can be nil when creating the client for contract deployment.
func (*Client) DeployBlobstreamContract ¶
func (ec *Client) DeployBlobstreamContract( opts *bind.TransactOpts, contractBackend bind.ContractBackend, contractInitValset types.Valset, contractInitNonce uint64, initBridge bool, ) (gethcommon.Address, *coregethtypes.Transaction, *blobstreamwrapper.Wrappers, error)
DeployBlobstreamContract Deploys the Blobstream contract and initializes it with the provided valset. The waitToBeMined, when set to true, will wait for the transaction to be included in a block, and log relevant information. The initBridge, when set to true, will assign the newly deployed bridge to the wrapper. This can be used later for further interactions with the new contract. Multiple calls to DeployBlobstreamContract with the initBridge flag set to true will overwrite everytime the bridge contract.
func (*Client) DeployERC1867Proxy ¶
func (ec *Client) DeployERC1867Proxy( opts *bind.TransactOpts, backend bind.ContractBackend, implementationAddress gethcommon.Address, data []byte, ) (gethcommon.Address, *coregethtypes.Transaction, *proxywrapper.Wrappers, error)
func (*Client) DeployImplementation ¶
func (ec *Client) DeployImplementation(opts *bind.TransactOpts, backend bind.ContractBackend) ( gethcommon.Address, *coregethtypes.Transaction, *blobstreamwrapper.Wrappers, error, )
func (*Client) NewEthClient ¶
NewEthClient creates a new Eth client using the existing EVM RPC address. Should be closed after usage.
func (*Client) NewTransactionOpts ¶
NewTransactionOpts creates a new transaction Opts to be used when submitting transactions.
func (*Client) StateLastEventNonce ¶
func (*Client) StateLastValidatorSetCheckpoint ¶
func (*Client) SubmitDataRootTupleRoot ¶
func (ec *Client) SubmitDataRootTupleRoot( opts *bind.TransactOpts, tupleRoot gethcommon.Hash, newNonce uint64, currentValset types.Valset, sigs []blobstreamwrapper.Signature, ) (*coregethtypes.Transaction, error)
func (*Client) UpdateValidatorSet ¶
func (ec *Client) UpdateValidatorSet( opts *bind.TransactOpts, newNonce, newThreshHold uint64, currentValset, newValset types.Valset, sigs []blobstreamwrapper.Signature, ) (*coregethtypes.Transaction, error)
func (*Client) WaitForTransaction ¶
func (ec *Client) WaitForTransaction( ctx context.Context, backend bind.DeployBackend, tx *coregethtypes.Transaction, timeout time.Duration, ) (*coregethtypes.Receipt, error)