forked from o1-labs/docs2
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
17 changed files
with
644 additions
and
130 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
73 changes: 73 additions & 0 deletions
73
docs/berkeley-upgrade/archive-migration/docker-example.mdx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
--- | ||
title: Example of Mainnet Archive Migration (Docker) | ||
sidebar_label: Docker example (Mainnet) | ||
hide_title: true | ||
description: A copy-paste example of how to do a Mainnet migration. | ||
keywords: | ||
- Berkeley | ||
- upgrade | ||
- archive migration | ||
- mina archive node | ||
- archive node | ||
--- | ||
|
||
You can follow these steps that can be copy-pasted directly into a OS running Docker. | ||
|
||
This example performs a Mainnet initial migration following the [debian-example](/berkeley-upgrade/archive-migration/debian-example) | ||
|
||
```sh | ||
|
||
# Create a new directory for the migration data | ||
mkdir $(pwd)/mainnet-migration && cd $(pwd)/mainnet-migration | ||
|
||
# Create Network | ||
docker network create mainnet | ||
|
||
# Launch Local Postgres Database | ||
docker run --name postgres -d -p 5432:5432 --network mainnet -v $(pwd)/mainnet-migration/postgresql/data:/var/lib/postgresql/data -e POSTGRES_USER=mina -e POSTGRES_PASSWORD=minamina -d postgres:13-bullseye | ||
|
||
export PGHOST="localhost" | ||
export PGPORT=5432 | ||
export PGUSER="mina" | ||
export PGPASSWORD="minamina" | ||
|
||
# Drop DBs if they exist | ||
psql -c "DROP DATABASE IF EXISTS mainnet_balances_migrated;" | ||
psql -c "DROP DATABASE IF EXISTS mainnet_really_migrated;" | ||
|
||
# Create DBs | ||
psql -c "CREATE DATABASE mainnet_balances_migrated;" | ||
psql -c "CREATE DATABASE mainnet_really_migrated;" | ||
|
||
# Retrieve Archive Node Backup | ||
wget https://673156464838-mina-archive-node-backups.s3.us-west-2.amazonaws.com/mainnet/mainnet-archive-dump-2024-04-29_0000.sql.tar.gz | ||
tar -xf mainnet-archive-dump-2024-04-29_0000.sql.tar.gz | ||
|
||
# Replace the database name in the dump | ||
sed -i -e s/archive_balances_migrated/mainnet_balances_migrated/g mainnet-archive-dump-2024-04-29_0000.sql | ||
psql mainnet_balances_migrated -f mainnet-archive-dump-2024-04-29_0000.sql | ||
|
||
# Prepare target | ||
wget https://raw.githubusercontent.com/MinaProtocol/mina/berkeley/src/app/archive/create_schema.sql | ||
wget https://raw.githubusercontent.com/MinaProtocol/mina/berkeley/src/app/archive/zkapp_tables.sql | ||
psql mainnet_really_migrated -f create_schema.sql | ||
|
||
# Start migration | ||
docker create --name mainnet-db-migration \ | ||
-v $(pwd)/mainnet-migration:/data \ | ||
--network mainnet gcr.io/o1labs-192920/mina-archive-migration:3.0.1-e848ecb-bullseye -- bash -c ' | ||
wget http://673156464838-mina-genesis-ledgers.s3-website-us-west-2.amazonaws.com/mainnet/genesis_ledger.json; mina-berkeley-migration-script initial \ | ||
--genesis-ledger genesis_ledger.json \ | ||
--source-db postgres://mina:minamina@postgres:5432/mainnet_balances_migrated \ | ||
--target-db postgres://mina:minamina@postgres:5432/mainnet_really_migrated \ | ||
--blocks-batch-size 5000 \ | ||
--blocks-bucket mina_network_block_data \ | ||
--checkpoint-output-path /data/checkpoints/. \ | ||
--precomputed-blocks-local-path /data/precomputed_blocks/. \ | ||
--network mainnet' | ||
|
||
docker start mainnet-db-migration | ||
|
||
docker logs -f mainnet-db-migration | ||
|
||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
--- | ||
title: Archive Migration | ||
sidebar_label: Archive Migration | ||
hide_title: true | ||
description: Berkeley upgrade is a major upgrade that requires all nodes in a network to upgrade to a newer version. It is not backward compatible. | ||
keywords: | ||
- Berkeley | ||
- upgrade | ||
- archive migration | ||
- mina archive node | ||
- archive node | ||
--- | ||
|
||
# Archive Migration | ||
|
||
The Berkeley upgrade is a major upgrade that requires all nodes in a network to upgrade to a newer version. It is not backward compatible. | ||
|
||
A major upgrade occurs when there are major changes to the core protocol that require all nodes on the network to update to the latest software. | ||
|
||
## How to prepare for the Berkeley upgrade | ||
|
||
The Berkeley upgrade requires upgrading all nodes, including archive nodes. One of the required steps is to migrate archive databases from the current Mainnet format to Berkeley. This migration requires actions and efforts from node operators and exchanges. | ||
|
||
Learn about the archive data migration: | ||
|
||
- [Understanding the migration process](/berkeley-upgrade/archive-migration/understanding-archive-migration) | ||
- [Prerequisites before migration](/berkeley-upgrade/archive-migration/archive-migration-prerequisites) | ||
- [Suggested installation procedure](/berkeley-upgrade/archive-migration/archive-migration-installation) | ||
- [How to perform archive migration](/berkeley-upgrade/archive-migration/migrating-archive-database-to-berkeley) | ||
|
||
Finally, see the shell script example that is compatible with a stock Debian 11 container: | ||
|
||
- [Worked Devnet Debian example using March 22 data](/berkeley-upgrade/archive-migration/debian-example) | ||
- [Worked Devnet Docker example using April 29 data](/berkeley-upgrade/archive-migration/docker-example) | ||
|
||
## What will happen with original Devnet/Mainnet data | ||
|
||
After the migration, you will have two databases: | ||
|
||
- The original Devnet/Mainnet database with small data adjustments (all pending blocks from last canoncial block until the fork block are converted to canoncial blocks) | ||
- A new Berkeley database based on Devnet/Mainnet data, but: | ||
- Without Devnet/Mainnet orphaned blocks | ||
- Without pending blocks that are not in the canonical chain | ||
- With all pending blocks on the canonical chain converted to canonical blocks | ||
|
||
There is no requirement to preserve the original Devnet/Mainnet database after migration. However, if for some reason you want to keep the Mainnet orphaned or non-canonical pending blocks, you can download the archive maintenance package for the Devnet/Mainnet database. | ||
|
||
To learn about maintaining archive data, see [Devnet/Mainnet database maintenance](/berkeley-upgrade/archive-migration/mainnet-database-maintenance). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.