Command-line wallet
The command-line wallet that connects to the hybrixd platform environment can be run on your own personal computer or server by downloading the command-line application. This makes it possible to control and use a wallet from the command line. It also makes it easy to use and integrate blockchain into your own shell scripts.
Quick start
The command-line wallet can be run on the following operating systems:
- GNU/Linux
- MacOS (Darwin)
- Windows Subsystem for Linux (link)
The command-line wallet requires NodeJS. We recommend using NodeJS version 12.
To install the hybrix command-line wallet, download the release above, and extract the zip file to your system.
You can now start the command-line wallet as seen in examples below. Note that you should pass options to let the command-line wallet know what to do for you. Below we also mention the quiet output option to make it easy to put the command-line wallet in your own scripts.
To look at all the possible command line arguments, simply add --help.
./cli-wallet --help
Short | Command | Description |
---|---|---|
-h | --help | Display help |
-a | --address | Get address of account [argument: symbol] |
-R | --api | Perform an API routing call [argument: API_path] |
-b | --balance | Get the balance of an address [argument: symbol]] |
-c | --create | Generate new deterministic account |
-D | --debug | Run in debug mode |
-d | --description | |
-h | --hostname | The hostname to use (for local specify: 'http://127.0.0.1:1111/', default is: 'https://api.hybrix.io/') |
-i | --importKey | Import private key [argument: privateKey] |
-K | --keysobject | Get internal keys object from account [argument: symbol] |
-l | --local | Use local host |
-M | --module | |
-n | --noroot | Use local host with non root port |
-o | --offset | Specify the account offset to use [argument: offset] |
-p | --password | Set password [argument: password] |
-P | --publickey | Get public key from account [argument: symbol] |
-q | --quiet | No extra output other than raw data |
-r | --rawtransaction | Create a raw transaction [argument: symbol] [argument: amount] [argument: target_address] |
-S | --secretkey | Get private key from account [argument: symbol] |
-s | --sendtransaction | Send transaction [argument: symbol] [argument: amount] [argument: target_address] |
-T | --test | Use test credentials |
-u | --username | Set username [argument: username] |
-V | --verbose | Display verbose output |
-v | --version | Retrieve the version |
-y | --yes | Consent to all requests (please know what you're doing) |
TODO.banking module | ||
allocation module | ||
-M allocation contactGet | Get contact target for receiving notifications | |
-M allocation create | Create new allocation account, returning the ID. [optional argument: initial deposit amount] | |
-M allocation details | Get the details of the account | |
-M allocation pairStats | Show pair stats (sorted by volume in HY) | |
-M allocation pairs | Show an overview of allocated pairs | |
-M allocation securityDetails | Get the details of the security reserve | |
deal module | ||
-M deal pairs | Show pairs available for swapping |
Examples
Creating a new wallet is also very easy:
./cli-wallet --create
To get the Bitcoin balance of your wallet type:
./cli-wallet --balance btc --userid USERNAME --passwd PASSWORD
You can also get the address belonging to Ethereum in your wallet:
./cli-wallet --address eth --userid USERNAME --passwd PASSWORD
To send a Dogecoin transaction, you can do the following:
./cli-wallet --sendtransaction doge 1 DAJXE83WEsiyMYiG2CVmp3kZ9MafrmkH5c --userid USERNAME --passwd PASSWORD
It is also possible to create the transaction without sending it:
./cli-wallet --rawtransaction doge 1 DAJXE83WEsiyMYiG2CVmp3kZ9MafrmkH5c --userid USERNAME --passwd PASSWORD
To export your public key you can do this:
./cli-wallet --publickey nxt --userid USERNAME --passwd PASSWORD
Exporting your private key can also be done:
./cli-wallet --secretkey trx --userid USERNAME --passwd PASSWORD
Direct API calls can be done in a session like this:
./cli-wallet --userid USERNAME --passwd PASSWORD -A /engine/storage/load/someKey
If you want to include cli-wallet in a shell script, you may want to use the -q (quiet) option to make it easier to use the output of the command.
./cli-wallet --userid USERNAME --passwd PASSWORD -q -b ltc