Skip to content

Commit

Permalink
Remove localosmosis Dockerfile (#2529)
Browse files Browse the repository at this point in the history
* Remove localosmois Dockerfile

* Retain .osmosisd folder
  • Loading branch information
niccoloraspa authored Aug 30, 2022
1 parent 2309773 commit 09b18a5
Show file tree
Hide file tree
Showing 6 changed files with 114 additions and 104 deletions.
10 changes: 6 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -310,26 +310,28 @@ format:
###############################################################################

localnet-keys:
. tests/localosmosis/keys.sh
. tests/localosmosis/scripts/add_keys.sh

localnet-build:
@docker build -t local:osmosis -f tests/localosmosis/Dockerfile .
@docker-compose -f tests/localosmosis/docker-compose.yml build

localnet-build-state-export:
@docker build -t local:osmosis-se --build-arg ID=$(ID) -f tests/localosmosis/mainnet_state/Dockerfile-stateExport .

localnet-start:
@docker-compose -f tests/localosmosis/docker-compose.yml up

localnet-startd:
@docker-compose -f tests/localosmosis/docker-compose.yml up -d

localnet-start-state-export:
@docker-compose -f tests/localosmosis/mainnet_state/docker-compose-state-export.yml up

localnet-stop:
@docker-compose -f tests/localosmosis/docker-compose.yml down

localnet-remove: localnet-stop
PWD=$(shell pwd)
@docker run --user root -v ${PWD}/tests/localosmosis/.osmosisd:/root/osmosis ubuntu /bin/sh -c "rm -rf /root/osmosis/*"
rm -rf $(PWD)/tests/localosmosis/.osmosisd

localnet-remove-state-export:
@docker-compose -f tests/localosmosis/mainnet_state/docker-compose-state-export.yml down
Expand Down
41 changes: 0 additions & 41 deletions tests/localosmosis/Dockerfile

This file was deleted.

23 changes: 15 additions & 8 deletions tests/localosmosis/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,22 @@
version: "3"

services:

osmosisd:
image: local:osmosis
user: "root:root"
build:
context: ../../
dockerfile: Dockerfile
args:
RUNNER_IMAGE: alpine:3.16
GO_VERSION: 1.18
volumes:
- ./.osmosisd/config:/osmosis/.osmosisd/config
- ./.osmosisd/data:/osmosis/.osmosisd/data
- ./.osmosisd/wasm:/osmosis/.osmosisd/wasm
- ./scripts/setup.sh:/osmosis/setup.sh
- ./.osmosisd/:/osmosis/.osmosisd/
entrypoint:
- /osmosis/setup.sh
ports:
- "26657:26657"
- "1317:1317"
- "9090:9090"
- "9091:9091"
- 26657:26657
- 1317:1317
- 9090:9090
- 9091:9091
File renamed without changes.
93 changes: 93 additions & 0 deletions tests/localosmosis/scripts/setup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
#!/bin/sh

CHAIN_ID=localosmosis
OSMOSIS_HOME=$HOME/.osmosisd
CONFIG_FOLDER=$OSMOSIS_HOME/config
MONIKER=val

MNEMONIC="satisfy adjust timber high purchase tuition stool faith fine install that you unaware feed domain license impose boss human eager hat rent enjoy dawn"

install_prerequisites () {
apk add dasel
}

edit_genesis () {

GENESIS=$CONFIG_FOLDER/genesis.json

# Update staking module
dasel put string -f $GENESIS '.app_state.staking.params.bond_denom' 'uosmo'
dasel put string -f $GENESIS '.app_state.staking.params.unbonding_time' '240s'

# Update crisis module
dasel put string -f $GENESIS '.app_state.crisis.constant_fee.denom' 'uosmo'

# Udpate gov module
dasel put string -f $GENESIS '.app_state.gov.voting_params.voting_period' '60s'
dasel put string -f $GENESIS '.app_state.gov.deposit_params.min_deposit.[0].denom' 'uosmo'

# Update epochs module
dasel put string -f $GENESIS '.app_state.epochs.epochs.[1].duration' "60s"

# Update poolincentives module
dasel put string -f $GENESIS '.app_state.poolincentives.lockable_durations.[0]' "120s"
dasel put string -f $GENESIS '.app_state.poolincentives.lockable_durations.[1]' "180s"
dasel put string -f $GENESIS '.app_state.poolincentives.lockable_durations.[2]' "240s"
dasel put string -f $GENESIS '.app_state.poolincentives.params.minted_denom' "uosmo"

# Update incentives module
dasel put string -f $GENESIS '.app_state.incentives.lockable_durations.[0]' "1s"
dasel put string -f $GENESIS '.app_state.incentives.lockable_durations.[1]' "120s"
dasel put string -f $GENESIS '.app_state.incentives.lockable_durations.[2]' "180s"
dasel put string -f $GENESIS '.app_state.incentives.lockable_durations.[3]' "240s"
dasel put string -f $GENESIS '.app_state.incentives.params.distr_epoch_identifier' "day"

# Update mint module
dasel put string -f $GENESIS '.app_state.mint.params.mint_denom' "uosmo"
dasel put string -f $GENESIS '.app_state.mint.params.epoch_identifier' "day"

# Update gamm module
dasel put string -f $GENESIS '.app_state.gamm.params.pool_creation_fee.[0].denom' "uosmo"

# Update txfee basedenom
dasel put string -f $GENESIS '.app_state.txfees.basedenom' "uosmo"
}

add_genesis_accounts () {

osmosisd add-genesis-account osmo1phaxpevm5wecex2jyaqty2a4v02qj7qmlmzk5a 100000000000uosmo,100000000000uion --home $OSMOSIS_HOME
osmosisd add-genesis-account osmo1cyyzpxplxdzkeea7kwsydadg87357qnahakaks 100000000000uosmo,100000000000uion --home $OSMOSIS_HOME
osmosisd add-genesis-account osmo18s5lynnmx37hq4wlrw9gdn68sg2uxp5rgk26vv 100000000000uosmo,100000000000uion --home $OSMOSIS_HOME
osmosisd add-genesis-account osmo1qwexv7c6sm95lwhzn9027vyu2ccneaqad4w8ka 100000000000uosmo,100000000000uion --home $OSMOSIS_HOME
osmosisd add-genesis-account osmo14hcxlnwlqtq75ttaxf674vk6mafspg8xwgnn53 100000000000uosmo,100000000000uion --home $OSMOSIS_HOME
osmosisd add-genesis-account osmo12rr534cer5c0vj53eq4y32lcwguyy7nndt0u2t 100000000000uosmo,100000000000uion --home $OSMOSIS_HOME
osmosisd add-genesis-account osmo1nt33cjd5auzh36syym6azgc8tve0jlvklnq7jq 100000000000uosmo,100000000000uion --home $OSMOSIS_HOME
osmosisd add-genesis-account osmo10qfrpash5g2vk3hppvu45x0g860czur8ff5yx0 100000000000uosmo,100000000000uion --home $OSMOSIS_HOME
osmosisd add-genesis-account osmo1f4tvsdukfwh6s9swrc24gkuz23tp8pd3e9r5fa 100000000000uosmo,100000000000uion --home $OSMOSIS_HOME
osmosisd add-genesis-account osmo1myv43sqgnj5sm4zl98ftl45af9cfzk7nhjxjqh 100000000000uosmo,100000000000uion --home $OSMOSIS_HOME
osmosisd add-genesis-account osmo14gs9zqh8m49yy9kscjqu9h72exyf295afg6kgk 100000000000uosmo,100000000000uion --home $OSMOSIS_HOME

echo $MNEMONIC | osmosisd keys add $MONIKER --recover --keyring-backend=test --home $OSMOSIS_HOME
osmosisd gentx $MONIKER 500000000uosmo --keyring-backend=test --chain-id=$CHAIN_ID --home $OSMOSIS_HOME

osmosisd collect-gentxs --home $OSMOSIS_HOME
}

edit_config () {
# Remove seeds
dasel put string -f $CONFIG_FOLDER/config.toml '.p2p.seeds' ''

# Expose the rpc
dasel put string -f $CONFIG_FOLDER/config.toml '.rpc.laddr' "tcp://0.0.0.0:26657"
}

if [[ ! -d $CONFIG_FOLDER ]]
then
echo $MNEMONIC | osmosisd init -o --chain-id=$CHAIN_ID --home $OSMOSIS_HOME --recover $MONIKER
install_prerequisites
edit_genesis
add_genesis_accounts
edit_config
fi

osmosisd start --home $OSMOSIS_HOME
51 changes: 0 additions & 51 deletions tests/localosmosis/setup.sh

This file was deleted.

0 comments on commit 09b18a5

Please sign in to comment.