Documentation ¶
Index ¶
- Constants
- Variables
- func Combine(a, b *proxy.Spoof) *proxy.Spoof
- func GetNewToken(jwtSecretBytes []byte, iat time.Time) (string, error)
- func MakeSpoofs(fields map[string]interface{}, methods ...string) []*proxy.Spoof
- func UnmarshalFromJsonRPCRequest(b []byte, params ...interface{}) error
- func UnmarshalFromJsonRPCResponse(b []byte, result interface{}) error
- type BinaryMarshable
- type EnodeClient
- type ExecutionClient
- func (ec *ExecutionClient) BalanceAt(parentCtx context.Context, account common.Address, n *big.Int) (*big.Int, error)
- func (ec *ExecutionClient) BlockByHash(parentCtx context.Context, h common.Hash) (*types.Block, error)
- func (ec *ExecutionClient) BlockByNumber(parentCtx context.Context, n *big.Int) (*types.Block, error)
- func (ec *ExecutionClient) CheckTTD(parentCtx context.Context) (bool, error)
- func (en *ExecutionClient) ConfiguredTTD() *big.Int
- func (en *ExecutionClient) EngineForkchoiceUpdated(parentCtx context.Context, fcState *api.ForkchoiceStateV1, ...) (*api.ForkChoiceResponse, error)
- func (en *ExecutionClient) EngineNewPayload(parentCtx context.Context, payload *api.ExecutableData, version int) (*api.PayloadStatusV1, error)
- func (en *ExecutionClient) EngineRPCAddress() (string, error)
- func (en *ExecutionClient) GetLatestForkchoiceUpdated(ctx context.Context) (*api.ForkchoiceStateV1, error)
- func (ec *ExecutionClient) HeaderByHash(parentCtx context.Context, h common.Hash) (*types.Header, error)
- func (ec *ExecutionClient) HeaderByLabel(parentCtx context.Context, l string) (*types.Header, error)
- func (ec *ExecutionClient) HeaderByNumber(parentCtx context.Context, n *big.Int) (*types.Header, error)
- func (en *ExecutionClient) Init(ctx context.Context) error
- func (en *ExecutionClient) IsRunning() bool
- func (en *ExecutionClient) Logf(format string, values ...interface{})
- func (en *ExecutionClient) MustGetEnode() string
- func (en *ExecutionClient) PrepareAuthCallToken(jwtSecretBytes []byte, iat time.Time) error
- func (en *ExecutionClient) PrepareDefaultAuthCallToken() error
- func (en *ExecutionClient) Proxy() *Proxy
- func (ec *ExecutionClient) SendTransaction(parentCtx context.Context, tx BinaryMarshable) error
- func (en *ExecutionClient) Shutdown() error
- func (en *ExecutionClient) Start() error
- func (en *ExecutionClient) TotalDifficultyByHash(parentCtx context.Context, blockHash common.Hash) (*big.Int, error)
- func (en *ExecutionClient) TotalDifficultyByNumber(parentCtx context.Context, blockNumber *big.Int) (*big.Int, error)
- func (en *ExecutionClient) UserRPCAddress() (string, error)
- func (ec *ExecutionClient) WaitForTerminalTotalDifficulty(parentCtx context.Context) error
- type ExecutionClientConfig
- type ExecutionClients
- type ExecutionProxyConfig
- type Proxies
- type Proxy
- func (p *Proxy) AddRequestCallbacks(callback func([]byte) *proxy.Spoof, methods ...string)
- func (p *Proxy) AddRequests(spoofs ...*proxy.Spoof)
- func (p *Proxy) AddResponseCallbacks(callback func([]byte, []byte) *proxy.Spoof, methods ...string)
- func (p *Proxy) AddResponses(spoofs ...*proxy.Spoof)
- func (p *Proxy) Cancel() error
- func (p *Proxy) EngineRPCAddress() (string, error)
- func (p *Proxy) RPC() *rpc.Client
- func (p *Proxy) UserRPCAddress() (string, error)
- type ProxyProvider
- type TD
- type TotalDifficultyHeader
Constants ¶
View Source
const ( PortUserRPC = 8545 PortEngineRPC = 8551 )
Variables ¶
View Source
var AllEngineCalls = []string{
"engine_forkchoiceUpdatedV1",
"engine_forkchoiceUpdatedV2",
"engine_forkchoiceUpdatedV3",
"engine_getPayloadV1",
"engine_getPayloadV2",
"engine_getPayloadV3",
"engine_newPayloadV1",
"engine_newPayloadV2",
"engine_newPayloadV3",
}
View Source
var AllForkchoiceUpdatedCalls = []string{
"engine_forkchoiceUpdatedV1",
"engine_forkchoiceUpdatedV2",
"engine_forkchoiceUpdatedV3",
}
View Source
var AllGetPayloadCalls = []string{
"engine_getPayloadV1",
"engine_getPayloadV2",
"engine_getPayloadV3",
}
View Source
var AllNewPayloadCalls = []string{
"engine_newPayloadV1",
"engine_newPayloadV2",
"engine_newPayloadV3",
}
Functions ¶
func GetNewToken ¶
JWT Tokens
func MakeSpoofs ¶
MakeSpoofs creates a slice of spoof requests with the same fields and different methods.
Types ¶
type BinaryMarshable ¶
type ExecutionClient ¶
type ExecutionClient struct { clients.Client Logger utils.Logging Config ExecutionClientConfig // contains filtered or unexported fields }
func (*ExecutionClient) BlockByHash ¶
func (*ExecutionClient) BlockByNumber ¶
func (*ExecutionClient) CheckTTD ¶
func (ec *ExecutionClient) CheckTTD(parentCtx context.Context) (bool, error)
func (*ExecutionClient) ConfiguredTTD ¶
func (en *ExecutionClient) ConfiguredTTD() *big.Int
func (*ExecutionClient) EngineForkchoiceUpdated ¶
func (en *ExecutionClient) EngineForkchoiceUpdated( parentCtx context.Context, fcState *api.ForkchoiceStateV1, pAttributes *api.PayloadAttributes, version int, ) (*api.ForkChoiceResponse, error)
func (*ExecutionClient) EngineNewPayload ¶
func (en *ExecutionClient) EngineNewPayload( parentCtx context.Context, payload *api.ExecutableData, version int, ) (*api.PayloadStatusV1, error)
func (*ExecutionClient) EngineRPCAddress ¶
func (en *ExecutionClient) EngineRPCAddress() (string, error)
func (*ExecutionClient) GetLatestForkchoiceUpdated ¶
func (en *ExecutionClient) GetLatestForkchoiceUpdated( ctx context.Context, ) (*api.ForkchoiceStateV1, error)
func (*ExecutionClient) HeaderByHash ¶
func (*ExecutionClient) HeaderByLabel ¶
func (*ExecutionClient) HeaderByNumber ¶
func (*ExecutionClient) IsRunning ¶
func (en *ExecutionClient) IsRunning() bool
func (*ExecutionClient) Logf ¶
func (en *ExecutionClient) Logf(format string, values ...interface{})
func (*ExecutionClient) MustGetEnode ¶
func (en *ExecutionClient) MustGetEnode() string
func (*ExecutionClient) PrepareAuthCallToken ¶
func (en *ExecutionClient) PrepareAuthCallToken( jwtSecretBytes []byte, iat time.Time, ) error
func (*ExecutionClient) PrepareDefaultAuthCallToken ¶
func (en *ExecutionClient) PrepareDefaultAuthCallToken() error
func (*ExecutionClient) Proxy ¶
func (en *ExecutionClient) Proxy() *Proxy
func (*ExecutionClient) SendTransaction ¶
func (ec *ExecutionClient) SendTransaction( parentCtx context.Context, tx BinaryMarshable, ) error
func (*ExecutionClient) Shutdown ¶
func (en *ExecutionClient) Shutdown() error
func (*ExecutionClient) Start ¶
func (en *ExecutionClient) Start() error
func (*ExecutionClient) TotalDifficultyByHash ¶
func (*ExecutionClient) TotalDifficultyByNumber ¶
func (*ExecutionClient) UserRPCAddress ¶
func (en *ExecutionClient) UserRPCAddress() (string, error)
func (*ExecutionClient) WaitForTerminalTotalDifficulty ¶
func (ec *ExecutionClient) WaitForTerminalTotalDifficulty( parentCtx context.Context, ) error
type ExecutionClientConfig ¶
type ExecutionClients ¶
type ExecutionClients []*ExecutionClient
func (ExecutionClients) CheckHeads ¶
Returns true if all head hashes match
func (ExecutionClients) Enodes ¶
func (all ExecutionClients) Enodes() (string, error)
Returns comma-separated Bootnodes of all running execution nodes
func (ExecutionClients) Running ¶
func (all ExecutionClients) Running() ExecutionClients
Return subset of clients that are currently running
func (ExecutionClients) Subnet ¶
func (all ExecutionClients) Subnet(subnet string) ExecutionClients
Return subset of clients that are part of an specific subnet
type ExecutionProxyConfig ¶
type Proxies ¶
type Proxies []ProxyProvider
type Proxy ¶
func (*Proxy) AddRequestCallbacks ¶
AddRequestCallbacks adds a callback for a request on multiple methods to the proxy.
func (*Proxy) AddRequests ¶
AddRequests adds spoofs for a set of requests to the proxy.
func (*Proxy) AddResponseCallbacks ¶
func (p *Proxy) AddResponseCallbacks( callback func([]byte, []byte) *proxy.Spoof, methods ...string, )
AddResponseCallbacks adds a callback for a response on multiple methods to the proxy.
func (*Proxy) AddResponses ¶
AddResponses adds spoofs for a set of responses to the proxy.
func (*Proxy) EngineRPCAddress ¶
func (*Proxy) UserRPCAddress ¶
type ProxyProvider ¶
type ProxyProvider interface {
Proxy() *Proxy
}
Interface used to provide a proxy for a given execution client
type TotalDifficultyHeader ¶
func (*TotalDifficultyHeader) UnmarshalJSON ¶
func (tdh *TotalDifficultyHeader) UnmarshalJSON(data []byte) error
Click to show internal directories.
Click to hide internal directories.