Skip to content
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

relayer and faucet by default #380

Merged
merged 10 commits into from
Dec 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/starship-docker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ on:
push:
branches:
- main
- anmol/bug-faucet-relayer # build debug docker images

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-starship-docker
Expand Down
2 changes: 1 addition & 1 deletion charts/devnet/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.1.47
version: 0.1.48-rc0

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
Expand Down
7 changes: 7 additions & 0 deletions charts/devnet/configs/keys.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,13 @@
"mnemonic": "issue have volume expire shoe year finish poem alien urban license undo rural endless food host opera fix forum crack wide example firm learn"
}
],
"faucet": [
{
"name": "faucet",
"type": "local",
"mnemonic": "chimney become stuff spoil resource supply picture divorce casual curve check web valid survey zebra various pet sphere timber friend faint blame mansion film"
}
],
"keys": [
{
"name": "test1",
Expand Down
14 changes: 10 additions & 4 deletions charts/devnet/scripts/default/create-genesis.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,16 @@ echo "Adding key...." $(jq -r ".genesis[0].name" $KEYS_CONFIG)
jq -r ".genesis[0].mnemonic" $KEYS_CONFIG | $CHAIN_BIN keys add $(jq -r ".genesis[0].name" $KEYS_CONFIG) --recover --keyring-backend="test"
$CHAIN_BIN $CHAIN_GENESIS_CMD add-genesis-account $($CHAIN_BIN keys show -a $(jq -r .genesis[0].name $KEYS_CONFIG) --keyring-backend="test") $COINS --keyring-backend="test"

# Add faucet key to the keyring and self delegate initial coins
echo "Adding key...." $(jq -r ".faucet[0].name" $KEYS_CONFIG)
jq -r ".faucet[0].mnemonic" $KEYS_CONFIG | $CHAIN_BIN keys add $(jq -r ".faucet[0].name" $KEYS_CONFIG) --recover --keyring-backend="test"
$CHAIN_BIN $CHAIN_GENESIS_CMD add-genesis-account $($CHAIN_BIN keys show -a $(jq -r .faucet[0].name $KEYS_CONFIG) --keyring-backend="test") $COINS --keyring-backend="test"

# Add relayer key and delegate tokens
echo "Adding key...." $(jq -r ".relayers[0].name" $KEYS_CONFIG)
jq -r ".relayers[0].mnemonic" $KEYS_CONFIG | $CHAIN_BIN keys add $(jq -r ".relayers[0].name" $KEYS_CONFIG) --recover --keyring-backend="test"
$CHAIN_BIN $CHAIN_GENESIS_CMD add-genesis-account $($CHAIN_BIN keys show -a $(jq -r .relayers[0].name $KEYS_CONFIG) --keyring-backend="test") $COINS --keyring-backend="test"

## if facuet not enabled then add validator and relayer with index as keys and into gentx
if [[ $FAUCET_ENABLED == "false" && $NUM_VALIDATORS -gt "1" ]];
then
Expand All @@ -33,10 +43,6 @@ then
jq -r ".validators[0].mnemonic" $KEYS_CONFIG | $CHAIN_BIN keys add $VAL_KEY_NAME --index $i --recover --keyring-backend="test"
$CHAIN_BIN $CHAIN_GENESIS_CMD add-genesis-account $($CHAIN_BIN keys show -a $VAL_KEY_NAME --keyring-backend="test") $COINS --keyring-backend="test"
done
## Add relayer key and delegate tokens
echo "Adding key...." $(jq -r ".relayers[0].name" $KEYS_CONFIG)
jq -r ".relayers[0].mnemonic" $KEYS_CONFIG | $CHAIN_BIN keys add $(jq -r ".relayers[0].name" $KEYS_CONFIG) --recover --keyring-backend="test"
$CHAIN_BIN $CHAIN_GENESIS_CMD add-genesis-account $($CHAIN_BIN keys show -a $(jq -r .relayers[0].name $KEYS_CONFIG) --keyring-backend="test") $COINS --keyring-backend="test"
fi

echo "Creating gentx..."
Expand Down
6 changes: 4 additions & 2 deletions charts/devnet/templates/chains/cosmos/genesis.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -271,12 +271,13 @@ spec:
done
export FAUCET_PATH_PATTERN="${HD_PATH:0:$((${#HD_PATH}-1))}a"
export FAUCET_MNEMONIC=$(jq -r ".genesis[0].mnemonic" /configs/keys.json)
export FAUCET_MNEMONIC=$(jq -r ".faucet[0].mnemonic" /configs/keys.json)
echo "FAUCET_MNEMONIC: $FAUCET_MNEMONIC"
echo "FAUCET_PATH_PATTERN: $FAUCET_PATH_PATTERN"
export | grep "FAUCET"
sleep 30
/app/packages/faucet/bin/cosmos-faucet-dist start "http://localhost:26657"
volumeMounts:
- mountPath: /configs
Expand Down Expand Up @@ -324,9 +325,10 @@ spec:
fi
done
export FAUCET_MNEMONIC=$(jq -r ".genesis[0].mnemonic" /configs/keys.json)
export FAUCET_MNEMONIC=$(jq -r ".faucet[0].mnemonic" /configs/keys.json)
export | grep "FAUCET"
sleep 30
/faucet/faucet --credit-coins="$CREDIT_COINS" --chain-fees="$FEES"
volumeMounts:
- mountPath: /configs
Expand Down
1 change: 1 addition & 0 deletions charts/devnet/templates/chains/cosmos/validator.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,7 @@ spec:
- "-c"
- "-e"
- |
sleep 30
set -eux
VAL_INDEX=${HOSTNAME##*-}
VAL_NAME="$(jq -r ".validators[0].name" $KEYS_CONFIG)-$VAL_INDEX"
Expand Down
7 changes: 1 addition & 6 deletions charts/devnet/templates/relayers/go-relayer/statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -70,12 +70,7 @@ spec:
DENOM="{{ $fullchain.denom }}"
RLY_ADDR=$(rly address "{{ $fullchain.name }}" | awk 'END{print}')
echo "Transfer tokens to address $RLY_ADDR on {{ $fullchain.name }} chain with denom $DENOM"
bash -e /scripts/transfer-tokens.sh \
$RLY_ADDR \
$DENOM \
http://{{- include "devnet.chain.name" $fullchain.name }}-genesis.$NAMESPACE.svc.cluster.local:8000/credit \
"{{ $fullchain.faucet.enabled }}"
echo "Relayer address $RLY_ADDR on {{ $fullchain.name }} chain with denom $DENOM
{{- end }}
PATHEND="{{ index $relayer.chains 0 }}-{{ index $relayer.chains 1 }}"
Expand Down
6 changes: 0 additions & 6 deletions charts/devnet/templates/relayers/hermes/statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -79,12 +79,6 @@ spec:
DENOM="{{ $fullchain.denom }}"
RLY_ADDR=$(hermes --json keys list --chain {{ $chain }} | tail -1 | jq -r '.result."{{ $chain }}".account')
echo "Transfer tokens to address $RLY_ADDR"

bash -e /scripts/transfer-tokens.sh \
$RLY_ADDR \
$DENOM \
http://{{ $fullchain.hostname }}-genesis.$NAMESPACE.svc.cluster.local:8000/credit \
"{{ $fullchain.faucet.enabled }}"
{{- end }}

hermes create channel \
Expand Down
7 changes: 1 addition & 6 deletions charts/devnet/templates/relayers/ts-relayer/statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -72,12 +72,7 @@ spec:
{{ $fullchain := include "devnet.fullchain" (dict "name" $chain "file" $defaultFile "context" $) | fromJson }}
DENOM="{{ $fullchain.denom }}"
RLY_ADDR=$(ibc-setup keys list | grep "{{ $fullchain.name }}" | awk '{print $2}')
echo "Transfer tokens to address $RLY_ADDR"
bash -e /scripts/transfer-tokens.sh \
$RLY_ADDR \
$DENOM \
http://{{- include "devnet.chain.name" $fullchain.name }}-genesis.$NAMESPACE.svc.cluster.local:8000/credit \
"{{ $fullchain.faucet.enabled }}"
echo "Relayer address $RLY_ADDR"
{{- end }}
if [ $RLY_INDEX -eq 0 ]; then
Expand Down
51 changes: 27 additions & 24 deletions clients/go/client/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@ require (
github.com/golang/protobuf v1.5.3
github.com/strangelove-ventures/lens v0.0.0-00010101000000-000000000000
github.com/tendermint/tendermint v0.37.0-rc2
go.uber.org/zap v1.24.0
go.uber.org/zap v1.26.0
)

require (
cloud.google.com/go v0.110.0 // indirect
cloud.google.com/go/compute v1.18.0 // indirect
cloud.google.com/go v0.110.9 // indirect
cloud.google.com/go/compute v1.23.2 // indirect
cloud.google.com/go/compute/metadata v0.2.3 // indirect
cloud.google.com/go/iam v0.12.0 // indirect
cloud.google.com/go/iam v1.1.4 // indirect
cloud.google.com/go/storage v1.30.1 // indirect
cosmossdk.io/api v0.3.1 // indirect
cosmossdk.io/core v0.5.1 // indirect
Expand Down Expand Up @@ -73,22 +73,23 @@ require (
github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2 // indirect
github.com/gogo/googleapis v1.4.1-0.20201022092350-68b0159b7869 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/glog v1.1.0 // indirect
github.com/golang/glog v1.1.2 // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/golang/mock v1.6.0 // indirect
github.com/golang/snappy v0.0.4 // indirect
github.com/google/btree v1.1.2 // indirect
github.com/google/go-cmp v0.5.9 // indirect
github.com/google/go-cmp v0.6.0 // indirect
github.com/google/orderedcode v0.0.1 // indirect
github.com/google/uuid v1.3.0 // indirect
github.com/googleapis/enterprise-certificate-proxy v0.2.3 // indirect
github.com/googleapis/gax-go/v2 v2.7.1 // indirect
github.com/google/s2a-go v0.1.7 // indirect
github.com/google/uuid v1.3.1 // indirect
github.com/googleapis/enterprise-certificate-proxy v0.2.5 // indirect
github.com/googleapis/gax-go/v2 v2.12.0 // indirect
github.com/gorilla/handlers v1.5.1 // indirect
github.com/gorilla/mux v1.8.0 // indirect
github.com/gorilla/websocket v1.5.0 // indirect
github.com/grpc-ecosystem/go-grpc-middleware v1.3.0 // indirect
github.com/grpc-ecosystem/grpc-gateway v1.16.0 // indirect
github.com/grpc-ecosystem/grpc-gateway/v2 v2.15.2 // indirect
github.com/grpc-ecosystem/grpc-gateway/v2 v2.18.1 // indirect
github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c // indirect
github.com/gtank/merlin v0.1.1 // indirect
github.com/gtank/ristretto255 v0.1.2 // indirect
Expand Down Expand Up @@ -127,7 +128,7 @@ require (
github.com/pkg/errors v0.9.1 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/prometheus/client_golang v1.14.0 // indirect
github.com/prometheus/client_model v0.3.0 // indirect
github.com/prometheus/client_model v0.4.0 // indirect
github.com/prometheus/common v0.40.0 // indirect
github.com/prometheus/procfs v0.9.0 // indirect
github.com/rakyll/statik v0.1.7 // indirect
Expand All @@ -141,7 +142,7 @@ require (
github.com/spf13/jwalterweatherman v1.1.0 // indirect
github.com/spf13/pflag v1.0.5 // indirect
github.com/spf13/viper v1.15.0 // indirect
github.com/stretchr/testify v1.8.2 // indirect
github.com/stretchr/testify v1.8.4 // indirect
github.com/subosito/gotenv v1.4.2 // indirect
github.com/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d // indirect
github.com/tendermint/go-amino v0.16.0 // indirect
Expand All @@ -152,22 +153,24 @@ require (
github.com/zondax/ledger-go v0.14.1 // indirect
go.etcd.io/bbolt v1.3.7 // indirect
go.opencensus.io v0.24.0 // indirect
go.uber.org/atomic v1.10.0 // indirect
go.uber.org/multierr v1.10.0 // indirect
golang.org/x/crypto v0.7.0 // indirect
golang.org/x/crypto v0.14.0 // indirect
golang.org/x/exp v0.0.0-20230310171629-522b1b587ee0 // indirect
golang.org/x/net v0.8.0 // indirect
golang.org/x/oauth2 v0.6.0 // indirect
golang.org/x/sys v0.6.0 // indirect
golang.org/x/term v0.6.0 // indirect
golang.org/x/text v0.9.0 // indirect
golang.org/x/tools v0.7.0 // indirect
golang.org/x/mod v0.11.0 // indirect
golang.org/x/net v0.17.0 // indirect
golang.org/x/oauth2 v0.13.0 // indirect
golang.org/x/sync v0.3.0 // indirect
golang.org/x/sys v0.13.0 // indirect
golang.org/x/term v0.13.0 // indirect
golang.org/x/text v0.14.0 // indirect
golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 // indirect
google.golang.org/api v0.114.0 // indirect
google.golang.org/api v0.139.0 // indirect
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/genproto v0.0.0-20230320184635-7606e756e683 // indirect
google.golang.org/grpc v1.53.0 // indirect
google.golang.org/protobuf v1.29.1 // indirect
google.golang.org/genproto v0.0.0-20231030173426-d783a09b4405 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20231106174013-bbf56f31fb17 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20231030173426-d783a09b4405 // indirect
google.golang.org/grpc v1.59.0 // indirect
google.golang.org/protobuf v1.31.0 // indirect
gopkg.in/ini.v1 v1.67.0 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
Expand Down
Loading
Loading