pub struct Server {
    pub vm: Arc<RwLock<Box<dyn Vm + Send + Sync>>>,
    pub stop_ch: Sender<()>,
}

Fields

vm: Arc<RwLock<Box<dyn Vm + Send + Sync>>>

Underlying Vm implementation.

stop_ch: Sender<()>

Stop channel broadcast producer.

Implementations

Trait Implementations

Creates the HTTP handlers for custom chain network calls. This creates and exposes handlers that the outside world can use to communicate with the chain. Each handler has the path:

Returns a mapping from [extension]s to HTTP handlers. Each extension can specify how locking is managed for convenience.

For example, if this VM implements an account-based payments system, it have an extension called accounts, where clients could get information about their accounts.

Creates the HTTP handlers for custom VM network calls.

This creates and exposes handlers that the outside world can use to communicate with a static reference to the VM. Each handler has the path: [Address of node]/ext/VM/[VM ID]/[extension]

Returns a mapping from [extension]s to HTTP handlers.

Each extension can specify how locking is managed for convenience.

For example, it might make sense to have an extension for creating genesis bytes this VM can interpret.

Attempt to load a block.

If the block does not exist, an empty GetBlockResponse is returned with an error code.

It is expected that blocks that have been successfully verified should be returned correctly. It is also expected that blocks that have been accepted by the consensus engine should be able to be fetched. It is not required for blocks that have been rejected by the consensus engine to be able to be fetched. ref: https://pkg.go.dev/github.com/ava-labs/avalanchego/snow/engine/snowman/block#Getter

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Wrap the input message T in a tonic::Request
Should always be Self
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.
Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more