mirror of
https://github.com/cerc-io/watcher-ts
synced 2026-09-08 08:54:05 +00:00
Add a payments plugin to GQL server (#391)
* Add a custom payments plugin in server process * Fix voucher channel read in voucher subscription * Use voucher hash and signature for payment authentication * Use a LRU hash map for storing received vouchers * Avoid hoisting level types to resolve build errors * Upgrade ts-nitro packages * Add payments related logs * Upgrade package versions * Always allow latestBlock query * Upgrade ts-nitro packages
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@cerc-io/cli",
|
||||
"version": "0.2.46",
|
||||
"version": "0.2.47",
|
||||
"main": "dist/index.js",
|
||||
"license": "AGPL-3.0",
|
||||
"scripts": {
|
||||
@@ -11,8 +11,8 @@
|
||||
"chat": "DEBUG='vulcanize:*, laconic:*' node dist/chat.js"
|
||||
},
|
||||
"dependencies": {
|
||||
"@cerc-io/peer": "^0.2.46",
|
||||
"@cerc-io/util": "^0.2.46",
|
||||
"@cerc-io/peer": "^0.2.47",
|
||||
"@cerc-io/util": "^0.2.47",
|
||||
"@ethersproject/providers": "^5.4.4",
|
||||
"@graphql-tools/utils": "^9.1.1",
|
||||
"@ipld/dag-cbor": "^8.0.0",
|
||||
|
||||
@@ -25,7 +25,8 @@ import {
|
||||
EventWatcher,
|
||||
GraphWatcherInterface,
|
||||
Config,
|
||||
P2PConfig
|
||||
P2PConfig,
|
||||
PaymentsManager
|
||||
} from '@cerc-io/util';
|
||||
import { TypeSource } from '@graphql-tools/utils';
|
||||
import {
|
||||
@@ -111,7 +112,8 @@ export class ServerCmd {
|
||||
async exec (
|
||||
createResolvers: (indexer: IndexerInterface, eventWatcher: EventWatcher) => Promise<any>,
|
||||
typeDefs: TypeSource,
|
||||
parseLibp2pMessage?: (peerId: string, data: any) => void
|
||||
parseLibp2pMessage?: (peerId: string, data: any) => void,
|
||||
paymentsManager?: PaymentsManager
|
||||
): Promise<{
|
||||
app: Application,
|
||||
server: ApolloServer
|
||||
@@ -136,7 +138,7 @@ export class ServerCmd {
|
||||
|
||||
// Create an Express app
|
||||
const app: Application = express();
|
||||
const server = await createAndStartServer(app, typeDefs, resolvers, config.server);
|
||||
const server = await createAndStartServer(app, typeDefs, resolvers, config.server, paymentsManager);
|
||||
|
||||
await startGQLMetricsServer(config);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user