Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bump lotus docker images to v1.17.2-rc2 #868

Merged
merged 3 commits into from
Oct 4, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions docker/devnet/.env
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
DOCKER_USER=filecoin
LOTUS_IMAGE=${DOCKER_USER}/lotus-dev:1.17.1-rc2
LOTUS_MINER_IMAGE=${DOCKER_USER}/lotus-miner-dev:1.17.1-rc2
LOTUS_IMAGE=${DOCKER_USER}/lotus-dev:1.17.2-rc2
LOTUS_MINER_IMAGE=${DOCKER_USER}/lotus-miner-dev:1.17.2-rc2
BOOST_IMAGE=${DOCKER_USER}/boost-dev:dev
BOOSTER_HTTP_IMAGE=${DOCKER_USER}/booster-http-dev:dev
BOOSTER_BITSWAP_IMAGE=${DOCKER_USER}/booster-bitswap-dev:dev
Expand Down
134 changes: 134 additions & 0 deletions docker/devnet/boost/sample/random.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,134 @@
#!/usr/bin/env bash
###################################################################################
# sample demo script for making a deal with boost client
###################################################################################
set -e
# colors
cb="\e[1m"
ci="\e[3m"
cn="\e[0m"
###################################################################################
printf "\n
###################################################################################\n \
Hello to the demo script that makes a storage deal using the boost client\n \
###################################################################################\n \
1. The boost client needs to know how to connect to the lotus instance. \
We need to set ${cb}FULLNODE_API_INFO${cn} env var. We have the lotus client here that will provide a connection token.\n \
: ${ci}lotus auth api-info --perm=admin${cn} - returns lotus connection token \n\n"
read -rsp $'Press any key to export variable...\n' -n1 key
export `lotus auth api-info --perm=admin`

printf "\nExported FULLNODE_API_INFO=$FULLNODE_API_INFO\n \
###################################################################################\n"
###################################################################################
printf "2. The boost client needs to be initialized by calling \n${ci}boost init${cn} \n\n"
read -rsp $'Press any key to execute it...\n\n' -n1 key

boost init

printf "\n\nGreat. Boost client has been initialized.\n \
###################################################################################\n"
###################################################################################
printf "3. Now add some funds from lotus to boost wallet. We will use the lotus client:\n\n \
: ${ci}lotus wallet default${cn} - returns default lotus wallet\n \
: ${ci}boost wallet default${cn} - returns default wallet for the current boost client actor\n \
: ${ci}lotus send --from=`lotus wallet default` `boost wallet default` 10${cn} - sends 10 FIL\n"
read -rsp $'Press any key to execute it...\n\n' -n1 key

lotus send --from=`lotus wallet default` `boost wallet default` 10

printf "\n\nDone. Funds transfer was initiated\n \
###################################################################################\n"
###################################################################################
printf "4. Now add some funds to the market actor\n \
: ${ci}boostx market-add 1${cn}\n\n"
read -rsp $'Press any key to execute it...\n' -n1 key

until boostx market-add 1; do printf "\nOpps, maybe funds not added yet.\nNeed to wait some time. \n"; read -rsp $'Press any key to try again...\n' -n1 key; done

printf "\n\nYes. We can make a deal now.\n \
###################################################################################\n"
###################################################################################
printf "5. Let's generate a random file in ${ci}/app/public/random.bin${cn}. We will use it as a demo file.\n\n"
read -rsp $'Press any key to generate it...\n\n' -n1 key
rm -f /app/public/random.bin
head -c 7655000 </dev/urandom >/app/public/random.bin

###################################################################################

printf "6. After that, you need to generate a car file for data you want to store on Filecoin (${ci}/app/public/random.bin${cn}), \
and note down its ${ci}payload-cid${cn}. \
We will use the ${ci}boostx${cn} utility\n \
: ${ci}boostx generate-car /app/public/random.bin /app/public/random.car${cn}\n\n"
read -rsp $'Press any key to execute it...\n\n' -n1 key

boostx generate-car /app/public/random.bin /app/public/random.car

PAYLOAD_CID=`boostx generate-car /app/public/random.bin /app/public/random.car | grep CID | cut -d: -f2 | xargs`
printf "\n\nDone. We noted payload-cid = ${ci}$PAYLOAD_CID${cn}\n \
###################################################################################\n"
###################################################################################
printf "7. Then you need to calculate the commp and piece size for the generated car file:\n \
: ${ci}boostx commp /app/public/random.car${cn}\n\n"
read -rsp $'Press any key to execute it...\n\n' -n1 key

boostx commp /app/public/random.car

