<aside> 💡
Read the sharding AIP here:
https://github.com/aptos-foundation/AIPs/blob/main/aips/aip-97.md
</aside>
Storage sharding is managed through your local node configuration. Since the new storage format is incompatible with the previous one, a full DB wipe is required (by simply delete the DB folder) to proceed.
<aside> 💡
Aptos node version required for sharding upgrade: aptos-node-v1.21.2 or higher
</aside>
Flag to start the format migration:
storage:
rocksdb_configs:
enable_storage_sharding: true
/accounts/{address}/events/{event_handle}/{field_name}
/accounts/{address}/events/{creation_number}
/accounts/{address}/transactions
/accounts/{address}/modules
/accounts/{address}/resources
Turn on internal indexer
# Only turn on the APIs you need as they will affect the performance of the node
indexer_db_config:
enable_event: true # controls first 2 APIs above
enable_statekeys: true # controls the 3rd API above
enable_transaction: true # controls the last 2 APIs above
Use Aptos Indexer, check the following links to see if any of them meet your need
Run your own indexer, here are some common infra you might need
Recommendation:
We recommend you to revisit the usage of the above APIs, and take this time as an opportunity to see if there are other ways to achieve the same purpose, because each of those APIs have their own problems. For example, the 2 event APIs are not supporting v2 events (https://github.com/aptos-foundation/AIPs/blob/main/aips/aip-44.md). The /accounts/{address}/transactions
assumes transactions have sequence number which won’t work after we introduce orderless txn (future AIP). The /accounts/{address}/modules
and /accounts/{address}/resources
can usually be replaced by querying the state you are interested in directly, or call the corresponding view function.
v1/info
 endpoint, you should be able to see "new_storage_format":true
, you will also be able to see which internal indexers are enabled.Here is a list of flags (and examples) that might require attention during the migration.
Sync mode
state_sync:
state_sync_driver:
bootstrapping_mode: DownloadLatestStates
continuous_syncing_mode: ExecuteTransactionsOrApplyOutputs
Specify peer(s)
# Note: Replace the address with the upstream you want to use.
seeds:
D717AF1761645FFACFE5A455FB021052AC0FEFBC1B97FC3681BA61423C043D23:
addresses:
- /dns4/pfn0.backup.cloud-a.mainnet.aptoslabs.com/tcp/6182/noise-ik/D717AF1761645FFACFE5A455FB021052AC0FEFBC1B97FC3681BA61423C043D23/handshake/0
role: Upstream
# Note the following example just to show what syntax is supported.
# You should decide how you want to put the data among multiple disks based on your hardware spec.
storage:
db_path_overrides:
ledger_db_path: "/disk0/db"
state_kv_db_path:
metadata_path: "/disk0/db"
shard_paths:
- shards: "1-3,7"
path: "/disk1/db"
- shards: "11-12,15"
path: "/disk2/db"
state_merkle_db_path:
metadata_path: "/disk0/db"
shard_paths:
- shards: "0-7"
path: "/disk3/db"
- shards: "8-15"
path: "/disk4/db"