1.0.2 • Published 3 years ago

signum-commit-my-balance v1.0.2

Weekly downloads
-
License
ISC
Repository
github
Last release
3 years ago

Security Rating Vulnerabilities Maintainability Rating npm npm

signum-commit-my-balance

Commits part or entire balance for mining in Signum

To boost your mining capacity you need to add so called `commitment' to your mining account. Think of it as kind of stake, signalizing that you not only leech the chain, but also are committed to Signum.

Read also: Optimizing Mining Income on Signum

This small tool makes adding commitment easy. Together with scheduled jobs of your OS you can automate the process.

DISCLAIMER: This software comes without any warranty. Keep in mind that you need to use your very secret passphrase to sign the transactions. Although, this software never ever stores or sends the secret to any server, you have to be conscious that you use this tool on your very own risk. The author assumes no responsibility for the use of this program.

Install

Prerequisites: Need NodeJS 14+ installed

To install just type: npm i signum-commit-my-balance -g

The tool will be installed as command line tool signumcmb

Usage

signumcmb --help to show the help options.

Usage: signumcmb [options]

Options:
  -V, --version              output the version number
  -s, --secret <yoursecret>  Your Signum accounts passphrase
  -a, --amount <amount>      Commit only amount, can be absolute in Signa, or percentage of balance, i.e. 50% (default: "100%")
  -n, --node <url>           Signum Node Host. Default: selects best node of reliable node list (default: "")
  -x, --exec                 Executes the command. If not set, the commitment will be only simulated (default: false)
  -f --fee <type>            Sets fee type by category (choices: "minimum", "cheap", "standard", "priority", default: "standard")
  -os, --onsuccess <script>  Executes a script on successful execution
  -oe, --onerror <script>    Executes a script on failed execution
  -h, --help                 display help for command

Examples

Running a test run

The following script runs a test (no commit at all) on committing all balance

$ signumcmb -s "<your very secret passphrase>"

Output: 

Selected Peer: https://brazil.signum.network
Address: S-K37B-9V85-FB95-793HN - (id: 6502115112683865257)
Available Balance: Ꞩ 1465170.08802094
Locked Balance: Ꞩ 41005
Current Commitment: Ꞩ 1005
Total Balance: Ꞩ 1506175.08802094
Fee: Ꞩ 0.0147
New Commitment: Ꞩ 1466175.07332094
Available Balance After Commitment: Ꞩ 0
🧪 Test Run: Commitment not applied (Run with -x to apply)
✅ Yay, all fine!

Running a balance commitment for real (Using -x)

The following script actually commits 50% of the accounts available balance as commitment

$ signumcmb -s "<your very secret passphrase>" -x -a "50%"

Output:

Selected Peer: https://brazil.signum.network
Address: S-K37B-9V85-FB95-793HN - (id: 6502115112683865257)
Available Balance: Ꞩ 1465170.08802094
Locked Balance: Ꞩ 41005
Current Commitment: Ꞩ 1005
Total Balance: Ꞩ 1506175.08802094
Fee: Ꞩ 0.0147
New Commitment: Ꞩ 733590.03666047
Available Balance After Commitment: Ꞩ 732585.03666047
Committing...
✅ Successfully committed
✅ Yay, all fine!

Adding additional run scripts (in case of success or failure)

signumcmb supports exit points for success or failures. This way you can add further processing, like sending emails, or other notifications (telegram, discord etc) in case of success or failure

Use the -os or --onsuccess option for successful commitments Use the -oe or --onerror option for failures

$ signumcmb -s "<your very secret passphrase>" -a "50%" -os ./onsuccess.sh -oe ./onerror.sh 

Script examples

./onerror.sh

#!/bin/bash
ERR="$1"
echo "Failed: ${ERR}"

./onsuccess.sh

#!/bin/bash
ACCOUNT="$1"
COMMITTED="$2"
echo "Committed ${COMMITTED} for ${ACCOUNT}"