|
1 |
| -# DPXCLI |
| 1 | +# 💎 DPXCLI |
2 | 2 | command line utility for interacting with DPX API
|
3 | 3 |
|
4 |
| -## Example commands |
| 4 | +## ✨ Examples |
5 | 5 |
|
6 |
| -## Install |
| 6 | +### Help |
| 7 | +Description: shows the help menu |
| 8 | +Usage: `dpxcli help` |
| 9 | +```text |
| 10 | +$ dpxcli help |
| 11 | +``` |
7 | 12 |
|
8 |
| -## Prerequisites |
| 13 | +### Balance |
| 14 | +Description: retrieves the balance of the wallet |
| 15 | +Usage: `dpxcli balance -w|--wallet <wallet>` |
| 16 | +```text |
| 17 | +$ dpxcli balance --wallet ADDRESS |
| 18 | +``` |
9 | 19 |
|
10 |
| -## DPX API Documentation |
| 20 | +### Transfer |
| 21 | +Description: transfers specified amount of DPX from departure wallet to destination wallet |
| 22 | +Usage: `dpxcli transfer -a|--amount <amount> -w|--wallet <wallet> -s|--secret <secret> -d|--destination <destination>` |
| 23 | +```text |
| 24 | +$ dpxcli transfer --amount 10.5 --wallet ADDRESS --secret SECRET --destination ADDRESS |
| 25 | +``` |
11 | 26 |
|
12 |
| -## Contribution |
| 27 | +### Transactions |
| 28 | +Description: retrieves transactions in descending order from specified offset (default is 0) |
| 29 | +Usage: `dpxcli transactions (-o|--offset <offset>)? (-w|--wallet <departure>)? (-d|--destination <destination>)?` |
| 30 | +```text |
| 31 | +$ dpxcli transactions // show latest 256 transactions |
| 32 | +$ dpxcli transactions --offset 128 // show from offset 128 |
| 33 | +$ dpxcli transactions --wallet ADDRESS // filter transactions that are from this departure |
| 34 | +$ dpxcli transactions --destination ADDRESS // filter transactions that are to this destination |
| 35 | +$ dpxcli transactions -o 64 -w DEPARTURE -d DESTINATION // filter transactions that are from DEPARTURE to DESTINATION and show from offset 64 |
| 36 | +``` |
13 | 37 |
|
14 |
| -## License |
| 38 | +### Transaction |
| 39 | +Description: retrieves information of the given transaction id |
| 40 | +Usage: `dpxcli transaction -i|--id <transactionId>` |
| 41 | +```text |
| 42 | +$ dpxcli transaction --id TRXID |
| 43 | +``` |
| 44 | + |
| 45 | +### Revoke |
| 46 | +Description: revokes the secret of the wallet and returns the new secret |
| 47 | +Usage: `dpxcli revoke -w|--wallet <wallet> -s|--secret <secret>` |
| 48 | +```text |
| 49 | +$ dpxcli revoke --wallet ADDRESS --secret SECRET |
| 50 | +``` |
| 51 | + |
| 52 | +### Verify |
| 53 | +Description: verifies a wallet credentials |
| 54 | +Usage: `dpxcli verify -w|--wallet <wallet> -s|--secret <secret>` |
| 55 | +```text |
| 56 | +$ dpxcli verify --wallet ADDRESS --secret SECRET |
| 57 | +``` |
| 58 | + |
| 59 | +## ⌛️ Install |
| 60 | + |
| 61 | +### Linux |
| 62 | +It's quite easy to compile the C soruce with GCC: |
| 63 | +```text |
| 64 | +gcc dpxcli.c -lcurl -ljson-c -o dpxcli |
| 65 | +``` |
| 66 | +or even to make it easier, there is an script for compilation and installation: |
| 67 | +```text |
| 68 | +sudo ./install-linux.sh |
| 69 | +``` |
| 70 | + |
| 71 | +### Windows |
| 72 | +No instructions yet, though you are more than welcome to use Cygwin and compile with `-lcurl` and `-ljson-c` and help us complete the documentation. |
| 73 | + |
| 74 | +## ⚙️ Prerequisites |
| 75 | +Development library files of libcurl (e.g. `libcurl4-openssl-dev` or `libcurl4-gnutls-dev`) are needed for `curl/curl.h`, also the json-c library (e.g. `libjson-c-dev`) is needed for `json-c/json.h`, and that's all. |
| 76 | + |
| 77 | +## ⚡ DPX API Documentation |
| 78 | +Soon |
| 79 | + |
| 80 | +## ✅ TODO |
| 81 | +- [ ] Commentify the code for better readability |
| 82 | +- [ ] Create a MakeFile for build systems |
| 83 | +- [ ] Github actions build & test pipeline |
| 84 | + |
| 85 | +## 🖊️ Contribution |
| 86 | +Your contribution to dpxcli development is very welcome! |
| 87 | + |
| 88 | +You may contribute in the following ways: |
| 89 | + |
| 90 | +- Report issues and feedback |
| 91 | +- Submit fixes, features via Pull Request |
| 92 | +- Write/polish documentation |
| 93 | + |
| 94 | +## 📃 License |
| 95 | +GNU Affero General Public License v3.0 see https://www.gnu.org/licenses/agpl-3.0.en.html |
0 commit comments