Skip to content

Commit

Permalink
example fixupes
Browse files Browse the repository at this point in the history
  • Loading branch information
mgild committed Jun 28, 2023
1 parent 3e0de49 commit cb03141
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 7 deletions.
17 changes: 13 additions & 4 deletions examples/functions/01_basic_oracle/sgx-function/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,24 @@ WORKDIR /home/root/switchboard-function/sgx-function
# cargo strip && \
# mv /home/root/switchboard-function/sgx-function/target/release/${CARGO_NAME} /sgx

RUN cargo build --release && \
RUN --mount=type=cache,target=/usr/local/cargo/registry --mount=type=cache,target=/home/root/switchboard-function/sgx-function/target \
cargo build --release && \
cargo strip && \
mv /home/root/switchboard-function/sgx-function/target/release/${CARGO_NAME} /sgx
mv target/release/basic-oracle-function /sgx/app

FROM switchboardlabs/sgx-function

# Copy the binary
WORKDIR /sgx
COPY --from=builder /sgx/${CARGO_NAME} /sgx/app
COPY --from=builder /sgx/app /sgx

# Get the measurement from the enclave
RUN /get_measurement.sh
RUN /get_measurement.sh

# COPY configs/app.manifest.template .
# COPY configs/boot.sh /boot.sh
RUN gramine-manifest /app.manifest.template > app.manifest
# RUN gramine-sgx-gen-private-key
RUN gramine-sgx-sign --manifest app.manifest --output app.manifest.sgx | tail -2 | tee /measurement.txt

ENTRYPOINT ["bash", "/boot.sh"]
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ WORKDIR /home/root/solana-sdk
COPY ./rust/switchboard-solana/Cargo.toml \
./rust/switchboard-solana/Cargo.lock \
./rust/switchboard-solana/

COPY ./examples/functions/01_basic_oracle/Cargo.toml \
./examples/functions/01_basic_oracle/Cargo.lock \
./examples/functions/01_basic_oracle/
Expand Down Expand Up @@ -40,4 +40,5 @@ WORKDIR /sgx
COPY --from=builder /sgx/${CARGO_NAME} /sgx/app

# Get the measurement from the enclave
RUN /get_measurement.sh
RUN /get_measurement.sh
ENTRYPOINT ["bash", "/boot.sh"]
2 changes: 1 addition & 1 deletion examples/functions/01_basic_oracle/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ pub use utils::*;
pub mod actions;
pub use actions::*;

declare_id!("HgVykECRLmtSfquJz7NTBg5H8SfL2ehTFZnzfDJQuxt2");
declare_id!("6tdxUefBQRpL1CbJhzXgcMtWChKqXj9P9Rz2bvTWiiar");

pub const PROGRAM_SEED: &[u8] = b"BASICORACLE";

Expand Down

0 comments on commit cb03141

Please sign in to comment.