-
Notifications
You must be signed in to change notification settings - Fork 202
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
39 changed files
with
1,532 additions
and
776 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
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,30 @@ | ||
FROM golang:1.19-alpine3.15 AS builder | ||
|
||
WORKDIR /src/app/ | ||
|
||
RUN set -eux; apk add --no-cache ca-certificates build-base git; | ||
|
||
RUN git clone https://github.com/CosmosContracts/juno.git \ | ||
&& cd juno \ | ||
&& git checkout 9558920 | ||
|
||
WORKDIR /src/app/juno | ||
|
||
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 | ||
RUN cp /lib/libwasmvm_muslc.$(uname -m).a /lib/libwasmvm_muslc.a | ||
|
||
RUN LEDGER_ENABLED=false BUILD_TAGS=muslc LINK_STATICALLY=true make build | ||
|
||
FROM alpine:3.15 | ||
COPY --from=builder /src/app/juno/bin/junod /usr/local/bin/ | ||
RUN adduser -S -h /home/juno -D juno -u 1000 | ||
|
||
USER juno | ||
WORKDIR /home/juno | ||
|
||
EXPOSE 26657 26656 1317 9090 | ||
|
||
CMD ["junod", "start"] |
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,31 @@ | ||
FROM golang:1.18-alpine3.15 AS builder | ||
|
||
WORKDIR /src/app/ | ||
|
||
RUN set -eux; apk add --no-cache ca-certificates build-base; apk add git linux-headers | ||
|
||
RUN git clone https://github.com/osmosis-labs/osmosis.git \ | ||
&& cd osmosis \ | ||
&& git checkout 08669da8509059980dc964976ee1ca60c84f5c8a | ||
|
||
WORKDIR /src/app/osmosis | ||
|
||
# Cosmwasm - download correct libwasmvm version and verify checksum | ||
RUN WASMVM_VERSION=$(go list -m github.com/CosmWasm/wasmvm | cut -d ' ' -f 2) \ | ||
&& wget https://github.com/CosmWasm/wasmvm/releases/download/$WASMVM_VERSION/libwasmvm_muslc.$(uname -m).a \ | ||
-O /lib/libwasmvm_muslc.a \ | ||
&& wget https://github.com/CosmWasm/wasmvm/releases/download/v1.0.0/checksums.txt -O /tmp/checksums.txt \ | ||
&& sha256sum /lib/libwasmvm_muslc.a | grep $(cat /tmp/checksums.txt | grep $(uname -m) | cut -d ' ' -f 1) | ||
|
||
RUN BUILD_TAGS=muslc LINK_STATICALLY=true make build | ||
|
||
FROM alpine:3.15 | ||
COPY --from=builder /src/app/osmosis/build/osmosisd /usr/local/bin/ | ||
RUN adduser -S -h /home/osmosis -D osmosis -u 1000 | ||
|
||
USER osmosis | ||
WORKDIR /home/osmosis | ||
|
||
EXPOSE 26657 26656 1317 9090 | ||
|
||
CMD ["osmosisd", "start"] |
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 |
---|---|---|
@@ -1,18 +1,19 @@ | ||
FROM golang:1.18-alpine3.15 AS relayer-builder | ||
FROM golang:1.18-alpine3.15 AS builder | ||
|
||
WORKDIR /src/ | ||
|
||
ENV COMMIT_HASH=65d6065e8016e420c0ddaf9141b5c834e01804c0 | ||
|
||
RUN apk add --update git make gcc linux-headers libc-dev eudev-dev | ||
RUN git clone https://github.com/cosmos/relayer.git \ | ||
&& cd relayer \ | ||
&& git checkout v2.0.0 \ | ||
&& git checkout $COMMIT_HASH \ | ||
&& make install | ||
|
||
FROM alpine:3.15 | ||
COPY --from=relayer-builder /go/bin/rly /usr/local/bin/ | ||
COPY --from=builder /go/bin/rly /usr/local/bin/ | ||
RUN adduser -S -h /home/relayer -D relayer -u 1000 | ||
|
||
USER relayer | ||
WORKDIR /home/relayer | ||
|
||
CMD ["rly", "start", "stride-gaia"] |
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 |
---|---|---|
@@ -1 +1,70 @@ | ||
`/scripts` contains (unmaintained) infrastructure that was used for early testing and development of the Stride protocol. The scripts here support docker-image based testing, some of which are heavily inspired by those used by Osmosis and Quicksilver (although there have been deviations from the original implementations since). The relevant licenses are included here. | ||
|
||
## Dockernet | ||
### Adding a new host zone | ||
* Create a new dockerfile at the root level (`Dockerfile.{new-host-zone}) | ||
* Add the host zone to the docker compose file at the root level. Add the port forwarding to the first node. Add 5 nodes here. Drop the RPC port number by 100, and the API/gRPC port by 10 since the last host zone. | ||
``` | ||
{new-host-zone}1: | ||
image: stridezone:{new-host-zone} | ||
volumes: | ||
- ./scripts/state/{new-host-zone}1:/home/{new-host-zone}/.{new-host-zone} | ||
ports: | ||
- "26257:26657" | ||
- "1277:1317" | ||
- "9050:9090" | ||
{new-host-zone}2: | ||
image: stridezone:{new-host-zone} | ||
volumes: | ||
- ./scripts/state/{new-host-zone}2:/home/{new-host-zone}/.{new-host-zone} | ||
... | ||
{new-host-zone}5: | ||
image: stridezone:{new-host-zone} | ||
volumes: | ||
- ./scripts/state/{new-host-zone}5:/home/{new-host-zone}/.{new-host-zone} | ||
``` | ||
* Add the host zone as a submodule in `deps` | ||
* Add the build command for that host zone in `scripts/build.sh` | ||
``` | ||
while getopts sgojhir{n} flag; do | ||
case "${flag}" in | ||
... | ||
n) build_local_and_docker {new-host-zone} deps/{new-host-zone} ;; | ||
``` | ||
* Add the following parameters to `scripts/vars.sh`, where `CHAIN_ID` is the ID of the new host zone | ||
``` | ||
{CHAIN_ID}_CHAIN_ID={NEW-HOST-ZONE} | ||
{CHAIN_ID}_NODE_PREFIX={new-host-zone} | ||
{CHAIN_ID}_NUM_NODES=3 | ||
{CHAIN_ID}_CMD="$SCRIPT_DIR/../build/{new-host-zone}d" | ||
{CHAIN_ID}_VAL_PREFIX={n}val | ||
{CHAIN_ID}_REV_ACCT={n}rev1 | ||
{CHAIN_ID}_DENOM= | ||
{CHAIN_ID}_IBC_DENOM= | ||
{CHAIN_ID}_RPC_PORT={the one included in the docker-compose above} | ||
{CHAIN_ID}_MAIN_CMD="${CHAIN_ID}_CMD --home $SCRIPT_DIR/state/${${CHAIN_ID}_NODE_PREFIX}1" | ||
{CHAIN_ID}_REV_MNEMONIC="" | ||
{CHAIN_ID}_VAL_MNEMONIC_1="" | ||
{CHAIN_ID}_VAL_MNEMONIC_2="" | ||
{CHAIN_ID}_VAL_MNEMONIC_3="" | ||
{CHAIN_ID}_VAL_MNEMONIC_4="" | ||
{CHAIN_ID}_VAL_MNEMONIC_5="" | ||
{CHAIN_ID}_VAL_MNEMONICS=("${CHAIN_ID}_VAL_MNEMONIC_1","${CHAIN_ID}_VAL_MNEMONIC_2","${CHAIN_ID}_VAL_MNEMONIC_3","${CHAIN_ID}_VAL_MNEMONIC_4","${CHAIN_ID}_VAL_MNEMONIC_5") | ||
HERMES_${CHAIN_ID}_ACCT=rly{add one since the account from the last host zone} | ||
HERMES_${CHAIN_ID}_MNEMONIC="" | ||
ICQ_${CHAIN_ID}_ACCT=rly{add one since the account from the last host zone} | ||
ICQ_${CHAIN_ID}_MNEMONIC="" | ||
``` | ||
* Finally add the execution of the `init_chain` script for this host zone in `scripts/start_network.sh`, and add it to the array of `HOST_CHAINS` | ||
``` | ||
sh ${SCRIPT_DIR}/init_chain.sh {NEW-HOST-ZONE} | ||
HOST_CHAINS=(GAIA JUNO OSMO ... {NEW-HOST-ZONE}) | ||
``` | ||
* And that's it! Just start the network as normal, and make sure to rebuild the new host zone when running for the first time. |
Oops, something went wrong.