fix volume init bug
This commit is contained in:
parent
20884d8047
commit
5aedda97fe
@ -13,7 +13,8 @@ services:
|
|||||||
- lotus-shared:/root/.lotus-shared
|
- lotus-shared:/root/.lotus-shared
|
||||||
healthcheck:
|
healthcheck:
|
||||||
# test: ["CMD-SHELL", "grep 'started ChainNotify channel' /var/log/lotus.log"]
|
# test: ["CMD-SHELL", "grep 'started ChainNotify channel' /var/log/lotus.log"]
|
||||||
test: ["CMD-SHELL", "[ -f /root/.lotus-shared/miner.addr ]"]
|
# test: ["CMD-SHELL", "[ -f /root/.lotus-shared/miner.addr ]"]
|
||||||
|
test: ["CMD-SHELL", "[ -d /root/.lotus-miner-local-net ]"]
|
||||||
interval: 10s
|
interval: 10s
|
||||||
timeout: 10s
|
timeout: 10s
|
||||||
retries: 10
|
retries: 10
|
||||||
|
@ -2,6 +2,10 @@
|
|||||||
|
|
||||||
lotus --version
|
lotus --version
|
||||||
|
|
||||||
|
# # remove old bootnode peer info if present
|
||||||
|
# [ -f /root/.lotus-shared/miner.addr ] && rm /root/.lotus-shared/miner.addr
|
||||||
|
|
||||||
|
# start daemon
|
||||||
nohup lotus daemon --genesis=/devgen.car --profile=bootstrapper --bootstrap=false > /var/log/lotus.log 2>&1 &
|
nohup lotus daemon --genesis=/devgen.car --profile=bootstrapper --bootstrap=false > /var/log/lotus.log 2>&1 &
|
||||||
|
|
||||||
# Loop until the daemon is started
|
# Loop until the daemon is started
|
||||||
@ -11,16 +15,17 @@ while ! grep -q "started ChainNotify channel" /var/log/lotus.log ; do
|
|||||||
done
|
done
|
||||||
echo "Daemon started."
|
echo "Daemon started."
|
||||||
|
|
||||||
# if not already initialized
|
# publish bootnode peer info to shared volume
|
||||||
if [ ! -f /root/.lotus-shared/miner.addr ]; then
|
lotus net listen | awk 'NR==1{print}' > /root/.lotus-shared/miner.addr
|
||||||
|
|
||||||
|
# if miner not already initialized
|
||||||
|
if [ ! -d /root/.lotus-miner-local-net ]; then
|
||||||
# initialize miner
|
# initialize miner
|
||||||
lotus wallet import --as-default ~/.genesis-sectors/pre-seal-t01000.key
|
lotus wallet import --as-default ~/.genesis-sectors/pre-seal-t01000.key
|
||||||
lotus-miner init --genesis-miner --actor=t01000 --sector-size=2KiB --pre-sealed-sectors=~/.genesis-sectors --pre-sealed-metadata=~/.genesis-sectors/pre-seal-t01000.json --nosync
|
lotus-miner init --genesis-miner --actor=t01000 --sector-size=2KiB --pre-sealed-sectors=~/.genesis-sectors --pre-sealed-metadata=~/.genesis-sectors/pre-seal-t01000.json --nosync
|
||||||
|
|
||||||
# publish miner address to shared volume
|
|
||||||
lotus net listen | awk 'NR==1{print}' > /root/.lotus-shared/miner.addr
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# start miner
|
||||||
nohup lotus-miner run --nosync &
|
nohup lotus-miner run --nosync &
|
||||||
|
|
||||||
tail -f /dev/null
|
tail -f /dev/null
|
||||||
|
@ -14,44 +14,15 @@ $ laconic-so --stack fixturenet-lotus build-containers
|
|||||||
```
|
```
|
||||||
$ laconic-so --stack fixturenet-lotus deploy up
|
$ laconic-so --stack fixturenet-lotus deploy up
|
||||||
```
|
```
|
||||||
Correct operation should be verified by checking the laconicd container's logs with:
|
Correct operation should be verified by checking the container logs with:
|
||||||
```
|
```
|
||||||
$ laconic-so --stack fixturenet-lotus deploy logs
|
$ laconic-so --stack fixturenet-lotus deploy logs lotus-miner
|
||||||
|
$ laconic-so --stack fixturenet-lotus deploy logs lotus-node-1
|
||||||
|
$ laconic-so --stack fixturenet-lotus deploy logs lotus-node-2
|
||||||
```
|
```
|
||||||
## 4. Get the multiaddress of miner node
|
or by checking the chain status on each node:
|
||||||
The full nodes will need the multiaddress of the miner node to form a peer connection. Find the miner's multiaddress with:
|
|
||||||
```
|
```
|
||||||
$ laconic-so --stack fixturenet-lotus deploy exec lotus-miner "lotus net listen"
|
$ laconic-so --stack fixturenet-lotus deploy exec lotus-miner "lotus status"
|
||||||
/ip4/192.168.160.4/tcp/44523/p2p/12D3KooWQiLfXiyQQY79Bn4Yhuti2PwekBc6cccp1rFpCo5WssLC
|
$ laconic-so --stack fixturenet-lotus deploy exec lotus-node-1 "lotus status"
|
||||||
/ip4/127.0.0.1/tcp/44523/p2p/12D3KooWQiLfXiyQQY79Bn4Yhuti2PwekBc6cccp1rFpCo5WssLC
|
$ laconic-so --stack fixturenet-lotus deploy exec lotus-node-2 "lotus status"
|
||||||
```
|
|
||||||
(Your node id will be different) Note the multiaddress and save it for a later step.
|
|
||||||
|
|
||||||
## 5. Start the miner
|
|
||||||
Import the key:
|
|
||||||
```
|
|
||||||
$ laconic-so --stack fixturenet-lotus deploy exec lotus-miner "lotus wallet import --as-default ~/.genesis-sectors/pre-seal-t01000.key"
|
|
||||||
imported key t3spusn5ia57qezc3fwpe3n2lhb4y4xt67xoflqbqy2muliparw2uktevletuv7gl4qakjpafgcl7jk2s2er3q successfully!
|
|
||||||
```
|
|
||||||
Init the miner (this will take several minutes):
|
|
||||||
```
|
|
||||||
$ laconic-so --stack fixturenet-lotus deploy exec lotus-miner "lotus-miner init --genesis-miner --actor=t01000 --sector-size=2KiB --pre-sealed-sectors=~/.genesis-sectors --pre-sealed-metadata=~/.genesis-sectors/pre-seal-t01000.json --nosync"
|
|
||||||
|
|
||||||
...
|
|
||||||
...
|
|
||||||
2023-05-08T15:48:32.660Z INFO main lotus-miner/init.go:282 Miner successfully created, you can now start it with 'lotus-miner run'
|
|
||||||
```
|
|
||||||
Start the miner:
|
|
||||||
```
|
|
||||||
$ laconic-so --stack fixturenet-lotus deploy exec lotus-miner "lotus-miner run --nosync"
|
|
||||||
```
|
|
||||||
|
|
||||||
## 6. Connect the nodes
|
|
||||||
Connect each full node to the miner using the multiaddress from step 4.
|
|
||||||
```
|
|
||||||
$ laconic-so --stack fixturenet-lotus deploy exec lotus-node-1 "lotus net connect <MULTIADDRESS_OF_MINER>"
|
|
||||||
connect 12D3KooWQiLfXiyQQY79Bn4Yhuti2PwekBc6cccp1rFpCo5WssLC: success
|
|
||||||
|
|
||||||
$ laconic-so --stack fixturenet-lotus deploy exec lotus-node-2 "lotus net connect <MULTIADDRESS_OF_MINER>"
|
|
||||||
connect 12D3KooWQiLfXiyQQY79Bn4Yhuti2PwekBc6cccp1rFpCo5WssLC: success
|
|
||||||
```
|
```
|
@ -1,2 +1,2 @@
|
|||||||
# This file should be re-generated running: scripts/create_build_tag_file.sh script
|
# This file should be re-generated running: scripts/create_build_tag_file.sh script
|
||||||
1.1.0-a6a1399-202305092241
|
1.1.0-20884d8-202305100258
|
||||||
|
@ -13,7 +13,8 @@ services:
|
|||||||
- lotus-shared:/root/.lotus-shared
|
- lotus-shared:/root/.lotus-shared
|
||||||
healthcheck:
|
healthcheck:
|
||||||
# test: ["CMD-SHELL", "grep 'started ChainNotify channel' /var/log/lotus.log"]
|
# test: ["CMD-SHELL", "grep 'started ChainNotify channel' /var/log/lotus.log"]
|
||||||
test: ["CMD-SHELL", "[ -f /root/.lotus-shared/miner.addr ]"]
|
# test: ["CMD-SHELL", "[ -f /root/.lotus-shared/miner.addr ]"]
|
||||||
|
test: ["CMD-SHELL", "[ -d /root/.lotus-miner-local-net ]"]
|
||||||
interval: 10s
|
interval: 10s
|
||||||
timeout: 10s
|
timeout: 10s
|
||||||
retries: 10
|
retries: 10
|
||||||
|
@ -2,6 +2,10 @@
|
|||||||
|
|
||||||
lotus --version
|
lotus --version
|
||||||
|
|
||||||
|
# # remove old bootnode peer info if present
|
||||||
|
# [ -f /root/.lotus-shared/miner.addr ] && rm /root/.lotus-shared/miner.addr
|
||||||
|
|
||||||
|
# start daemon
|
||||||
nohup lotus daemon --genesis=/devgen.car --profile=bootstrapper --bootstrap=false > /var/log/lotus.log 2>&1 &
|
nohup lotus daemon --genesis=/devgen.car --profile=bootstrapper --bootstrap=false > /var/log/lotus.log 2>&1 &
|
||||||
|
|
||||||
# Loop until the daemon is started
|
# Loop until the daemon is started
|
||||||
@ -11,16 +15,17 @@ while ! grep -q "started ChainNotify channel" /var/log/lotus.log ; do
|
|||||||
done
|
done
|
||||||
echo "Daemon started."
|
echo "Daemon started."
|
||||||
|
|
||||||
# if not already initialized
|
# publish bootnode peer info to shared volume
|
||||||
if [ ! -f /root/.lotus-shared/miner.addr ]; then
|
lotus net listen | awk 'NR==1{print}' > /root/.lotus-shared/miner.addr
|
||||||
|
|
||||||
|
# if miner not already initialized
|
||||||
|
if [ ! -d /root/.lotus-miner-local-net ]; then
|
||||||
# initialize miner
|
# initialize miner
|
||||||
lotus wallet import --as-default ~/.genesis-sectors/pre-seal-t01000.key
|
lotus wallet import --as-default ~/.genesis-sectors/pre-seal-t01000.key
|
||||||
lotus-miner init --genesis-miner --actor=t01000 --sector-size=2KiB --pre-sealed-sectors=~/.genesis-sectors --pre-sealed-metadata=~/.genesis-sectors/pre-seal-t01000.json --nosync
|
lotus-miner init --genesis-miner --actor=t01000 --sector-size=2KiB --pre-sealed-sectors=~/.genesis-sectors --pre-sealed-metadata=~/.genesis-sectors/pre-seal-t01000.json --nosync
|
||||||
|
|
||||||
# publish miner address to shared volume
|
|
||||||
lotus net listen | awk 'NR==1{print}' > /root/.lotus-shared/miner.addr
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# start miner
|
||||||
nohup lotus-miner run --nosync &
|
nohup lotus-miner run --nosync &
|
||||||
|
|
||||||
tail -f /dev/null
|
tail -f /dev/null
|
||||||
|
@ -1,2 +1,22 @@
|
|||||||
# Lotus Fixturenet
|
# Lotus Fixturenet
|
||||||
|
|
||||||
|
Instructions for deploying a local Lotus (Filecoin) chain for development and testing purposes using laconic-stack-orchestrator.
|
||||||
|
|
||||||
|
## 1. Clone required repositories
|
||||||
|
```
|
||||||
|
$ laconic-so --stack fixturenet-lotus setup-repositories
|
||||||
|
```
|
||||||
|
## 2. Build the stack's packages and containers
|
||||||
|
```
|
||||||
|
$ laconic-so --stack fixturenet-lotus build-containers
|
||||||
|
```
|
||||||
|
## 3. Deploy the stack
|
||||||
|
```
|
||||||
|
$ laconic-so --stack fixturenet-lotus deploy up
|
||||||
|
```
|
||||||
|
Correct operation should be verified by checking the container logs with:
|
||||||
|
```
|
||||||
|
$ laconic-so --stack fixturenet-lotus deploy logs lotus-miner
|
||||||
|
$ laconic-so --stack fixturenet-lotus deploy logs lotus-node-1
|
||||||
|
$ laconic-so --stack fixturenet-lotus deploy logs lotus-node-2
|
||||||
|
```
|
||||||
|
Loading…
Reference in New Issue
Block a user