|
| 1 | +## TLDR |
| 2 | + |
| 3 | +Deploy |
| 4 | + |
| 5 | +```sh |
| 6 | +# setup helm/starship |
| 7 | +yarn starship setup |
| 8 | + |
| 9 | +# deploy starship, the command will wait until all pods are running |
| 10 | +yarn starship:all |
| 11 | + |
| 12 | +# sanity check |
| 13 | +yarn starship get-pods |
| 14 | +``` |
| 15 | + |
| 16 | +Run Tests |
| 17 | + |
| 18 | +```sh |
| 19 | +# test |
| 20 | +yarn starship:test |
| 21 | +``` |
| 22 | + |
| 23 | +Teardown |
| 24 | + |
| 25 | +```sh |
| 26 | +# stop port forwarding (done by clean() too) |
| 27 | +# yarn starship stop-ports |
| 28 | + |
| 29 | +# stop ports and delete & remove helm chart |
| 30 | +yarn starship:clean |
| 31 | +``` |
| 32 | + |
| 33 | +## 1. Installation |
| 34 | + |
| 35 | +Inorder to get started with starship, one needs to install the following |
| 36 | + |
| 37 | +- `kubectl`: https://kubernetes.io/docs/tasks/tools/ |
| 38 | +- `kind`: https://kind.sigs.k8s.io/docs/user/quick-start/#installation |
| 39 | +- `helm`: https://helm.sh/docs/intro/install/ |
| 40 | + |
| 41 | +Note: To make the process easy we have a simple command that will try and install dependencies |
| 42 | +so that you dont have to. |
| 43 | + |
| 44 | +```bash |
| 45 | +yarn starship setup |
| 46 | +``` |
| 47 | + |
| 48 | +This command will |
| 49 | + |
| 50 | +- check (and install) if your system has all the dependencies needed to run the e2e tests wtih Starship |
| 51 | +- fetch the helm charts for Starship |
| 52 | + |
| 53 | +## 2. Connect to a kubernetes cluster |
| 54 | + |
| 55 | +Inorder to set up the infrastructure, for Starship, we need access to a kubernetes cluster. |
| 56 | +One can either perform connect to a |
| 57 | + |
| 58 | +- remote cluster in a managed kubernetes service |
| 59 | +- use kubernetes desktop to spin up a cluster |
| 60 | +- use kind to create a local cluster on local machine |
| 61 | + |
| 62 | +To make this easier we have a handy command which will create a local kind cluster and give you access |
| 63 | +to a kubernetes cluster locally. |
| 64 | + |
| 65 | +NOTE: Resources constraint on local machine will affect the performance of Starship spinup time |
| 66 | + |
| 67 | +```bash |
| 68 | +kubectl get pods |
| 69 | +``` |
| 70 | + |
| 71 | +## 3. Start Starship |
| 72 | + |
| 73 | +Now with the dependencies and a kubernetes cluster in handy, we can proceed with creating the mini-cosmos ecosystem |
| 74 | + |
| 75 | +Run |
| 76 | + |
| 77 | +```bash |
| 78 | +yarn starship:all |
| 79 | +# or |
| 80 | +yarn starship start |
| 81 | +``` |
| 82 | + |
| 83 | +We use the config file `configs/config.yaml` as the genesis file to define the topology of the e2e test infra. Change it as required |
| 84 | + |
| 85 | +Note: Spinup will take some time, while you wait for the system, can check the progress in another tab with `kubectl get pods` |
| 86 | + |
| 87 | +## 4. Run the tests |
| 88 | + |
| 89 | +We have everything we need, our desired infrastructure is now running as intended, now we can run |
| 90 | +our end-to-end tests. |
| 91 | + |
| 92 | +Run |
| 93 | + |
| 94 | +```bash |
| 95 | +yarn starship:test |
| 96 | +``` |
| 97 | + |
| 98 | +## 5. Stop the infra |
| 99 | + |
| 100 | +The tests should be ideompotent, so the tests can be run multiple times (which is recommeded), since the time to spinup is still high (around 5 to 10 mins). |
| 101 | + |
| 102 | +Once the state of the mini-cosmos is corrupted, you can stop the deployments with |
| 103 | + |
| 104 | +```bash |
| 105 | +yarn starship:clean |
| 106 | +``` |
| 107 | + |
| 108 | +Which will |
| 109 | + |
| 110 | +- Stop port-forwarding the traffic to your local |
| 111 | +- Delete all the helm charts deployed |
| 112 | + |
| 113 | +## Related |
| 114 | + |
| 115 | +Checkout these related projects: |
| 116 | + |
| 117 | +- [@cosmology/telescope](https://github.com/hyperweb-io/telescope) Your Frontend Companion for Building with TypeScript with Cosmos SDK Modules. |
| 118 | +- [@cosmwasm/ts-codegen](https://github.com/CosmWasm/ts-codegen) Convert your CosmWasm smart contracts into dev-friendly TypeScript classes. |
| 119 | +- [chain-registry](https://github.com/hyperweb-io/chain-registry) Everything from token symbols, logos, and IBC denominations for all assets you want to support in your application. |
| 120 | +- [cosmos-kit](https://github.com/hyperweb-io/cosmos-kit) Experience the convenience of connecting with a variety of web3 wallets through a single, streamlined interface. |
| 121 | +- [create-cosmos-app](https://github.com/hyperweb-io/create-cosmos-app) Set up a modern Cosmos app by running one command. |
| 122 | +- [interchain-ui](https://github.com/hyperweb-io/interchain-ui) The Interchain Design System, empowering developers with a flexible, easy-to-use UI kit. |
| 123 | +- [starship](https://github.com/hyperweb-io/starship) Unified Testing and Development for the Interchain. |
| 124 | + |
| 125 | +## Credits |
| 126 | + |
| 127 | +🛠 Built by Hyperweb (formerly Cosmology) — if you like our tools, please checkout and contribute to [our github ⚛️](https://github.com/hyperweb-io) |
| 128 | + |
| 129 | +## Disclaimer |
| 130 | + |
| 131 | +AS DESCRIBED IN THE LICENSES, THE SOFTWARE IS PROVIDED “AS IS”, AT YOUR OWN RISK, AND WITHOUT WARRANTIES OF ANY KIND. |
| 132 | + |
| 133 | +No developer or entity involved in creating this software will be liable for any claims or damages whatsoever associated with your use, inability to use, or your interaction with other users of the code, including any direct, indirect, incidental, special, exemplary, punitive or consequential damages, or loss of profits, cryptocurrencies, tokens, or anything else of value. |
0 commit comments