Spawn
Register a program to run on Aleph.im virtual machines.
Description
With the Spawn() functionnality you can launch aleph virtual machine without uploading the code by yourself.
Be aware about the ownership of the source code you are using.
If you use a code from an Aleph message you don't own, know that this code can be amend or deleted at any time by it owner.
Usage
Import the Spawn declaration to interact with the Spawn function and the Item type to choose your storage location.
Then call the Spawn function, with the required parameters as follow:
Required Parameters
account - required Account | Account to use for signing. |
channel - required string | Channel of the message. Ideally, an application would decide and use one channel. |
programRef - required string | A message hash of a store message that contain the code to deploy. |
entrypoint - required string | The entrypoint is composed of two values:β’ The name of the main file that is running the programβ’ The name of the object in the program that inits FastApi Ex: <mainFile:FastApiObject>. Learn more about FastApi here. |
subscription - optional Record<string, unknown> |
|
memory - optional number |
|
runtime - optional string |
|
volumes - optional array of MachineVolume | |
storageEngine - optional ItemType | A location to store the message if inlineRequested is False or your message exced the Max_size (~50 000kb). |
inlineRequested - optinal boolean | If True, the message itself will be stored inline, if False it will be store in the same destination as the storageEngine.β |
APIServer - optional string | The API server endpoint used to carry the request to the Aleph's network. |
Return
After spawning your program, you can find it on the Aleph Explorer. This is an example of a Hello world test.
When you are spawning a Program Message, the function returns the transaction. Inside it, you can find the item_hash
field that is referring to your program location.
You can "pin" your programs' hashes with a Post message for example with some tags and references to allow you to retrieve them easily.
Last updated