Documentation
¶
Index ¶
- Constants
- type Block
- type Config
- type GetEpochResponse
- type JSONRPCClient
- type PostForkBlock
- type VM
- func (vm *VM) BatchedParseBlock(ctx context.Context, blks [][]byte) ([]snowman.Block, error)
- func (vm *VM) BuildBlock(ctx context.Context) (snowman.Block, error)
- func (vm *VM) CreateHandlers(ctx context.Context) (map[string]http.Handler, error)
- func (vm *VM) GetAncestors(ctx context.Context, blkID ids.ID, maxBlocksNum int, maxBlocksSize int, ...) ([][]byte, error)
- func (vm *VM) GetBlock(ctx context.Context, id ids.ID) (snowman.Block, error)
- func (vm *VM) GetBlockIDAtHeight(ctx context.Context, height uint64) (ids.ID, error)
- func (vm *VM) GetLastStateSummary(ctx context.Context) (block.StateSummary, error)
- func (vm *VM) GetOngoingSyncStateSummary(ctx context.Context) (block.StateSummary, error)
- func (vm *VM) GetStateSummary(ctx context.Context, height uint64) (block.StateSummary, error)
- func (vm *VM) Initialize(ctx context.Context, chainCtx *snow.Context, db database.Database, ...) error
- func (vm *VM) LastAccepted(ctx context.Context) (ids.ID, error)
- func (vm *VM) NewHTTPHandler(ctx context.Context) (http.Handler, error)
- func (vm *VM) ParseBlock(ctx context.Context, b []byte) (snowman.Block, error)
- func (vm *VM) ParseLocalBlock(ctx context.Context, b []byte) (snowman.Block, error)
- func (vm *VM) ParseStateSummary(ctx context.Context, summaryBytes []byte) (block.StateSummary, error)
- func (vm *VM) SetPreference(ctx context.Context, preferred ids.ID) error
- func (vm *VM) SetState(ctx context.Context, newState snow.State) error
- func (vm *VM) Shutdown(ctx context.Context) error
- func (vm *VM) StateSyncEnabled(ctx context.Context) (bool, error)
- func (vm *VM) WaitForEvent(ctx context.Context) (common.Message, error)
Constants ¶
const ( HTTPHeaderRoute = "proposervm" // DefaultMinBlockDelay should be kept as whole seconds because block // timestamps are only specific to the second. DefaultMinBlockDelay = time.Second // DefaultNumHistoricalBlocks as 0 results in never deleting any historical // blocks. DefaultNumHistoricalBlocks uint64 = 0 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶ added in v1.10.18
type Config struct {
Upgrades upgrade.Config
// Configurable minimal delay among blocks issued consecutively
MinBlkDelay time.Duration
// Maximal number of block indexed.
// Zero signals all blocks are indexed.
NumHistoricalBlocks uint64
// Block signer
StakingLeafSigner crypto.Signer
// Block certificate
StakingCertLeaf *staking.Certificate
// Registerer for prometheus metrics
Registerer prometheus.Registerer
}
type GetEpochResponse ¶
type JSONRPCClient ¶
type JSONRPCClient struct {
Requester rpc.EndpointRequester
}
JSONRPCClient for interacting with the jsonrpc API.
func NewJSONRPCClient ¶
func NewJSONRPCClient(uri string, chain string) *JSONRPCClient
NewJSONRPCClient returns a Client for interacting with the jsonrpc API.
The provided chain should be the chainID or an alias. Such as "P" for the P-Chain.
func (*JSONRPCClient) GetCurrentEpoch ¶
func (j *JSONRPCClient) GetCurrentEpoch(ctx context.Context, options ...rpc.Option) (block.Epoch, error)
GetCurrentEpoch returns the current epoch information.
func (*JSONRPCClient) GetProposedHeight ¶
func (j *JSONRPCClient) GetProposedHeight(ctx context.Context, options ...rpc.Option) (uint64, error)
GetProposedHeight returns the P-chain height this node would propose in the next block.
type PostForkBlock ¶
type PostForkBlock interface {
Block
// contains filtered or unexported methods
}
type VM ¶
type VM struct {
block.ChainVM
Config
state.State
proposer.Windower
tree.Tree
mockable.Clock
// contains filtered or unexported fields
}
func New ¶
New performs best when [minBlkDelay] is whole seconds. This is because block timestamps are only specific to the second.
func (*VM) BatchedParseBlock ¶ added in v1.6.4
func (*VM) CreateHandlers ¶
func (*VM) GetAncestors ¶ added in v1.6.4
func (*VM) GetBlockIDAtHeight ¶ added in v1.7.5
vm.ctx.Lock should be held
func (*VM) GetLastStateSummary ¶ added in v1.7.11
func (*VM) GetOngoingSyncStateSummary ¶ added in v1.7.11
func (*VM) GetStateSummary ¶ added in v1.7.11
func (*VM) Initialize ¶
func (*VM) ParseBlock ¶
func (*VM) ParseLocalBlock ¶ added in v1.11.11
func (*VM) ParseStateSummary ¶ added in v1.7.11
func (vm *VM) ParseStateSummary(ctx context.Context, summaryBytes []byte) (block.StateSummary, error)
Note: it's important that ParseStateSummary do not use any index or state to allow summaries being parsed also by freshly started node with no previous state.
func (*VM) StateSyncEnabled ¶ added in v1.7.11
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
ACP181 implements the epoch logic specified here: https://github.com/avalanche-foundation/ACPs/blob/main/ACPs/181-p-chain-epoched-views/README.md
|
ACP181 implements the epoch logic specified here: https://github.com/avalanche-foundation/ACPs/blob/main/ACPs/181-p-chain-epoched-views/README.md |
|
proposermock
Package proposermock is a generated GoMock package.
|
Package proposermock is a generated GoMock package. |