Fund a known account
This commit is contained in:
parent
87ff06d9c3
commit
4227693652
@ -8,6 +8,7 @@ services:
|
||||
image: cerc/lotus:local
|
||||
volumes:
|
||||
- ../config/fixturenet-lotus/setup-miner.sh:/docker-entrypoint-scripts.d/setup-miner.sh
|
||||
- ../config/fixturenet-lotus/fund-account.sh:/fund-account.sh
|
||||
- lotus_miner_params:/var/tmp/filecoin-proof-parameters
|
||||
- lotus-shared:/root/.lotus-shared
|
||||
entrypoint: ["sh", "/docker-entrypoint-scripts.d/setup-miner.sh"]
|
||||
|
||||
20
app/data/config/fixturenet-lotus/fund-account.sh
Executable file
20
app/data/config/fixturenet-lotus/fund-account.sh
Executable file
@ -0,0 +1,20 @@
|
||||
#!/bin/bash
|
||||
|
||||
# ETH account with pk c05fd3613bcd62a4f25e5eba1f464d0b76d74c3f771a7c2f13e26ad6439444b3
|
||||
ETH_ADDRESS=0xD375B03bd3A2434A9f675bEC4Ccd68aC5e67C743
|
||||
AMOUNT=1000
|
||||
|
||||
# Pre-fund stat
|
||||
PREFUND_STAT_OUTPUT=$(lotus evm stat $ETH_ADDRESS)
|
||||
|
||||
FILECOIN_ADDRESS=$(echo "$PREFUND_STAT_OUTPUT" | grep -oP 'Filecoin address:\s+\K\S+')
|
||||
echo Filecoin address: "$FILECOIN_ADDRESS"
|
||||
|
||||
echo Sending balance to "$FILECOIN_ADDRESS"
|
||||
lotus send --from $(lotus wallet default) "$FILECOIN_ADDRESS" $AMOUNT
|
||||
|
||||
# Post-fund stat
|
||||
echo lotus evm stat $ETH_ADDRESS
|
||||
lotus evm stat $ETH_ADDRESS
|
||||
|
||||
echo "Account with ETH address $ETH_ADDRESS funded"
|
||||
@ -25,7 +25,7 @@ nohup lotus daemon --lotus-make-genesis=devgen.car --profile=bootstrapper --gene
|
||||
# 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
|
||||
sleep 5
|
||||
done
|
||||
echo "Daemon started."
|
||||
|
||||
@ -39,6 +39,10 @@ lotus net listen | awk 'NR==2{print}' > /root/.lotus-shared/miner.addr
|
||||
if [ ! -d $LOTUS_MINER_PATH ]; then
|
||||
# initialize miner
|
||||
lotus wallet import --as-default ~/.genesis-sectors/pre-seal-t01000.key
|
||||
|
||||
# fund a known account for usage
|
||||
/fund-account.sh
|
||||
|
||||
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
|
||||
fi
|
||||
|
||||
|
||||
@ -5,7 +5,7 @@ lotus --version
|
||||
# Loop until the daemon is started
|
||||
echo "Waiting for miner to share peering info..."
|
||||
while [ ! -f /root/.lotus-shared/miner.addr ]; do
|
||||
sleep 5
|
||||
sleep 5
|
||||
done
|
||||
echo "Resuming..."
|
||||
|
||||
|
||||
Reference in New Issue
Block a user