Expand description
Functions and helpers for creating programs from programs.
Any program being an actor, can not only process incoming messages and send outcoming messages to other actors but also create new actors. This feature can be useful when implementing the factory pattern, as a single actor can produce multiple derived actors with different input data.
Firstly you need to upload a Wasm code of the future program(s) by calling
gear.uploadCode
extrinsic to obtain the corresponding
CodeId
.
You must also provide a unique byte sequence to create multiple program
instances from the same code. This sequence is often referenced as salt.
ProgramGenerator
allows generating of salt automatically.
The newly created program should be initialized using a corresponding
payload; therefore, you must provide it when calling any create_program_*
function.
Structs§
- Helper to create programs without setting the salt manually.
Functions§
- Same as
create_program_bytes
, but allows initialize program with the encodable payload. - Create a new program from the already existing on-chain code identified by
CodeId
. - Same as
create_program_bytes
, but creates a new program after thedelay
expressed in block count. - Same as
create_program_bytes
, but the program will interrupt until the reply is received. - Same as
create_program_bytes
, but the program will interrupt until the reply is received. - Same as
create_program_bytes
, but with an explicit gas limit. - Same as
create_program_bytes_with_gas
, but creates a new program after thedelay
expressed in block count. - Same as
create_program_bytes_with_gas
, but the program will interrupt until the reply is received. - Same as
create_program_bytes_with_gas
, but the program will interrupt until the reply is received. - Same as
create_program
, but creates a new program after thedelay
expressed in block count. - Same as
create_program
, but the program will interrupt until the reply is received. - Same as
create_program
, but the program will interrupt until the reply is received. - Same as
create_program
, but with an explicit gas limit. - Same as
create_program_with_gas
, but creates a new program after thedelay
expressed in block count. - Same as
create_program_with_gas
, but the program will interrupt until the reply is received. - Same as
create_program_with_gas
, but the program will interrupt until the reply is received.