Launch your Chainlet
To launch a chainlet, you will need the following:
To launch a chainlet, you will need the following:
- 1.
- 2.Chainlet type version you wish to launch
- 3.An account in
sagacli
that has funds to cover the chainlet launch and the subsequent billing of the chainlet.
Ok, let's take this one step at a time! In order to list the chainlet types and versions that are available to be launched on SAGA Platform, you can use the following command:
sagacli chainlet list-types
This command will have a similar output to this:
$ sagacli chainlet list-types
DisplayName Description Creator Version SetupCost EpochCost
----------- ----------- ------- ------- --------- ---------
sagaevm SagaEVM Chainlet Stack saga17gk4chqd0lrkyamrxdmu62czmu0dpnemmxlymn 1.0 10tsaga 10tsaga/day
Chainlet types are added at the moment by admins, members of the SAGA engineering team. In the near future, this will be done in a decentralized manner via a community governance process
To launch a chainlet of type
sagaevm
, you would execute the following command:$ sagacli chainlet launch sagaevm 1.1 magicwarriors --dac-enable --maintainer saga1rdssl22ysxyendrkh2exw9zm7hvj8d2ju346g3 --genesis-account 1B610FA944818999B476BAB267145BF5D923B552:10000000000 --denom saga
You are about to sign and broadcast a transaction, with the following configurations:
* Keyname: shan
* Keyring: os
* Address: saga1rdssl22ysxyendrkh2exw9zm7hvj8d2ju
* Network RPC: https://spc.sp1.sagarpc.io
* Platform chain id: cassiospc-1
* Ledger: false
* Message Detail:
creator:"saga1rdssl22ysxyendrkh2exw9zm7hvj8d2ju346g3"
maintainers:"saga1rdssl22ysxyendrkh2exw9zm7hvj8d2ju346g3"
chainletStackName:"sagaevm"
chainletStackVersion:"1.0"
chainId:"magicwarriors_1679724736025955-1"
chainletName:"magicwarriors"
params:<gasLimit:10000000
dacEnable:true
genAcctBalances:<>
>
Do you want to proceed? (y/N):
y
2023-03-25T01:12:22-05:00 INF tx broadcasted to the remote node code=0 gas_used=125370 gas_wanted=200000 hash=1AA884883BE6A92D3CC5C50DCBAD82A988A5CD8BBEB22CC9505357C45ABF1143
That was a lot to take in at the same time! Let's break that down and take a look at each parameter provided to the command we executed above. Here is the command again:
sagacli chainlet launch sagaevm 1.1 magicwarriors --dac-enable \
--maintainer saga1rdssl22ysxyendrkh2exw9zm7hvj8d2ju346g3 \
--genesis-account 1B610FA944818999B476BAB267145BF5D923B552:10000000000 --denom saga
sagacli chainlet launch | enables access to the chainlet launch capability of sagacli |
sagaevm | indicates the chainlet type we are launching |
1.1 | indicates the version of the chainlet type we want to use for the chainlet. Note that there can be multiple versions of a chainlet type, which often happens when the chainlet of a specific type is updated and enhanced, or patched |
magicwarriors | this is what we want to call the chainlet i.e. the chainlet's name, it will be part of the new chainlet chain-id and will be used for the RPC endpoints and Explorer URLs of this new chainlet |
--dac-enable | this flag enables deployment access control for the chainlet so that multiple users ( sagacli accounts) can be tagged as chainlet admins and/or as accounts that are allowed to deploy smart contracts on the chainlet. No other account will be allowed to deploy smart contracts on this chainlet if this flag is provided! |
--maintainer | this is a comma separated list of chainlet admins. The address following the maintainer flag is the account that will be added as a chainlet admin, giving this address the ability to deploy smart contracts. |
--genesis-account | this is a list of hex addresses along with their respective balances that we want to allocate at chainlet genesis i.e. the chainlet will be launched with these addresses holding the specified balance in tokens. |
IMPORTANT: The above chainlet has been launched by the address associated with the default key (refer to Configuring a Default Key in
sagacli
). If you wish to use a different key to sign the launch chainlet transaction (which will set the address of that key as the chainlet
owner), simply append the --from <keyname>
flag to the sagacli chainlet launch
command.
Example:
sagacli chainlet launch <chainlet launch parms> --from mykey2
Launching the chainlet will automatically fund the escrow account from the account. Prior to launching, you need to ensure there are enough tokens in your account. If you do not have enough tokens, you may see some error messages when launching your chainlet.
IMPORTANT: If you need to launch a chainlet with a different currency aka token denomination, other than the default (
tsaga
), simply pass the --denom
flag to set the token denomination for the chainlet.Example:
sagacli chainlet launch sagaevm 1.0 mychain --dac-enable \
--maintainer <your saga account address> --genesis-account <your hex wallet address>:1000000 --denom <your token name>
For a comprehensive list of options, including how to control naming of the chainlet, control the gas limit on each transaction, set up accounts on the chainlet genesis, please refer to
sagacli chainlet launch --help