Add support for running node in calibration network
This commit is contained in:
parent
e75c36ab1d
commit
78b0a695cc
@ -7,6 +7,7 @@ services:
|
||||
lotus:
|
||||
environment:
|
||||
- DOCKER_LOTUS_IMPORT_SNAPSHOT=/var/lotus-snapshots/snapshot
|
||||
- LOTUS_NETWORK=${CERC_LOTUS_NETWORK}
|
||||
- LOTUS_FEVM_ENABLEETHRPC=true
|
||||
- LOTUS_API_LISTENADDRESS=/ip4/0.0.0.0/tcp/1234/http
|
||||
- LOTUS_LIBP2P_LISTENADDRESSES=/ip4/0.0.0.0/tcp/1235,/ip6/::/tcp/1235,/ip4/0.0.0.0/udp/1235/quic-v1,/ip6/::/udp/1235/quic-v1,/ip4/0.0.0.0/udp/1235/quic-v1/webtransport,/ip6/::/udp/1235/quic-v1/webtransport
|
||||
@ -16,6 +17,7 @@ services:
|
||||
- parameters:/var/tmp/filecoin-proof-parameters
|
||||
- lotus-repo:/var/lib/lotus
|
||||
- lotus_shared:/root/.lotus
|
||||
- ../config/lotus-node/docker-lotus-entrypoint.sh:/docker-lotus-entrypoint.sh
|
||||
ports:
|
||||
- "1234"
|
||||
- "1235"
|
||||
|
28
stack-orchestrator/config/lotus-node/docker-lotus-entrypoint.sh
Executable file
28
stack-orchestrator/config/lotus-node/docker-lotus-entrypoint.sh
Executable file
@ -0,0 +1,28 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
TARGET_LOTUS="/usr/local/bin/lotus"
|
||||
TARGET_LOTUS_SHED="/usr/local/bin/lotus-shed"
|
||||
|
||||
if [ "$LOTUS_NETWORK" = "calibration" ]; then
|
||||
echo "Using Calibration Lotus binary"
|
||||
TARGET_LOTUS="/usr/local/bin/lotus-calibnet"
|
||||
TARGET_LOTUS_SHED="/usr/local/bin/lotus-calibnet-shed"
|
||||
fi
|
||||
|
||||
if [ ! -z $DOCKER_LOTUS_IMPORT_SNAPSHOT ]; then
|
||||
GATE="$LOTUS_PATH"/date_initialized
|
||||
# Don't init if already initialized.
|
||||
if [ ! -f "$GATE" ]; then
|
||||
echo importing minimal snapshot
|
||||
echo "yes" | $TARGET_LOTUS daemon --import-snapshot "$DOCKER_LOTUS_IMPORT_SNAPSHOT" --halt-after-import
|
||||
# Block future inits
|
||||
date > "$GATE"
|
||||
fi
|
||||
fi
|
||||
|
||||
# import wallet, if provided
|
||||
if [ ! -z $DOCKER_LOTUS_IMPORT_WALLET ]; then
|
||||
$TARGET_LOTUS_SHED keyinfo import "$DOCKER_LOTUS_IMPORT_WALLET"
|
||||
fi
|
||||
|
||||
exec $TARGET_LOTUS daemon $@
|
@ -47,6 +47,11 @@ RUN make clean deps && \
|
||||
install -C ./lotus-shed /usr/local/bin/lotus-shed && \
|
||||
install -C ./lotus-stats /usr/local/bin/lotus-stats
|
||||
|
||||
RUN make clean deps && \
|
||||
make calibnet && \
|
||||
install -C ./lotus /usr/local/bin/lotus-calibnet && \
|
||||
install -C ./lotus-shed /usr/local/bin/lotus-calibnet-shed
|
||||
|
||||
#####################################
|
||||
FROM ubuntu:20.04 AS lotus-base
|
||||
MAINTAINER Lotus Development Team
|
||||
@ -73,6 +78,8 @@ MAINTAINER Lotus Development Team
|
||||
COPY --from=lotus-builder \
|
||||
/usr/local/bin/lotus \
|
||||
/usr/local/bin/lotus-shed \
|
||||
/usr/local/bin/lotus-calibnet \
|
||||
/usr/local/bin/lotus-calibnet-shed \
|
||||
/usr/local/bin/
|
||||
|
||||
ENV FILECOIN_PARAMETER_CACHE /var/tmp/filecoin-proof-parameters
|
||||
@ -107,6 +114,8 @@ ENV DOCKER_LOTUS_IMPORT_SNAPSHOT=${DOCKER_LOTUS_IMPORT_SNAPSHOT}
|
||||
COPY --from=lotus-builder /opt/filecoin/lotus /usr/local/bin/
|
||||
COPY --from=lotus-builder /opt/filecoin/lotus-shed /usr/local/bin/
|
||||
COPY --from=lotus-builder /opt/filecoin/lotus-stats /usr/local/bin/
|
||||
COPY --from=lotus-builder /opt/filecoin/lotus-calibnet /usr/local/bin/
|
||||
COPY --from=lotus-builder /opt/filecoin/lotus-calibnet-shed /usr/local/bin/
|
||||
COPY scripts/docker-lotus-entrypoint.sh /docker-lotus-entrypoint.sh
|
||||
RUN chmod +x /docker-lotus-entrypoint.sh
|
||||
|
||||
|
@ -5,11 +5,21 @@ Instructions for deploying a Lotus snap-synced node (for both mainnet and calibn
|
||||
## Prerequisite
|
||||
|
||||
Downloaded chain snapshot
|
||||
|
||||
- For Mainnet
|
||||
```bash
|
||||
aria2c -o snapshot -x5 https://forest-archive.chainsafe.dev/latest/mainnet/
|
||||
aria2c -o mainnet-snapshot.car.zst -x5 https://forest-archive.chainsafe.dev/latest/mainnet/
|
||||
|
||||
# or using wget
|
||||
wget -O snapshot https://forest-archive.chainsafe.dev/latest/mainnet/
|
||||
wget -O mainnet-snapshot.car.zst https://forest-archive.chainsafe.dev/latest/mainnet/
|
||||
```
|
||||
|
||||
- For Calibration Testnet
|
||||
```
|
||||
aria2c -o calibnet-snapshot.car.zst -x5 https://forest-archive.chainsafe.dev/latest/calibnet/
|
||||
|
||||
# or using wget
|
||||
wget -O calibnet-snapshot.car.zst https://forest-archive.chainsafe.dev/latest/calibnet/
|
||||
```
|
||||
|
||||
## Clone the stack repo
|
||||
@ -39,12 +49,22 @@ $ laconic-so --stack ~/cerc/lotus-stack/stack-orchestrator/stacks/lotus-node dep
|
||||
|
||||
## Setup config
|
||||
|
||||
Set file path of downloaded snapshot in config.env
|
||||
Inside deployment directory, open the `config.env` file and set following env variables:
|
||||
|
||||
- For Mainnet
|
||||
```bash
|
||||
CERC_LOTUS_NETWORK=mainnet
|
||||
|
||||
# File path of downloaded snapshot
|
||||
CERC_LOTUS_SNAPSHOT_PATH=/path-to-file/snapshot
|
||||
CERC_LOTUS_SNAPSHOT_PATH=/path-to-file/mainnet-snapshot.car.zst
|
||||
```
|
||||
|
||||
- For Calibration
|
||||
```bash
|
||||
CERC_LOTUS_NETWORK=calibration
|
||||
|
||||
# File path of downloaded snapshot
|
||||
CERC_LOTUS_SNAPSHOT_PATH=/path-to-file/calibnet-snapshot.car.zst
|
||||
```
|
||||
|
||||
## Start the container
|
||||
|
@ -2,8 +2,7 @@ version: "1.0"
|
||||
name: lotus-node
|
||||
description: "Lotus node stack"
|
||||
repos:
|
||||
# TODO: Use a release version tag
|
||||
- git.vdb.to/cerc-io/lotus
|
||||
- git.vdb.to/cerc-io/lotus@v1.27.0-rc3-interal-0.0.1
|
||||
containers:
|
||||
- cerc/lotus-node
|
||||
pods:
|
||||
|
Loading…
Reference in New Issue
Block a user