Local-Interchain is a development environment that simplifies local and public testnet setup for the Cosmos Interchain by abstracting away complex IBC relayer configuration, supporting multiple chains (Cosmos, Ethereum, Polkadot) through Docker, and providing multi-language SDKs (Python, Rust, Go, Bash) for developers with varying blockchain experience levels, addressing the common challenges of platform-specific binaries, OS dependencies, and complex relayer setup that make traditional local development environments difficult for new developers.
Local Interchain: Cosmos IBC Testnet Environment Tutorial
Added:so I'm ree I'm at Strange Love we built up local interchain this is built on top of the interchain test repository you can find it as a subdirectory and we're targeting a different Market with local interchain than what we are with interchain tests and I want to go over that there'll be a couple Demos in here showing the power that local interchain brings and the problems that we're trying to solve quickly I'm going to go through who am I I'm 22 I started in Cosmos at craft economy I led the cosmos SDK to Minecraft integration so that way that we could have chains talk over IBC to other Minecraft related chains it was extremely uh breaking and then we had Microsoft come in and shut us down all of the code is still open source we're super excited about it but we were just weren't able to launch the product we did get to launch that on Juno so I joined Juno in 2022 through 2023 and began working on developer experience tooling to make building contracts easier and then since then I've joined Strange Love and also now Ro chains to begin further expanding that out into the inner chain in relations to ux whenever I started there were a lot of tools that I wish I had and I made note of those tools of confusing areas and so I was able to go through my list see what the biggest problems I had on boarding as well as others that I help onboard into Cosmos and then solve those for them by by building up those Solutions abstracting away the complexities and bringing that to Market so a couple of things that I built are local interchain which we'll be discussing today Cosmos cap cash which is an RPC rest cache that does about a 90% cach hit rate drastically reducing infrastructure cost and needs I built a generalized interchain indexer km wasm web hosting proof of the authority module and also spawn which is a ux Improvement uh that's building up using local interchain under the hood the problem is that local development environments are extremely hard they're very platform specific such as local osmosis locala where it's built for its own platform with very limited expandability to say launch another chain beside it such as your own or one like Juno or others you have to have lots of binaries installed where if you want to have multiple instances of Cosmos Hub you've got to install multiple of those rename them CH mod and like all of this setup is required and it's a lot of headache for someone that just wants to launch a chain and test it with IBC there's a lot of bash it's uh a lot more bash than what most people are comfortable with it's typically only local where you can't actually share that to others to use your test net because of security concerns with someone taking over with token faucet or other aspects there and then there's a lot of os dependencies where you're not really able to use Windows for a lot of these tools uh it's mainly made for Mac some of them require kubernetes which is just another headache you have to go figure out if you're not typically a devops person you're normally limited to one validator setting up the relayer is a hassle to go find okay where is that port go put that in your config start it up oh I'm out of funds and go restart the process it's extremely difficult and it's absolutely terrible ux for new application developers both on IVC as well as the typical chain side so what do we really need we need to be able to use any chain in Cosmos and ideally other ecosystems like ethereum polka dot Etc we should support all major operating systems it needs to be very easy to configure you should have zero blockchain experience and be able to start up a blockchain maybe you don't understand all of the complexi that's going on behind the scenes but at least you have a chain where you can begin to understand how things are put together and connected we abstract away all of the initial IBC relayer setup that way that a user can come on I just want to connect two chains great we're going to do that for you and allow you to just get started and then you can build on more complex protocols such as IA you should be able to interact in a standard language and format if you're coming from the standard web 2 world you'll know python or Java or go you should be able to interact in one of those languages and we need to allow power users the ability to be able to bypass the abstractions and do exactly what they need for for their given use case local interchain is that solution we have support for all Cosmos chains via Docker as well as ethereum we'll have penumbra support and polka dot in the future as well and whenever you're getting started we have pre-built configs for you which we'll go over in one of the videos there's a rest API for interaction this is completely optional so by default we have rust python bash and go drivers so that way you can use your native language of choice to interact with this with this test net of multi multiple chains we'll have JavaScript typescript and and Java in the future uh but you can also still use the standard binaries if you want that way so if you are a power user you interact with the standard RPC everything will work as expected you just don't get all of the abstraction that we built in for beginners on the require M side all you need is Docker and a standard operating system we have Windows Linux and both Mac support and you do need to know some Json but uh by us giving you those configurations we also have a CLI helper it can automatically generate the Json for you we'll have web apps in the future as well to make this a very uh non- difficult process so I'm going to show now the demo this is going to build up a chain and show you kind of the format that we have here as well as some examp Le interaction and what that looks like here we've got the main local interchain repository this is going to go through how to install it how to install it on like Windows 7 Windows 10 the different options that we have maybe some gotas and links to our other documentation including the rest API and and other repositories this is a base Network that is going to connect Cosmos to tra locally and it's going to connect them via these IBC paths that are human readable so you just set Adam to Tera and it's going to automatically create all of the relaying behind you we set up the Genesis accounts for you all of that is loaded in via the docker images it doesn't require any binaries locally other than local interchain as long as you have that one binary everything is handled for you what we're going to do here is start a base IBC chain this will load everything into inner chain test and begin to set this up as you normally would with any other testing framework you just don't need to know go we can see these starting up in Docker PS and as the Genesis is are created for you and the user can just let this sit because it's the first time it's not cash it does take a little bit longer here's a more complex example of a base IBC using Juno specifying things like the coin types number of validators you can override host ports so that way it's not randomized over override config files set Genesis modifications as we also mentioned accounts to and then startup commands where once the chain is started perform form Linux based shell commands on the test net to set it up whether that be setting up contracts or some other functions that you need you can set those all up there before the chain is exposed to you the chain has now been set up and we can see that here where the relayer is automatically started for us between these channels The guia Hub or yeah Cosmos Hub node and Tera are open and it looks like a standard chain which is all handled by interchain test with the abstraction layer of local interchain on top here's an example bash script of how you interact this is ugly but I just wanted to show if you want to use standard curl you absolutely can with just standard post request we also have an abstraction layer using local interchain interact that will handle these so we have custom actions such as get channels to perform these as well as standard queries and relayer executions as well as executing via the binary which we'll see in the next video so all of this is done through Docker no binaries except local interchain and you don't even really need that and then here's some of the the the action values that you can provide in the reason that we have off key is that it allows for you to take a test net make it public only your team can execute against it using this offkey password and others can play on the test net with the standard rpcs as they would with any other RPC RPC Network such as other test Nets so it allows for local test Nets as well as public test Nets and this was shown out with ethoses public test net where we use this to set up all of that infrastructure set up ethereum and then connect out all the other relayer and we didn't have to handle any of it it was all just done through a Json config so that's the base of what starting up a chain looks like and some basic interactions the here's some more configuration showing that while on the right yes it's a there's a lot of complexities that you can get into but it's the same complexities that you'll have on setting up any other chain so on the left we have an ethereum chain that follows the same format as it does on the cosmos chain side and we figure that out on our end for what should match and how to set that up and you're also able to like load state for an AVS igen layer State can load up on the ethereum side with the same format as you would have on a standard Juno side with its configuration so a lot of it is passes right over and we already have those defaults build out for you so it's super simple to modify it as you need what about consumer chains consumer chains are notoriously a pain to set up with governance proposals and handling all of that we abstract all of it away you add a single line to your to your consumer and you specify I want to link to Cosmos Hub with my local instance in this case would be the provider and it will handle all of that for you so as it sets up it will set up the Rel layers it will automatically do your governance proposal it will perform all of the Genesis needs modify your Genesis to your to your liking and then set it up and you have full access to the IC consumer that's connected to the provider it has support for multiple consumer so you can mock out an entire AE setup uh locally with with using all main net related binaries and versions what does client interaction look like so we we've seen that we can do Post requests but we can pull those into these drivers and allow for Python and rust native code execution as a t as a programmer would typically be used to so we've got a contract here which is going to be a CM blosom type and then we instantiate on the contract and it's almost the exact same uh Syntax for both of these and under the hood they're doing the same thing we're going to instantiate the contract and run that code let's see that now using python so we're going to connect two IBC contracts over a double Juno Network so this is just two instances of Juno and these have been automatically connected with uh the connections and then we're going to launch this CW IBC example so this is we started the chains we're going to initialize both contracts then we're going to relay connect those and then we're going to execute on one and over IBC it will interact on the other so we've run this python file it's going to set up our base environment that we want outputs of Json and then we're going to upload these contracts to the docker instance so this is also going to automatically realize that they're km wasm files it will upload it to the chain and then return back to you the code ID so you don't have to deal with any of that you just need to store it on the docker instance and it takes care of the rest we can instantiate both of these contracts this is going to show here we query those those transactions we parse it out for you all of it's done through just standard Cur requests to the local interchain and it allows us this easy API to interact with in Python we've interacted here we can check that the relayer is now actually connecting these these contracts that that we've generated so the relayer has now done that currently we only have support for the goore layer we execute on the the channels so that would be ch channel one since we previously had Channel Zero for for transfers we execute on that to increment it and then we flush those packets once the packets are flushed on the opposite side we should see that increase to one which we did it was previously zero so we've have full IVC interaction with multiple smart contracts on multiple chains and all we had to do was set up Json and then interact with it in Python no binaries required it looks the same for rust with rust you use your rate your of rust syntax and then we also have support for GitHub C so it's not much difficult it's not very difficult compared to setting up interchain test you just run it in the background and then you run make your run test and it will run all of your code set that up and continue on as if you're writing it in just a native language of interchain test for our road map we currently have Comet mock support it's a work in progress GitHub CI is not liking it but that will drastically speed up uh the flows due to to faster blocks we'll have safe state in the near future as well which will include mounting that way if your test net goes down you can just launch right back up as if nothing had happened we want to have mayet interaction too so that way that your test net locally can interact with a public uh node or network in that way that you can perform other actions based off of real main net state so also importing Genesis States will be one of those added features as well kind of part of safe State node upgrades are not really our Focus since that's mainly for interchain test go developers but due to more chains coming up with rust we would like to add that support as well so you can write it in Rust we'll have native IC mes security and polytone support you'll add a single line that says give me these features I want to have an AA Channel automatically set up for me and the relayer will handle that for you same for mesh security and polytone where it'll upload those those pre-built contracts to your chain for you that way you don't have to do it yourself as I mentioned earlier typescript JavaScript and Java clients will come in the future we want to support all major languages that have HTTP support it's very simple to add if you just look at the current Python and rust examples it will really show you where you need to go for that and then the big part of how does this play into full full building out of of a seamless platform is using spawn spawn is like ignite CLI but we allow you to choose and pick which modules you want and then from there in three commands you can go from a brand new chain to an entire IBC test net that is connected to a local Cosmos Hub instance so you would just say spawn create me a new chain with proof of authority it does that you move into that directory and then say make test net and it's going to build up all of interchain test for you and all of local interchain for you so there's a lot of great ux improvements that this that this brings and we needed this to be able to build onto that next level of abstraction for chain developers to just get started so that concludes my talk on local inter chain questions or you know suggestions you can either email me send me that or open up an issue in the GitHub we're always happy to have people that think that there are better ways to do something we're more than happy to get those in thank you is all right if I um jumped in a question now yeah so it as long as you can provide a Docker image um say you've got a uh like a a chain in development you're test net or just before testnet as long as you can provide a Docker image You' be able to use this um use this piece of software that you guys have made exactly and you can use highliner for this which will automatically handle that for you this builds up I just put it in the chat this will build up automatically like public test n such as Gia osmosis Juno Etc with spawn we automatically package that with you so all you have to run is make testnet we build up the binaries and Docker images for you without you having to touch any Docker or any Docker configs so that's that's one group uh and then also you could just import highliner into your current repo make local image done and then now you're able to throw that onto local interchain and so if you already have like a a whole Docker pipeline like using tilt everything um would you be able to bring those configurations over well all we need is just the docker image itself so we just build the dock like a Docker build and then take that image you can throw that into like a tar file and then just use that in local interchange so you don't actually need all of your configs you just need the final Docker uh image itself and then just use the image okay that's so cool and and second question with with spawn obviously the way you mentioned it it seemed like a replacement for ignite to like fully scaffold the chain um but obviously ignite has the same capabilities to like add modules once you've already got a chain um is is spawn the same way like because uh I found ignite to be kind of a pain in the ass sometimes so yes um if you could do that on like a pre-existing chain you want to add some like IBC capabilities that obviously I ignite I think only comes with like IBC transfers so being able to add like interchain accounts just straight out the way on a pre-existing chain is that something that spawn can handle spawn already does that today we also have support for the wasam light client so you just specify I want to use the wasam light client on start it automatically build that up for you we don't currently have where you can easily add modules after the fact but we've already built it into new it just needs to be pulled into its own command so that will maybe take a couple of hours to do for all of the modules we currently support we have heard the feedback of people that had issues with Ignite CLI we wanted to solve those pain points so we do that where there's no comments required spawn just like infers it and figures it out itself because a lot of the format's the same and we handle all of the difficulty behind the scenes for you which really helped bring up the experience we had a testimony from Burt who was able to quickly spin up a new chain a full upgrade to SDK version 50 from 47 in a weekend with one developer so it's it's drastically increased the throughput that we can have we want to abstract away all of those difficulties and local interchain is a part of that which helps with testing to ensure that everything went correct wow one weekend that's amazing and so I'm guessing spawn is on like 50.3 spawn is on 50 yes yeah it's all the and greatest of everything and we're going to continue it's easy to maintain as well unlike ignite where there's Temple files uh we're just native go and so we just embed all of those together and then we remove the different features Etc on our side based off of what the user wants there's a tweet in the the chat that goes over a video that quickly shows in four minutes from from just creating the chain automatically connecting it with IBC and being able to create a new module it's extremely extremely quick that's amazing you guys is sick cool yeah how does this compare to uh other interchain testing Frameworks like Starship for instance yeah so Starship is probably our I would say is the closest competitor the issue that I have personally with Starship is that it's it's great from a it work standpoint like it's a great product the issue is more so the ux behind adding new features and allowing it to be easy and interacting in multiple languages so if you want to interact with Starship I believe you need to know JavaScript or typescript that should not be a hard requirement we have the same issue on interchange test where you have to use go to interact with it we want to allow any language also to mentioned Starship is moving over to local interchange so their entire backend is going to be using us in the future because they've they've agreed like that's the way to have you true interchange support is to have multilanguage support and it's a lot easier to configure it's a lot easier to set up and so they'll be moving to our back end actually as well um thanks Ria just just a question so so with local interchange you can also just like have a automated tests that you would like to run and execute against that local yeah so you can write your your test in any language you're you're familiar with if you're going to use goat you should probably just use the standard interchain test because you probably need deeper but for application developers that they want to just write a test write up your test normally and then it'll just hit it as if you were writing interchange test just in a different language so we have that abstraction layer to allow for that so yeah you build up your test you run your test and in the background and then as long as everything goes correctly and your asserts are proper then you're good cool so so then just a question so so what would what's the difference then for a user when should a user use interchain test when local interchain uh yeah so the way that I see it interchain test if you're a module developer or protocol and you're building very low-level checks you should probably still be using interchain test because you're writing in go if you're planning on writing in any other language or you're building an application out itself whether that be in rust or just some other feature on top of a test net I would typically say local interchain is the way to go as well as most smart contracts fits with the local interchain uh flow because again you're writing a rust you probably want to write your test in Rust so it's really more up to the user of how much abstraction are you comfortable with if you need extremely fine level detail interchain test all of the way if you don't need as much go with local interchain cool thanks
Up Next

Private Blockchain Setup with Geth: Step-by-Step Tutorial
@Orkblockchain
7.2K views•2023-03-28

Hollywood Fantasy Orchestrator RPG Expansion Pack Tutorial Walkthrough
@HighResolutionJapan
1.1K views•2024-03-08

FastAPI vs Flask vs Django: Choosing the Right Python Web Framework
@TechWithTim
302.5K views•2024-05-26

Game of Thrones Opening Credits: A Cinematic Analysis
@gameofthrones
46.3M views•2011-04-18
Related Study Plans & Knowledge Roadmaps
Structured learning paths in General & Interdisciplinary Studies






































