-
Notifications
You must be signed in to change notification settings - Fork 18
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
3 changed files
with
43 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
.github | ||
scripts | ||
target | ||
Dockerfile |
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,29 @@ | ||
FROM rust:1.71 AS builder | ||
WORKDIR /tmp/ | ||
|
||
# Copy from nearcore: | ||
# https://github.com/near/nearcore/blob/master/Dockerfile | ||
RUN apt-get update -qq && \ | ||
apt-get install -y \ | ||
git \ | ||
cmake \ | ||
g++ \ | ||
pkg-config \ | ||
libssl-dev \ | ||
curl \ | ||
llvm \ | ||
clang | ||
|
||
COPY . . | ||
|
||
# build for release | ||
RUN cargo build --release | ||
|
||
FROM debian:bookworm-slim as runtime | ||
WORKDIR /near-lake-app | ||
|
||
RUN apt update && apt install -yy openssl ca-certificates jq | ||
|
||
COPY --from=builder /tmp/target/release/near-lake . | ||
COPY ./entrypoint.sh entrypoint.sh | ||
ENTRYPOINT [ "./entrypoint.sh" ] |
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,10 @@ | ||
#!/bin/bash | ||
|
||
# Initialize NEAR Lake to generate config and genesis | ||
/near-lake-app/near-lake init --chain-id localnet | ||
|
||
# Tweak nearcore config to track all shards | ||
tmp=$(mktemp) | ||
jq '.tracked_shards = [0]' /root/.near/config.json >"$tmp" && mv "$tmp" /root/.near/config.json | ||
|
||
/near-lake-app/near-lake run "$@" |