# Advanced Notes

Validators should see the [v2.0 Testnet Restart](/validating/network-upgrades/tachyon-2.0.md) guide for validator migration instructions.

This guide details the steps taken to migrate the X1 Testnet Chain to v2.0 to document the process for future reference.

**Do not preform these steps.**

On the bootstrap node, the following steps were taken to migrate the X1 Testnet Chain to v2.0:

1. Install Tachyon v2.0
2. Stop the Validator
3. Set Environment Variables:

   ```bash
   export PARENT_DIRECTORY=/data/x1-testnet
   export LEDGER_PATH=$PARENT_DIRECTORY/ledger
   export ACCOUNTS_PATH=$PARENT_DIRECTORY/accounts
   export SNAPSHOTS_PATH=$PARENT_DIRECTORY/snapshots
   export VOTE_ACCOUNT_KEYPAIR=/var/lib/x1/vote-account-keypair.json
   ```
4. Backup the keys and ledger data

   ```bash
   rsync -av $PARENT_DIRECTORY/ $PARENT_DIRECTORY.bak/
   ```
5. Create a snapshot using solana-ledger-tool with a Hard Fork: deactivate the development feature gates & deactivate all other stake accounts.

   ```bash
   export SLOT_X=$(tachyon-ledger-tool --output json-compact --ledger $LEDGER_PATH latest-optimistic-slot | tail -1 | awk '{print $1}')
   export VOTE_ADDRESS=$(solana address -k "$VOTE_ACCOUNT_KEYPAIR")
   export OTHER_STAKERS=$(solana --url https://rpc.testnet.x1.xyz validators --output json-compact | jq -r '.validators[].voteAccountPubkey' | grep -v "$VOTE_ADDRESS" | xargs xargs -0 printf "--destake-vote-account %s ")
   snapshot_output=$(tachyon-ledger-tool create-snapshot $SLOT_X \
      --ledger $LEDGER_PATH \
      --incremental-snapshot-archive-path $SNAPSHOTS_PATH \
      --snapshots $SNAPSHOTS_PATH \
      --hard-fork $SLOT_X \
      --destake-vote-account $OTHER_STAKERS \
      --warp-slot $(($SLOT_X+1001)) \
      --enable-capitalization-change \
      --deactivate-feature-gate \
        tvcF6b1TRz353zKuhBjinZkKzjmihXmBAHJdjNYw1sQ decoMktMcnmiq6t3u7g5BfgcQu91nKZr6RvMYf9z1Jb 7uZBkJXJ1HkuP6R3MJfZs7mLwymBcDbKdqbF51Z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YgF29mMnTSusGx5EJ zkNLP7EQALfC1TYeB3biDU7akDckj8iPkvh9y2Mt2K3 zkiTNuzBKxrCLMKehzuQeKZyLtX2yvFcEKMML8nExU8)QQ
   echo $snapshot_output
   export SLOT_X=$(echo $snapshot_output | awk '{print $8}')
   export BANK_HASH=$(echo $snapshot_output | awk '{print $16}' | sed 's/:$//')
   ```
6. Modify the Genesis to switch the cluster type from `development` to `testnet`

   ```bash
   tachyon-ledger-tool modify-genesis --ledger $LEDGER_PATH \
     --cluster-type testnet /tmp/modify-tachyon-genesis/
   rsync -av /tmp/modify-tachyon-genesis/ $LEDGER_PATH/   
   rsync -av /tmp/modify-tachyon-genesis/rocksdb/ $LEDGER_PATH/rocksdb/
   export SHRED_VERSION=$(tachyon-ledger-tool --ledger $LEDGER_PATH shred-version)
   echo export SLOT_X=$SLOT_X; 
   echo export BANK_HASH=$BANK_HASH; 
   echo export SHRED_VERSION=$SHRED_VERSION
   ```
7. Update Startup Config

   ```bash
   tachyon-validator \                       # <-- Update the binary name from solana-validator to tachyon-validator.
   --wait-for-supermajority $(($SLOT_X + 1)) \   # <-- NEW! IMPORTANT! REMOVE AFTER THIS RESTART
   --expected-shred-version $SHRED_VERSION \          # <-- NEW! IMPORTANT! REMOVE AFTER THIS RESTART
   --expected-bank-hash $BANK_HASH   # <-- NEW! IMPORTANT! REMOVE AFTER THIS RESTART
   ...
   ```

   ⚠️ **Warning**: You might encounter an error related to a mismatch in the shred version. If this happens, note the reported shred version and update the --expected-shred-version argument with the correct value.

## **Next Steps**

Once the validator starts, monitor the logs for block processing and ensure the validator is running correctly. Announce the restart on Telegram and provide instructions for other validators to update their nodes.

Don't forget to remove the `--wait-for-supermajority`, `--expected-shred-version`, and `--expected-bank-hash` arguments after the restart.


---

# 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.x1.xyz/validating/network-upgrades/tachyon-2.0/advanced.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.
