Skip to content

Commit 259f012

Browse files
author
Dev Kalra
authored
[cosmwasm] wormhole stub (#770)
* docker file to build wormhole contracts * move to wormhole stub * add comment * update readme
1 parent d42b489 commit 259f012

File tree

3 files changed

+38
-0
lines changed

3 files changed

+38
-0
lines changed

target_chains/cosmwasm/README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,14 @@ Deployed Code ID: 11
4949

5050
### Instantiating new contract
5151

52+
Pyth contract needs the Wormhole core contract deployed on the same chain. Some chains won't have it deployed.
53+
In that case, you have to deploy wormhole contract yourself. You can build the contract using the scripts given in `wormhole-stub`.
54+
Run and you will get the compiled contract code in `wormhole-stub/artifacts`
55+
56+
```sh
57+
./build.sh
58+
```
59+
5260
This command will upload the code and instantiates a new Pyth contract with the given code id:
5361

5462
```sh
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Run with:
2+
# docker build -f Dockerfile.wormhole -o artifacts .
3+
4+
# Source: https://github.com/CosmWasm/rust-optimizer#notice
5+
# Arm images are released to ease development and testing on Mac M1 machines.
6+
# For release / production use, only contracts built with the Intel optimizers must be used.
7+
# In order to test on mac m1 uncomment the below line
8+
# FROM cosmwasm/workspace-optimizer-arm64:0.12.11@sha256:a00c01c2fdae8c74d6a9db95fa7b0cbb8e81101ce23a78487012e363d632fee9 AS builder
9+
# and comment this one
10+
FROM cosmwasm/workspace-optimizer:0.12.11@sha256:b6b0b1d5ed76dafd0ec0d3812a1e7a275316cf862fd6d0a918f14d71c4cb187f AS builder
11+
12+
WORKDIR /tmp/wormhole-repo
13+
14+
ARG WORMHOLE_REV=2.14.9
15+
ADD https://github.com/certusone/wormhole/archive/refs/tags/v${WORMHOLE_REV}.tar.gz .
16+
RUN tar -xvf v${WORMHOLE_REV}.tar.gz
17+
RUN mv wormhole-${WORMHOLE_REV}/cosmwasm/Cargo.lock /code/
18+
RUN mv wormhole-${WORMHOLE_REV}/cosmwasm/Cargo.toml /code/
19+
RUN mv wormhole-${WORMHOLE_REV}/cosmwasm/contracts /code/contracts
20+
RUN mv wormhole-${WORMHOLE_REV}/cosmwasm/packages /code/packages
21+
RUN mv wormhole-${WORMHOLE_REV}/sdk /sdk
22+
23+
WORKDIR /code
24+
RUN --mount=type=cache,target=/code/target,id=cosmwasm_wormhole_target --mount=type=cache,target=/usr/local/cargo/registry optimize_workspace.sh
25+
26+
FROM scratch AS export-stage
27+
COPY --from=builder /code/artifacts/wormhole* /
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/bin/sh
2+
3+
docker build -f Dockerfile.wormhole -o artifacts .

0 commit comments

Comments
 (0)