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

feat: Local-Interchain environment #663

Merged
merged 16 commits into from
Aug 15, 2023
Merged

feat: Local-Interchain environment #663

merged 16 commits into from
Aug 15, 2023

Conversation

Reecepbcups
Copy link
Member

@Reecepbcups Reecepbcups commented Jul 10, 2023

summary

Brings local-interchain into this repo. Builds off PR #610

Using https://github.com/Reecepbcups/local-interchain commit 5dae0b60cac915873c48d4a86eda02811a822a44

future features (non MVP)

  • Cache pre started chains (hash of the chain config) to reduce start times drastically from scratch.
  • Sidecar explorer
  • GH action CI example
  • Typescript (& rust?) client

files

  • ./local-interchain/*

how to run

  • cd local-interchain
  • make install || make build
  • local-ic chains
  • local-ic start

commit bfa7653
Merge: 55aeeb8 cedf87f
Author: Reece Williams <[email protected]>
Date:   Wed Jun 28 16:44:56 2023 -0500

    Merge branch 'main' into reece/localic-tweaks

commit 55aeeb8
Author: Reece Williams <[email protected]>
Date:   Wed Jun 28 16:41:57 2023 -0500

    Fix hostAPIPort

commit ba71ff1
Author: Reece Williams <[email protected]>
Date:   Wed Jun 28 16:37:07 2023 -0500

    Adds REST API support

commit 87804b1
Merge: c79a765 220ce33
Author: Reece Williams <[email protected]>
Date:   Fri Jun 23 10:49:43 2023 -0500

    Merge branch 'main' into reece/localic-tweaks

commit c79a765
Author: Reece Williams <[email protected]>
Date:   Wed Jun 21 16:17:47 2023 -0500

    Revert TxCommand gas auto

commit 2650ce1
Merge: 7abc87b b8ef5ef
Author: Reece Williams <[email protected]>
Date:   Wed Jun 21 16:12:08 2023 -0500

    Merge branch 'reece/juno-improvements-v47' into reece/localic-tweaks

commit 7abc87b
Merge: c2f6c02 c4bf11d
Author: Reece Williams <[email protected]>
Date:   Wed Jun 21 16:11:57 2023 -0500

    Merge branch 'main' into reece/localic-tweaks

commit b8ef5ef
Author: Reece Williams <[email protected]>
Date:   Wed Jun 21 16:02:38 2023 -0500

    Revert "TxCommand gas auto"

    This reverts commit 83b50de.

commit 2b9025f
Merge: 5fe9709 c4bf11d
Author: Reece Williams <[email protected]>
Date:   Wed Jun 21 15:59:15 2023 -0500

    Merge branch 'main' into reece/juno-improvements-v47

commit 5fe9709
Merge: 35497b6 3c63f8c
Author: Reece Williams <[email protected]>
Date:   Fri Jun 2 18:21:03 2023 -0500

    Merge branch 'main' into reece/juno-improvements-v47

commit c2f6c02
Merge: 91fdcfd 3c63f8c
Author: Reece Williams <[email protected]>
Date:   Fri Jun 2 18:19:42 2023 -0500

    Merge branch 'main' into reece/localic-tweaks

commit 91fdcfd
Author: Reece Williams <[email protected]>
Date:   Thu Jun 1 21:54:13 2023 -0500

    Squashed commit of the following:

    commit 35497b6
    Author: Reece Williams <[email protected]>
    Date:   Fri May 19 16:21:04 2023 -0500

        rename result -> path (of components)

    commit 66c2c32
    Merge: a01b723 4c903c4
    Author: Reece Williams <[email protected]>
    Date:   Fri May 19 16:11:18 2023 -0500

        Merge branch 'main' into reece/juno-improvements-v47

    commit a01b723
    Author: Reece Williams <[email protected]>
    Date:   Fri May 19 16:08:24 2023 -0500

        Adds ModifyGenesis generalized Function + test

    commit 33d7faf
    Author: Reece Williams <[email protected]>
    Date:   Fri May 12 11:14:06 2023 -0500

        Remove uneeded BuildProposal arg

    commit 62fd485
    Author: Reece Williams <[email protected]>
    Date:   Fri May 12 11:07:12 2023 -0500

        Adds BuildProposal for govv1

    commit 268df1f
    Author: Reece Williams <[email protected]>
    Date:   Fri May 12 11:04:41 2023 -0500

        comment

    commit 80e66c2
    Author: Reece Williams <[email protected]>
    Date:   Fri May 12 10:27:54 2023 -0500

        makes SubmitProposal public for chains

    commit 83b50de
    Author: Reece Williams <[email protected]>
    Date:   Thu May 11 14:45:28 2023 -0500

        TxCommand gas auto

commit 1383abd
Author: Reece Williams <[email protected]>
Date:   Thu Jun 1 21:52:27 2023 -0500

    Interface tweaks

commit 35497b6
Author: Reece Williams <[email protected]>
Date:   Fri May 19 16:21:04 2023 -0500

    rename result -> path (of components)

commit 66c2c32
Merge: a01b723 4c903c4
Author: Reece Williams <[email protected]>
Date:   Fri May 19 16:11:18 2023 -0500

    Merge branch 'main' into reece/juno-improvements-v47

commit a01b723
Author: Reece Williams <[email protected]>
Date:   Fri May 19 16:08:24 2023 -0500

    Adds ModifyGenesis generalized Function + test

commit 33d7faf
Author: Reece Williams <[email protected]>
Date:   Fri May 12 11:14:06 2023 -0500

    Remove uneeded BuildProposal arg

commit 62fd485
Author: Reece Williams <[email protected]>
Date:   Fri May 12 11:07:12 2023 -0500

    Adds BuildProposal for govv1

commit 268df1f
Author: Reece Williams <[email protected]>
Date:   Fri May 12 11:04:41 2023 -0500

    comment

commit 80e66c2
Author: Reece Williams <[email protected]>
Date:   Fri May 12 10:27:54 2023 -0500

    makes SubmitProposal public for chains

commit 83b50de
Author: Reece Williams <[email protected]>
Date:   Thu May 11 14:45:28 2023 -0500

    TxCommand gas auto
@Reecepbcups Reecepbcups marked this pull request as ready for review July 10, 2023 17:24
@Reecepbcups Reecepbcups requested a review from a team as a code owner July 10, 2023 17:24
Copy link
Contributor

@boojamya boojamya left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alright... here is a start!
Might have some more feedback as I continue making my way though over the next couple days.

local-interchain/README.md Outdated Show resolved Hide resolved
Comment on lines +34 to +35
"repository": "ghcr.io/cosmoscontracts/juno-e2e",
"version": "v14.1.0"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unrelated to this PR... but there is no arm64 image so had to tweak this to get it to work on an m1 mac.

https://github.com/CosmosContracts/juno/pkgs/container/juno-e2e/109148503?tag=latest

local-interchain/configs/relayer.json Outdated Show resolved Hide resolved
local-interchain/interchain/start.go Outdated Show resolved Hide resolved
local-interchain/cmd/local-ic/chains.go Show resolved Hide resolved
local-interchain/cmd/local-ic/main.go Outdated Show resolved Hide resolved
local-interchain/cmd/local-ic/new_chain.go Show resolved Hide resolved
local-interchain/cmd/local-ic/new_chain.go Show resolved Hide resolved
local-interchain/cmd/local-ic/root.go Outdated Show resolved Hide resolved
Comment on lines 25 to 26
- Run: `local-ic start mytest1_ignored.json`
- Change directory `ICTEST_HOME=/root/example/local-interchain local-ic start myother_ignored.json`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think a little bit of clarity between these two bullets here could help users get started.

Changing directory appears to be optional. If user does change directory, they have to create a chains folder in there right? To house the config?
(I commented about this somewhere else as well)

Potentially open to the idea of simplifying and having it just accept full paths.
Ex: local-ic start full/path/to/config.json

Copy link
Member Author

@Reecepbcups Reecepbcups Jul 28, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, if you move your configs elsewhere you would need to have a chains folder in the ICTEST_HOME directory. Good point

I was trying to get away with not using full/abs paths since it is meant to be quick local-ic start NAME vs needing to always /home/name/.../chain.json

maybe default is to search in the chains/ folder, if not there use absolute / full path or something


update Seems like a UX nightmare when it comes to also specifying the relayer config if you use IBC (unless I absolute path in some JSON key in the config). hmm

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ahh. I see! I glossed over the other config files.
In that case maybe just note that the config folder is necessary somewhere in the docs. Should suffice.
Thanks for the context.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Resolved in: eff98a1

Requires chains and config folder in the selected path or else it panics. Also added to docs to explain

local-interchain/interchain/ibc.go Show resolved Hide resolved
local-interchain/interchain/start.go Outdated Show resolved Hide resolved
Comment on lines 22 to 24
// This may be un-needed.
var longestTTLChain *cosmos.CosmosChain
ttlWait := 0
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agree maybe I'm missing something but I don't find this necessary.

Also, tbh, I never understood BlocksTTL.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yea it is a bit confusing. Was meant more for local testing, but I always find myself using -1 BlocksTTL anyways

Resolved: 16f0696

Comment on lines 25 to 26
- Run: `local-ic start mytest1_ignored.json`
- Change directory `ICTEST_HOME=/root/example/local-interchain local-ic start myother_ignored.json`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ahh. I see! I glossed over the other config files.
In that case maybe just note that the config folder is necessary somewhere in the docs. Should suffice.
Thanks for the context.

local-interchain/cmd/local-ic/chains.go Show resolved Hide resolved
Comment on lines 151 to 157
func (a *actions) killAll() {
for _, v := range a.vals {
v.StopContainer(a.ctx)
}
a.ic.Close()
a.ctx.Done()
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I haven't dove too far into this but for me, this only kills one of the vals. Maybe context related?
Also, not to add too much complexity and mapping, but this should kill the relayers too.

Again... maybe not necessary for MVP.

Copy link
Member Author

@Reecepbcups Reecepbcups Jul 29, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Resolved & simplified: 51530bb

tested with juno_ibc and it killed both + relayer as expected for the REST API request

for now I am going to put off ctrl+c cleanup: 4646a31

@DavidNix DavidNix added the BACKPORT backport into all maintained branches label Aug 15, 2023
Copy link
Contributor

@boojamya boojamya left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alright, nice job Reece! Im ready to get this merged 👍

@boojamya boojamya merged commit bd6da21 into strangelove-ventures:main Aug 15, 2023
6 checks passed
mergify bot pushed a commit that referenced this pull request Aug 15, 2023
* Squashed commit of the following:

commit bfa7653
Merge: 55aeeb8 cedf87f
Author: Reece Williams <[email protected]>
Date:   Wed Jun 28 16:44:56 2023 -0500

    Merge branch 'main' into reece/localic-tweaks

commit 55aeeb8
Author: Reece Williams <[email protected]>
Date:   Wed Jun 28 16:41:57 2023 -0500

    Fix hostAPIPort

commit ba71ff1
Author: Reece Williams <[email protected]>
Date:   Wed Jun 28 16:37:07 2023 -0500

    Adds REST API support

commit 87804b1
Merge: c79a765 220ce33
Author: Reece Williams <[email protected]>
Date:   Fri Jun 23 10:49:43 2023 -0500

    Merge branch 'main' into reece/localic-tweaks

commit c79a765
Author: Reece Williams <[email protected]>
Date:   Wed Jun 21 16:17:47 2023 -0500

    Revert TxCommand gas auto

commit 2650ce1
Merge: 7abc87b b8ef5ef
Author: Reece Williams <[email protected]>
Date:   Wed Jun 21 16:12:08 2023 -0500

    Merge branch 'reece/juno-improvements-v47' into reece/localic-tweaks

commit 7abc87b
Merge: c2f6c02 c4bf11d
Author: Reece Williams <[email protected]>
Date:   Wed Jun 21 16:11:57 2023 -0500

    Merge branch 'main' into reece/localic-tweaks

commit b8ef5ef
Author: Reece Williams <[email protected]>
Date:   Wed Jun 21 16:02:38 2023 -0500

    Revert "TxCommand gas auto"

    This reverts commit 83b50de.

commit 2b9025f
Merge: 5fe9709 c4bf11d
Author: Reece Williams <[email protected]>
Date:   Wed Jun 21 15:59:15 2023 -0500

    Merge branch 'main' into reece/juno-improvements-v47

commit 5fe9709
Merge: 35497b6 3c63f8c
Author: Reece Williams <[email protected]>
Date:   Fri Jun 2 18:21:03 2023 -0500

    Merge branch 'main' into reece/juno-improvements-v47

commit c2f6c02
Merge: 91fdcfd 3c63f8c
Author: Reece Williams <[email protected]>
Date:   Fri Jun 2 18:19:42 2023 -0500

    Merge branch 'main' into reece/localic-tweaks

commit 91fdcfd
Author: Reece Williams <[email protected]>
Date:   Thu Jun 1 21:54:13 2023 -0500

    Squashed commit of the following:

    commit 35497b6
    Author: Reece Williams <[email protected]>
    Date:   Fri May 19 16:21:04 2023 -0500

        rename result -> path (of components)

    commit 66c2c32
    Merge: a01b723 4c903c4
    Author: Reece Williams <[email protected]>
    Date:   Fri May 19 16:11:18 2023 -0500

        Merge branch 'main' into reece/juno-improvements-v47

    commit a01b723
    Author: Reece Williams <[email protected]>
    Date:   Fri May 19 16:08:24 2023 -0500

        Adds ModifyGenesis generalized Function + test

    commit 33d7faf
    Author: Reece Williams <[email protected]>
    Date:   Fri May 12 11:14:06 2023 -0500

        Remove uneeded BuildProposal arg

    commit 62fd485
    Author: Reece Williams <[email protected]>
    Date:   Fri May 12 11:07:12 2023 -0500

        Adds BuildProposal for govv1

    commit 268df1f
    Author: Reece Williams <[email protected]>
    Date:   Fri May 12 11:04:41 2023 -0500

        comment

    commit 80e66c2
    Author: Reece Williams <[email protected]>
    Date:   Fri May 12 10:27:54 2023 -0500

        makes SubmitProposal public for chains

    commit 83b50de
    Author: Reece Williams <[email protected]>
    Date:   Thu May 11 14:45:28 2023 -0500

        TxCommand gas auto

commit 1383abd
Author: Reece Williams <[email protected]>
Date:   Thu Jun 1 21:52:27 2023 -0500

    Interface tweaks

commit 35497b6
Author: Reece Williams <[email protected]>
Date:   Fri May 19 16:21:04 2023 -0500

    rename result -> path (of components)

commit 66c2c32
Merge: a01b723 4c903c4
Author: Reece Williams <[email protected]>
Date:   Fri May 19 16:11:18 2023 -0500

    Merge branch 'main' into reece/juno-improvements-v47

commit a01b723
Author: Reece Williams <[email protected]>
Date:   Fri May 19 16:08:24 2023 -0500

    Adds ModifyGenesis generalized Function + test

commit 33d7faf
Author: Reece Williams <[email protected]>
Date:   Fri May 12 11:14:06 2023 -0500

    Remove uneeded BuildProposal arg

commit 62fd485
Author: Reece Williams <[email protected]>
Date:   Fri May 12 11:07:12 2023 -0500

    Adds BuildProposal for govv1

commit 268df1f
Author: Reece Williams <[email protected]>
Date:   Fri May 12 11:04:41 2023 -0500

    comment

commit 80e66c2
Author: Reece Williams <[email protected]>
Date:   Fri May 12 10:27:54 2023 -0500

    makes SubmitProposal public for chains

commit 83b50de
Author: Reece Williams <[email protected]>
Date:   Thu May 11 14:45:28 2023 -0500

    TxCommand gas auto

* Upload Local-Interchain

* Minor readme fix

* Remove comma from readme JSON

Co-authored-by: Dan Kanefsky <[email protected]>

* Remove default events from relayre

Co-authored-by: Dan Kanefsky <[email protected]>

* Better error for root cli execute

Co-authored-by: Dan Kanefsky <[email protected]>

* Remove debugging print

* Add signal & endpoint kill-all (stop & cleanup)

* Remove validation panics for Chain types

* Show F32 + 64 in defaults output

* Remove BlocksTTL and use math.MaxInt instead

* Kill relayer & all containers on ctrl+c / kill endpoint

* Require `configs` and `chains` in ICTEST_HOME

* `docs`: relative paths

* TODO: cleanup on ctrl+c

---------

Co-authored-by: Dan Kanefsky <[email protected]>
Co-authored-by: David Nix <[email protected]>
(cherry picked from commit bd6da21)
mergify bot added a commit that referenced this pull request Aug 15, 2023
* Squashed commit of the following:

commit bfa7653
Merge: 55aeeb8 cedf87f
Author: Reece Williams <[email protected]>
Date:   Wed Jun 28 16:44:56 2023 -0500

    Merge branch 'main' into reece/localic-tweaks

commit 55aeeb8
Author: Reece Williams <[email protected]>
Date:   Wed Jun 28 16:41:57 2023 -0500

    Fix hostAPIPort

commit ba71ff1
Author: Reece Williams <[email protected]>
Date:   Wed Jun 28 16:37:07 2023 -0500

    Adds REST API support

commit 87804b1
Merge: c79a765 220ce33
Author: Reece Williams <[email protected]>
Date:   Fri Jun 23 10:49:43 2023 -0500

    Merge branch 'main' into reece/localic-tweaks

commit c79a765
Author: Reece Williams <[email protected]>
Date:   Wed Jun 21 16:17:47 2023 -0500

    Revert TxCommand gas auto

commit 2650ce1
Merge: 7abc87b b8ef5ef
Author: Reece Williams <[email protected]>
Date:   Wed Jun 21 16:12:08 2023 -0500

    Merge branch 'reece/juno-improvements-v47' into reece/localic-tweaks

commit 7abc87b
Merge: c2f6c02 c4bf11d
Author: Reece Williams <[email protected]>
Date:   Wed Jun 21 16:11:57 2023 -0500

    Merge branch 'main' into reece/localic-tweaks

commit b8ef5ef
Author: Reece Williams <[email protected]>
Date:   Wed Jun 21 16:02:38 2023 -0500

    Revert "TxCommand gas auto"

    This reverts commit 83b50de.

commit 2b9025f
Merge: 5fe9709 c4bf11d
Author: Reece Williams <[email protected]>
Date:   Wed Jun 21 15:59:15 2023 -0500

    Merge branch 'main' into reece/juno-improvements-v47

commit 5fe9709
Merge: 35497b6 3c63f8c
Author: Reece Williams <[email protected]>
Date:   Fri Jun 2 18:21:03 2023 -0500

    Merge branch 'main' into reece/juno-improvements-v47

commit c2f6c02
Merge: 91fdcfd 3c63f8c
Author: Reece Williams <[email protected]>
Date:   Fri Jun 2 18:19:42 2023 -0500

    Merge branch 'main' into reece/localic-tweaks

commit 91fdcfd
Author: Reece Williams <[email protected]>
Date:   Thu Jun 1 21:54:13 2023 -0500

    Squashed commit of the following:

    commit 35497b6
    Author: Reece Williams <[email protected]>
    Date:   Fri May 19 16:21:04 2023 -0500

        rename result -> path (of components)

    commit 66c2c32
    Merge: a01b723 4c903c4
    Author: Reece Williams <[email protected]>
    Date:   Fri May 19 16:11:18 2023 -0500

        Merge branch 'main' into reece/juno-improvements-v47

    commit a01b723
    Author: Reece Williams <[email protected]>
    Date:   Fri May 19 16:08:24 2023 -0500

        Adds ModifyGenesis generalized Function + test

    commit 33d7faf
    Author: Reece Williams <[email protected]>
    Date:   Fri May 12 11:14:06 2023 -0500

        Remove uneeded BuildProposal arg

    commit 62fd485
    Author: Reece Williams <[email protected]>
    Date:   Fri May 12 11:07:12 2023 -0500

        Adds BuildProposal for govv1

    commit 268df1f
    Author: Reece Williams <[email protected]>
    Date:   Fri May 12 11:04:41 2023 -0500

        comment

    commit 80e66c2
    Author: Reece Williams <[email protected]>
    Date:   Fri May 12 10:27:54 2023 -0500

        makes SubmitProposal public for chains

    commit 83b50de
    Author: Reece Williams <[email protected]>
    Date:   Thu May 11 14:45:28 2023 -0500

        TxCommand gas auto

commit 1383abd
Author: Reece Williams <[email protected]>
Date:   Thu Jun 1 21:52:27 2023 -0500

    Interface tweaks

commit 35497b6
Author: Reece Williams <[email protected]>
Date:   Fri May 19 16:21:04 2023 -0500

    rename result -> path (of components)

commit 66c2c32
Merge: a01b723 4c903c4
Author: Reece Williams <[email protected]>
Date:   Fri May 19 16:11:18 2023 -0500

    Merge branch 'main' into reece/juno-improvements-v47

commit a01b723
Author: Reece Williams <[email protected]>
Date:   Fri May 19 16:08:24 2023 -0500

    Adds ModifyGenesis generalized Function + test

commit 33d7faf
Author: Reece Williams <[email protected]>
Date:   Fri May 12 11:14:06 2023 -0500

    Remove uneeded BuildProposal arg

commit 62fd485
Author: Reece Williams <[email protected]>
Date:   Fri May 12 11:07:12 2023 -0500

    Adds BuildProposal for govv1

commit 268df1f
Author: Reece Williams <[email protected]>
Date:   Fri May 12 11:04:41 2023 -0500

    comment

commit 80e66c2
Author: Reece Williams <[email protected]>
Date:   Fri May 12 10:27:54 2023 -0500

    makes SubmitProposal public for chains

commit 83b50de
Author: Reece Williams <[email protected]>
Date:   Thu May 11 14:45:28 2023 -0500

    TxCommand gas auto

* Upload Local-Interchain

* Minor readme fix

* Remove comma from readme JSON

Co-authored-by: Dan Kanefsky <[email protected]>

* Remove default events from relayre

Co-authored-by: Dan Kanefsky <[email protected]>

* Better error for root cli execute

Co-authored-by: Dan Kanefsky <[email protected]>

* Remove debugging print

* Add signal & endpoint kill-all (stop & cleanup)

* Remove validation panics for Chain types

* Show F32 + 64 in defaults output

* Remove BlocksTTL and use math.MaxInt instead

* Kill relayer & all containers on ctrl+c / kill endpoint

* Require `configs` and `chains` in ICTEST_HOME

* `docs`: relative paths

* TODO: cleanup on ctrl+c

---------

Co-authored-by: Dan Kanefsky <[email protected]>
Co-authored-by: David Nix <[email protected]>
(cherry picked from commit bd6da21)

Co-authored-by: Reece Williams <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
BACKPORT backport into all maintained branches
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants