xdapp-book/src/technical/env/tilt.md

79 lines
3.5 KiB
Markdown
Raw Normal View History

2022-09-19 09:42:45 -07:00
# Tilt (Devnet)
2022-09-15 08:47:50 -07:00
2022-09-23 07:46:46 -07:00
## What is Tilt?
2022-09-16 10:43:06 -07:00
2022-09-19 08:29:26 -07:00
[Tilt](https://tilt.dev/) is part of the official Docker ecosystem. It's a tool which allows developers to easily configure a Kubernetes environment for development.
2022-09-16 10:43:06 -07:00
2022-09-23 07:46:46 -07:00
However, in the context of Wormhole, 'Tilt' refers to the development environment used by the [Wormhole Core Repository](https://github.com/wormhole-foundation/wormhole). This environment stands up docker images for all the tools necessary to build across multiple blockchains, including:
2022-09-16 10:43:06 -07:00
2022-09-20 11:12:31 -07:00
- All the Wormhole supported blockchains / ecosystems
2022-09-16 10:43:06 -07:00
- A Guardian Node
- Relayers
- Databases, Redis
- Utility frontends
2022-09-23 07:46:46 -07:00
The 'Tilt' environment is meant to provide an entire cross-chain development stack right out of the box.
_Note: Tilt is often referred to as 'Devnet' in the Wormhole ecosystem so any information that is labelled as 'devnet' also applies to Tilt._
2022-09-16 10:43:06 -07:00
2022-09-16 19:21:22 -07:00
### Is Tilt Right for You?
2022-09-16 10:43:06 -07:00
2022-09-19 09:42:45 -07:00
Tilt is generally a good starting point for most developers. Here's a succinct list of the pros and cons of the environment, so you can decide if it's the right fit for you.
2022-09-15 08:47:50 -07:00
2022-09-23 07:46:46 -07:00
**Pros**
2022-09-15 08:47:50 -07:00
2022-09-23 07:46:46 -07:00
- Out-of-the-box support for the many components needed to develop across the heterogenous blockchain spaces.
2022-09-19 08:29:26 -07:00
- Consistent development environment, where contracts deploy deterministically and everything is already linked up.
- Ability to easily enable/disable components as needed.
- Regularly updated as new components join the Wormhole ecosystem.
2022-09-15 08:47:50 -07:00
2022-09-23 07:46:46 -07:00
**Cons**
2022-09-15 08:47:50 -07:00
2022-09-23 07:46:46 -07:00
- Relatively high system requirements but this can be mitigated by disabling components.
- Most blockchains are 'fresh' and have no contracts by default. Thus, if your contracts have any dependencies, you may have to deploy them yourself or alter the default tilt configuration.
- Spin-up and rebuild times can be slow which can result in a slow workflow.
2022-09-16 10:43:06 -07:00
2022-09-23 07:46:46 -07:00
## Setting up Tilt
2022-09-15 08:47:50 -07:00
2022-09-23 07:46:46 -07:00
Tilt functions best in a UNIX-style environment. For Windows users, a WSL environment is recommended.
2022-09-16 19:21:22 -07:00
2022-09-23 07:46:46 -07:00
In order to run the Tilt environment, make sure you have [Tilt](https://docs.tilt.dev/install.html) and [Go](https://go.dev/doc/install) installed.
2022-09-16 19:21:22 -07:00
Once you've installed these two dependencies, just clone the Wormhole Core Repository and start Tilt.
```
git clone --branch main https://github.com/wormhole-foundation/wormhole.git
2022-09-16 19:21:22 -07:00
cd wormhole
tilt up
```
Be sure to check out the [**Tiltfile**](https://github.com/wormhole-foundation/wormhole/blob/main/Tiltfile), which has much of the configuration and arguments for the development environment. It's relatively straightforward to enable and disable components.
2022-09-23 07:46:46 -07:00
For example, you can disable blockchains by setting them to false at startup
2022-09-16 19:21:22 -07:00
```
tilt up -- --algorand=false --near=false --solana=false terra_classic=false terra2=false
```
2022-09-23 07:46:46 -07:00
## Using Tilt
2022-09-16 19:21:22 -07:00
2022-09-23 07:46:46 -07:00
Tilt can pretty much be treated as an external environment / testnet that you can easily spin up and tear down.
2022-09-16 19:21:22 -07:00
2022-09-19 08:29:26 -07:00
If you've followed the standard setup, all your resources will be bound to various ports on localhost. To see all the endpoints which are being hosted in your Tilt environment, you should check the Tilt dashboard, located at [http://localhost:10350/overview](http://localhost:10350/overview).
2022-09-16 19:21:22 -07:00
2022-09-23 07:46:46 -07:00
All the deployed contract addresses can be found under the 'Devnet / Tilt' section of [contracts](../../reference/contracts.md).
2022-09-16 19:21:22 -07:00
Useful information pertaining to funded wallets & private keys can also be found in the [devnet.md](https://github.com/wormhole-foundation/wormhole/blob/main/docs/devnet.md) file of the docs.
2022-09-16 19:21:22 -07:00
2022-09-23 07:46:46 -07:00
Additional helpful resources can be found in the [Tooling](./tooling.md) page.
2022-09-16 19:21:22 -07:00
2022-09-23 07:46:46 -07:00
## Shutting down Tilt
2022-09-19 09:42:45 -07:00
In order to shut down Tilt, simply run
```
tilt down
```