Restore archived contract data using the Stellar CLI
If a contract's persistent storage entry has been archived, you can restore it using the Stellar CLI. For a storage entry that uses a simple Symbol
as its storage key, you can run a command like so:
stellar contract restore \
--source S... \
--network testnet \
--id C... \
--key COUNTER \
--durability persistent
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 restore \
--source S... \
--network testnet \
--id C... \
--key-xdr AAAABgAAAAHXkotywnA8z+r365/0701QSlWouXn8m0UOoshCtNHOYQAAAA4AAAAHQmFsYW5jZQAAAAAB \
--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
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.
📄️ 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.