Documentation
¶
Index ¶
- func NewServer(exec execution.Executor, config *Config) pb.ExecutionServiceServer
- 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(target string, opts ...grpc.DialOption) error
- func (c *Client) Stop() error
- type Config
- type Server
- func (s *Server) ExecuteTxs(ctx context.Context, req *pb.ExecuteTxsRequest) (*pb.ExecuteTxsResponse, error)
- func (s *Server) GetTxs(ctx context.Context, req *pb.GetTxsRequest) (*pb.GetTxsResponse, error)
- func (s *Server) InitChain(ctx context.Context, req *pb.InitChainRequest) (*pb.InitChainResponse, error)
- func (s *Server) SetFinal(ctx context.Context, req *pb.SetFinalRequest) (*pb.SetFinalResponse, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewServer ¶
func NewServer(exec execution.Executor, config *Config) pb.ExecutionServiceServer
NewServer creates a new ExecutionService gRPC server with the given execution client and configuration.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client defines gRPC proxy client
func NewClient ¶
func NewClient() *Client
NewClient creates a new instance of Client with default configuration.
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 holds configuration settings for the gRPC proxy.
func DefaultConfig ¶
func DefaultConfig() *Config
DefaultConfig returns a Config instance populated with default settings.
type Server ¶
type Server struct { pb.UnimplementedExecutionServiceServer // contains filtered or unexported fields }
Server defines a gRPC proxy server
func (*Server) ExecuteTxs ¶
func (s *Server) ExecuteTxs(ctx context.Context, req *pb.ExecuteTxsRequest) (*pb.ExecuteTxsResponse, error)
ExecuteTxs handles ExecuteTxs method call from execution API.
func (*Server) GetTxs ¶
func (s *Server) GetTxs(ctx context.Context, req *pb.GetTxsRequest) (*pb.GetTxsResponse, error)
GetTxs handles GetTxs method call from execution API.
func (*Server) InitChain ¶
func (s *Server) InitChain(ctx context.Context, req *pb.InitChainRequest) (*pb.InitChainResponse, error)
InitChain handles InitChain method call from execution API.
func (*Server) SetFinal ¶
func (s *Server) SetFinal(ctx context.Context, req *pb.SetFinalRequest) (*pb.SetFinalResponse, error)
SetFinal handles SetFinal method call from execution API.