Extend a deployed contract's storage entry TTL
You can use the Soroban CLI to extend the TTL of a contract's persistent storage entry. For a storage entry that uses a simple Symbol
as its storage key, you can run a command like so:
soroban contract extend \
--source S... \
--network testnet \
--id C... \
--key COUNTER \
--ledgers-to-extend 535679 \
--durability persistent
This example uses 535,679 ledgers as the new archival TTL. This is the maximum allowable value for this argument on the CLI. This corresponds to roughly 30 days (averaging 5 second ledger close times).
If your storage entry uses a more advanced storage key, such as Balance(Address)
in a token contract, you'll need to provide the key in a base64-encoded XDR form:
soroban contract extend \
--source S... \
--network testnet \
--id C... \
--key-xdr AAAABgAAAAHXkotywnA8z+r365/0701QSlWouXn8m0UOoshCtNHOYQAAAA4AAAAHQmFsYW5jZQAAAAAB \
--ledgers-to-extend 535679 \
--durability persistent
Be sure to check out our guide on creating XDR ledger keys for help generating them.
Guides in this category:
📄️ Deploy a Contract from Installed Wasm Bytecode
To deploy an instance of a compiled smart contract that has already been isntalled onto the Stellar network, use the soroban contract deploy command:
📄️ Deploy the Stellar Asset Contract for a Stellar Asset
The Soroban CLI can deploy a [Stellar Asset Contract] for a Stellar asset so that any Soroban contract can interact with the asset.
📄️ Extend a deployed contract instance's TTL
You can use the Soroban CLI to extend the TTL of a contract instance like so:
📄️ Extend a deployed contract's storage entry TTL
You can use the Soroban CLI to extend the TTL of a contract's persistent storage entry. For a storage entry that uses a simple Symbol as its storage key, you can run a command like so:
📄️ Extend a deployed contract's Wasm code TTL
You can use the Soroban CLI to extend the TTL of a contract's Wasm bytecode. This can be done in two forms
📄️ Install and Deploy a Smart Contract
You can combine the install and deploy commands of the Soroban CLI to accomplish both tasks:
📄️ Install Wasm Bytecode
To use the Soroban CLI to install a compiled smart contract on the ledger, use the soroban contract install command:
📄️ Restore an archived contract using the Soroban CLI
If your contract instance has been archived, it can easily be restored using the Soroban CLI.
📄️ Restore archived contract data using the Soroban CLI
If a contract's persistent storage entry has been archived, you can restore it using the Soroban CLI. For a storage entry that uses a simple Symbol as its storage key, you can run a command like so: