Links
Comment on page

CLI

Access to the Bloq CLI is through bcl.
Jump to:
Usage: bcl <COMMAND>
The following commands are available:
Command
Description
client-keys
Manage Bloq client key(s)
client-token
Generate new client token(s)
clusters
Manage Bloq node clusters
conf
Manage configuration
connect
Access Connect services through bcl
events
Get Bloq Events
help
Display help for bcl
login
Login to Bloq account
logout
Clear local user data
nodes
Manage Bloq nodes
profile
Retrieve user profile
signup
Setup a new Bloq account
status
Get Bloq services status
update-password
Update user password
verify
Verify Bloq account and complete signup process

Client Keys

Client Keys are required to access Bloq services and generate Access and Refresh tokens.
The following operations are supported within bcl client-keys <OPERATION>
Operation
Description
create
Create a new client-key
list (default)
Get list of client-keys
remove
Remove a client-key

Create Client Keys

The bcl client-keys create operation enables users to create a Client Key ID and Client Key Secret pair.
A user must create a client-key in order to use Bloq services.
WARNING
Make sure to save your Client Key Secret in a secure location. Secrets are not viewable in the future. Upon Client Key Secret generation, the secret is automatically copied to the clipboard for easy storage.

List Client Keys

The bcl client-keys list operation enables users to list existing keys by Client Key ID. Client Key Secret are not viewable.

Remove Client Keys

The bcl client-keys remove operation enables users to remove a Client Key ID and Client Key Secret pair.

Client Token

The bcl client-token command creates a clientAccessToken and refreshToken for use with Bloq services.
TIP
A client-key pair must be created prior to creating a clientAccessToken or refreshToken. Use the bcl client-keys command if client-keys do not currently exist.
A clientAccessToken is a short-lived (1 hr) token that is required by applications to access Bloq services (Connect, Nodes, etc).
A refreshToken is a longer term (1 year) token that enables your application to request a new clientAccessToken to the authentication server. When the clientAccessToken expires, the refreshToken will let you obtain a new clientAccessToken. The refreshToken is renewed every time a new clientAccessToken is requested.
WARNING
Make sure to save your clientAccessToken and refreshToken in a secure location. Upon token generation, the they will no longer be possible to access again.

Clusters

The bcl clusters <METHOD> <OPTIONAL FLAGS> command enables the user to interact with and manage their registered Bloq clusters. The <METHOD> is the clusters method that can be invoked.
Valid <METHOD> options are:
  • chains
  • info
  • list
  • remove
  • services

Optional Flags

The following are the list of optional flags for the bcl clusters command:
Optional Flag
Description
-a, --all
List all clusters
-c, --capacity
Specify the node capacity for the cluster (default: 2)
-i, --clusterId
Specify the cluster to interact with
-s, --serviceId
Specify a specific clusters service
-t, --authType
Speciy the authentication type for clusters (default: basic) Options include basic, jwt
TIP
bcl clusters methods do not require any additional flags. If more input is required, the client will prompt you for that information upon command execution.

Conf

Set Client Keys

In order to reload your previous Client Keys to the CLI, use the following commands:
bcl conf --key clientId --value <Previous_clientId>
bcl conf --key clientSecret --value <Previous_clientSecret>

Retrieve Account Access Token

To retrieve the Account Access Token that is generated upon bcl login, use the following command:
bcl conf accessToken

Connect

The bcl connect <METHOD> <OPTIONAL FLAGS> command provides a subset of the full Connect service functionality through the bcl interface. The <METHOD> is the Connect service method that can be invoked.
Valid <METHOD> options are:
  • block
  • blocks
  • block-hash
  • raw-block
  • transaction
  • tx
  • raw-tx
Most of these methods require an additional input value to be specified as part of the -a flag:
The block and raw-block methods require a block hash:
bcl connect block -a 000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f
The transaction, tx, and raw-tx methods require a transaction id:
bcl connect transaction -a 4a5e1e4baab89f3a32518a88c31bc87f618f76673e2cc77ab2127b7afdeda33b
The block-hash method requires a block height:
bcl connect block-hash -a 0
The blocks method accepts no additional arguments.

Optional Flags

The following are the list of optional flags for the bcl connect command:
Optional Flag
Description
-a, --argument
Specify the argument for the method
-c, --chain
Specify the chain for the method (default: btc) Options include btc, bch

Events

The bcl events command provides a history of the most recent events.
Use the -s=<service> flag to filter events by services.
Valid options for <service> are:
  • accounts
  • connect
  • nodes

Help

The bcl help command provides the help screen.

Login

The bcl login -u <Account ID> command authenticates and logs the user into the CLI.
The Account ID is contained within the user signup confirmation email.

Logout

The bcl logout command logs the user out of the CLI and removes any local user data from the CLI.

Nodes

The bcl nodes <METHOD> <OPTIONAL FLAGS> command enables the user to access Bloq Nodes services and manage their registered Bloq Nodes. The <METHOD> is the Nodes service method that can be invoked.
Valid <METHOD> options are:
  • chains
  • info
  • list
  • remove
  • services

Optional Flags

The following are the list of optional flags for the bcl nodes command:
Optional Flag
Description
-a, --all
List all nodes
-i, --nodeId
Specify the node to interact with
-s, --serviceId
Specify an exact service encompassed by Bloq Nodes
-t, --authType
Speciy the authentication type for a node (default: basic) Options include basic, jwt
TIP
bcl nodes methods do not require any additional flags. If more input is required, the client will prompt you for that information upon command execution.

Profile

The bcl profile command provides information about the user including:
  • Account ID
  • Display Name
  • Email Address
  • Verification Status

Status

The bcl status command provides the online status of Bloq services.

Update-Password

The bcl update-password command provides the ability for the user to change their existing password associated with their Bloq account.