Skip to content

Commit

Permalink
Aotumated: Update starship documentation from starship repo
Browse files Browse the repository at this point in the history
  • Loading branch information
actions-user committed May 7, 2024
1 parent 9388a19 commit 4a2bc2b
Show file tree
Hide file tree
Showing 6 changed files with 118 additions and 53 deletions.
78 changes: 39 additions & 39 deletions pages/starship/config/chains.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,48 +2,48 @@

Here we will go into details of the `chains` top level directive in the Starship config file.

## `name`
Name of the chain, this is used as the `chain-id` of the chain
## `id`
ID of the chain, this is used as the `chain-id` of the chain
```yaml
chains:
- name: osmosis-1
- id: osmosis-1
...
- name: gaia-2
- id: gaia-2
...
- name: juno-1
- id: juno-1
...
```
## `type`
## `name`
Type of chain is a short hand to use the default key values for a chain found [here](https://github.com/cosmology-tech/starship/blob/main/charts/devnet/values.yaml#L54...#L244)
```yaml
chains:
- name: osmosis-1
type: osmosis
- id: osmosis-1
name: osmosis
...
- name: gaia-2
type: cosmos
- id: gaia-2
name: cosmos
...
```

One can override the default values supported by `defaultChain` by simply mentioning it in the chain directive.
Here is how one can set the docker image of the default values
```yaml
chains:
- name: osmosis-1
type: osmosis
- id: osmosis-1
name: osmosis
image: ghcr.io/cosmology-tech/starship/osmosis:v15.0.0
coins: 100000000000000uosmo
...
```

### `type: custom`
### `name: custom`
Optionally one can define the type to `custom`, and pass all the default params directly into the chain directive. This is useful when one is
trying setup a chain not supported in the `defaultChains`.
```yaml
chains:
- name: osmosis-1
type: custom
- id: osmosis-1
name: custom
image: ghcr.io/cosmology-tech/starship/osmosis:v15.1.2-wasmvm1.1.2
home: /root/.osmosisd
binary: osmosisd
Expand All @@ -58,12 +58,12 @@ chains:

## `image` (optional)
Already mentioned above, but here we will go deeper into how the docker images are used for the chain. By default this value is taken from
the `type` directive. This is the standard way of running chains at specific versions.
the `name` directive. This is the standard way of running chains at specific versions.

```yaml
chains:
- name: osmosis-1
type: osmosis
- id: osmosis-1
name: osmosis
image: "<docker-image>"
...
```
Expand All @@ -80,8 +80,8 @@ Number of validators to run for the chain. It must be greater than 1, can go up

```yaml
chains:
- name: osmosis-1
type: osmosis
- id: osmosis-1
name: osmosis
numValidators: 2
```

Expand All @@ -95,8 +95,8 @@ which is 5, then other validators are created with random mnemonic on initializa
Ports directive in the `chains` directive is used for `kubectl port-forward` forwarding kubernetes service ports to local host.
```yaml
chains:
- name: osmosis-1
type: osmosis
- id: osmosis-1
name: osmosis
numValidators: 2
ports:
rest: 1317 # Rest endpoint of the Genesis validator node (most used)
Expand All @@ -116,8 +116,8 @@ Available endpoints for extra services:
Resource directive is something with which you can control how much resources to provide to each of the chain node.
```yaml
chains:
- name: osmosis-1
type: osmosis
- id: osmosis-1
name: osmosis
numValidators: 1
resources:
cpu: 1 # 1 CPU
Expand All @@ -130,8 +130,8 @@ One can provide fractional cpus and memory as per the resource constraints of th
Usually when running in the CI or locally you can provide partial resources like following:
```yaml
chains:
- name: osmosis-1
type: osmosis
- id: osmosis-1
name: osmosis
numValidators: 1
resources:
cpu: "0.2" # 0.2 CPU
Expand All @@ -153,8 +153,8 @@ overridden with this directive, specially for compatible cosmjs version with the

```yaml
chains:
- name: osmosis-1
type: osmosis
- id: osmosis-1
name: osmosis
numValidators: 1
faucet:
enabled: true # optional, default is true, need to specify if want to disable faucet, set to false
Expand All @@ -181,24 +181,24 @@ When the directive is `enabled`, then the docker image is set to a [`runner` doc
which is a basic alpine image with starship dependencies.
```yaml
chains:
- name: osmosis-1
type: osmosis
- id: osmosis-1
name: osmosis
numValidators: 2
build:
enabled: true
source: v15.0.0 # can be a tag or a commit or a branch
```
We fetch the source from the `repo` defined in the `defaultChains`.

If you are using the `type: custom`, then you need to specify `repo` directive, from where to get the source.
If you are using the `name: custom`, then you need to specify `repo` directive, from where to get the source.

## `upgrade` (optional)
If you want to perform a software upgrade on a chain, then this directive is here help. This will not perform the chain
upgrade, but prepare the chain nodes to be able to do an actual software upgrade.
```yaml
chains:
- name: osmosis-1
type: osmosis
- id: osmosis-1
name: osmosis
numValidators: 2
upgrade:
enabled: true # enable the directive
Expand All @@ -219,8 +219,8 @@ Patch `genesis.json` file directly from the config file using this directive. On
patch for genesis is applied.
```yaml
chains:
- name: osmosis-1
type: osmosis
- id: osmosis-1
name: osmosis
numValidators: 2
genesis:
app_state:
Expand All @@ -247,8 +247,8 @@ One can choose the sub-scripts that need to be overwritten, default scripts will

```yaml
chains:
- name: osmosis-1
type: osmosis
- id: osmosis-1
name: osmosis
numValidators: 1
scripts:
createGenesis:
Expand Down Expand Up @@ -284,8 +284,8 @@ that connect with the cometmock pod.
Enabling cometmock is really simple with following
```yaml
chains:
- name: cosmoshub-4
type: cosmos
- id: cosmoshub-4
name: cosmos
numValidators: 4
cometmock:
enabled: true
Expand Down
34 changes: 33 additions & 1 deletion pages/starship/config/features.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ registry:
image: ghcr.io/cosmology-tech/starship/registry:20230614-7173db2
```
> Note: `registry.localhost` is set to true by default, meaning if the ports are specified in chains[].ports, then we set the various api endpoints of the chain registry to `localhost:<port>`. Make sure `rest`, `grpc`, `rpc` are set as [chain ports](https://github.com/cosmology-tech/starship/blob/main/docs/pages/config/chains.mdx#ports). If set to false, then it is set to kubernetes internal DNS endpoints.
> Note: `registry.localhost` is set to true by default, meaning if the ports are specified in chains[].ports, then we set the various api endpoints of the chain registry to `localhost:<port>`. Make sure `rest`, `grpc`, `rpc` are set as [chain ports](https://starship.cosmology.tech/config/chains#ports). If set to false, then it is set to kubernetes internal DNS endpoints.

### Usage

Expand Down Expand Up @@ -71,3 +71,35 @@ Available versions for the explorer can be found [here](https://github.com/cosmo
### Usage

After performing `port-forward`, open explorer at: http://localhost:8080

## Ingress
In order to get external traffic into Starship, one can use the `ingress` directive to
create ingress rules on the domain.

> NOTE: Prerequists include installing `cert-issuer` and `nginx-ingress` controller in the k8s cluster.
Domain specified, needs to be pointing to the k8s cluster in which Starship is deployed

### Syntax
```yaml
ingress:
enabled: true
type: nginx
# host must be a wildcard entry, so that we can use the wildcard to create
# service specific ingress rules.
host: "*.thestarship.io"
certManager:
issuer: "cert-issuer"
```

Above will create following endpoints with the domain, and valid certs:
* Explorer at: `https://explorere.<host>` (if enabled)
* Registry at: `https://registry.<host>` (if enabled)
* Chains at:
* RPC endpoint: `https://rpc.<chain-id>-genesis.<host>`
* Rest endpoint: `https://rest.<chain-id>-genesis.<host>`
* Chain exposer: `https://rest.<chain-id>-genesis.<host>/exposer`
* Chain faucet: `https://rest.<chain-id>-genesis.<host>/faucet`
* Relayers at:
* Rest endpoint: `https://rest.<relayer-type>-<relayer-name>.<host>`
* Exposer endpoint: `https://rest.<relayer-type>-<relayer-name>.<host>/exposer`

8 changes: 4 additions & 4 deletions pages/starship/config/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@ Here is a basic example that will spin up:

```yaml
chains:
- name: osmosis-1
type: osmosis
- id: osmosis-1
name: osmosis
numValidators: 2
ports:
rest: 1313
rpc: 26653
- name: gaia-1
type: cosmos
- id: gaia-1
name: cosmos
numValidators: 2
ports:
rest: 1317
Expand Down
25 changes: 24 additions & 1 deletion pages/starship/config/relayers.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ relayers:

## `chains`
List of chains to connect to each other, via the Relayer.
Must be `name` of chains defined in the `chains` directive.
Must be `id` of chains defined in the `chains` directive.

```yaml
chains:
Expand Down Expand Up @@ -116,3 +116,26 @@ relayers:

All allowed config params can be found in the [default values](https://github.com/cosmology-tech/starship/pull/185/files#diff-b6d755bc9ec9f0229fa0fc7beff17964f31889df81dbd5a16764ed8cdecbfa96R286-R310)
(Basically everything in [config.toml](https://github.com/informalsystems/hermes/blob/master/config.toml#L8...L111) file for the hermes relayer)

## `ports` (optional, hermes only)
Ports directive in the `relayers` directive is used for `kubectl port-forward` forwarding kubernetes service ports to local host.
```yaml
relayers:
- name: hermes-osmo-juno
type: hermes
replicas: 1
chains:
- osmosis-1
- juno-1
ports:
rest: 3001
exposer: 3002
```

Available endpoints on
* `rest` endpoints: https://hermes.informal.systems/documentation/rest-api.html?highlight=rest#rest-api
* `exposer` endpoint
* `/create_channel` endpoint: Supports post request. Proto defination: https://github.com/cosmology-tech/starship/blob/main/proto/exposer/service.proto#L47

One can use the exposer endpoint on the relayer to create channel from outside.
Note: Still an experimental feature on exposer
12 changes: 6 additions & 6 deletions pages/starship/get-started/step-3.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Run
```bash
helm repo add starship https://cosmology-tech.github.io/starship/
helm repo update
helm search repo starship/devnet --version 0.1.45
helm search repo starship/devnet --version 0.2.0
```

## 3.2) Define the desired infrastructure
Expand All @@ -35,14 +35,14 @@ touch starship.yaml
Add following content to `starship.yaml` with the following content
```yaml
chains:
- name: osmosis-1
type: osmosis
- id: osmosis-1
name: osmosis
numValidators: 1
ports:
rest: 1313
rpc: 26653
- name: gaia-1
type: cosmos
- id: gaia-1
name: cosmos
numValidators: 1
ports:
rest: 1317
Expand Down Expand Up @@ -76,7 +76,7 @@ For the tutorial we will keep it simple.
## 3.3) Spin up the infrastructure
Spin up the infrastructure with
```bash
helm install -f starship.yaml tutorial starship/devnet --version 0.1.45
helm install -f starship.yaml tutorial starship/devnet --version 0.2.0
# Where
# -f starship.yaml: use the starship.yaml file as the configuration
Expand Down
14 changes: 12 additions & 2 deletions pages/starship/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,23 @@ import React from "react";
Starship is a unified development environment that allows Cosmos developers to spin up a fully simulated mini-cosmos ecosystem
and write end-to-end test cases


Go to the [Official Project](https://github.com/cosmology-tech/starship) (👷‍♀️in progress...).

## Get Started

⚡️ How to use Starship?
Follow the Steps 1 to 4 in Get Started section

## Projects using Starship

### [Cosmos-sdk](https://github.com/cosmos/cosmos-sdk/tree/main/tests/starship)

Cosmos-SDK is running Starship for testing out the latest simapp. Runs in [CI/CD](https://github.com/cosmos/cosmos-sdk/actions/workflows/starship-tests.yml)
### [Mesh-Security](https://github.com/osmosis-labs/mesh-security-sdk/tree/main/tests/starship)

For mesh-security development, Starship is being used to create a dev environment in a cloud cluster to
run 2 chains and a relayer, setup mesh-security contracts between them, as well as spin up mesh-security frontend as well.
### [OsmoJS](https://github.com/osmosis-labs/osmojs/pull/36)

JS library using Starship to run end-to-end tests against Osmosis chain. (Run in CI/CD)
Expand All @@ -72,6 +82,6 @@ Run tests with Golang

Setup chain with cosmovisor setup with different chain version binaries.
Run tests with Golang
### [Multi chain setup](https://github.com/cosmology-tech/starship/blob/main/examples/multi-chain/configs/osmo-juno-cosmos.yaml)
### [Multi chain setup](https://github.com/cosmology-tech/starship/blob/main/examples/multi-chain/config.yaml)

Multi chain setup with 2 chains with 4 validators, a ts-relayer between them and the explorer
Multi chain setup with 3 chains, 2 relayers between the chain, explorer and registry

0 comments on commit 4a2bc2b

Please sign in to comment.