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.
Files changed (2) hide show
  1. package/README.md +24 -16
  2. package/package.json +2 -2
package/README.md CHANGED
@@ -1,24 +1,32 @@
1
- [![codecov](https://codecov.io/gh/pactus-project/pactus/branch/main/graph/badge.svg?token=8N6N60D5UI)](https://codecov.io/gh/pactus-project/pactus)
2
- [![Go Report Card](https://goreportcard.com/badge/github.com/pactus-project/pactus)](https://goreportcard.com/report/github.com/pactus-project/pactus)
3
- [![Twitter(X)](https://badgen.net/badge/icon/twitter?icon=twitter&label)](https://x.com/PactusChain)
4
- [![Discord](https://badgen.net/badge/icon/discord?icon=discord&label)](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
- # Pactus Blockchain
5
+ ## Installation
9
6
 
10
- A full-node implementation of the Pactus blockchain in Go.
7
+ ```bash
8
+ npm install pactus-grpc
9
+ ```
11
10
 
12
- ## Install
11
+ ## Usage
13
12
 
14
- Please check the [install](./docs/install.md) document to build and run the Pactus blockchain.
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
- ## Contribution
18
+ const client = new blockchain_grpc_pb.BlockchainClient(
19
+ "127.0.0.1:50051",
20
+ grpc.credentials.createInsecure()
21
+ );
17
22
 
18
- Contributions to the Pactus blockchain are appreciated.
19
- Please read the [CONTRIBUTING](./CONTRIBUTING.md) guidelines before submitting a pull request or opening an issue.
20
-
21
- ## License
22
-
23
- The Pactus blockchain is under MIT [license](./LICENSE).
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": "v1.9.1",
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://github.com/pactus-project/pactus#readme",
7
+ "homepage": "https://pactus.org",
8
8
  "repository": {
9
9
  "type": "git",
10
10
  "url": "git+https://github.com/pactus-project/pactus.git"