Skip to content

Commit

Permalink
Merge pull request #43 from jplomas/master
Browse files Browse the repository at this point in the history
Improve CI & API call stability
  • Loading branch information
jplomas authored Dec 6, 2020
2 parents ae8528c + 1a434af commit 55c292e
Show file tree
Hide file tree
Showing 8 changed files with 1,755 additions and 1,366 deletions.
6 changes: 5 additions & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,16 +33,20 @@ jobs:
- run:
name: Upload code coverage to codecov
command: yarn cov
- run:
name: "Update docs"
command: "yarn run prepack"
- run:
name: Build binaries
command: yarn run make-binaries
- run: cd dist && find . -type f -print0 | xargs -0 shasum -a 256 > ../shasum.256.asc && cd .. && cp shasum.256.asc dist/
- run: zip -r qrl-cli-macos.zip dist/macos
- run: zip -r qrl-cli-win.zip dist/win
- run: zip -r qrl-cli-linux.zip dist/linux
- run: yarn run postpack
- run:
name: "Publish Release on GitHub"
command: nvm use v12 && npx semantic-release
command: nvm use v12 && yarn add @semantic-release/git && npx semantic-release

cache:
<<: *test
Expand Down
1 change: 1 addition & 0 deletions .releaserc
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"npmPublish": false
}
],
"@semantic-release/git",
[
"@semantic-release/github",
{
Expand Down
12 changes: 12 additions & 0 deletions .snyk
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Snyk (https://snyk.io) policy file, patches or ignores known vulnerabilities.
version: v1.14.1
# ignores vulnerabilities until expiry date; change duration by modifying expiry date
ignore:
SNYK-JS-AXIOS-1038255:
- '@theqrl/explorer-helpers > axios':
reason: Not used in current code
expires: '2021-01-05T15:09:10.954Z'
- axios:
reason: Not used in current code
expires: '2021-01-05T15:09:10.954Z'
patch: {}
56 changes: 28 additions & 28 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ $ npm install -g @theqrl/cli
$ qrl-cli COMMAND
running command...
$ qrl-cli (-v|--version|version)
@theqrl/cli/1.7.1 darwin-x64 node-v12.3.1
@theqrl/cli/1.7.2 darwin-x64 node-v10.16.3
$ qrl-cli --help [COMMAND]
USAGE
$ qrl-cli COMMAND
Expand Down Expand Up @@ -78,7 +78,7 @@ DESCRIPTION
See the documentation at https://docs.theqrl.org/developers/qrl-cli
```

_See code: [src/commands/balance.js](https://github.com/theqrl/qrl-cli/blob/v1.7.1/src/commands/balance.js)_
_See code: [src/commands/balance.js](https://github.com/theqrl/qrl-cli/blob/v1.7.2/src/commands/balance.js)_

## `qrl-cli create-lattice`

Expand Down Expand Up @@ -107,7 +107,7 @@ DESCRIPTION
Documentation at https://docs.theqrl.org/developers/qrl-cli
```

_See code: [src/commands/create-lattice.js](https://github.com/theqrl/qrl-cli/blob/v1.7.1/src/commands/create-lattice.js)_
_See code: [src/commands/create-lattice.js](https://github.com/theqrl/qrl-cli/blob/v1.7.2/src/commands/create-lattice.js)_

## `qrl-cli create-wallet`

Expand All @@ -132,7 +132,7 @@ DESCRIPTION
Documentation at https://docs.theqrl.org/developers/qrl-cli
```

_See code: [src/commands/create-wallet.js](https://github.com/theqrl/qrl-cli/blob/v1.7.1/src/commands/create-wallet.js)_
_See code: [src/commands/create-wallet.js](https://github.com/theqrl/qrl-cli/blob/v1.7.2/src/commands/create-wallet.js)_

## `qrl-cli decrypt`

Expand All @@ -148,7 +148,7 @@ OPTIONS
-t, --testnet queries testnet for the OTS state
```

_See code: [src/commands/decrypt.js](https://github.com/theqrl/qrl-cli/blob/v1.7.1/src/commands/decrypt.js)_
_See code: [src/commands/decrypt.js](https://github.com/theqrl/qrl-cli/blob/v1.7.2/src/commands/decrypt.js)_

## `qrl-cli encrypt [ADDRESS] [ITEM_PER_PAGE] [PAGE_NUMBER] [MESSAGE]`

Expand All @@ -172,7 +172,7 @@ OPTIONS
-t, --testnet queries testnet for the OTS state
```

_See code: [src/commands/encrypt.js](https://github.com/theqrl/qrl-cli/blob/v1.7.1/src/commands/encrypt.js)_
_See code: [src/commands/encrypt.js](https://github.com/theqrl/qrl-cli/blob/v1.7.2/src/commands/encrypt.js)_

## `qrl-cli get-keys ADDRESS ITEM_PER_PAGE PAGE_NUMBER`

Expand All @@ -194,7 +194,7 @@ OPTIONS
-t, --testnet queries testnet for the OTS state
```

_See code: [src/commands/get-keys.js](https://github.com/theqrl/qrl-cli/blob/v1.7.1/src/commands/get-keys.js)_
_See code: [src/commands/get-keys.js](https://github.com/theqrl/qrl-cli/blob/v1.7.2/src/commands/get-keys.js)_

## `qrl-cli help [COMMAND]`

Expand Down Expand Up @@ -226,19 +226,19 @@ ARGUMENTS
OPTIONS
-d, --devnet queries devnet for the OTS state
-g, --grpc=grpc advanced: grcp endpoint (for devnet/custom QRL network deployments)
-g, --grpc=grpc advanced: grpc endpoint (for devnet/custom QRL network deployments)
-m, --mainnet queries mainnet for the OTS state
-p, --password=password wallet file password
-t, --testnet queries testnet for the OTS state
DESCRIPTION
Reports the next unused availabel OTS key. Pass either an address starting with
Reports the next unused available OTS key. Pass either an address starting with
QQ0004 or a wallet.json file to se the next OTS. You can set the network flag with either (-t) testnet or (-m) mainnet
If the wallet file is encrypted use the -p flag to pass the wallet file encryption password.
```

_See code: [src/commands/ots.js](https://github.com/theqrl/qrl-cli/blob/v1.7.1/src/commands/ots.js)_
_See code: [src/commands/ots.js](https://github.com/theqrl/qrl-cli/blob/v1.7.2/src/commands/ots.js)_

## `qrl-cli receive ADDRESS`

Expand All @@ -259,7 +259,7 @@ DESCRIPTION
If using an encrypted wallet file pass the encryption password with the (-p) flag.
```

_See code: [src/commands/receive.js](https://github.com/theqrl/qrl-cli/blob/v1.7.1/src/commands/receive.js)_
_See code: [src/commands/receive.js](https://github.com/theqrl/qrl-cli/blob/v1.7.2/src/commands/receive.js)_

## `qrl-cli receive-initial-message FILE`

Expand All @@ -281,7 +281,7 @@ OPTIONS
-t, --testnet uses testnet for this function
```

_See code: [src/commands/receive-initial-message.js](https://github.com/theqrl/qrl-cli/blob/v1.7.1/src/commands/receive-initial-message.js)_
_See code: [src/commands/receive-initial-message.js](https://github.com/theqrl/qrl-cli/blob/v1.7.2/src/commands/receive-initial-message.js)_

## `qrl-cli receive-next-message INDEX`

Expand All @@ -300,11 +300,11 @@ OPTIONS
-t, --testnet uses testnet for this function
```

_See code: [src/commands/receive-next-message.js](https://github.com/theqrl/qrl-cli/blob/v1.7.1/src/commands/receive-next-message.js)_
_See code: [src/commands/receive-next-message.js](https://github.com/theqrl/qrl-cli/blob/v1.7.2/src/commands/receive-next-message.js)_

## `qrl-cli search SEARCH`

Gets the network status
Searches for a transaction, block or address

```
USAGE
Expand All @@ -314,18 +314,18 @@ ARGUMENTS
SEARCH a search term: address/txhash/block to query API for
OPTIONS
-d, --devnet queries devnet for the OTS state
-g, --grpc=grpc advanced: grcp endpoint (for devnet/custom QRL network deployments)
-m, --mainnet queries mainnet for the OTS state
-t, --testnet queries testnet for the OTS state
-d, --devnet queries devnet for the address/txhash/block
-g, --grpc=grpc advanced: grpc endpoint (for devnet/custom QRL network deployments)
-m, --mainnet queries mainnet for the address/txhash/block
-t, --testnet queries testnet for the address/txhash/block
DESCRIPTION
Fetches data about queried transaction/block/address. Defaults to mainnet; network selection flags are (-m) mainnet,
(-t) testnet or (-d) devnet.
Advanced: you can use a custom defined node to query for status. Use the (-g) grpc endpoint.
```

_See code: [src/commands/search.js](https://github.com/theqrl/qrl-cli/blob/v1.7.1/src/commands/search.js)_
_See code: [src/commands/search.js](https://github.com/theqrl/qrl-cli/blob/v1.7.2/src/commands/search.js)_

## `qrl-cli send QUANTITY`

Expand All @@ -340,7 +340,7 @@ ARGUMENTS
OPTIONS
-f, --fee=fee Fee for transaction in Shor (defaults to 100 Shor)
-g, --grpc=grpc advanced: grcp endpoint (for devnet/custom QRL network deployments)
-g, --grpc=grpc advanced: grpc endpoint (for devnet/custom QRL network deployments)
-h, --hexseed=hexseed hexseed/mnemonic of wallet from where funds should be sent
-i, --otsindex=otsindex (required) OTS key index
-j, --jsonObject=jsonObject Pass a JSON object of recipients/quantities for multi-output transactions
Expand All @@ -357,7 +357,7 @@ DESCRIPTION
TODO
```

_See code: [src/commands/send.js](https://github.com/theqrl/qrl-cli/blob/v1.7.1/src/commands/send.js)_
_See code: [src/commands/send.js](https://github.com/theqrl/qrl-cli/blob/v1.7.2/src/commands/send.js)_

## `qrl-cli send-initial-message FILE`

Expand All @@ -379,7 +379,7 @@ OPTIONS
-t, --testnet queries testnet for the OTS state
```

_See code: [src/commands/send-initial-message.js](https://github.com/theqrl/qrl-cli/blob/v1.7.1/src/commands/send-initial-message.js)_
_See code: [src/commands/send-initial-message.js](https://github.com/theqrl/qrl-cli/blob/v1.7.2/src/commands/send-initial-message.js)_

## `qrl-cli send-next-message INDEX MESSAGE`

Expand All @@ -399,7 +399,7 @@ OPTIONS
-t, --testnet queries testnet for the OTS state
```

_See code: [src/commands/send-next-message.js](https://github.com/theqrl/qrl-cli/blob/v1.7.1/src/commands/send-next-message.js)_
_See code: [src/commands/send-next-message.js](https://github.com/theqrl/qrl-cli/blob/v1.7.2/src/commands/send-next-message.js)_

## `qrl-cli sign`

Expand All @@ -418,7 +418,7 @@ OPTIONS
-t, --testnet queries testnet for the OTS state
```

_See code: [src/commands/sign.js](https://github.com/theqrl/qrl-cli/blob/v1.7.1/src/commands/sign.js)_
_See code: [src/commands/sign.js](https://github.com/theqrl/qrl-cli/blob/v1.7.2/src/commands/sign.js)_

## `qrl-cli status`

Expand All @@ -430,7 +430,7 @@ USAGE
OPTIONS
-d, --devnet queries devnet for the OTS state
-g, --grpc=grpc advanced: grcp endpoint (for devnet/custom QRL network deployments)
-g, --grpc=grpc advanced: grpc endpoint (for devnet/custom QRL network deployments)
-m, --mainnet queries mainnet for the OTS state
-t, --testnet queries testnet for the OTS state
Expand All @@ -439,7 +439,7 @@ DESCRIPTION
Advanced: you can use a custom defined node to query for status. Use the (-g) grpc endpoint.
```

_See code: [src/commands/status.js](https://github.com/theqrl/qrl-cli/blob/v1.7.1/src/commands/status.js)_
_See code: [src/commands/status.js](https://github.com/theqrl/qrl-cli/blob/v1.7.2/src/commands/status.js)_

## `qrl-cli validate ADDRESS`

Expand All @@ -460,7 +460,7 @@ DESCRIPTION
when passed a QRL address in hexstring (preceded by 'Q'), will return details about the addresses validity.
```

_See code: [src/commands/validate.js](https://github.com/theqrl/qrl-cli/blob/v1.7.1/src/commands/validate.js)_
_See code: [src/commands/validate.js](https://github.com/theqrl/qrl-cli/blob/v1.7.2/src/commands/validate.js)_

## `qrl-cli verify ADDRESS ITEM_PER_PAGE PAGE_NUMBER`

Expand All @@ -481,5 +481,5 @@ OPTIONS
-t, --testnet queries testnet for the OTS state
```

_See code: [src/commands/verify.js](https://github.com/theqrl/qrl-cli/blob/v1.7.1/src/commands/verify.js)_
_See code: [src/commands/verify.js](https://github.com/theqrl/qrl-cli/blob/v1.7.2/src/commands/verify.js)_
<!-- commandsstop -->
16 changes: 10 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
{
"name": "@theqrl/cli",
"description": "QRL CLI functions",
"version": "1.7.1",
"version": "1.7.2",
"author": "JP Lomas <[email protected]>, The QRL Foundation",
"bin": {
"qrl-cli": "./bin/run"
},
"bugs": "https://github.com/theqrl/qrl-cli/issues",
"dependencies": {
"@grpc/grpc-js": "^0.8.1",
"@grpc/grpc-js": "0.8.1",
"@grpc/proto-loader": "^0.5.1",
"@oclif/command": "^1",
"@oclif/config": "^1",
"@oclif/plugin-help": "^2",
"@theqrl/explorer-helpers": "^2.0.0",
"@theqrl/explorer-helpers": "2.0.0",
"@theqrl/qrl-proto-sha256": "^3.3.0",
"@theqrl/qrlbase.proto": "^1.1.0",
"@theqrl/validate-qrl-address": "^1.1.0",
Expand All @@ -25,7 +25,7 @@
"bignumber.js": "^9.0.0",
"cli-ux": "^5.3.1",
"crypto": "^1.0.1",
"crypto-js": "^3.1.9-1",
"crypto-js": "3.1.9-1",
"eccrypto": "^1.1.5",
"google-proto-files": "^2.3.0",
"grpc-js-kit": "^0.1.0",
Expand Down Expand Up @@ -92,7 +92,11 @@
"make-binaries": "pkg . -t node10-macos-x64 -o dist/macos/qrl-cli && pkg . -t node10-win-x64 -o dist/win/qrl-cli && pkg . -t node10-linux-x64 -o dist/linux/qrl-cli && cp ./assets/macos/ecdh.node dist/macos && cp ./assets/linux/ecdh.node dist/linux && cp ./assets/win/ecdh.node dist/win"
},
"pkg": {
"scripts": [ "src/**" ],
"assets": [ "node_modules/@theqrl/qrlbase.proto/**" ]
"scripts": [
"src/**"
],
"assets": [
"node_modules/@theqrl/qrlbase.proto/**"
]
}
}
8 changes: 4 additions & 4 deletions src/commands/search.js
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ class Search extends Command {
}
}

Search.description = `Gets the network status
Search.description = `Searches for a transaction, block or address
Fetches data about queried transaction/block/address. Defaults to mainnet; network selection flags are (-m) mainnet, (-t) testnet or (-d) devnet.
Advanced: you can use a custom defined node to query for status. Use the (-g) grpc endpoint.
Expand All @@ -172,17 +172,17 @@ Search.flags = {
testnet: flags.boolean({
char: 't',
default: false,
description: 'queries testnet for the OTS state',
description: 'queries testnet for the address/txhash/block',
}),
mainnet: flags.boolean({
char: 'm',
default: false,
description: 'queries mainnet for the OTS state',
description: 'queries mainnet for the address/txhash/block',
}),
devnet: flags.boolean({
char: 'd',
default: false,
description: 'queries devnet for the OTS state',
description: 'queries devnet for the address/txhash/block',
}),
grpc: flags.string({
char: 'g',
Expand Down
2 changes: 1 addition & 1 deletion src/functions/grpc.js
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ class QrlNode {
async api(apiCall, request = {}) {
return new Promise((resolve, reject) => {
const { client } = this
client[apiCall](request, async (error, response) => {
client[apiCall](request, (error, response) => {
if (error) {
reject(error)
}
Expand Down
Loading

0 comments on commit 55c292e

Please sign in to comment.