COMMP_CID=`boostx commp /app/public/random.car 2> /dev/null | grep CID | cut -d: -f2 | xargs`
PIECE=`boostx commp /app/public/random.car 2> /dev/null | grep Piece | cut -d: -f2 | xargs`
CAR=`boostx commp /app/public/random.car 2> /dev/null | grep Car | cut -d: -f2 | xargs`
printf "\n\nYes. We also have remembered these values:\n \
Commp-cid = $COMMP_CID \n \
Piece size = $PIECE \n \
Car size = $CAR \n \
###################################################################################\n"
###################################################################################
printf "8. That's it. We are ready to make the deal. \n \
: ${ci}boost deal --verified=false --provider=t01000 \
--http-url=http://demo-http-server/random.car \
--commp=$COMMP_CID --car-size=$CAR --piece-size=$PIECE \
--payload-cid=$PAYLOAD_CID --storage-price 20000000000\n\n${cn}"
read -rsp $'Press any key to make the deal...\n\n' -n1 key

until boost deal --verified=false \
--provider=t01000 \
--http-url=http://demo-http-server/random.car \
--commp=$COMMP_CID \
--car-size=$CAR \
--piece-size=$PIECE \
--payload-cid=$PAYLOAD_CID --storage-price 20000000000
do
printf "\nThe error has occured. Perhaps we should wait some time for funds to arrive into the market account.\n\n"
read -rsp $'Press any key to check the boost wallet...\n\n' -n1 key
boost init
read -rsp $'\n\nPress any key to try making the deal again...\n' -n1 key
done

printf "\n\n ${cb}Congrats! You have made it.${cn}\n\n \
###################################################################################\n"
###################################################################################"
printf "9. Deal has been made, and it will be published automatically after some time, but you can do it manually using boost's graphql API\n \
: ${ci}curl -X POST -H \"Content-Type: application/json\" -d '{\"query\":\"mutation { dealPublishNow }\"}' http://localhost:8080/graphql/query ${cn}\n\n"
read -rsp $'Press any key to publish the deal...\n\n' -n1 key

curl -X POST -H "Content-Type: application/json" -d '{"query":"mutation { dealPublishNow }"}' http://localhost:8080/graphql/query | jq
printf "\nDone.\n\n \
###################################################################################\n"
###################################################################################
printf "10. To retrieve the file from the ${cb}lotus${cn} system you can use \n\
${ci}lotus client retrieve${cn} or ${ci}lotus client cat${cn} commands.\n\
: ${ci}lotus client cat --miner t01000 $PAYLOAD_CID ${cn}\n\n"

read -rsp $'Press any key to show the file content...\n\n' -n1 key
until lotus client cat --provider=t01000 $PAYLOAD_CID > /tmp/random.bin
do
printf "\nFile publishing may take time, please wait some time until the deal is finished and try again.\n\n"
read -rsp $'Press any key to try again...\n' -n1 key
done

printf "\n\nIf you see a file content you have just completed the demo. You have succesfully:\n\n\
1) initiated the boost client\n\
2) prepared sample file\n\
3) sent the sample file to the Filecoin devnet\n\
4) retrieved the content of the file from it.\n\n\
More info at ${cb}https://boost.filecoin.io${cn} or ${cb}https://github.com/filecoin-project/boost${cn}.\n\n\n"
10 changes: 10 additions & 0 deletions docker/devnet/booster-bitswap/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,16 @@ export BOOST_API_INFO=`boostd auth api-info --perm=admin | cut -f2 -d=`
echo $FULLNODE_API_INFO
echo $MINER_API_INFO
echo $BOOST_API_INFO
echo $BOOSTER_BITSWAP_REPO

if [ ! -f $BOOSTER_BITSWAP_REPO/.init.booster-bitswap ]; then
echo Init booster-bitswap on first run ...

booster-bitswap init

echo Done
touch $BOOSTER_BITSWAP_REPO/.init.booster-bitswap
fi

echo Starting booster-bitswap...
exec booster-bitswap run --api-boost=$BOOST_API_INFO --tracing
2 changes: 2 additions & 0 deletions docker/devnet/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -89,12 +89,14 @@ services:
ports:
- "8888:8888"
environment:
- BOOSTER_BITSWAP_REPO=/var/lib/booster-bitswap
- BOOST_PATH=/var/lib/boost
- LOTUS_PATH=/var/lib/lotus
- LOTUS_MINER_PATH=/var/lib/lotus-miner
restart: unless-stopped
logging: *default-logging
volumes:
- ./data/booster-bitswap:/var/lib/booster-bitswap:rw
- ./data/boost:/var/lib/boost:ro
- ./data/lotus:/var/lib/lotus:ro
- ./data/lotus-miner:/var/lib/lotus-miner:ro
Expand Down