# Hard-fork instructions for operators (pre-Phase 4)
Namada is upgrading to [v101.0.0](https://github.com/anoma/namada/releases/tag/v101.0.0) in advance of activating Phase 4. Here are the steps:
### Mainnet params
- `H` = 2176000 (~ May 27 15:00 UTC according to https://namada.valopers.com/blocks/2176000)
- `M` = 2176020
- `E` = 175
## Prerequisites
Below are the things you need to know or have ahead of time before beginning the migration. Migration parameters will be chosen with community confirmation ahead of time. Migration files will be provided in a central location.
- Parameters
- Hard fork height `H`
- Migration height `M`
- Target MASP epoch `E`
- Migration files
- [pre_phase4_migration.json](https://github.com/anoma/namada/releases/download/v101.0.0/pre_phase4_migration.json) -- from the `v101.0.0` release page
- original raw file is [here](https://github.com/anoma/namada/raw/refs/heads/brent/mainnet-upgrade-pre-phase4/pre_phase4_migration.json)
- Migration file hash `$MIGRATION_HASH` from `sha256sum pre_phase4_migration.json`
- Mainnet: `83d7b4fc38f135adfae2f6219bf13c1bbf9022609fb61124be1ff0c5f79e1d7e`
Additionally, if you are operating other services like indexers, then you will need to upgrade those too with new software as part of this process. See [these instructions](https://hackmd.io/Pv_8yyX_R-2RHnVHzGgMOA#Node-operator-instructions) below in particular for this.
## Instructions
- If you are running a validator or full node only, go [here](https://hackmd.io/Pv_8yyX_R-2RHnVHzGgMOA#Validator-only-instructions)
- The instructions contain the minimal set of steps needed to upgrade your validator or full node
- If you are a node operator that offers public services such as indexers, masp-indexers, and/or public RPCs, go [here](https://hackmd.io/Pv_8yyX_R-2RHnVHzGgMOA#Node-operator-instructions)
### Validator-only instructions
0. Make sure you build or download the `v101.0.0` binaries and `pre_phase4_migration.json` ahead of time.
1. Configure your node to stop at the hard fork height `H` with
```
namadan ledger run-until --block-height H --halt
```
Your node will avoid committing block `H` when it is reached and instead shut down. This must be done with the current `v1.1.x`
2. Replace all binaries with new versions `v101.0.0` for upgrading.
3. Restart your node with the new `namadan v101.0.0` and perform the scheduled migration:
```
namadan ledger run --path pre_phase4_migration.json \\
--hash $MIGRATION_HASH --height M
```
You can keep your node running with this command for the rest of the procedure. The node will not stop at height `M` and will continue processing blocks. If you desire or need to stop and restart your node at some height in the future later than `M`, you must restart your node with the simple `namadan ledger run` at that point.
### Node operator instructions
0. Make sure you build or download the new post-upgrade software ahead of time for all services you are running (node, namada-indexer, MASP indexer) described above. Do not start running the new software until the future steps. The indexer versions are:
- namada-indexer [v3.0.2](https://github.com/anoma/namada-indexer/releases/tag/v3.0.2)
- masp-indexer [v1.3.0](https://github.com/anoma/namada-masp-indexer/releases/tag/v1.3.0)
2. Configure your node to stop at the hard fork height `H` with
```
namadan ledger run-until --block-height H --suspend
```
Your node will avoid committing block `H` when it is reached and instead shut down. This must be done with the current `v1.1.x`.
2. `[Opt MASP Idx]` Allow your MASP indexer to run until height `H-1`. Once it reaches this height, stop all microservices except for the `webserver` and `postgres`.
3. `[Opt MASP Idx + RPC provider]` Run the [Namada MASP events migration software](https://github.com/heliaxdev/migrate-masp-events) over the CometBFT home directory `cometbft` within the Namada base directory. Further instructions are provided in the `README` of the linked migration software.
4. Run the namada-indexer until height `H-1` and kill the service once this is reached.
5. Kill your node and replace all binaries with new versions for upgrading.
6. Restart your node with the new `namadan v101.0.0` to perform the scheduled migration:
```
namadan ledger run --path pre_phase4_migration.json \\
--hash $MIGRATION_HASH --height M
```
You can keep your node running with this command for the rest of the procedure. The node will not stop at height `M` and will continue processing blocks.
7. Stop the MASP indexer's `webserver` service that had been running `v1.2.X`
8. Upgrade to the new MASP indexer software version and run all associated services.
9. Upgrade to the new namada-indexer software and run all associated services.
10. No more steps to perform for the upgrade. The conversion tree should reset at the very end of the MASP epoch `E`, at which point the upgrade will be completed. After this point, an operator would be free (but not required) to stop and restart their node with a simple `namadan ledger run`.