Skip to content

Commit

Permalink
Fix/batch cash bc cmd (#162)
Browse files Browse the repository at this point in the history
* fix: add check for batch_cash script

* fix: add comment

* fix: complete documentation
  • Loading branch information
imstevez authored and daniel-tron committed May 9, 2022
1 parent e43dc3d commit 30831f5
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
22 changes: 22 additions & 0 deletions docs/tutorial-upgrade-to-v2.1.2.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ We provide a bash script to facilitate these burdensome operations, and you can

Note that the script will skip cashing cheques whose cashable amount is less than estimated gas fee.



```shell
# When API endpoint is 127.0.0.1:5001, which is the default one
$ curl -s https://raw.githubusercontent.com/bittorrent/go-btfs/master/scripts/batch_cash.sh | bash -s 127.0.0.1:5001
Expand All @@ -20,6 +22,26 @@ $ curl -s https://raw.githubusercontent.com/bittorrent/go-btfs/master/scripts/ba
$ curl -s https://raw.githubusercontent.com/bittorrent/go-btfs/master/scripts/batch_cash.sh | bash -s <your-api-host>
```

Before running this script, please confirm that 'curl' and 'bc' tools are installed on your system.
If not, you can install them through the system's corresponding package management tools, for example:

```shell
# on centos
$ sudo yum install -y curl
$ sudo yum install -y bc

# on ubuntu
$ sudo apt install curl
$ sudo apt install bc

# on macos
$ brew install curl
$ brew install bc
```

If your system is windows, you may need to install 'git-bash' and the corresponding 'bc' tool to run this script.
If you have difficulty installing these tools, you can cash cheques and withdraw balance manually via commands or dashboard, just a little more tedious.

The scripts will prompts "Success, all tasks completed!" if everything gose well.
You can run the script again if it failed due to occasional reasons, weak network for example.

Expand Down
8 changes: 8 additions & 0 deletions scripts/batch_cash.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,14 @@ wait_seconds=15
# check curl
if ! [ -x "$(command -v curl)" ]; then
echo "curl is not found"
echo "for details, please refer to this document: https://github.com/bittorrent/go-btfs/blob/master/docs/tutorial-upgrade-to-v2.1.2.md"
exit 1
fi

# check bc
if ! [ -x "$(command -v bc)" ]; then
echo "bc is not found"
echo "for details, please refer to this document: https://github.com/bittorrent/go-btfs/blob/master/docs/tutorial-upgrade-to-v2.1.2.md"
exit 1
fi

Expand Down

0 comments on commit 30831f5

Please sign in to comment.