-
Notifications
You must be signed in to change notification settings - Fork 2
136 lines (126 loc) · 4.85 KB
/
Copy pathlive-testnet-e2e.yml
File metadata and controls
136 lines (126 loc) · 4.85 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
---
name: Live Testnet E2E (Optional)
"on":
workflow_dispatch:
inputs:
network_profile:
description: "Network profile to use (example: testnet11)"
default: "testnet11"
required: true
pair:
description: "Asset pair for manager proof (example: TDBX:txch)"
default: "TDBX:txch"
required: true
size_base_units:
description: "Offer size in base units"
default: "1"
required: true
dry_run:
description: "Run in dry-run mode where possible"
default: "true"
required: true
jobs:
live-testnet-e2e:
runs-on: ubuntu-latest
env:
TESTNET_WALLET_MNEMONIC: ${{ secrets.TESTNET_WALLET_MNEMONIC }}
GREENFLOOR_CHIA_KEYS_DERIVATION_SCAN_LIMIT: "1000"
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Install Rust toolchain (chia-wallet-sdk pyo3 build)
run: |
curl https://sh.rustup.rs -sSf | sh -s -- -y --profile minimal
echo "$HOME/.cargo/bin" >> "$GITHUB_PATH"
"$HOME/.cargo/bin/rustc" --version
"$HOME/.cargo/bin/cargo" --version
- name: Resolve chia-wallet-sdk pinned commit
id: sdk
run: |
echo "sha=$(git rev-parse HEAD:chia-wallet-sdk)" >> "$GITHUB_OUTPUT"
- name: Cache chia-wallet-sdk wheelhouse
id: cache-sdk-wheelhouse
uses: actions/cache@v4
with:
path: ./.cache/wheelhouse/chia-wallet-sdk
key: sdk-wheelhouse-${{ runner.os }}-py311-${{ steps.sdk.outputs.sha }}
- name: Build chia-wallet-sdk wheel (cache miss)
if: steps.cache-sdk-wheelhouse.outputs.cache-hit != 'true'
run: |
mkdir -p ./.cache/wheelhouse/chia-wallet-sdk
python -m pip wheel --wheel-dir ./.cache/wheelhouse/chia-wallet-sdk ./chia-wallet-sdk/pyo3
- name: Install package
run: |
python -m pip install --upgrade pip
python -m pip install -e ".[dev]"
python -m pip install ./.cache/wheelhouse/chia-wallet-sdk/*.whl
- name: Validate config and run manager proof flow
shell: bash
run: |
set -euo pipefail
export GREENFLOOR_SIGNING_DEBUG=1
if [ -z "${TESTNET_WALLET_MNEMONIC:-}" ]; then
echo "::error::TESTNET_WALLET_MNEMONIC is not set; cannot run live testnet proof workflow."
exit 1
fi
mkdir -p ./.tmp-state ./artifacts
printf "1\n%s\n" "${TESTNET_WALLET_MNEMONIC}" | \
greenfloor-manager \
--program-config config/program.yaml \
keys-onboard \
--key-id key-main-1 \
--state-dir ./.tmp-state
greenfloor-manager \
--program-config config/program.yaml \
--markets-config config/markets.yaml \
config-validate
greenfloor-manager \
--program-config config/program.yaml \
--markets-config config/markets.yaml \
doctor
greenfloor-manager \
--program-config config/program.yaml \
--markets-config config/markets.yaml \
build-and-post-offer \
--pair "${{ inputs.pair }}" \
--size-base-units "${{ inputs.size_base_units }}" \
--network "${{ inputs.network_profile }}" \
--dry-run | tee ./artifacts/build-and-post-offer.dry-run.log
if [ "${{ inputs.dry_run }}" = "false" ]; then
greenfloor-manager \
--program-config config/program.yaml \
--markets-config config/markets.yaml \
build-and-post-offer \
--pair "${{ inputs.pair }}" \
--size-base-units "${{ inputs.size_base_units }}" \
--network "${{ inputs.network_profile }}" \
| tee ./artifacts/build-and-post-offer.live.log
greenfloor-manager \
--program-config config/program.yaml \
--markets-config config/markets.yaml \
offers-status \
--limit 50 \
--events-limit 30 \
| tee ./artifacts/offers-status.log
greenfloor-manager \
--program-config config/program.yaml \
--markets-config config/markets.yaml \
offers-reconcile \
--limit 200 \
| tee ./artifacts/offers-reconcile.log
fi
greenfloord \
--program-config config/program.yaml \
--markets-config config/markets.yaml \
--state-dir ./.tmp-state \
--once | tee ./artifacts/greenfloord-once.log
- name: Upload proof artifacts
if: always()
uses: actions/upload-artifact@v4
with:
name: live-testnet-e2e-artifacts
path: artifacts/