# Update Chainlet Version

It may happen that you will need to update the chainlet stack version to include a security patch or a new feature or for any other reason. You can update a chainlet's version by using the `chainlet update` command.

Here is an example:

```
sagacli chainlet update <chain id> <version to upgrade to>
```

## Available Versions

To view available versions for a chainlet type, simply use the `sagacli chainlet list-types` command:

```
$ sagacli chainlet list-types
DisplayName     Description                Creator                                        Version     SetupCost          EpochCost
-----------     -----------                -------                                        -------     ---------          ---------
SagaOS         SagaOS Chainlet Stack     saga17gk4chqd0lrkyamrxdmu62czmu0dpnemmxlymn      0.5.16      10000000upsaga     10000000upsaga/day
SagaOS         SagaOS Chainlet Stack     saga1u2a8ktctqhpx655ysw7ru27t6hqt9wlq4fn5ca      0.5.17      10000000upsaga     10000000upsaga/day
```

We can see that we have a newer version of the chainlet type `sagaevm`.

## Update Example

To update to this newer version called "SagaEVM Chainlet Latest", we would use the following command:

```
$ sagacli chainlet update jargames_1679785243507504-1 1.1

You are about to sign and broadcast a transaction, with the following configurations:
* Keyname:                shan
* Keyring:                os
* Address:                saga1rdssl22ysxyendrkh2exw9zm7hvj8d2ju346g3
* Network RPC:            https://spc.sagarpc.io
* Platform chain id:      spc-1
* Ledger:                 false
* Message Detail:
	sender:"saga1rdssl22ysxyendrkh2exw9zm7hvj8d2ju346g3"
	chainId:"jargames_1679785243507504-1"
	maintainers:"saga1rdssl22ysxyendrkh2exw9zm7hvj8d2ju346g3"
	chainletStackName:"SagaOS"
	chainletStackVersion:"0.5.17"
	chainletName:"jargames"
	params:<genAcctBalances:<>
	>
	
Do you want to proceed? (y/N):
y
2023-03-25T19:48:00-05:00 INF tx broadcasted to the remote node code=0 gas_used=62507 gas_wanted=200000 hash=B20F1BDDDCA619869F385B58977F470179C7C92EC784EE30310E1EAC739C4E90
```

We can see that our request was successfully submitted. Now we can check the status of our chainlet by using the `chainlet list` or `chainlet get <chain-id>` command:

```
$ sagacli chainlet list
ChainId                       Name       StackName     StackVersion     Status     EscrowBalance
-------                       ----       ---------     ------------     ------     -------------
jargames_1679785243507504-1   jargames   SagaOS        0.5.17           Pending     28000000upsaga
```

As can be seen from the output, the chainlet's version has been upgraded to 1.1 and it is currently being upgraded (status = Pending)

## Further Details

For further details and additional options on using the `chainlet update` command, refer to

```
sagacli chainlet update --help
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.saga.xyz/sagacli/working-with-chainlet/update-chainlet-version.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
