How to use Pactus Shell?
Pactus Shell is a command-line tool designed for interacting with the Pactus blockchain. This tool receives the commands from the terminal and send them to the node using gRPC. The resulting response is then displayed as a structured JSON format.
You can execute pactus-shell
with the -h
flag to display available commands for communicating with your node.
./pactus-shell -h
Example
Suppose you want to get the latest blockchain information.
In that case, you can use the following command in the pactus-shell
:
./pactus-shell blockchain get-blockchain-info
Server address
By default, the exposed port of the Pactus gRPC node is 50051
.
Therefore, when you use pactus-shell
, it automatically attempts to connect to localhost:50051
.
However, you can easily change the default address by using the --server-addr
flag.
For instance, if you want to connect to a remote server, you can execute:
./pactus-shell blockchain get-blockchain-info --server-addr example.com:50051
Security consideration
When connecting to a remote node, it’s important to think about security. You can make the gRPC communication more secure in some ways. For instance, set a password for the gRPC service, or use NGINX to enable TLS/SSL for your node.