Extend a deployed contract's storage entry TTL
You can use the Stellar 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:
stellar 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:
stellar 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:
ποΈ Contract Lifecycle
Manage the lifecycle of a Stellar smart contract using the CLI
ποΈ Deploy a contract from installed Wasm bytecode
Deploy an instance of a compiled contract that is already installed on the network
ποΈ Deploy the Stellar Asset Contract for a Stellar asset
Deploy an SAC for a Stellar asset so that it can interact with smart contracts
ποΈ Extend a deployed contract instance's TTL
Use the CLI to extend the time to live (TTL) of a contract instance
ποΈ Extend a deployed contract's storage entry TTL
Use the CLI to extend the time to live (TTL) of a contract's persistent storage entry
ποΈ Extend a deployed contract's Wasm code TTL
Use Stellar CLI to extend contract's Wasm bytecode TTL, with or without local binary
ποΈ Install and deploy a smart contract
Combine the install and deploy commands in the Stellar CLI to accomplish both tasks
ποΈ Install Wasm bytecode
Use the Stellar CLI to install a compiled smart contract on the ledger
ποΈ Payments and Assets
Send XLM, stellar classic, or a soroban asset using the Stellar CLI
ποΈ Restore an archived contract using the Stellar CLI
Restore an archived contract instance using the Stellar CLI
ποΈ Restore archived contract data using the Stellar CLI
Restore archived contract storage entries using Stellar CLI