feat: use docker arg to specify Stacks 2.0 branch

This commit is contained in:
Matthew Little
2020-12-30 15:43:46 +01:00
parent b23c97dba0
commit bee8f2664f
3 changed files with 31 additions and 6 deletions

View File

@@ -7,7 +7,8 @@ RUN apt-get install -y nodejs
RUN node --version
### Checkout Stacks 2.0 src
RUN git clone --depth 1 --branch v24.2.1.0-xenon https://github.com/blockstack/stacks-blockchain.git /stacks2.0
ARG STACKS_V2_BRANCH
RUN git clone --depth 1 --branch $STACKS_V2_BRANCH https://github.com/blockstack/stacks-blockchain.git /stacks2.0
WORKDIR /stacks2.0/testnet/stacks-node
RUN cargo fetch

View File

@@ -0,0 +1,29 @@
This directory contains a Dockerfile that performs automated validation of the migration process from Stacks 1.0 to Stacks 2.0.
A sampling of STX balances and lockup schedules are tested.
The following steps are automatically performed:
1. Checkout and install Stacks 1.0.
2. Run a Stacks 1.0 fast-sync to get caught up to the latest chain state (as of the latest hosted snapshot).
3. Trigger a fast-sync-dump similar to how it will be triggered from the name threshold.
4. Perform the chainstate export step from the fast-sync-dump.
5. Checkout the Stacks 2.0 source, and copy over the newly exported chainstate.txt, and build.
6. Query the Stacks 1.0 db for 1000 address balances, and ~1000 lockup schedules.
7. Spin up both a Stacks 1.0 and Stacks 2.0 node, and validate the address balances match using the account RPC endpoints:
* Stacks 1.0: `/v1/accounts/{address}/STACKS/balance`
* Stacks 2.0: `/v2/accounts/{address-in-testnet-format}`
8. Validate lockup schedules in Stacks 2.0 match the samples dumped from the Stacks 1.0, using a contract map lookup:
* `/v2/map_entry/ST000000000000000000002AMW42H/lockup/lockups`
### Running
This is a resources intensive process and can take upwards of an hour.
Ensure Docker is allocated at least 70GB disk size and 4GB memory.
Run the docker build:
```shell
cd migration-verification
DOCKER_BUILDKIT=1 BUILDKIT_PROGRESS=plain docker build --build-arg STACKS_V2_BRANCH=<branch or tag> .
```

View File

@@ -1,5 +0,0 @@
#!/bin/bash
cd "$(dirname "${BASH_SOURCE[0]}")"
DOCKER_BUILDKIT=1 BUILDKIT_PROGRESS=plain docker build .