-
Notifications
You must be signed in to change notification settings - Fork 208
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
feat: multichain-testing #9462
Merged
Merged
feat: multichain-testing #9462
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
5bd2f89
feat(orchestration): e2e testing environment with starship
0xpatrickdev c388baa
feat(orchestration): e2e tests with starship
0xpatrickdev 10766b1
fix(e2e): increase k8s resources for ci
0xpatrickdev d5b4930
fix(e2): configure multichain-e2e workflow to run on 16 core runners
LuqiPan 7908662
fix: Error from server (NotFound): pods "agoriclocal-genesis-0" not f…
0xpatrickdev 43d3258
fix: chain registry is not available
0xpatrickdev 5cb591b
WIP: copy e2e-tools etc. from dapp-agoric-basics
dckc 0eb79a3
WIP: starship test using makeE2ETools
dckc 4b940a5
fix: ensure e2e-tools are compatible with `multichain-testing` package
0xpatrickdev 753ea0c
test: ensure only 1 test is running at a time
0xpatrickdev 8f710c8
test: provision smart wallet
0xpatrickdev 859b002
test: common setup
0xpatrickdev 54f453f
test: use ava@6
0xpatrickdev File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
name: Multichain E2E Tests | ||
|
||
on: | ||
workflow_dispatch: | ||
push: | ||
branches: | ||
# $default-branch | ||
- master | ||
- 'release-*' | ||
- 'dev-*' | ||
tags: | ||
- '@agoric/sdk@*' | ||
|
||
jobs: | ||
multichain-e2e: | ||
runs-on: ubuntu-latest-16core | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
submodules: 'true' | ||
path: ./agoric-sdk | ||
- uses: ./agoric-sdk/.github/actions/restore-node | ||
with: | ||
node-version: 18.x | ||
path: ./agoric-sdk | ||
|
||
- name: Enable Corepack | ||
run: corepack enable | ||
working-directory: ./agoric-sdk/multichain-testing | ||
|
||
- name: Install @agoric/multichain-testing deps | ||
run: yarn install | ||
working-directory: ./agoric-sdk/multichain-testing | ||
|
||
- name: Lint @agoric/multichain-testing | ||
run: yarn lint | ||
working-directory: ./agoric-sdk/multichain-testing | ||
|
||
- name: Setup Starship Infrastructure | ||
id: starship-infra | ||
uses: cosmology-tech/[email protected] | ||
with: | ||
# uses ghcr.io/agoric/agoric-sdk:dev image (latest master) | ||
values: ./agoric-sdk/multichain-testing/config.yaml | ||
port-forward: true | ||
version: 0.2.2 | ||
timeout: 30m | ||
namespace: agoric-multichain | ||
|
||
- name: Fund Provision Pool | ||
run: | | ||
kubectl config set-context --current --namespace=agoric-multichain | ||
kubectl get pods | ||
make fund-provision-pool | ||
working-directory: ./agoric-sdk/multichain-testing | ||
|
||
- name: Ensure ports are forwarded | ||
run: | | ||
curl --fail --retry 3 --retry-delay 10 http://localhost:26657/status || (echo "agoriclocal node is available") | ||
curl --fail --retry 3 --retry-delay 10 http://localhost:8081/chains/agoriclocal || (echo "agoriclocal URL check failed") | ||
curl --fail --retry 3 --retry-delay 10 http://localhost:8081/chains/osmosislocal || (echo "osmosislocal URL check failed") | ||
curl --fail --retry 3 --retry-delay 10 http://localhost:8081/chains/gaialocal || (echo "gaialocal URL check failed") | ||
|
||
- name: Run @agoric/multichain-testing E2E Tests | ||
run: yarn test | ||
working-directory: ./agoric-sdk/multichain-testing |
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,3 @@ | ||
.tsimp | ||
.yarn/* | ||
!.yarn/patches/* |
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 @@ | ||
nodeLinker: node-modules |
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,85 @@ | ||
# see https://github.com/cosmology-tech/starship/blob/0e18757b8393357fc66426c5ee23da4ccf760e74/examples/getting-started/Makefile | ||
|
||
NAME = starship-getting-started | ||
FILE = config.yaml | ||
|
||
HELM_REPO = starship | ||
HELM_CHART = devnet | ||
HELM_VERSION = v0.2.2 | ||
|
||
############################################################################### | ||
### All commands ### | ||
############################################################################### | ||
|
||
.PHONY: setup | ||
setup: setup-deps setup-kind | ||
|
||
.PHONY: stop | ||
stop: stop-forward delete | ||
|
||
.PHONY: clean | ||
clean: stop clean-kind | ||
|
||
############################################################################### | ||
### Dependency check ### | ||
############################################################################### | ||
|
||
.PHONY: check | ||
setup-deps: | ||
bash $(CURDIR)/scripts/dev-setup.sh | ||
|
||
############################################################################### | ||
### Helm Charts ### | ||
############################################################################### | ||
|
||
install: | ||
bash $(CURDIR)/scripts/install.sh --config $(FILE) --name $(NAME) --version $(HELM_VERSION) | ||
|
||
delete: | ||
-helm delete $(NAME) | ||
|
||
############################################################################### | ||
### Port forward ### | ||
############################################################################### | ||
|
||
.PHONY: port-forward | ||
port-forward: | ||
bash $(CURDIR)/scripts/port-forward.sh --config=$(FILE) | ||
|
||
.PHONY: stop-forward | ||
stop-forward: | ||
-pkill -f "port-forward" | ||
|
||
############################################################################### | ||
### Local Kind Setup ### | ||
############################################################################### | ||
KIND_CLUSTER=starship | ||
|
||
.PHONY: setup-kind | ||
setup-kind: | ||
kind create cluster --name $(KIND_CLUSTER) | ||
|
||
.PHONY: clean-kind | ||
clean-kind: | ||
kind delete cluster --name $(KIND_CLUSTER) | ||
|
||
############################################################################### | ||
### Agoric Setup ### | ||
############################################################################### | ||
PROVISION_POOL_ADDR=agoric1megzytg65cyrgzs6fvzxgrcqvwwl7ugpt62346 | ||
|
||
fund-provision-pool: | ||
kubectl exec -i agoriclocal-genesis-0 -c validator -- agd tx bank send faucet $(PROVISION_POOL_ADDR) 1000000000uist -y -b block | ||
|
||
ADDR=agoric1ldmtatp24qlllgxmrsjzcpe20fvlkp448zcuce | ||
COIN=1000000000uist | ||
|
||
fund-wallet: | ||
kubectl exec -i agoriclocal-genesis-0 -c validator -- agd tx bank send faucet $(ADDR) $(COIN) -y -b block | ||
|
||
provision-smart-wallet: | ||
kubectl exec -i agoriclocal-genesis-0 -c validator -- agd tx swingset provision-one wallet $(ADDR) SMART_WALLET --from $(ADDR) -y -b block | ||
|
||
# view agoric swingset logs from slog file, until we can set `DEBUG=SwingSet:vat,SwingSet:ls` | ||
tail-slog: | ||
kubectl exec -i agoriclocal-genesis-0 -c validator -- tail -f slog.slog |
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,84 @@ | ||
# Starship | ||
|
||
End-to-end testing environment for fully simulated chains, powered by [Starship](https://docs.cosmology.zone/starship). | ||
|
||
|
||
## Configuration | ||
|
||
The current commands will read from [`config.yaml`](./config.yaml) to build a multi-chain teting environment. Currently, the image includes `agoric`, `osmosis`, and `cosmos-hub` chains and a hermes relayer between each. | ||
|
||
The `agoric` software revision includes the vats necessary for building and testing orchestration applications: | ||
- vat-network | ||
- vat-ibc | ||
- vat-localchain | ||
- vat-transfer | ||
- vat-orchestration | ||
|
||
## Initial Setup | ||
|
||
Ensure you have `kubectl`, `kind`, `helm`, and `yq` installed on your machine. For convenience, the following command will install dependencies: | ||
|
||
```sh | ||
make setup-deps | ||
``` | ||
|
||
You will need a `kind` cluster: | ||
|
||
```sh | ||
make setup-kind | ||
``` | ||
|
||
## Getting Started | ||
|
||
```sh | ||
# install helm chart and start starship service | ||
make install | ||
|
||
# NOTE: it takes about 10-12 minutes for the above to finish setting up. Use `watch kubectl get pods` to confirm all pods are up and running before running the next command. | ||
|
||
# expose ports on your local machine. useful for testing dapps | ||
make port-forward | ||
|
||
# stop the containers and port-forwarding | ||
make stop | ||
``` | ||
|
||
To setup finish setting up Agoric, also run: | ||
|
||
```bash | ||
make fund-provision-poool | ||
``` | ||
|
||
## Logs | ||
|
||
You can use the following commmands to view logs: | ||
|
||
```sh | ||
# agoric slogfile | ||
make tail-slog | ||
|
||
# agoric validator logs | ||
kubectl logs agoriclocal-genesis-0 --container=validator --follow | ||
|
||
# relayer logs | ||
kubectl logs hermes-agoric-gaia-0 --container=validator --follow | ||
kubectl logs hermes-agoric-gaia-0 --container=validator --follow | ||
``` | ||
|
||
## Agoric Smart Wallet | ||
|
||
For the steps below, you must import a key to `agd` or create a new one. | ||
|
||
```bash | ||
# create a `user1` key from a random seed | ||
kubectl exec -i agoriclocal-genesis-0 -c validator -- agd keys add user1 | ||
|
||
# get the newly created address | ||
ADDR=$(kubectl exec -i agoriclocal-genesis-0 -c validator -- agd keys show user1 -a) | ||
|
||
# fund the wallet with some tokens | ||
make fund-wallet COIN=20000000ubld ADDR=$ADDR | ||
|
||
# provision the smart wallet | ||
make provision-smart-wallet ADDR=$ADDR | ||
``` |
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,106 @@ | ||
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-config.json" | ||
faucet: | ||
enabled: false | ||
ports: | ||
rest: 1317 | ||
rpc: 26657 | ||
exposer: 38087 | ||
grpc: 9090 | ||
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: ["*"] | ||
faucet: | ||
enabled: true | ||
type: starship | ||
ports: | ||
rest: 1315 | ||
rpc: 26655 | ||
grpc: 9093 | ||
faucet: 8084 | ||
resources: | ||
cpu: 1 | ||
memory: 1Gi | ||
- id: gaialocal | ||
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 | ||
ports: | ||
rest: 1314 | ||
rpc: 26654 | ||
grpc: 9092 | ||
faucet: 8083 | ||
resources: | ||
cpu: 1 | ||
memory: 1Gi | ||
|
||
relayers: | ||
- name: osmosis-gaia | ||
type: hermes | ||
replicas: 1 | ||
chains: | ||
- osmosislocal | ||
- gaialocal | ||
- name: agoric-osmosis | ||
type: hermes | ||
replicas: 1 | ||
chains: | ||
- agoriclocal | ||
- osmosislocal | ||
- name: agoric-gaia | ||
type: hermes | ||
replicas: 1 | ||
chains: | ||
- agoriclocal | ||
- gaialocal | ||
|
||
explorer: | ||
enabled: false | ||
|
||
registry: | ||
enabled: true | ||
ports: | ||
rest: 8081 |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Following this guide everything works except the two steps below. Would be helpful to provide an example:
I considered adding a make target for adding a new key instead of the kubectl command, but not sure if it's useful beyond one-offs.
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.
Thanks, added this note as a note