Documentation
¶
Index ¶
- Constants
- Variables
- type Client
- func (c *Client) ExecuteTxs(ctx context.Context, txs []types.Tx, blockHeight uint64, timestamp time.Time, ...) (types.Hash, uint64, error)
- func (c *Client) GetTxs(ctx context.Context) ([]types.Tx, error)
- func (c *Client) InitChain(ctx context.Context, genesisTime time.Time, initialHeight uint64, ...) (types.Hash, uint64, error)
- func (c *Client) SetConfig(config *Config)
- func (c *Client) SetFinal(ctx context.Context, blockHeight uint64) error
- func (c *Client) Start(endpoint string) error
- func (c *Client) Stop() error
- type Config
- type Server
Constants ¶
View Source
const ( // ErrCodeParse is a reserved JSON-RPC error code ErrCodeParse = -32700 // ErrCodeInvalidRequest is a reserved JSON-RPC error code ErrCodeInvalidRequest = -32600 // ErrCodeMethodNotFound is a reserved JSON-RPC error code ErrCodeMethodNotFound = -32601 // ErrCodeInvalidParams is a reserved JSON-RPC error code ErrCodeInvalidParams = -32602 // ErrCodeInternal is a reserved JSON-RPC error code ErrCodeInternal = -32603 )
Variables ¶
View Source
var ( // ErrParse represents a JSON-RPC error indicating a problem with parsing the JSON request payload. ErrParse = &jsonRPCError{Code: ErrCodeParse, Message: "Parse error"} // ErrInvalidRequest represents a JSON-RPC error indicating an invalid JSON request payload. ErrInvalidRequest = &jsonRPCError{Code: ErrCodeInvalidRequest, Message: "Invalid request"} // ErrMethodNotFound represents a JSON-RPC error indicating that the requested method could not be found. ErrMethodNotFound = &jsonRPCError{Code: ErrCodeMethodNotFound, Message: "Method not found"} // ErrInvalidParams represents a JSON-RPC error indicating invalid parameters in the request. ErrInvalidParams = &jsonRPCError{Code: ErrCodeInvalidParams, Message: "Invalid params"} // ErrInternal represents a JSON-RPC error indicating an unspecified internal error within the server. ErrInternal = &jsonRPCError{Code: ErrCodeInternal, Message: "Internal error"} )
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client defines JSON-RPC proxy client of execution API.
func (*Client) ExecuteTxs ¶
func (c *Client) ExecuteTxs(ctx context.Context, txs []types.Tx, blockHeight uint64, timestamp time.Time, prevStateRoot types.Hash) (types.Hash, uint64, error)
ExecuteTxs executes a set of transactions to produce a new block header.
func (*Client) GetTxs ¶
GetTxs retrieves all available transactions from the execution client's mempool.
func (*Client) InitChain ¶
func (c *Client) InitChain(ctx context.Context, genesisTime time.Time, initialHeight uint64, chainID string) (types.Hash, uint64, error)
InitChain initializes the blockchain with genesis information.
type Config ¶
Config represents configuration settings for server/client.
func DefaultConfig ¶
func DefaultConfig() *Config
DefaultConfig returns Config struct initialized with default settings.
Click to show internal directories.
Click to hide internal directories.