Update sushiswap-subgraph stack to point to filecoin endpoint #509

Merged
prathamesh0 merged 16 commits from pm-sushigraph-filecoin into main 2023-08-30 10:35:16 +00:00
4 changed files with 13 additions and 111 deletions
Showing only changes of commit f93febe812 - Show all commits

View File

@ -1,8 +1,8 @@
version: "3.8"
services:
lotus-miner-1:
hostname: lotus-miner-1
lotus-miner:
hostname: lotus-miner
env_file:
- ../config/fixturenet-lotus/lotus-env.env
image: cerc/lotus:local
@ -11,7 +11,7 @@ services:
- ../config/fixturenet-lotus/fund-account.sh:/fund-account.sh
- lotus_miner_params:/var/tmp/filecoin-proof-parameters
- lotus_shared:/root/.lotus-shared
- lotus_miner_1_data:/root/data
- lotus_miner_data:/root/data
entrypoint: ["sh", "/docker-entrypoint-scripts.d/setup-miner.sh"]
ports:
- "1234"
@ -19,48 +19,6 @@ services:
- "3456"
- "1777"
lotus-miner-2:
hostname: lotus-miner-2
env_file:
- ../config/fixturenet-lotus/lotus-env.env
environment:
- MINER_INDEX=1
image: cerc/lotus:local
volumes:
- ../config/fixturenet-lotus/setup-secondary-miner.sh:/docker-entrypoint-scripts.d/setup-secondary-miner.sh
- lotus_miner_params:/var/tmp/filecoin-proof-parameters
- lotus_shared:/root/.lotus-shared
- lotus_miner_2_data:/root/data
depends_on:
- lotus-miner-1
entrypoint: ["sh", "/docker-entrypoint-scripts.d/setup-secondary-miner.sh"]
ports:
- "1234"
- "2345"
- "3456"
- "1777"
lotus-miner-3:
hostname: lotus-miner-3
env_file:
- ../config/fixturenet-lotus/lotus-env.env
environment:
- MINER_INDEX=2
image: cerc/lotus:local
volumes:
- ../config/fixturenet-lotus/setup-secondary-miner.sh:/docker-entrypoint-scripts.d/setup-secondary-miner.sh
- lotus_miner_params:/var/tmp/filecoin-proof-parameters
- lotus_shared:/root/.lotus-shared
- lotus_miner_3_data:/root/data
depends_on:
- lotus-miner-1
entrypoint: ["sh", "/docker-entrypoint-scripts.d/setup-secondary-miner.sh"]
ports:
- "1234"
- "2345"
- "3456"
- "1777"
lotus-node-1:
hostname: lotus-node-1
env_file:
@ -81,7 +39,7 @@ services:
retries: 60
start_period: 3s
depends_on:
- lotus-miner-1
- lotus-miner
entrypoint: ["sh", "/docker-entrypoint-scripts.d/setup-node.sh"]
ports:
- "1234"
@ -109,7 +67,7 @@ services:
retries: 60
start_period: 3s
depends_on:
- lotus-miner-1
- lotus-miner
entrypoint: ["sh", "/docker-entrypoint-scripts.d/setup-node.sh"]
ports:
- "1234"
@ -122,8 +80,6 @@ volumes:
lotus_node_1_params:
lotus_node_2_params:
lotus_shared:
lotus_miner_1_data:
lotus_miner_2_data:
lotus_miner_3_data:
lotus_miner_data:
lotus_node_1_data:
lotus_node_2_data:

View File

