|
| 1 | +# Upgrade Protocol |
| 2 | + |
| 3 | +Quick local test setup of upgrade protocol: |
| 4 | + |
| 5 | +## Start some DBs |
| 6 | + |
| 7 | +```bash |
| 8 | +docker compose up -d |
| 9 | +``` |
| 10 | + |
| 11 | +will bring up two old dbs on ports 6200 and 6201, and 3 new dbs on ports 6100,6101,6102. |
| 12 | + |
| 13 | +## Fill DBs with test data |
| 14 | + |
| 15 | +```bash |
| 16 | +cargo run --release --bin seed-v1-dbs -- --side right --shares-db-urls postgres://postgres:postgres@localhost:6100 --shares-db-urls postgres://postgres:postgres@localhost:6101 --masks-db-url postgres://postgres:postgres@localhost:6111 --num-elements 10000 |
| 17 | +cargo run --release --bin seed-v1-dbs -- --side left --shares-db-urls postgres://postgres:postgres@localhost:6100 --shares-db-urls postgres://postgres:postgres@localhost:6101 --masks-db-url postgres://postgres:postgres@localhost:6111 --num-elements 10000 |
| 18 | +``` |
| 19 | + |
| 20 | +## Upgrade for left eye |
| 21 | + |
| 22 | +### Run the 3 upgrade servers |
| 23 | + |
| 24 | +Concurrently run: |
| 25 | + |
| 26 | +```bash |
| 27 | +cargo run --release --bin upgrade-server -- --bind-addr 127.0.0.1:8000 --db-url postgres://postgres:postgres@localhost:6200 --party-id 0 --eye left --environment dev |
| 28 | +``` |
| 29 | + |
| 30 | +```bash |
| 31 | +cargo run --release --bin upgrade-server -- --bind-addr 127.0.0.1:8001 --db-url postgres://postgres:postgres@localhost:6201 --party-id 1 --eye left --environment dev |
| 32 | +``` |
| 33 | + |
| 34 | +```bash |
| 35 | +cargo run --release --bin upgrade-server -- --bind-addr 127.0.0.1:8002 --db-url postgres://postgres:postgres@localhost:6202 --party-id 2 --eye left --environment dev |
| 36 | +``` |
| 37 | + |
| 38 | +### Run the 2 upgrade clients |
| 39 | + |
| 40 | +Concurrently run: |
| 41 | + |
| 42 | +```bash |
| 43 | +cargo run --release --bin upgrade-client -- --server1 127.0.0.1:8000 --server2 127.0.0.1:8001 --server3 127.0.0.1:8002 --db-start 0 --db-end 10000 --party-id 0 --eye left --shares-db-url postgres://postgres:postgres@localhost:6100 --masks-db-url postgres://postgres:postgres@localhost:6111 |
| 44 | +cargo run --release --bin upgrade-client -- --server1 127.0.0.1:8000 --server2 127.0.0.1:8001 --server3 127.0.0.1:8002 --db-start 0 --db-end 10000 --party-id 1 --eye left --shares-db-url postgres://postgres:postgres@localhost:6101 --masks-db-url postgres://postgres:postgres@localhost:6111 |
| 45 | +``` |
| 46 | + |
| 47 | +## Upgrade for right eye |
| 48 | + |
| 49 | +### Run the 3 upgrade servers |
| 50 | + |
| 51 | +Concurrently run: |
| 52 | + |
| 53 | +```bash |
| 54 | +cargo run --release --bin upgrade-server -- --bind-addr 127.0.0.1:8000 --db-url postgres://postgres:postgres@localhost:6200 --party-id 0 --eye right --environment dev |
| 55 | +``` |
| 56 | + |
| 57 | +```bash |
| 58 | +cargo run --release --bin upgrade-server -- --bind-addr 127.0.0.1:8001 --db-url postgres://postgres:postgres@localhost:6201 --party-id 1 --eye right --environment dev |
| 59 | +``` |
| 60 | + |
| 61 | +```bash |
| 62 | +cargo run --release --bin upgrade-server -- --bind-addr 127.0.0.1:8002 --db-url postgres://postgres:postgres@localhost:6202 --party-id 2 --eye right --environment dev |
| 63 | +``` |
| 64 | + |
| 65 | +### Run the 2 upgrade clients |
| 66 | + |
| 67 | +(In practice these DBs would point to different old DBs, we just use the same old DBs for left and right in this example ) |
| 68 | + |
| 69 | +Concurrently run: |
| 70 | + |
| 71 | +```bash |
| 72 | +cargo run --release --bin upgrade-client -- --server1 127.0.0.1:8000 --server2 127.0.0.1:8001 --server3 127.0.0.1:8002 --db-start 0 --db-end 10000 --party-id 0 --eye right --shares-db-url postgres://postgres:postgres@localhost:6100 --masks-db-url postgres://postgres:postgres@localhost:6111 |
| 73 | +``` |
| 74 | +```bash |
| 75 | +cargo run --release --bin upgrade-client -- --server1 127.0.0.1:8000 --server2 127.0.0.1:8001 --server3 127.0.0.1:8002 --db-start 0 --db-end 10000 --party-id 1 --eye right --shares-db-url postgres://postgres:postgres@localhost:6101 --masks-db-url postgres://postgres:postgres@localhost:6111 |
| 76 | + |
| 77 | +``` |
| 78 | +## Check the upgrade was successful |
| 79 | + |
| 80 | +```bash |
| 81 | +cargo run --release --bin upgrade-checker -- --environment dev --num-elements 10000 --db-urls postgres://postgres:postgres@localhost:6100 --db-urls postgres://postgres:postgres@localhost:6101 --db-urls postgres://postgres:postgres@localhost:6111 --db-urls postgres://postgres:postgres@localhost:6200 --db-urls postgres://postgres:postgres@localhost:6201 --db-urls postgres://postgres:postgres@localhost:6202 |
| 82 | +``` |
0 commit comments