Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fumarole TypeScript SDK #499

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 54 additions & 3 deletions examples/typescript/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ This is a sample client for Solana geyser gRPC written in TypeScript.
This can be used in the following way:

```shell
npm start -- --endpoint https://api.rpcpool.com \
--x-token <token> \
npm start -- --endpoint https://url \
--x-token token \
subscribe \
--accounts --accounts-account SysvarC1ock11111111111111111111111111111111
```
Expand Down Expand Up @@ -72,7 +72,7 @@ response: 1
### unary GetLatestBlockhash

```shell
npm start -- -e="https://api.rpcpool.com" \
npm start -- -e="http://fumarole-fumarole-server.service.consul:26847" \
--x-token "<token>" \
get-latest-blockhash
```
Expand Down Expand Up @@ -132,3 +132,54 @@ npm start -- -e="https://api.rpcpool.com" \
```text
response: { version: "{\"version\":\"0.7.0+solana.1.15.2\",\"proto\":\"1.2.0+solana.1.15.2\",\"solana\":\"1.15.2\",\"git\":\"e03a47c-modified\",\"rustc\":\"1.68.0-nightly\",\"buildts\":\"2023-05-27T08:20:15.440278Z\"}" }
```

## Fumarole

### Create Subscription Id
```shell
npm start -- -e="https://api.rpcpool.com" \
fumarole-create-subscription-id
```

### Get Slot Lag Info
```shell
npm start -- -e="https://api.rpcpool.com" \
fumarole-get-slot-lag-info --subscription-id someId --consumer-group-label abcd
```

### Create Consumer Group
```shell
npm start -- -e="https://api.rpcpool.com" \
create-consumer-group
```

### Create Consumer Group
```shell
npm start -- -e="https://api.rpcpool.com" \
fumarole-create-consumer-group --subscription-id someId --consumer-group-label helloo
```

### Subscribe
```shell
npm start -- -e="https://api.rpcpool.com" \
fumarole-subscribe \
--accounts --accounts-account SysvarC1ock11111111111111111111111111111111
```

### List Consumer Groups
```shell
npm start -- -e="https://api.rpcpool.com" \
fumarole-list-consumer-groups --subscription-id someId
```

### Get Consumer Group Info
```shell
npm start -- -e="https://api.rpcpool.com" \
fumarole-get-consumer-group-info --subscription-id someId --consumer-group-label abcd
```

### Delete Consumer Group
```shell
npm start -- -e="https://api.rpcpool.com" \
fumarole-delete-consumer-group --subscription-id someId --consumer-group-label abcd
```
7 changes: 4 additions & 3 deletions examples/typescript/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,14 @@
"description": "Yellowstone gRPC Geyser TypeScript example",
"homepage": "https://triton.one",
"dependencies": {
"yargs": "^17.6.2",
"@triton-one/yellowstone-grpc": "file:../../yellowstone-grpc-client-nodejs"
"@grpc/grpc-js": "^1.12.4",
"@triton-one/yellowstone-grpc": "file:../../yellowstone-grpc-client-nodejs",
"yargs": "^17.6.2"
},
"scripts": {
"build": "tsc -p .",
"fmt": "prettier -w .",
"start": "npm run build && node dist/client.js"
"start": "pnpm run build && node dist/client.js"
},
"devDependencies": {
"prettier": "^2.8.3",
Expand Down
291 changes: 291 additions & 0 deletions examples/typescript/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading