forked from hyperledger-cacti/cacti
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(connector-chainlink): add skeleton implementation - oracle streams
WORK IN PROGRESS Fixes hyperledger-cacti#3530 Signed-off-by: Peter Somogyvari <[email protected]>
- Loading branch information
Showing
105 changed files
with
15,968 additions
and
0 deletions.
There are no files selected for viewing
343 changes: 343 additions & 0 deletions
343
packages/cacti-plugin-ledger-connector-chainlink/README.md
Large diffs are not rendered by default.
Oops, something went wrong.
7 changes: 7 additions & 0 deletions
7
packages/cacti-plugin-ledger-connector-chainlink/openapitools.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"$schema": "node_modules/@openapitools/openapi-generator-cli/config.schema.json", | ||
"spaces": 2, | ||
"generator-cli": { | ||
"version": "6.6.0" | ||
} | ||
} |
112 changes: 112 additions & 0 deletions
112
packages/cacti-plugin-ledger-connector-chainlink/package.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,112 @@ | ||
{ | ||
"name": "@hyperledger/cacti-plugin-ledger-connector-chainlink", | ||
"version": "2.0.0-rc.4", | ||
"description": "Allows Cacti users to perform read/write operations on a Chainlink ledger.", | ||
"keywords": [ | ||
"Hyperledger", | ||
"Cacti", | ||
"Integration", | ||
"Blockchain", | ||
"Distributed Ledger Technology" | ||
], | ||
"homepage": "https://github.com/hyperledger/cacti#readme", | ||
"bugs": { | ||
"url": "https://github.com/hyperledger/cacti/issues" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/hyperledger/cacti.git" | ||
}, | ||
"license": "Apache-2.0", | ||
"author": { | ||
"name": "Hyperledger Cactus Contributors", | ||
"email": "[email protected]", | ||
"url": "https://www.hyperledger.org/use/cacti" | ||
}, | ||
"contributors": [ | ||
{ | ||
"name": "Please add yourself to the list of contributors", | ||
"email": "[email protected]", | ||
"url": "https://example.com" | ||
}, | ||
{ | ||
"name": "Peter Somogyvari", | ||
"email": "[email protected]", | ||
"url": "https://accenture.com" | ||
} | ||
], | ||
"main": "dist/lib/main/typescript/index.js", | ||
"module": "dist/lib/main/typescript/index.js", | ||
"browser": "dist/cacti-plugin-ledger-connector-chainlink.web.umd.js", | ||
"types": "dist/lib/main/typescript/index.d.ts", | ||
"files": [ | ||
"dist/*" | ||
], | ||
"scripts": { | ||
"benchmark": "tsx ./src/test/typescript/benchmark/run-plugin-ledger-connector-chainlink-benchmark.ts .tmp/benchmark-results/plugin-ledger-connector-chainlink/run-plugin-ledger-connector-chainlink-benchmark.ts.log", | ||
"codegen": "yarn run --top-level run-s 'codegen:*'", | ||
"codegen:openapi": "npm run generate-sdk", | ||
"codegen:proto": "run-s proto:openapi proto:protoc-gen-ts", | ||
"generate-sdk": "run-s 'generate-sdk:*'", | ||
"generate-sdk:go": "openapi-generator-cli generate -i ./src/main/json/openapi.json -g go -o ./src/main/go/generated/openapi/go-client/ --git-user-id hyperledger --git-repo-id $(echo $npm_package_name | replace @hyperledger/ \"\" -z)/src/main/go/generated/openapi/go-client --package-name $(echo $npm_package_name | replace @hyperledger/ \"\" -z) --reserved-words-mappings protected=protected --ignore-file-override ../../openapi-generator-ignore", | ||
"generate-sdk:typescript-axios": "openapi-generator-cli generate -i ./src/main/json/openapi.json -g typescript-axios -o ./src/main/typescript/generated/openapi/typescript-axios/ --reserved-words-mappings protected=protected --ignore-file-override ../../openapi-generator-ignore", | ||
"proto:openapi": "yarn run --top-level openapi-generator-cli generate -i ./src/main/json/openapi.json -g protobuf-schema --model-name-suffix=PB --language-specific-primitives=google.protobuf.Any --type-mappings=AnyType=google.protobuf.Any --type-mappings=object=google.protobuf.Any --additional-properties=packageName=org.hyperledger.cacti.plugin.ledger.connector.chainlink -o ./src/main/proto/generated/openapi/ -t=./src/main/mustache/openapi-generator/templates/protobuf-schema/ --ignore-file-override ../../openapi-generator-ignore", | ||
"proto:protoc-gen-ts": "yarn run --top-level grpc_tools_node_protoc --plugin=protoc-gen-ts=../../node_modules/.bin/protoc-gen-ts --ts_out=grpc_js:./src/main/typescript/generated/proto/protoc-gen-ts/ --proto_path ./src/main/proto/generated/openapi/ --proto_path ./src/main/proto/generated/openapi/models/ --proto_path ./src/main/proto/ ./src/main/proto/generated/openapi/services/*.proto ./src/main/proto/services/*.proto", | ||
"watch": "npm-watch", | ||
"webpack": "npm-run-all webpack:dev", | ||
"webpack:dev": "npm-run-all webpack:dev:node webpack:dev:web", | ||
"webpack:dev:node": "webpack --env=dev --target=node --config ../../webpack.config.js", | ||
"webpack:dev:web": "webpack --env=dev --target=web --config ../../webpack.config.js" | ||
}, | ||
"dependencies": { | ||
"@grpc/grpc-js": "1.11.1", | ||
"@hyperledger/cactus-common": "2.0.0-rc.4", | ||
"@hyperledger/cactus-core": "2.0.0-rc.4", | ||
"@hyperledger/cactus-core-api": "2.0.0-rc.4", | ||
"axios": "1.7.7", | ||
"express": "4.19.2", | ||
"google-protobuf": "3.21.4", | ||
"http-errors-enhanced-cjs": "2.0.1", | ||
"openapi-types": "12.1.3", | ||
"prom-client": "15.1.3", | ||
"run-time-error-cjs": "1.4.0", | ||
"rxjs": "7.8.1", | ||
"socket.io-client-fixed-types": "4.5.4", | ||
"ts-results": "3.3.0" | ||
}, | ||
"devDependencies": { | ||
"@hyperledger/cactus-plugin-keychain-memory": "2.0.0-rc.4", | ||
"@hyperledger/cactus-test-tooling": "2.0.0-rc.4", | ||
"@openapitools/openapi-generator-cli": "2.7.0", | ||
"@types/benchmark": "2.1.5", | ||
"@types/body-parser": "1.19.4", | ||
"@types/express": "4.17.21", | ||
"@types/fs-extra": "11.0.4", | ||
"@types/google-protobuf": "3.15.5", | ||
"benchmark": "2.1.4", | ||
"body-parser": "1.20.2", | ||
"fs-extra": "11.2.0", | ||
"grpc-tools": "1.12.4", | ||
"grpc_tools_node_protoc_ts": "5.3.3", | ||
"npm-run-all2": "6.1.2", | ||
"protobufjs": "7.4.0", | ||
"socket.io": "4.6.2", | ||
"tsx": "4.16.2" | ||
}, | ||
"engines": { | ||
"node": ">=18", | ||
"npm": ">=8" | ||
}, | ||
"publishConfig": { | ||
"access": "public" | ||
}, | ||
"browserMinified": "dist/cacti-plugin-ledger-connector-chainlink.web.umd.min.js", | ||
"mainMinified": "dist/cacti-plugin-ledger-connector-chainlink.node.umd.min.js", | ||
"watch": { | ||
"codegen:openapi": { | ||
"patterns": [ | ||
"./src/main/json/openapi.json" | ||
] | ||
} | ||
} | ||
} |
17 changes: 17 additions & 0 deletions
17
...dger-connector-chainlink/src/main/go/generated/openapi/go-client/.openapi-generator/FILES
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
.travis.yml | ||
README.md | ||
api/openapi.yaml | ||
api_default.go | ||
client.go | ||
configuration.go | ||
go.mod | ||
go.sum | ||
model_get_subscription_info_v1_request.go | ||
model_get_subscription_info_v1_request_subscription_id.go | ||
model_get_subscription_info_v1_response.go | ||
model_subscription_info.go | ||
model_watch_blocks_v1.go | ||
model_watch_blocks_v1_progress.go | ||
model_watch_blocks_v1_request.go | ||
response.go | ||
utils.go |
1 change: 1 addition & 0 deletions
1
...er-connector-chainlink/src/main/go/generated/openapi/go-client/.openapi-generator/VERSION
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
6.6.0 |
8 changes: 8 additions & 0 deletions
8
...cti-plugin-ledger-connector-chainlink/src/main/go/generated/openapi/go-client/.travis.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
language: go | ||
|
||
install: | ||
- go get -d -v . | ||
|
||
script: | ||
- go build -v ./ | ||
|
119 changes: 119 additions & 0 deletions
119
...in-ledger-connector-chainlink/src/main/go/generated/openapi/go-client/README.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,119 @@ | ||
# Go API client for cacti-plugin-ledger-connector-chainlink | ||
|
||
Can perform basic tasks on a Chainlink ledger | ||
|
||
## Overview | ||
This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [OpenAPI-spec](https://www.openapis.org/) from a remote server, you can easily generate an API client. | ||
|
||
- API version: 2.0.0-rc.4 | ||
- Package version: 1.0.0 | ||
- Build package: org.openapitools.codegen.languages.GoClientCodegen | ||
|
||
## Installation | ||
|
||
Install the following dependencies: | ||
|
||
```shell | ||
go get github.com/stretchr/testify/assert | ||
go get golang.org/x/net/context | ||
``` | ||
|
||
Put the package under your project folder and add the following in import: | ||
|
||
```golang | ||
import cacti-plugin-ledger-connector-chainlink "github.com/hyperledger/cacti-plugin-ledger-connector-chainlink/src/main/go/generated/openapi/go-client" | ||
``` | ||
|
||
To use a proxy, set the environment variable `HTTP_PROXY`: | ||
|
||
```golang | ||
os.Setenv("HTTP_PROXY", "http://proxy_name:proxy_port") | ||
``` | ||
|
||
## Configuration of Server URL | ||
|
||
Default configuration comes with `Servers` field that contains server objects as defined in the OpenAPI specification. | ||
|
||
### Select Server Configuration | ||
|
||
For using other server than the one defined on index 0 set context value `sw.ContextServerIndex` of type `int`. | ||
|
||
```golang | ||
ctx := context.WithValue(context.Background(), cacti-plugin-ledger-connector-chainlink.ContextServerIndex, 1) | ||
``` | ||
|
||
### Templated Server URL | ||
|
||
Templated server URL is formatted using default variables from configuration or from context value `sw.ContextServerVariables` of type `map[string]string`. | ||
|
||
```golang | ||
ctx := context.WithValue(context.Background(), cacti-plugin-ledger-connector-chainlink.ContextServerVariables, map[string]string{ | ||
"basePath": "v2", | ||
}) | ||
``` | ||
|
||
Note, enum values are always validated and all unused variables are silently ignored. | ||
|
||
### URLs Configuration per Operation | ||
|
||
Each operation can use different server URL defined using `OperationServers` map in the `Configuration`. | ||
An operation is uniquely identified by `"{classname}Service.{nickname}"` string. | ||
Similar rules for overriding default operation server index and variables applies by using `sw.ContextOperationServerIndices` and `sw.ContextOperationServerVariables` context maps. | ||
|
||
```golang | ||
ctx := context.WithValue(context.Background(), cacti-plugin-ledger-connector-chainlink.ContextOperationServerIndices, map[string]int{ | ||
"{classname}Service.{nickname}": 2, | ||
}) | ||
ctx = context.WithValue(context.Background(), cacti-plugin-ledger-connector-chainlink.ContextOperationServerVariables, map[string]map[string]string{ | ||
"{classname}Service.{nickname}": { | ||
"port": "8443", | ||
}, | ||
}) | ||
``` | ||
|
||
## Documentation for API Endpoints | ||
|
||
All URIs are relative to *http://127.0.0.1:4000* | ||
|
||
Class | Method | HTTP request | Description | ||
------------ | ------------- | ------------- | ------------- | ||
*DefaultApi* | [**GetOpenApiSpecV1**](docs/DefaultApi.md#getopenapispecv1) | **Get** /api/v1/plugins/@hyperledger/cacti-plugin-ledger-connector-chainlink/get-open-api-spec | Retrieves the .json file that contains the OpenAPI specification for the plugin. | ||
*DefaultApi* | [**GetSubscriptionInfoV1**](docs/DefaultApi.md#getsubscriptioninfov1) | **Post** /api/v1/plugins/@hyperledger/cacti-plugin-ledger-connector-chainlink/get-subscription-info | You can request details for a given subscription (on the network on which it has been created) using this service. This is a read-only interaction with the ledger. | ||
|
||
|
||
## Documentation For Models | ||
|
||
- [GetSubscriptionInfoV1Request](docs/GetSubscriptionInfoV1Request.md) | ||
- [GetSubscriptionInfoV1RequestSubscriptionId](docs/GetSubscriptionInfoV1RequestSubscriptionId.md) | ||
- [GetSubscriptionInfoV1Response](docs/GetSubscriptionInfoV1Response.md) | ||
- [SubscriptionInfo](docs/SubscriptionInfo.md) | ||
- [WatchBlocksV1](docs/WatchBlocksV1.md) | ||
- [WatchBlocksV1Progress](docs/WatchBlocksV1Progress.md) | ||
- [WatchBlocksV1Request](docs/WatchBlocksV1Request.md) | ||
|
||
|
||
## Documentation For Authorization | ||
|
||
Endpoints do not require authorization. | ||
|
||
|
||
## Documentation for Utility Methods | ||
|
||
Due to the fact that model structure members are all pointers, this package contains | ||
a number of utility functions to easily obtain pointers to values of basic types. | ||
Each of these functions takes a value of the given basic type and returns a pointer to it: | ||
|
||
* `PtrBool` | ||
* `PtrInt` | ||
* `PtrInt32` | ||
* `PtrInt64` | ||
* `PtrFloat` | ||
* `PtrFloat32` | ||
* `PtrFloat64` | ||
* `PtrString` | ||
* `PtrTime` | ||
|
||
## Author | ||
|
||
|
||
|
Oops, something went wrong.