@ -17,15 +17,9 @@ fi
# if genesis is not already setup
if [ ! -f /root/data/localnet.json ]; then
lotus-seed --sector-dir /root/.lotus-shared/.genesis-sectors pre-seal --sector-size 2KiB --num-sectors 2 --miner-addr t01000
lotus-seed --sector-dir /root/.lotus-shared/.genesis-sectors pre-seal --sector-size 2KiB --num-sectors 2 --miner-addr t01001
lotus-seed --sector-dir /root/.lotus-shared/.genesis-sectors pre-seal --sector-size 2KiB --num-sectors 2 --miner-addr t01002
lotus-seed --sector-dir /root/.lotus-shared/.genesis-sectors genesis new /root/data/localnet.json
lotus-seed --sector-dir /root/.lotus-shared/.genesis-sectors genesis add-miner /root/data/localnet.json /root/.lotus-shared/.genesis-sectors/pre-seal-t01000.json
lotus-seed --sector-dir /root/.lotus-shared/.genesis-sectors genesis add-miner /root/data/localnet.json /root/.lotus-shared/.genesis-sectors/pre-seal-t01001.json
lotus-seed --sector-dir /root/.lotus-shared/.genesis-sectors genesis add-miner /root/data/localnet.json /root/.lotus-shared/.genesis-sectors/pre-seal-t01002.json
lotus-seed --sector-dir /root/data/.genesis-sectors pre-seal --sector-size 2KiB --num-sectors 2
lotus-seed --sector-dir /root/data/.genesis-sectors genesis new /root/data/localnet.json
lotus-seed --sector-dir /root/data/.genesis-sectors genesis add-miner /root/data/localnet.json /root/data/.genesis-sectors/pre-seal-t01000.json
fi
# start daemon
@ -41,13 +35,13 @@ echo "Daemon started."
# if miner not already initialized
if [ ! -d $LOTUS_MINER_PATH ]; then
# initialize miner
lotus wallet import --as-default /root/.lotus-shared/.genesis-sectors/pre-seal-t01000.key
lotus wallet import --as-default /root/data/.genesis-sectors/pre-seal-t01000.key
# fund a known account for usage
/fund-account.sh
echo "Initializing miner..."
lotus-miner init --genesis-miner --actor=t01000 --sector-size=2KiB --pre-sealed-sectors=/root/.lotus-shared/.genesis-sectors --pre-sealed-metadata=/root/.lotus-shared/.genesis-sectors/pre-seal-t01000.json --nosync
lotus-miner init --genesis-miner --actor=t01000 --sector-size=2KiB --pre-sealed-sectors=/root/data/.genesis-sectors --pre-sealed-metadata=/root/data/.genesis-sectors/pre-seal-t01000.json --nosync
fi
# publish bootnode peer info to shared volume

View File

@ -1,44 +0,0 @@
#!/bin/bash
lotus --version
# Wait for bootstrap peer info
echo "Waiting for miner 1 to share peering info..."
while [ ! -f /root/.lotus-shared/miner.addr ]; do
sleep 5
done
echo "Resuming..."
# init node config
mkdir -p "$LOTUS_PATH"
lotus config default > "$LOTUS_PATH"/config.toml
# add bootstrap peer info to config file
MINER_ADDR=\"$(cat /root/.lotus-shared/miner.addr)\"
sed -i "/^\[Libp2p\]/a \ \ BootstrapPeers = [$MINER_ADDR]" $LOTUS_PATH/config.toml
# start node
nohup lotus daemon --genesis=/root/.lotus-shared/devgen.car > /var/log/lotus.log 2>&1 &
# Loop until the daemon is started
echo "Waiting for daemon to start..."
while ! grep -q "started ChainNotify channel" /var/log/lotus.log ; do
sleep 5
done
echo "Daemon started."
# if miner not already initialized
if [ ! -d "$LOTUS_MINER_PATH" ]; then
# initialize miner
MINER_ACTOR="t0100$MINER_INDEX"
lotus wallet import --as-default "/root/.lotus-shared/.genesis-sectors/pre-seal-$MINER_ACTOR.key"
echo "Initializing miner..."
lotus-miner init --actor="$MINER_ACTOR" --sector-size=2KiB --pre-sealed-sectors=/root/.lotus-shared/.genesis-sectors --pre-sealed-metadata=/root/.lotus-shared/.genesis-sectors/pre-seal-"$MINER_ACTOR".json --nosync
fi
# start miner
nohup lotus-miner run --nosync &
tail -f /dev/null

View File

@ -19,17 +19,13 @@ Note: When running for the first time (or after clean up), the services will tak
Correct operation should be verified by checking the container logs with:
```
$ laconic-so --stack fixturenet-lotus deploy --cluster lotus logs lotus-miner-1
$ laconic-so --stack fixturenet-lotus deploy --cluster lotus logs lotus-miner-2
$ laconic-so --stack fixturenet-lotus deploy --cluster lotus logs lotus-miner-3
$ laconic-so --stack fixturenet-lotus deploy --cluster lotus logs lotus-miner
$ laconic-so --stack fixturenet-lotus deploy --cluster lotus logs lotus-node-1
$ laconic-so --stack fixturenet-lotus deploy --cluster lotus logs lotus-node-2
```
or by checking the chain status on each node:
```
$ laconic-so --stack fixturenet-lotus deploy --cluster lotus exec lotus-miner-1 "lotus status"
$ laconic-so --stack fixturenet-lotus deploy --cluster lotus exec lotus-miner-2 "lotus status"
$ laconic-so --stack fixturenet-lotus deploy --cluster lotus exec lotus-miner-3 "lotus status"
$ laconic-so --stack fixturenet-lotus deploy --cluster lotus exec lotus-miner "lotus status"
$ laconic-so --stack fixturenet-lotus deploy --cluster lotus exec lotus-node-1 "lotus status"
$ laconic-so --stack fixturenet-lotus deploy --cluster lotus exec lotus-node-2 "lotus status"
```