pub trait OffchainWorker<BlockNumber> {
    fn offchain_worker(_n: BlockNumber) { ... }
}
Expand description

Off-chain computation trait.

Implementing this trait on a module allows you to perform long-running tasks that make (by default) validators generate transactions that feed results of those long-running computations back on chain.

NOTE: This function runs off-chain, so it can access the block state, but cannot preform any alterations. More specifically alterations are not forbidden, but they are not persisted in any way after the worker has finished.

Provided methods

This function is being called after every block import (when fully synced).

Implement this and use any of the Offchain sp_io set of APIs to perform off-chain computations, calls and submit transactions with results to trigger any on-chain changes. Any state alterations are lost and are not persisted.

Implementations on Foreign Types

This function is being called after every block import (when fully synced).

Implement this and use any of the Offchain sp_io set of APIs to perform off-chain computations, calls and submit transactions with results to trigger any on-chain changes. Any state alterations are lost and are not persisted.

This function is being called after every block import (when fully synced).

Implement this and use any of the Offchain sp_io set of APIs to perform off-chain computations, calls and submit transactions with results to trigger any on-chain changes. Any state alterations are lost and are not persisted.

This function is being called after every block import (when fully synced).

Implement this and use any of the Offchain sp_io set of APIs to perform off-chain computations, calls and submit transactions with results to trigger any on-chain changes. Any state alterations are lost and are not persisted.

This function is being called after every block import (when fully synced).

Implement this and use any of the Offchain sp_io set of APIs to perform off-chain computations, calls and submit transactions with results to trigger any on-chain changes. Any state alterations are lost and are not persisted.

This function is being called after every block import (when fully synced).

Implement this and use any of the Offchain sp_io set of APIs to perform off-chain computations, calls and submit transactions with results to trigger any on-chain changes. Any state alterations are lost and are not persisted.

This function is being called after every block import (when fully synced).

Implement this and use any of the Offchain sp_io set of APIs to perform off-chain computations, calls and submit transactions with results to trigger any on-chain changes. Any state alterations are lost and are not persisted.

This function is being called after every block import (when fully synced).

Implement this and use any of the Offchain sp_io set of APIs to perform off-chain computations, calls and submit transactions with results to trigger any on-chain changes. Any state alterations are lost and are not persisted.

This function is being called after every block import (when fully synced).

Implement this and use any of the Offchain sp_io set of APIs to perform off-chain computations, calls and submit transactions with results to trigger any on-chain changes. Any state alterations are lost and are not persisted.

This function is being called after every block import (when fully synced).

Implement this and use any of the Offchain sp_io set of APIs to perform off-chain computations, calls and submit transactions with results to trigger any on-chain changes. Any state alterations are lost and are not persisted.

This function is being called after every block import (when fully synced).

Implement this and use any of the Offchain sp_io set of APIs to perform off-chain computations, calls and submit transactions with results to trigger any on-chain changes. Any state alterations are lost and are not persisted.

This function is being called after every block import (when fully synced).

Implement this and use any of the Offchain sp_io set of APIs to perform off-chain computations, calls and submit transactions with results to trigger any on-chain changes. Any state alterations are lost and are not persisted.

This function is being called after every block import (when fully synced).

Implement this and use any of the Offchain sp_io set of APIs to perform off-chain computations, calls and submit transactions with results to trigger any on-chain changes. Any state alterations are lost and are not persisted.

This function is being called after every block import (when fully synced).

Implement this and use any of the Offchain sp_io set of APIs to perform off-chain computations, calls and submit transactions with results to trigger any on-chain changes. Any state alterations are lost and are not persisted.

This function is being called after every block import (when fully synced).

Implement this and use any of the Offchain sp_io set of APIs to perform off-chain computations, calls and submit transactions with results to trigger any on-chain changes. Any state alterations are lost and are not persisted.

This function is being called after every block import (when fully synced).

Implement this and use any of the Offchain sp_io set of APIs to perform off-chain computations, calls and submit transactions with results to trigger any on-chain changes. Any state alterations are lost and are not persisted.

This function is being called after every block import (when fully synced).

Implement this and use any of the Offchain sp_io set of APIs to perform off-chain computations, calls and submit transactions with results to trigger any on-chain changes. Any state alterations are lost and are not persisted.

This function is being called after every block import (when fully synced).

Implement this and use any of the Offchain sp_io set of APIs to perform off-chain computations, calls and submit transactions with results to trigger any on-chain changes. Any state alterations are lost and are not persisted.

This function is being called after every block import (when fully synced).

Implement this and use any of the Offchain sp_io set of APIs to perform off-chain computations, calls and submit transactions with results to trigger any on-chain changes. Any state alterations are lost and are not persisted.

This function is being called after every block import (when fully synced).

Implement this and use any of the Offchain sp_io set of APIs to perform off-chain computations, calls and submit transactions with results to trigger any on-chain changes. Any state alterations are lost and are not persisted.

This function is being called after every block import (when fully synced).

Implement this and use any of the Offchain sp_io set of APIs to perform off-chain computations, calls and submit transactions with results to trigger any on-chain changes. Any state alterations are lost and are not persisted.

This function is being called after every block import (when fully synced).

Implement this and use any of the Offchain sp_io set of APIs to perform off-chain computations, calls and submit transactions with results to trigger any on-chain changes. Any state alterations are lost and are not persisted.

This function is being called after every block import (when fully synced).

Implement this and use any of the Offchain sp_io set of APIs to perform off-chain computations, calls and submit transactions with results to trigger any on-chain changes. Any state alterations are lost and are not persisted.

This function is being called after every block import (when fully synced).

Implement this and use any of the Offchain sp_io set of APIs to perform off-chain computations, calls and submit transactions with results to trigger any on-chain changes. Any state alterations are lost and are not persisted.

This function is being called after every block import (when fully synced).

Implement this and use any of the Offchain sp_io set of APIs to perform off-chain computations, calls and submit transactions with results to trigger any on-chain changes. Any state alterations are lost and are not persisted.

This function is being called after every block import (when fully synced).

Implement this and use any of the Offchain sp_io set of APIs to perform off-chain computations, calls and submit transactions with results to trigger any on-chain changes. Any state alterations are lost and are not persisted.

This function is being called after every block import (when fully synced).

Implement this and use any of the Offchain sp_io set of APIs to perform off-chain computations, calls and submit transactions with results to trigger any on-chain changes. Any state alterations are lost and are not persisted.

This function is being called after every block import (when fully synced).

Implement this and use any of the Offchain sp_io set of APIs to perform off-chain computations, calls and submit transactions with results to trigger any on-chain changes. Any state alterations are lost and are not persisted.

This function is being called after every block import (when fully synced).

Implement this and use any of the Offchain sp_io set of APIs to perform off-chain computations, calls and submit transactions with results to trigger any on-chain changes. Any state alterations are lost and are not persisted.

This function is being called after every block import (when fully synced).

Implement this and use any of the Offchain sp_io set of APIs to perform off-chain computations, calls and submit transactions with results to trigger any on-chain changes. Any state alterations are lost and are not persisted.

This function is being called after every block import (when fully synced).

Implement this and use any of the Offchain sp_io set of APIs to perform off-chain computations, calls and submit transactions with results to trigger any on-chain changes. Any state alterations are lost and are not persisted.

This function is being called after every block import (when fully synced).

Implement this and use any of the Offchain sp_io set of APIs to perform off-chain computations, calls and submit transactions with results to trigger any on-chain changes. Any state alterations are lost and are not persisted.

Implementors