Skip to content

Commit

Permalink
Add baedeker workflow - in progress
Browse files Browse the repository at this point in the history
  • Loading branch information
gztensor committed Jul 29, 2024
1 parent e58bc68 commit ca06814
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 18 deletions.
25 changes: 10 additions & 15 deletions .baedeker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,28 +2,23 @@ FROM ubuntu:20.04
WORKDIR /substrate

# show backtraces
# ENV RUST_BACKTRACE 1
ENV RUST_BACKTRACE 1

# Necessary libraries for Rust execution
# RUN apt-get update && \
# apt-get install -y curl build-essential protobuf-compiler clang git && \
# rm -rf /var/lib/apt/lists/*
RUN apt-get update && \
apt-get install -y curl build-essential protobuf-compiler clang git && \
rm -rf /var/lib/apt/lists/*

# Install cargo and Rust
# RUN curl https://sh.rustup.rs -sSf | sh -s -- -y
# ENV PATH="/root/.cargo/bin:${PATH}"
RUN curl https://sh.rustup.rs -sSf | sh -s -- -y
ENV PATH="/root/.cargo/bin:${PATH}"

# Capture dependencies
# COPY . .
COPY . .

# Cargo build
# RUN cargo build --release
# EXPOSE 9946
#RUN cp -R ./target/* /target
RUN cargo build --release
EXPOSE 9946

# Run the Substrate node binary
#CMD ["./scripts/localnet-baedeker.sh"]

RUN echo "hello from docker" > a.txt

CMD ["bash"]
CMD ["./scripts/localnet-baedeker.sh"]
2 changes: 1 addition & 1 deletion .baedeker/util/runtimeUpgrade.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const fs = require('fs');

const NODE_URL = 'ws://127.0.0.1:9946';
const SUDO_ACCOUNT_SEED = '//Alice';
const WASM_FILE_PATH = '../../target/release/wbuild/node-subtensor-runtime/node_subtensor_runtime.wasm';
const WASM_FILE_PATH = '../../wasm/node_subtensor_runtime.wasm';

async function main() {
// Create a provider connected to the local node
Expand Down
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,7 @@ specs/*.json
bt.snap

# localnet spec
scripts/specs/local.json
scripts/specs/local.json

# Copied wasm files
wasm
2 changes: 1 addition & 1 deletion docker-compose-baedeker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ services:
ports:
- 9946:9946
volumes:
- ./target:/substrate
- ./wasm:/substrate/wasm
build:
context: .
dockerfile: ./.baedeker/Dockerfile
Expand Down
5 changes: 5 additions & 0 deletions scripts/localnet-baedeker.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
#!/bin/bash

# Copy wasm runtime
ls -la ./target/release/wbuild/node-subtensor-runtime/
mkdir -p ./wasm
cp ./target/release/wbuild/node-subtensor-runtime/*.wasm ./wasm

: "${BUILD_BINARY:=1}"
# : "${FEATURES:=pow-faucet}"

Expand Down

0 comments on commit ca06814

Please sign in to comment.