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

Fix/batch cash bc cmd #162

Merged
merged 3 commits into from
Apr 13, 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
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