-
Notifications
You must be signed in to change notification settings - Fork 627
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* tests: add mainnet state to localosmosis (#1627) * dont change operator address * state export changes * additions * changes * apt get update * changes * extra notes * adding flags * add ID * linter fixes * move files (cherry picked from commit 8043e65) # Conflicts: # Makefile # cmd/osmosisd/cmd/testnetify/testnetify.py # tests/localosmosis/README.md * Update testnetify.py Co-authored-by: Adam Tucker <[email protected]>
- Loading branch information
1 parent
6e6e8a1
commit 0b4b15a
Showing
7 changed files
with
562 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
# syntax=docker/dockerfile:1 | ||
|
||
|
||
# -------------------------------------------------------- | ||
# Build | ||
# -------------------------------------------------------- | ||
|
||
FROM golang:1.18.2-alpine3.15 as build | ||
|
||
RUN set -eux; apk add --no-cache ca-certificates build-base; | ||
RUN apk add git | ||
# Needed by github.com/zondax/hid | ||
RUN apk add linux-headers | ||
|
||
WORKDIR /osmosis | ||
COPY . /osmosis | ||
|
||
|
||
# CosmWasm: see https://github.com/CosmWasm/wasmvm/releases | ||
ADD https://github.com/CosmWasm/wasmvm/releases/download/v1.0.0/libwasmvm_muslc.aarch64.a /lib/libwasmvm_muslc.aarch64.a | ||
ADD https://github.com/CosmWasm/wasmvm/releases/download/v1.0.0/libwasmvm_muslc.x86_64.a /lib/libwasmvm_muslc.x86_64.a | ||
RUN sha256sum /lib/libwasmvm_muslc.aarch64.a | grep 7d2239e9f25e96d0d4daba982ce92367aacf0cbd95d2facb8442268f2b1cc1fc | ||
RUN sha256sum /lib/libwasmvm_muslc.x86_64.a | grep f6282df732a13dec836cda1f399dd874b1e3163504dbd9607c6af915b2740479 | ||
|
||
# CosmWasm: copy the right library according to architecture. The final location will be found by the linker flag `-lwasmvm_muslc` | ||
RUN cp /lib/libwasmvm_muslc.$(uname -m).a /lib/libwasmvm_muslc.a | ||
|
||
RUN BUILD_TAGS=muslc LINK_STATICALLY=true make build | ||
|
||
# -------------------------------------------------------- | ||
# Runner | ||
# -------------------------------------------------------- | ||
|
||
FROM ubuntu | ||
|
||
COPY --from=build /osmosis/build/osmosisd /bin/osmosisd | ||
COPY /tests/localosmosis/mainnet_state/statesync.sh /osmosis/statesync.sh | ||
COPY /tests/localosmosis/mainnet_state/testnetify.py /osmosis/testnetify.py | ||
COPY /tests/localosmosis/testnet_genesis.json /osmosis/testnet_genesis.json | ||
|
||
ENV HOME /osmosis | ||
WORKDIR $HOME | ||
# RUN apk update | ||
# RUN apk add jq | ||
# RUN apk add moreutils | ||
# RUN rm -rf /var/cache/apk/* | ||
# RUN apk add --no-cache python3 py3-pip | ||
# RUN apt-get update && apt-get install -y software-properties-common gcc && \ | ||
# add-apt-repository -y ppa:deadsnakes/ppa | ||
# RUN apt-get update && apt-get install -y python3.6 python3-distutils python3-pip python3-apt | ||
RUN apt-get update && apt-get install -y python3 | ||
RUN chmod +x /osmosis/statesync.sh | ||
RUN /osmosis/statesync.sh | ||
ARG ID=localosmosis | ||
RUN python3 /osmosis/testnetify.py --chain-id=$ID | ||
RUN cp testnet_genesis.json .osmosisd/config/genesis.json | ||
EXPOSE 26656 | ||
EXPOSE 26657 | ||
EXPOSE 1317 | ||
|
||
ENTRYPOINT ["osmosisd"] | ||
CMD ["start", "--x-crisis-skip-assert-invariants"] |
15 changes: 15 additions & 0 deletions
15
tests/localosmosis/mainnet_state/docker-compose-state-export.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
version: "3" | ||
|
||
services: | ||
osmosisd: | ||
image: local:osmosis-se | ||
user: "root:root" | ||
command: | ||
- start | ||
- --x-crisis-skip-assert-invariants | ||
- --rpc.laddr=tcp://0.0.0.0:26657 | ||
ports: | ||
- "26657:26657" | ||
- "1317:1317" | ||
- "9090:9090" | ||
- "9091:9091" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#!/bin/bash | ||
|
||
# initialize osmosis | ||
osmosisd init --chain-id=localosmosis val | ||
# remove seeds | ||
sed -i.bak -E 's#^(seeds[[:space:]]+=[[:space:]]+).*$#\1""#' ~/.osmosisd/config/config.toml | ||
sed -i.bak -E 's#^(fast_sync[[:space:]]+=[[:space:]]+).*$#\1false#' ~/.osmosisd/config/config.toml |
Oops, something went wrong.