pactus-grpc 1.9.1 → 1.9.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +24 -16
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1,24 +1,32 @@
|
|
|
1
|
-
|
|
2
|
-
[](https://goreportcard.com/report/github.com/pactus-project/pactus)
|
|
3
|
-
[](https://x.com/PactusChain)
|
|
4
|
-
[](https://discord.gg/H5vZkNnXCu)
|
|
1
|
+
# pactus-grpc
|
|
5
2
|
|
|
6
|
-
|
|
3
|
+
JavaScript client for interacting with the [Pactus](https://pactus.org) blockchain via gRPC.
|
|
7
4
|
|
|
8
|
-
|
|
5
|
+
## Installation
|
|
9
6
|
|
|
10
|
-
|
|
7
|
+
```bash
|
|
8
|
+
npm install pactus-grpc
|
|
9
|
+
```
|
|
11
10
|
|
|
12
|
-
##
|
|
11
|
+
## Usage
|
|
13
12
|
|
|
14
|
-
|
|
13
|
+
```javascript
|
|
14
|
+
import grpc from '@grpc/grpc-js';
|
|
15
|
+
import blockchain_pb from "pactus-grpc/blockchain_pb.js";
|
|
16
|
+
import blockchain_grpc_pb from "pactus-grpc/blockchain_grpc_pb.js";
|
|
15
17
|
|
|
16
|
-
|
|
18
|
+
const client = new blockchain_grpc_pb.BlockchainClient(
|
|
19
|
+
"127.0.0.1:50051",
|
|
20
|
+
grpc.credentials.createInsecure()
|
|
21
|
+
);
|
|
17
22
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
23
|
+
const request = new blockchain_pb.GetBlockchainInfoRequest();
|
|
24
|
+
client.getBlockchainInfo(request, (err, response) => {
|
|
25
|
+
if (err) {
|
|
26
|
+
console.log(err);
|
|
27
|
+
} else {
|
|
28
|
+
console.log(response.toObject());
|
|
29
|
+
}
|
|
30
|
+
});
|
|
24
31
|
|
|
32
|
+
```
|
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pactus-grpc",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "1.9.3",
|
|
4
4
|
"description": "JavaScript client for interacting with the Pactus blockchain via gRPC",
|
|
5
5
|
"author": "Pactus Development Team",
|
|
6
6
|
"license": "MIT",
|
|
7
|
-
"homepage": "https://
|
|
7
|
+
"homepage": "https://pactus.org",
|
|
8
8
|
"repository": {
|
|
9
9
|
"type": "git",
|
|
10
10
|
"url": "git+https://github.com/pactus-project/pactus.git"
|