client

package
v0.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 13, 2024 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AttackerCommand

type AttackerCommand int
const (
	CMD_NULL AttackerCommand = iota
	CMD_CONTINUE
	CMD_RETURN
	CMD_ABORT
	CMD_SKIP
	CMD_ROLE_TO_NORMAL   // 角色转换为普通节点
	CMD_ROLE_TO_ATTACKER // 角色转换为攻击者
	CMD_EXIT
	CMD_UPDATE_STATE
	CMP_DELAY_BROAD_CAST
)

type AttackerResponse

type AttackerResponse struct {
	Cmd    AttackerCommand `json:"cmd"`
	Result string          `json:"result"`
}

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client defines typed wrappers for the Ethereum RPC API.

func Dial

func Dial(rawurl string, valIdx int) (*Client, error)

Dial connects a client to the given URL.

func DialContext

func DialContext(ctx context.Context, rawurl string, valIdx int) (*Client, error)

DialContext connects a client to the given URL with context.

func NewClient

func NewClient(c *rpc.Client, valIdx int) *Client

NewClient creates a client that uses the given RPC client.

func (*Client) AttestAfterBroadCast

func (ec *Client) AttestAfterBroadCast(ctx context.Context, slot uint64) (AttackerResponse, error)

func (*Client) AttestAfterPropose

func (ec *Client) AttestAfterPropose(ctx context.Context, slot uint64, pubkey string, siginedAttestDataBase64 string) (AttackerResponse, error)

func (*Client) AttestAfterSign

func (ec *Client) AttestAfterSign(ctx context.Context, slot uint64, pubkey string, siginedAttestDataBase64 string) (AttackerResponse, error)

func (*Client) AttestBeforeBroadCast

func (ec *Client) AttestBeforeBroadCast(ctx context.Context, slot uint64) (AttackerResponse, error)

func (*Client) AttestBeforePropose

func (ec *Client) AttestBeforePropose(ctx context.Context, slot uint64, pubkey string, siginedAttestDataBase64 string) (AttackerResponse, error)

func (*Client) AttestBeforeSign

func (ec *Client) AttestBeforeSign(ctx context.Context, slot uint64, pubkey string, attestDataBase64 string) (AttackerResponse, error)

func (*Client) BlockAfterBroadCast

func (ec *Client) BlockAfterBroadCast(ctx context.Context, slot uint64) (AttackerResponse, error)

func (*Client) BlockAfterPropose

func (ec *Client) BlockAfterPropose(ctx context.Context, slot uint64, pubkey string, siginedBlockDataBase64 string) (AttackerResponse, error)

func (*Client) BlockAfterSign

func (ec *Client) BlockAfterSign(ctx context.Context, slot uint64, pubkey string, siginedBlockDataBase64 string) (AttackerResponse, error)

func (*Client) BlockBeforeBroadCast

func (ec *Client) BlockBeforeBroadCast(ctx context.Context, slot uint64) (AttackerResponse, error)

func (*Client) BlockBeforePropose

func (ec *Client) BlockBeforePropose(ctx context.Context, slot uint64, pubkey string, siginedBlockDataBase64 string) (AttackerResponse, error)

func (*Client) BlockBeforeSign

func (ec *Client) BlockBeforeSign(ctx context.Context, slot uint64, pubkey string, blockDataBase64 string) (AttackerResponse, error)

func (*Client) BlockGetNewParentRoot

func (ec *Client) BlockGetNewParentRoot(ctx context.Context, slot uint64, pubkey string, parentRoot string) (AttackerResponse, error)

func (*Client) Client

func (ec *Client) Client() *rpc.Client

Client gets the underlying RPC client.

func (*Client) Close

func (ec *Client) Close()

Close closes the underlying RPC connection.

func (*Client) DelayForReceiveBlock

func (ec *Client) DelayForReceiveBlock(ctx context.Context, slot uint64) (AttackerResponse, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL