Skip to content

Commit

Permalink
[release] @subql/[email protected], @subql/[email protected], @subq…
Browse files Browse the repository at this point in the history
  • Loading branch information
HuberTRoy authored Nov 27, 2023
1 parent 27f0b48 commit 7e1ddb7
Show file tree
Hide file tree
Showing 9 changed files with 41 additions and 20 deletions.
29 changes: 16 additions & 13 deletions packages/apollo-links/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@ npm install @subql/apollo-links @apollo/client graphql
- **Caching**: Integrated caching ensures data is fetched efficiently with reduced costs.

## Usage - external authorization mode

### What scenario work best with external authorization mode

This is the recommended way to use `@subql/apollo-links`. With an auth-server to handle cryptography stuff that consumer needed to interact with indexer.
Client side doesn't need to expose anything to reveal the identity of consumer.
Auth-server will also provide some extra benefits like indexer progress monitoring and filtering.
Expand All @@ -47,7 +49,6 @@ import gql from 'graphql-tag';
const options = {
authUrl: 'https://kepler-auth.subquery.network',
deploymentId: 'your_deployment_id_here',
httpOptions: { fetchOptions: { timeout: 5000 } },
// ... other optional configurations
// fallbackUrl:
};
Expand Down Expand Up @@ -92,42 +93,44 @@ const { link, cleanup } = dictHttpLink(options);
```

## Usage - local authorization mode

Need to put consumer controller's private key with client so it can sign and authorise every requests sent to indexer.

```ts
const options = {
sk: '<private key>',
// don't put authUrl
}
sk: '<private key>',
// don't put authUrl
};
```

## Score Store

We have an internal store for indexer scores so bad performed, bad progressed or unreachable indexers will be punished and not getting new requests.

For browser side usage, after page refresh, the score will lose though. To solve that, you can instantiate a LocalStorageStore and pass in when constructing the link object.

```ts
const store = createLocalStorageStore({ttl: 86_400_000});
const store = createLocalStorageStore({ ttl: 86_400_000 });

const { link, cleanup } = deploymentHttpLink({
authUrl: 'https://kepler-auth.subquery.network',
deploymentId: 'your_deployment_id_here',
httpOptions: { fetchOptions: { timeout: 5000 } },
scoreStore: store,
authUrl: 'https://kepler-auth.subquery.network',
deploymentId: 'your_deployment_id_here',
httpOptions: { fetchOptions: { timeout: 5000 } },
scoreStore: store,
});

```

## Other options

| params | usage |
|--------|------------------------------------------------------------------|
| ------ | ---------------------------------------------------------------- |
| logger | apollo link will write logs to it, by default no logs will print |
| | |


## Cleanup

Because of the extra state management logic in it, call `cleanup()` to completely destroy the link and release resources.

```TS
cleanup();
```
```
9 changes: 9 additions & 0 deletions packages/eth-provider/README.md
Original file line number Diff line number Diff line change
@@ -1 +1,10 @@
# eth-provider

```
import { SubqueryAuthedRpcProvider } from '@subql/eth-provider'
const provider = new SubqueryAuthedRpcProvider({
deploymentId: "RPC deployment id"
authUrl: "auth service url"
})
```
5 changes: 4 additions & 1 deletion packages/network-clients/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [0.3.20] - 2023-11-27

## [0.3.18] - 2023-09-28

Upgrade @subql/contracts
Expand Down Expand Up @@ -45,7 +47,8 @@ Upgrade @subql/contracts

- Release first version

[unreleased]: https://github.com/subquery/network-clients/compare/v0.3.18...HEAD
[unreleased]: https://github.com/subquery/network-clients/compare/v0.3.20...HEAD
[0.3.20]: https://github.com/subquery/network-clients/compare/v0.3.18...v0.3.20
[0.3.18]: https://github.com/subquery/network-clients/compare/v0.3.17...v0.3.18
[0.3.17]: https://github.com/subquery/network-clients/compare/v0.3.15...v0.3.17
[0.3.15]: https://github.com/subquery/network-clients/compare/v0.3.13...v0.3.15
Expand Down
2 changes: 1 addition & 1 deletion packages/network-clients/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@subql/network-clients",
"version": "0.3.19-0",
"version": "0.3.20",
"description": "SubQuery client sdk for network",
"main": "dist/index.js",
"author": "SubQuery Pte Limited",
Expand Down
5 changes: 4 additions & 1 deletion packages/network-config/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [0.3.18] - 2023-11-27

## [0.3.16] - 2023-09-28

Upgrade @subql/contracts
Expand Down Expand Up @@ -37,7 +39,8 @@ Add `LEADERBOARD_SUBQL_ENDPOINTS`

- Release first version

[unreleased]: https://github.com/subquery/network-clients/compare/v0.3.16...HEAD
[unreleased]: https://github.com/subquery/network-clients/compare/v0.3.18...HEAD
[0.3.18]: https://github.com/subquery/network-clients/compare/v0.3.16...v0.3.18
[0.3.16]: https://github.com/subquery/network-clients/compare/v0.3.14...v0.3.16
[0.3.14]: https://github.com/subquery/network-clients/compare/v0.3.13...v0.3.14
[0.3.13]: https://github.com/subquery/network-clients/compare/v0.3.11...v0.3.13
Expand Down
2 changes: 1 addition & 1 deletion packages/network-config/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@subql/network-config",
"version": "0.3.17-4",
"version": "0.3.18",
"main": "dist/index.js",
"description": "SubQuery package containing network configuration",
"author": "SubQuery Pte Limited",
Expand Down
2 changes: 1 addition & 1 deletion packages/network-support/README.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
# eth-provider
# network-support
5 changes: 4 additions & 1 deletion packages/react-hooks/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [0.3.17] - 2023-11-27

## [0.3.15] - 2023-07-21

## [0.3.11] - 2023-07-04
Expand All @@ -31,7 +33,8 @@ Add `leaderboard`.

- Release first version

[unreleased]: https://github.com/subquery/network-clients/compare/v0.3.15...HEAD
[unreleased]: https://github.com/subquery/network-clients/compare/v0.3.17...HEAD
[0.3.17]: https://github.com/subquery/network-clients/compare/v0.3.15...v0.3.17
[0.3.15]: https://github.com/subquery/network-clients/compare/v0.3.13...v0.3.15
[0.3.13]: https://github.com/subquery/network-clients/compare/v0.3.11...v0.3.13
[0.3.11]: https://github.com/subquery/network-clients/compare/v0.3.9...v0.3.11
Expand Down
2 changes: 1 addition & 1 deletion packages/react-hooks/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@subql/react-hooks",
"version": "0.3.16-26",
"version": "0.3.17",
"description": "SubQuery client sdk for react hooks",
"main": "dist/index.js",
"author": "SubQuery Pte Limited",
Expand Down

0 comments on commit 7e1ddb7

Please sign in to comment.