Skip to content
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 50 additions & 0 deletions docs/upgrading-to-berkeley.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,60 @@ done

## Verifying packaged configuration


A script is installed (from `./scripts/mina-verify-packaged-fork-config`) that automates this process. If you want to verify that an installed Mina package was generated from the same configuration as the one exported earlier, it is as easy as:

```
mina-verify-packaged-fork-config (mainnet|devnet) fork_config.json /tmp/mina-verification
```

Many of the script inputs are environment variables that default to the locations used by the debs. If you are building from source, inspect the script, determine what you need to change, and then run it.

Here are some general instructions that should help you get most of the way there.

### Package Verification

#### Environment Setup
1. **Use a Debian Environment:**
- It is recommended to perform package verification in a Debian environment because macOS Intel emulation doesn’t support the required AVX instructions for libp2p.

2. **Environment Preparation:**
- **Install mina-create-legacy-genesis**
```bash
echo "deb [trusted=yes] http://packages.o1test.net bullseye stable" > /etc/apt/sources.list.d/o1.list
apt-get update
apt-get install mina-create-legacy-genesis=1.4.1-97f7d8c
```
- **Prepare Environment Variables:** Set up the necessary environment variables manually to match the expected configuration for verification.
- **Create `genesis_ledgers` Directory:** Temporarily, create a new directory named `genesis_ledgers` in the working directory and place the daemon config for the required chain, typically `mainnet.json` there. Alternatively, make sure that `genesis_ledgers/mainnet.json` is present. The script assumes that it is running in a directory where this is present.

3. **Set Environment Variables:**
- **GSUTIL Path:**
```bash
export GSUTIL=/usr/bin/gsutil
```
- **Download Block Data:**
- Example command to download the block data:
```bash
gsutil cp gs://mina_network_block_data/mainnet-<some-version>.json ./block_data.json
export PRECOMPUTED_FORK_BLOCK=./block_data.json
```
- **Verify Additional Variables:**
- Confirm the following variables are properly set:
```bash
CONFIG_JSON_GZ_URL=<url to fork config zip> ex: "https://storage.googleapis.com/fork-config-dryrun.json.gz"
GENESIS_TIMESTAMP=<same ts as your genesis config> ex: "2024-05-03T00:00:00Z"
NETWORK_NAME=<this should match the intended network> ex: mainnet
PRECOMPUTED_BLOCK_GS_PREFIX=<url to the network block datta> ex: "gs://mina_network_block_data/mainnet"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo- data

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

```

#### Verification Process
1. **Run the Verification Command:**
- If the fork config is not already on your machine, you can download it with a command similiar to:
```bash
curl https://storage.googleapis.com/fork-config-dryrun.json.gz > config.json.gz && gunzip config.json.gz && mina-verify-packaged-fork-config mainnet config.json /workdir/verification gs://mina_network_block_data/mainnet-pre-hf-dry-run-2
```
- If the fork config is already available locally, use:
```bash
mina-verify-packaged-fork-config mainnet fork-config-dryrun.json /tmp/mina-verification
```