-
Notifications
You must be signed in to change notification settings - Fork 245
chore(orchestration): create scaffold for swap anything asyncFlow #11304
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
b719deb
89b18db
1c76e82
00b07f9
668f415
2ffcdce
b2bff31
dd8b0eb
00275c8
a2c8920
ba5b9ed
6573231
ea3ab00
ad27056
8191a94
54e569a
75782a5
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import mainConfig from './ava.config.js'; | ||
|
||
export default { | ||
...mainConfig, | ||
files: ['test/xcs-swap-anything/**/*.test.ts'], | ||
}; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,125 @@ | ||
name: agoric-multichain-testing | ||
dckc marked this conversation as resolved.
Show resolved
Hide resolved
|
||
version: 0.2.20 | ||
|
||
chains: | ||
- id: agoriclocal | ||
name: agoric | ||
image: ghcr.io/agoric/agoric-sdk:dev | ||
numValidators: 1 | ||
env: | ||
- name: DEBUG | ||
value: SwingSet:vat,SwingSet:ls | ||
genesis: | ||
app_state: | ||
staking: | ||
params: | ||
unbonding_time: '2m' | ||
swingset: | ||
params: | ||
bootstrap_vat_config: '@agoric/vm-config/decentral-itest-orchestration-chains-config.json' | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why the
|
||
scripts: | ||
updateConfig: | ||
file: scripts/update-config.sh | ||
faucet: | ||
enabled: true | ||
type: starship | ||
ports: | ||
rest: 1317 | ||
rpc: 26657 | ||
exposer: 38087 | ||
grpc: 9090 | ||
faucet: 8082 | ||
resources: | ||
cpu: 1 | ||
memory: 4Gi | ||
- id: osmosislocal | ||
name: osmosis | ||
numValidators: 1 | ||
genesis: | ||
app_state: | ||
staking: | ||
params: | ||
unbonding_time: '2m' | ||
interchain_accounts: | ||
host_genesis_state: | ||
params: | ||
host_enabled: true | ||
allow_messages: ['*'] | ||
interchainquery: | ||
host_port: 'icqhost' | ||
params: | ||
host_enabled: true | ||
allow_queries: | ||
- /cosmos.bank.v1beta1.Query/Balance | ||
- /cosmos.bank.v1beta1.Query/AllBalances | ||
scripts: | ||
updateConfig: | ||
file: scripts/update-config-logs.sh | ||
faucet: | ||
enabled: true | ||
type: starship | ||
ports: | ||
rest: 1315 | ||
rpc: 26655 | ||
grpc: 9093 | ||
faucet: 8084 | ||
resources: | ||
cpu: 1 | ||
memory: 1Gi | ||
- id: cosmoshublocal | ||
name: cosmoshub | ||
numValidators: 1 | ||
genesis: | ||
app_state: | ||
staking: | ||
params: | ||
unbonding_time: '2m' | ||
interchain_accounts: | ||
host_genesis_state: | ||
params: | ||
host_enabled: true | ||
allow_messages: ['*'] | ||
faucet: | ||
enabled: true | ||
type: starship | ||
ports: | ||
rest: 1314 | ||
rpc: 26654 | ||
grpc: 9092 | ||
faucet: 8083 | ||
resources: | ||
cpu: 1 | ||
memory: 1Gi | ||
|
||
relayers: | ||
- name: osmosis-cosmoshub | ||
type: hermes | ||
replicas: 1 | ||
chains: | ||
- osmosislocal | ||
- cosmoshublocal | ||
- name: agoric-osmosis | ||
type: hermes | ||
replicas: 1 | ||
chains: | ||
- agoriclocal | ||
- osmosislocal | ||
config: | ||
global: | ||
log_level: 'debug' | ||
telemetry: | ||
enabled: true | ||
- name: agoric-cosmoshub | ||
type: hermes | ||
replicas: 1 | ||
chains: | ||
- agoriclocal | ||
- cosmoshublocal | ||
|
||
explorer: | ||
enabled: false | ||
|
||
registry: | ||
enabled: true | ||
ports: | ||
rest: 8081 |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,13 +9,15 @@ | |
"test:main": "ava --config ava.rest.config.js", | ||
"test:fast-usdc": "ava --config ava.fusdc.config.js", | ||
"test:queries": "ava --config ava.queries.config.js", | ||
"test:staking": "ava --config ava.staking.config.js" | ||
"test:staking": "ava --config ava.staking.config.js", | ||
"test:xcs": "ava --config ava.xcs.config.js" | ||
}, | ||
"packageManager": "[email protected]", | ||
"devDependencies": { | ||
"@agoric/cosmic-proto": "dev", | ||
"@agoric/fast-usdc": "dev", | ||
"@cosmjs/amino": "npm:^0.32.4", | ||
"@cosmjs/cosmwasm-stargate": "^0.33.1", | ||
"@cosmjs/crypto": "^0.33.0", | ||
"@cosmjs/proto-signing": "^0.33.0", | ||
"@cosmjs/stargate": "^0.33.0", | ||
|
@@ -33,6 +35,7 @@ | |
"eslint-config-prettier": "^10.1.1", | ||
"execa": "^9.5.2", | ||
"fs-extra": "^11.2.0", | ||
"osmojs": "^16.15.0", | ||
"starshipjs": "2.4.1", | ||
"ts-blank-space": "^0.4.4", | ||
"typescript": "~5.8.2" | ||
|
@@ -94,8 +97,8 @@ | |
"@agoric/xsnap-lockdown": "portal:../packages/xsnap-lockdown", | ||
"@agoric/zoe": "portal:../packages/zoe", | ||
"@agoric/zone": "portal:../packages/zone", | ||
"@cosmjs/proto-signing@npm:0.32.3": "npm:@cosmjs/proto-signing@0.33.0", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why are the |
||
"@cosmjs/stargate@npm:0.32.3": "npm:@cosmjs/stargate@0.33.0" | ||
"@cosmjs/proto-signing": "0.33.1", | ||
"@cosmjs/stargate": "0.33.1" | ||
}, | ||
"license": "Apache-2.0" | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
#!/bin/bash | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm struggling to see the purpose of this script. How about a sentence or two of file comments? |
||
|
||
CHAIN_ID="${CHAIN_ID:=osmosis}" | ||
CHAIN_DIR="${CHAIN_DIR:=$HOME/.osmosisd}" | ||
KEYS_CONFIG="${KEYS_CONFIG:=configs/keys.json}" | ||
|
||
set -eux | ||
|
||
ls $CHAIN_DIR | ||
|
||
echo "Update config.toml file" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Update in what way? For what purpose? We don't need a comment to say that the config.toml file is being changed; that much is obvious. Please let's use comments to say what the code doesn't say. |
||
sed -i -e 's#"tcp://127.0.0.1:26657"#"tcp://0.0.0.0:26657"#g' $CHAIN_DIR/config/config.toml | ||
sed -i -e 's/index_all_keys = false/index_all_keys = true/g' $CHAIN_DIR/config/config.toml | ||
sed -i -e 's/seeds = ".*"/seeds = ""/g' $CHAIN_DIR/config/config.toml | ||
sed -i -e 's#cors_allowed_origins = \[\]#cors_allowed_origins = \["*"\]#g' $CHAIN_DIR/config/config.toml | ||
sed -i -e 's/index_all_keys = false/index_all_keys = true/g' $CHAIN_DIR/config/config.toml | ||
|
||
echo "Update client.toml file" | ||
sed -i -e 's#keyring-backend = "os"#keyring-backend = "test"#g' $CHAIN_DIR/config/client.toml | ||
sed -i -e 's#output = "text"#output = "json"#g' $CHAIN_DIR/config/client.toml | ||
sed -i -e "s#chain-id = \"\"#chain-id = \"$CHAIN_ID\"#g" $CHAIN_DIR/config/client.toml | ||
|
||
echo "Update app.toml file" | ||
sed -i -e "s#minimum-gas-prices = \".*\"#minimum-gas-prices = \"0$DENOM\"#g" $CHAIN_DIR/config/app.toml | ||
sed -i -e "s#pruning = \".*\"#pruning = \"default\"#g" $CHAIN_DIR/config/app.toml | ||
sed -i -e 's/enable-unsafe-cors = false/enable-unsafe-cors = true/g' $CHAIN_DIR/config/app.toml | ||
sed -i -e 's/enabled-unsafe-cors = false/enabled-unsafe-cors = true/g' $CHAIN_DIR/config/app.toml | ||
sed -i -e 's/enable = false/enable = true/g' $CHAIN_DIR/config/app.toml | ||
sed -i -e 's/swagger = false/swagger = true/g' $CHAIN_DIR/config/app.toml | ||
sed -i -e 's/enable = false/enable = true/g' $CHAIN_DIR/config/app.toml | ||
sed -i -e 's/enabled = false/enabled = true/g' $CHAIN_DIR/config/app.toml | ||
|
||
function get_next_line_number() { | ||
local txt=$1 | ||
local file=$2 | ||
local line_number=$(grep -n "$txt" $file | cut -d: -f1 | head -1) | ||
echo $((line_number + 1)) | ||
} | ||
|
||
line_number=$(get_next_line_number "Address defines the API server to listen on." $CHAIN_DIR/config/app.toml) | ||
sed -i -e "${line_number}s#address = \".*\"#address = \"tcp://0.0.0.0:1317\"#g" $CHAIN_DIR/config/app.toml | ||
|
||
line_number=$(get_next_line_number "Address defines the gRPC server address to bind to." $CHAIN_DIR/config/app.toml) | ||
sed -i -e "${line_number}s#address = \".*\"#address = \"0.0.0.0:9090\"#g" $CHAIN_DIR/config/app.toml | ||
|
||
line_number=$(get_next_line_number "Address defines the gRPC-web server address to bind to." $CHAIN_DIR/config/app.toml) | ||
sed -i -e "${line_number}s#address = \".*\"#address = \"0.0.0.0:9091\"#g" $CHAIN_DIR/config/app.toml | ||
|
||
if [ "$METRICS" == "true" ]; then | ||
sed -i -e "s/prometheus = false/prometheus = true/g" $CHAIN_DIR/config/config.toml | ||
|
||
line_number=$(get_next_line_number "PrometheusRetentionTime, when positive, enables a Prometheus metrics sink." $CHAIN_DIR/config/app.toml) | ||
sed -i -e "${line_number}s/prometheus-retention-time = 0/prometheus-retention-time = 3600/g" $CHAIN_DIR/config/app.toml | ||
fi | ||
|
||
echo "Update consensus params in config.toml" | ||
sed -i -e "s#timeout_propose = \".*\"#timeout_propose = \"$TIMEOUT_PROPOSE\"#g" $CHAIN_DIR/config/config.toml | ||
sed -i -e "s#timeout_propose_delta = \".*\"#timeout_propose_delta = \"$TIMEOUT_PROPOSE_DELTA\"#g" $CHAIN_DIR/config/config.toml | ||
sed -i -e "s#timeout_prevote = \".*\"#timeout_prevote = \"$TIMEOUT_PREVOTE\"#g" $CHAIN_DIR/config/config.toml | ||
sed -i -e "s#timeout_prevote_delta = \".*\"#timeout_prevote_delta = \"$TIMEOUT_PREVOTE_DELTA\"#g" $CHAIN_DIR/config/config.toml | ||
sed -i -e "s#timeout_precommit = \".*\"#timeout_precommit = \"$TIMEOUT_PRECOMMIT\"#g" $CHAIN_DIR/config/config.toml | ||
sed -i -e "s#timeout_precommit_delta = \".*\"#timeout_precommit_delta = \"$TIMEOUT_PRECOMMIT_DELTA\"#g" $CHAIN_DIR/config/config.toml | ||
sed -i -e "s#timeout_commit = \".*\"#timeout_commit = \"$TIMEOUT_COMMIT\"#g" $CHAIN_DIR/config/config.toml | ||
|
||
echo "Update config.toml file log level" | ||
sed -i -E 's/^(log_level\s*=\s*)".*"/\1"debug"/' $CHAIN_DIR/config/config.toml | ||
Comment on lines
+65
to
+66
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think I saw some explanation of why |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
## Spin up Environment | ||
```sh | ||
cd agoric-sdk/multichain-testing | ||
make start FILE=config.xcs-swap-anything.yaml | ||
make osmosis-xcs-setup | ||
make create-osmosis-pool | ||
|
||
## Configure the osmosis registries | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is this supposed to be a markdown heading? It's currently a shell comment inside a fenced block. |
||
cd agoric-sdk/multichain-testing/test/xcs-swap-anything | ||
make tx-chain-channel-links | ||
make tx-bec32-prefixes | ||
``` | ||
|
||
## Run tests | ||
```sh | ||
cd agoric-sdk/multichain-testing | ||
yarn ava test/xcs-swap-anything/swap-anything.test.ts | ||
``` |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
#!/bin/bash | ||
# Usage: ./download_specific_files.sh <owner> <repo> <branch> <folder> <destination> <file1> <file2> ... | ||
|
||
set -euo pipefail | ||
|
||
owner="$1" | ||
repo="$2" | ||
branch="$3" | ||
folder="$4" | ||
dest="$5" | ||
shift 5 | ||
files_to_download=("$@") | ||
|
||
api_url="https://api.github.com/repos/$owner/$repo/contents/$folder?ref=$branch" | ||
mkdir -p "$dest" | ||
|
||
curl -s "$api_url" | jq -r '.[] | select(.type=="file") | .name + " " + .download_url' \ | ||
| while read -r filename url; do | ||
for wanted in "${files_to_download[@]}"; do | ||
if [[ "$filename" == "$wanted" ]]; then | ||
echo "Downloading $filename..." | ||
curl -sL "$url" -o "$dest/$filename" | ||
fi | ||
done | ||
done | ||
|
||
echo "✅ Selected files downloaded to $dest" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so this starts another set of nodes? How long does that take? It appears that landing this would slow down ci for all PRs going forward. Can you estimate how much?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The
Swap on Osmosis XCS contract
job takes proximally21 minutes
https://github.com/Agoric/agoric-sdk/actions/runs/15276953486/job/42965699219?pr=11304
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does it run in parallel with other jobs? Or in series?
p.s. I see it runs in parallel.