Skip to content

Commit

Permalink
Migration ignite22.1 (lavanet#36)
Browse files Browse the repository at this point in the history
* For Cosmos&Ignite Upgrade Help, Check out ./docs/upgrade_cosmos.md

* For Cosmos&Ignite Upgrade Help, Check out ./docs/upgrade_cosmos.md

* fixed timeout

* Ignite 0.22.1 Cosmos 0.44.5 - e2e timeout 11m

* Lava Docker - Starport 0.19.2

* Lava Docker - Working! - starport

* Updated e2e paths to use $LAVA

* E2E Working on Docker

* Updated Github LAVA env

* LAVA IGNITE 22.1 DOCKER E2E WORKING !!!

* restored starport

* Updated Test Homepath

* Ignite: Updated Test Paths

* fix updated paths gh

* fixed gh paths

* GHA - Pre-build with ignite

* GHA - Pre-build with ignite

* docker experiments

* removed .scripts

* Reorder scripts for PR

* e2e test changed dockerfile path

* disabled docker build (for now)

Co-authored-by: omerlavanet <[email protected]>
  • Loading branch information
lava17 and omerlavanet authored Jun 21, 2022
1 parent fb0455c commit 9251404
Show file tree
Hide file tree
Showing 23 changed files with 44,048 additions and 13,699 deletions.
61 changes: 24 additions & 37 deletions .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
name: Lava e2e Tests

on: [push, pull_request]
# on: [push]


jobs:
go:
Expand All @@ -14,22 +12,22 @@ jobs:
- uses: actions/setup-go@v3
with:
go-version: 1.18.2
# - name: install screen
# run: sudo apt install screen -y

# Install Ignite
- name: ignite install
run: curl https://get.ignite.com/cli! | bash
- name: ls usr
run: ls -l /home/runner/work/lava/lava
# - name: docker build
# run: docker build -t lava-docker .
- name: ignite version
run: ignite version
- name: starport install
run: curl https://get.starport.network/[email protected]! | bash
- name: starport version
run: starport version
# - name: starport install
# run: curl https://get.starport.network/[email protected]! | bash
# - name: starport version
# run: starport version

# Setup Paths
- name: home
run: pwd && ls -l
- name: ls usr
run: ls -l /home/runner/work/lava/lava
- name: cp lava
run: cp -r ~/work/lava/lava ~/go/lava
- name: export PATH
Expand All @@ -38,6 +36,8 @@ jobs:
# run: export PATH=$PATH:/go/lava
- name: export GOPATH
run: export GOPATH=$GOPATH:$(go env GOPATH):/go:/go/lava:/usr/local:`pwd`
- name: export LAVA
run: export LAVA=/home/runner/work/lava/lava
- name: go env
run: go env
- name: pwd
Expand All @@ -46,34 +46,18 @@ jobs:
run: tree
- name: ls -l
run: ls -l

# Pre-build with ignite
- name: ignite build
run: ignite chain build -v
- name: starport build
run: starport chain build -v


# - name: node
# run: cd ~/go/lava; starport chain serve -v -r
# run: cd ~/go/lava; go test ./testutil/e2e/ -v
# - name: test timeout 4 mins
# run: go test -timeout 240s
# - name: test timeout 3 mins
# run: go test -timeout 180s
- name: lava e2e tests
# run: cd ~/go/lava; go test ./testutil/e2e/ -v
run: go test ./testutil/e2e/ -v -timeout 440s # 8mins 20secs
# run: go test ./testutil/e2e/ -v -timeout 240s & sleep 60 && ./providers.sh
# - name: starport build
# run: starport chain build -v

# - name: check lavad prov1 output
# run: sleep 120 ; go run relayer/cmd/relayer/main.go server 127.0.0.1 2221 ws://kololo8ex9:ifififkwqlspAFJIjfdMCsdmasdgAKoakdFOAKSFOakfaSEFkbntb311esad@168.119.211.250/eth/ws/ ETH1 jsonrpc --from servicer1

# - name: sleep 60 for node uptime
# run: sleep 60
# - name: ./init_provX
# run: cd /home/runner/work/lava/lava && ./init_provX.sh

# - name: cat provX.log
# run: cat ./testutil/e2e/logs/provX.log
######################################################
### Run Lava E2E Tests IGNITE VERSION:0.22.1
######################################################
- name: Run Lava E2E Tests IGNITE VERSION:0.22.1 -timeout 660s
run: go test ./testutil/e2e/ -v -timeout 660s # 11mins

# Show ETH Logs
- name: cat clientEth.log
Expand All @@ -88,5 +72,8 @@ jobs:
run: cat ./testutil/e2e/logs/clientOsmo2.log
- name: cat providers_osmosis.log
run: cat ./testutil/e2e/logs/providers_eth.log
# - name: docker build
# run: docker build -t lava-docker scripts/docker



3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,5 @@ vue/src/store/generated/lavanet/lava/lavanet.lava.user/index.ts
vue/src/store/generated/lavanet/lava/lavanet.lava.user/module/index.d.ts
vue/src/store/generated/lavanet/lava/lavanet.lava.user/module/index.js
vue/src/store/generated/lavanet/lava/lavanet.lava.user/module/index.ts
testutil/e2e/logs/
testutil/e2e/logs/
ptnet/
8 changes: 4 additions & 4 deletions readme.md → Readme.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# lava
**lava** is a blockchain built using Cosmos SDK and Tendermint and created with [Starport](https://starport.com).
**lava** is a blockchain built using Cosmos SDK and Tendermint and created with [Ignite (Starport)](https://ignite.com/cli).

## Get started

Expand All @@ -10,7 +10,7 @@

## build your chain
```
starport chain serve
ignite chain serve
```
you might want to provide arguments like -v for verbosity or -r for restart, use the help for more

Expand Down Expand Up @@ -54,9 +54,9 @@ After a draft release is created, make your final changes from the release page
* when compiling a binary called: "lavad", is created by starport on your $GOPATH (and if you configured go environment properly,
it should be ~/go/bin/lavad)
* you can interact with the binary to send transactions and queries
* ./init_chain_commands.sh has examples on how to set up an initial chain with 5 servicers and 1 user,
* ./scripts/init_chain_commands.sh has examples on how to set up an initial chain with 5 servicers and 1 user,
for basic testing of pairing on ethereum mainnet, you can run it or have a look at the commands to learn more


# Lava e2e Test & Mock Proxy
* check out ./testutils/e2e/Readme.md
* check out ./testutils/e2e/Readme.md
83 changes: 56 additions & 27 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,26 +70,18 @@ import (
upgradeclient "github.com/cosmos/cosmos-sdk/x/upgrade/client"
upgradekeeper "github.com/cosmos/cosmos-sdk/x/upgrade/keeper"
upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types"
"github.com/cosmos/ibc-go/v2/modules/apps/transfer"
ibctransferkeeper "github.com/cosmos/ibc-go/v2/modules/apps/transfer/keeper"
ibctransfertypes "github.com/cosmos/ibc-go/v2/modules/apps/transfer/types"
ibc "github.com/cosmos/ibc-go/v2/modules/core"
ibcclient "github.com/cosmos/ibc-go/v2/modules/core/02-client"
ibcclientclient "github.com/cosmos/ibc-go/v2/modules/core/02-client/client"
ibcclienttypes "github.com/cosmos/ibc-go/v2/modules/core/02-client/types"
ibcporttypes "github.com/cosmos/ibc-go/v2/modules/core/05-port/types"
ibchost "github.com/cosmos/ibc-go/v2/modules/core/24-host"
ibckeeper "github.com/cosmos/ibc-go/v2/modules/core/keeper"
"github.com/spf13/cast"
abci "github.com/tendermint/tendermint/abci/types"
tmjson "github.com/tendermint/tendermint/libs/json"
"github.com/tendermint/tendermint/libs/log"
tmos "github.com/tendermint/tendermint/libs/os"
dbm "github.com/tendermint/tm-db"

"github.com/tendermint/starport/starport/pkg/cosmoscmd"
"github.com/tendermint/starport/starport/pkg/openapiconsole"

"github.com/cosmos/ibc-go/v3/modules/apps/transfer"
ibctransferkeeper "github.com/cosmos/ibc-go/v3/modules/apps/transfer/keeper"
ibctransfertypes "github.com/cosmos/ibc-go/v3/modules/apps/transfer/types"
ibc "github.com/cosmos/ibc-go/v3/modules/core"
ibcclient "github.com/cosmos/ibc-go/v3/modules/core/02-client"
ibcclientclient "github.com/cosmos/ibc-go/v3/modules/core/02-client/client"
ibcclienttypes "github.com/cosmos/ibc-go/v3/modules/core/02-client/types"
ibcporttypes "github.com/cosmos/ibc-go/v3/modules/core/05-port/types"
ibchost "github.com/cosmos/ibc-go/v3/modules/core/24-host"
ibckeeper "github.com/cosmos/ibc-go/v3/modules/core/keeper"
"github.com/ignite-hq/cli/ignite/pkg/cosmoscmd"
"github.com/ignite-hq/cli/ignite/pkg/openapiconsole"
"github.com/lavanet/lava/docs"
epochstoragemodule "github.com/lavanet/lava/x/epochstorage"
epochstoragemodulekeeper "github.com/lavanet/lava/x/epochstorage/keeper"
Expand All @@ -102,6 +94,12 @@ import (
specmoduleclient "github.com/lavanet/lava/x/spec/client"
specmodulekeeper "github.com/lavanet/lava/x/spec/keeper"
specmoduletypes "github.com/lavanet/lava/x/spec/types"
"github.com/spf13/cast"
abci "github.com/tendermint/tendermint/abci/types"
tmjson "github.com/tendermint/tendermint/libs/json"
"github.com/tendermint/tendermint/libs/log"
tmos "github.com/tendermint/tendermint/libs/os"
dbm "github.com/tendermint/tm-db"
// this line is used by starport scaffolding # stargate/app/moduleImport
)

Expand Down Expand Up @@ -372,10 +370,11 @@ func New(
// Create Transfer Keepers
app.TransferKeeper = ibctransferkeeper.NewKeeper(
appCodec, keys[ibctransfertypes.StoreKey], app.GetSubspace(ibctransfertypes.ModuleName),
app.IBCKeeper.ChannelKeeper, &app.IBCKeeper.PortKeeper,
app.IBCKeeper.ChannelKeeper, app.IBCKeeper.ChannelKeeper, &app.IBCKeeper.PortKeeper,
app.AccountKeeper, app.BankKeeper, scopedTransferKeeper,
)
transferModule := transfer.NewAppModule(app.TransferKeeper)
transferIBCModule := transfer.NewIBCModule(app.TransferKeeper)

// Create evidence Keeper for to register the IBC light client misbehaviour evidence route
evidenceKeeper := evidencekeeper.NewKeeper(
Expand Down Expand Up @@ -418,7 +417,8 @@ func New(

// Create static IBC router, add transfer route, then set and seal it
ibcRouter := ibcporttypes.NewRouter()
ibcRouter.AddRoute(ibctransfertypes.ModuleName, transferModule)
// ibcRouter.AddRoute(ibctransfertypes.ModuleName, transferModule)
ibcRouter.AddRoute(ibctransfertypes.ModuleName, transferIBCModule)
// this line is used by starport scaffolding # ibc/app/router
app.IBCKeeper.SetRouter(ibcRouter)

Expand Down Expand Up @@ -463,14 +463,42 @@ func New(
// CanWithdrawInvariant invariant.
// NOTE: staking module is required if HistoricalEntries param > 0
app.mm.SetOrderBeginBlockers(
upgradetypes.ModuleName, capabilitytypes.ModuleName, minttypes.ModuleName, distrtypes.ModuleName, slashingtypes.ModuleName,
evidencetypes.ModuleName, stakingtypes.ModuleName, ibchost.ModuleName,
feegrant.ModuleName,
capabilitytypes.ModuleName,
authtypes.ModuleName,
banktypes.ModuleName,
distrtypes.ModuleName,
stakingtypes.ModuleName,
slashingtypes.ModuleName,
govtypes.ModuleName,
minttypes.ModuleName,
crisistypes.ModuleName,
ibchost.ModuleName,
genutiltypes.ModuleName,
evidencetypes.ModuleName,
ibctransfertypes.ModuleName,
specmoduletypes.ModuleName,
epochstoragemoduletypes.ModuleName,
pairingmoduletypes.ModuleName,
)
"vesting", "upgrade", "feegrant", "params")

app.mm.SetOrderEndBlockers(crisistypes.ModuleName, govtypes.ModuleName, stakingtypes.ModuleName, epochstoragemoduletypes.ModuleName)
app.mm.SetOrderEndBlockers(
capabilitytypes.ModuleName,
authtypes.ModuleName,
banktypes.ModuleName,
distrtypes.ModuleName,
stakingtypes.ModuleName,
slashingtypes.ModuleName,
govtypes.ModuleName,
minttypes.ModuleName,
crisistypes.ModuleName,
ibchost.ModuleName,
genutiltypes.ModuleName,
evidencetypes.ModuleName,
ibctransfertypes.ModuleName,
specmoduletypes.ModuleName,
epochstoragemoduletypes.ModuleName,
pairingmoduletypes.ModuleName,
"vesting", "upgrade", "feegrant", "params")

// NOTE: The genutils module must occur after staking so that pools are
// properly initialized with tokens from genesis accounts.
Expand All @@ -494,6 +522,7 @@ func New(
specmoduletypes.ModuleName,
epochstoragemoduletypes.ModuleName,
pairingmoduletypes.ModuleName,
"vesting", "upgrade", "feegrant", "params",
// this line is used by starport scaffolding # stargate/app/initGenesis
)

Expand Down
2 changes: 1 addition & 1 deletion app/simulation_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ import (
"github.com/cosmos/cosmos-sdk/types/module"
simulationtypes "github.com/cosmos/cosmos-sdk/types/simulation"
"github.com/cosmos/cosmos-sdk/x/simulation"
"github.com/ignite-hq/cli/ignite/pkg/cosmoscmd"
"github.com/lavanet/lava/app"
"github.com/stretchr/testify/require"
"github.com/tendermint/starport/starport/pkg/cosmoscmd"
abci "github.com/tendermint/tendermint/abci/types"
tmproto "github.com/tendermint/tendermint/proto/tendermint/types"
tmtypes "github.com/tendermint/tendermint/types"
Expand Down
2 changes: 1 addition & 1 deletion cmd/lavad/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import (
"os"

svrcmd "github.com/cosmos/cosmos-sdk/server/cmd"
"github.com/ignite-hq/cli/ignite/pkg/cosmoscmd"
"github.com/lavanet/lava/app"
"github.com/tendermint/starport/starport/pkg/cosmoscmd"
)

func main() {
Expand Down
Loading

0 comments on commit 9251404

Please sign in to comment.