Documentation ¶
Index ¶
- func GenesisTransaction() []byte
- func HashTxs(txs [][]byte) ([32]byte, error)
- type App
- type Block
- type Config
- type ExecutionServiceServerV1Alpha2
- func (s *ExecutionServiceServerV1Alpha2) BatchGetBlocks(ctx context.Context, req *astriaPb.BatchGetBlocksRequest) (*astriaPb.BatchGetBlocksResponse, error)
- func (s *ExecutionServiceServerV1Alpha2) ExecuteBlock(ctx context.Context, req *astriaPb.ExecuteBlockRequest) (*astriaPb.Block, error)
- func (s *ExecutionServiceServerV1Alpha2) GetBlock(ctx context.Context, req *astriaPb.GetBlockRequest) (*astriaPb.Block, error)
- func (s *ExecutionServiceServerV1Alpha2) GetCommitmentState(ctx context.Context, req *astriaPb.GetCommitmentStateRequest) (*astriaPb.CommitmentState, error)
- func (s *ExecutionServiceServerV1Alpha2) GetGenesisInfo(ctx context.Context, req *astriaPb.GetGenesisInfoRequest) (*astriaPb.GenesisInfo, error)
- func (s *ExecutionServiceServerV1Alpha2) UpdateCommitmentState(ctx context.Context, req *astriaPb.UpdateCommitmentStateRequest) (*astriaPb.CommitmentState, error)
- type RollupBlocks
- func (rb *RollupBlocks) AddBlock(block Block) error
- func (rb *RollupBlocks) GetFirmBlock() *Block
- func (rb *RollupBlocks) GetLatestBlock() *Block
- func (rb *RollupBlocks) GetSingleBlock(height uint32) (*Block, error)
- func (rb *RollupBlocks) GetSoftBlock() *Block
- func (rb *RollupBlocks) Height() uint32
- type SequencerClient
- type Transaction
- type WSClient
- type WSClientList
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Block ¶
type Block struct { ParentHash [32]byte Hash [32]byte Height uint32 Timestamp time.Time Txs [][]byte }
type Config ¶
type Config struct { SequencerRPC string `env:"SEQUENCER_RPC, required"` ConductorRPC string `env:"CONDUCTOR_RPC, required"` ComposerRpc string `env:"COMPOSER_RPC, required"` RESTApiPort string `env:"RESTAPI_PORT, required"` RollupName string `env:"ROLLUP_NAME, required"` SeqPrivate string `env:"SEQUENCER_PRIVATE, required"` }
type ExecutionServiceServerV1Alpha2 ¶
type ExecutionServiceServerV1Alpha2 struct { astriaGrpc.UnimplementedExecutionServiceServer // contains filtered or unexported fields }
ExecutionServiceServerV1Alpha2 is a server that implements the ExecutionServiceServer interface.
func NewExecutionServiceServerV1Alpha2 ¶
func NewExecutionServiceServerV1Alpha2(rollupBlocks *RollupBlocks, rollupID []byte) *ExecutionServiceServerV1Alpha2
NewExecutionServiceServerV1Alpha2 creates a new ExecutionServiceServerV1Alpha2.
func (*ExecutionServiceServerV1Alpha2) BatchGetBlocks ¶
func (s *ExecutionServiceServerV1Alpha2) BatchGetBlocks(ctx context.Context, req *astriaPb.BatchGetBlocksRequest) (*astriaPb.BatchGetBlocksResponse, error)
BatchGetBlocks retrieves multiple blocks by their identifiers.
func (*ExecutionServiceServerV1Alpha2) ExecuteBlock ¶
func (s *ExecutionServiceServerV1Alpha2) ExecuteBlock(ctx context.Context, req *astriaPb.ExecuteBlockRequest) (*astriaPb.Block, error)
ExecuteBlock executes a block and adds it to the blockchain.
func (*ExecutionServiceServerV1Alpha2) GetBlock ¶
func (s *ExecutionServiceServerV1Alpha2) GetBlock(ctx context.Context, req *astriaPb.GetBlockRequest) (*astriaPb.Block, error)
GetBlock retrieves a block by its identifier.
func (*ExecutionServiceServerV1Alpha2) GetCommitmentState ¶
func (s *ExecutionServiceServerV1Alpha2) GetCommitmentState(ctx context.Context, req *astriaPb.GetCommitmentStateRequest) (*astriaPb.CommitmentState, error)
GetCommitmentState retrieves the current commitment state of the blockchain.
func (*ExecutionServiceServerV1Alpha2) GetGenesisInfo ¶
func (s *ExecutionServiceServerV1Alpha2) GetGenesisInfo(ctx context.Context, req *astriaPb.GetGenesisInfoRequest) (*astriaPb.GenesisInfo, error)
func (*ExecutionServiceServerV1Alpha2) UpdateCommitmentState ¶
func (s *ExecutionServiceServerV1Alpha2) UpdateCommitmentState(ctx context.Context, req *astriaPb.UpdateCommitmentStateRequest) (*astriaPb.CommitmentState, error)
UpdateCommitmentState updates the commitment state of the blockchain.
type RollupBlocks ¶
type RollupBlocks struct { Blocks []Block NewBlockChan chan Block // contains filtered or unexported fields }
Messenger is a struct that manages the blocks in the blockchain.
func NewRollupBlocks ¶
func NewRollupBlocks(newBlockChan chan Block) *RollupBlocks
func (*RollupBlocks) AddBlock ¶
func (rb *RollupBlocks) AddBlock(block Block) error
func (*RollupBlocks) GetFirmBlock ¶
func (rb *RollupBlocks) GetFirmBlock() *Block
func (*RollupBlocks) GetLatestBlock ¶
func (rb *RollupBlocks) GetLatestBlock() *Block
func (*RollupBlocks) GetSingleBlock ¶
func (rb *RollupBlocks) GetSingleBlock(height uint32) (*Block, error)
GetSingleBlock retrieves a block by its height, failing if the requested height is higher than the current height.
func (*RollupBlocks) GetSoftBlock ¶
func (rb *RollupBlocks) GetSoftBlock() *Block
func (*RollupBlocks) Height ¶
func (rb *RollupBlocks) Height() uint32
type SequencerClient ¶
type SequencerClient struct {
// contains filtered or unexported fields
}
SequencerClient is a client for interacting with the sequencer.
func NewSequencerClient ¶
func NewSequencerClient(sequencerAddr string, composerAddr string, rollupId []byte, private ed25519.PrivateKey) *SequencerClient
NewSequencerClient creates a new SequencerClient.
func (*SequencerClient) SendMessage ¶
func (sc *SequencerClient) SendMessage(tx []byte) (*tendermintPb.ResultBroadcastTx, error)
SendMessage sends a message as a transaction.
func (*SequencerClient) SendMessageViaComposer ¶
func (sc *SequencerClient) SendMessageViaComposer(tx []byte) error
type Transaction ¶
Transaction represents a transaction in the blockchain.
type WSClient ¶
type WSClient struct {
// contains filtered or unexported fields
}
func (*WSClient) WaitForMessages ¶
func (c *WSClient) WaitForMessages()