#state #backup #osmosis #testnet #download #latest #command

app osmoinplace

Utility for setting up osmosis in-place testnet for development and testing

1 unstable release

0.1.0 Jul 19, 2024

#3 in #osmosis

MIT/Apache

20KB
391 lines

osmoinplace

Utility for setting up osmosis in-place testnet for development and testing. The usual flow requires too much manual process and stitching together of commands, this utility aims to reduce the friction to get a local testnet with mainnet state up and running.

Install

cargo install osmoinplace

Usage

Make sure that osmosisd is in your PATH.

First, download your latest state snapshot and create a backup in case you need to restore it in you testing.

osmoinplace download-mainnet-state
osmoinplace backup

This, by default, should download the latest state snapshot and save it to ~/.osmosisd and backup to ~/.osmosisd_bak.

Now you can keep running clean in-place testnet from backup state by running:

osmoinplace magic-start

note that you can pipe yes to skip the interactive prompt like this

yes | osmoinplace magic-start

In case there is a version upgrade, make sure that you have the current and next version of osmosisd binary. For this example, it has osmosisd_v25 and osmosisd_v26 in the PATH.

yes | osmoinplace --osmosisd-bin osmosisd_v25 magic-start  --upgrade-handler v26 --new-osmosisd-bin osmosisd_v26

This might take a while to complete, so if you want to run some command when the chain is ready, or just want to notify yourself, you can pass any shell script to --on-ready flag.

yes | osmoinplace --osmosisd-bin osmosisd_v25 magic-start  --upgrade-handler v26 --new-osmosisd-bin osmosisd_v26 --on-ready "say 'ready to rumble!'"

Dependencies

~17–30MB
~470K SLoC