Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/danforbes/bchd-grpc-adapter
A Chainlink adapter for the bchd gRPC API
https://github.com/danforbes/bchd-grpc-adapter
Last synced: 25 days ago
JSON representation
A Chainlink adapter for the bchd gRPC API
- Host: GitHub
- URL: https://github.com/danforbes/bchd-grpc-adapter
- Owner: danforbes
- License: mit
- Created: 2019-09-23T16:59:03.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2019-09-23T21:00:24.000Z (over 5 years ago)
- Last Synced: 2024-10-18T08:38:11.589Z (3 months ago)
- Language: Go
- Size: 2.93 KB
- Stars: 1
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Chainlink `bchd` gRPC Adapter
A Chainlink adapter for [the `bchd` gRPC API](https://github.com/gcash/bchd/tree/master/bchrpc).
## Environment Variables
* `BCHD_GRPC_URL` - the URL to the `bchd` gRPC server (default: `bchd.greyh.at:8335`)
* `BCHD_CERT_PATH` - the path to the TLS client certificate for the `bchd` gRPC server (leave blank for servers with CA-signed certificates)
* `BCHD_SERVER_OVERRIDE` - for testing purposes only, can be used to override virtual host name in requests## Usage
The `bchd` gRPC adapter exposes the following capabilities:
### Get Mempool Info
Get info about the mempool.
#### Params
* `proc` - `mempoolInfo`
### Get Mempool
Get info about all of the transactions currently in the memory pool.
#### Params
* `proc` - `mempool`
* `fullTrx` - if provided value converts to `false`, the response will only contain transaction hashes, otherwise, it will contain full transactions### Get Blockchain Info
Get info about the blockchain including most recent block hash and height.
#### Params
* `proc` - `blockchainInfo`
## Errors
This adapter will throw errors in the following scenarios:
* It is not possible to create a TLS certificate using the path provided in the `BCHD_CERT_PATH` environment variable.
* It is not possible to parse the URL provided in the `BCHD_GRPC_URL` environment variable.
* It is not possible to connect to the `bchd` gRPC server.## Test
```
go test
```## Build
```
go build -o cl-bchd-grpc
```## Lambda
Zip the binary
```
zip cl-bchd-grpc.zip cl-bchd-grpc
```Then upload to AWS Lambda and use `cl-bchd-grpc` as the handler.