mirror of
https://github.com/cerc-io/watcher-ts
synced 2024-11-19 12:26:19 +00:00
Add support for gossipsub (#410)
* Replace floodsub with gossipsub * Add a pubsub flag to support both floodsub and gossipsub * Fix deps * Handle empty string values * Upgrade @cerc-io/libp2p dependency * Upgrade package versions
This commit is contained in:
parent
f89eea0d2f
commit
c80e4d0ab7
@ -2,7 +2,7 @@
|
||||
"packages": [
|
||||
"packages/*"
|
||||
],
|
||||
"version": "0.2.55",
|
||||
"version": "0.2.56",
|
||||
"npmClient": "yarn",
|
||||
"useWorkspaces": true,
|
||||
"command": {
|
||||
|
2
packages/cache/package.json
vendored
2
packages/cache/package.json
vendored
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@cerc-io/cache",
|
||||
"version": "0.2.55",
|
||||
"version": "0.2.56",
|
||||
"description": "Generic object cache",
|
||||
"main": "dist/index.js",
|
||||
"scripts": {
|
||||
|
@ -51,6 +51,6 @@ A basic CLI to pass messages between peers using `stdin`/`stdout`
|
||||
* `dial-timeout`: timeout for dial to peers (ms)
|
||||
* `max-relay-connections`: max number of relay node connections for this peer
|
||||
* `peer-id-file (f)`: file path for peer id to be used (json)
|
||||
* `enable-debug-info`: Whether to broadcast node's info over floodsub on request
|
||||
* `enable-debug-info`: Whether to broadcast node's info over pubsub on request
|
||||
|
||||
* The process starts reading from `stdin` and outputs messages from others peers over the `/chat/1.0.0` protocol to `stdout`.
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@cerc-io/cli",
|
||||
"version": "0.2.55",
|
||||
"version": "0.2.56",
|
||||
"main": "dist/index.js",
|
||||
"license": "AGPL-3.0",
|
||||
"scripts": {
|
||||
@ -12,11 +12,11 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@apollo/client": "^3.7.1",
|
||||
"@cerc-io/cache": "^0.2.55",
|
||||
"@cerc-io/ipld-eth-client": "^0.2.55",
|
||||
"@cerc-io/peer": "^0.2.55",
|
||||
"@cerc-io/rpc-eth-client": "^0.2.55",
|
||||
"@cerc-io/util": "^0.2.55",
|
||||
"@cerc-io/cache": "^0.2.56",
|
||||
"@cerc-io/ipld-eth-client": "^0.2.56",
|
||||
"@cerc-io/peer": "^0.2.56",
|
||||
"@cerc-io/rpc-eth-client": "^0.2.56",
|
||||
"@cerc-io/util": "^0.2.56",
|
||||
"@ethersproject/providers": "^5.4.4",
|
||||
"@graphql-tools/utils": "^9.1.1",
|
||||
"@ipld/dag-cbor": "^8.0.0",
|
||||
|
@ -14,6 +14,7 @@ import {
|
||||
PeerIdObj
|
||||
// @ts-expect-error https://github.com/microsoft/TypeScript/issues/49721#issuecomment-1319854183
|
||||
} from '@cerc-io/peer';
|
||||
import { PubsubType } from '@cerc-io/util';
|
||||
|
||||
import { readPeerId } from './utils';
|
||||
|
||||
@ -26,6 +27,7 @@ interface Arguments {
|
||||
dialTimeout: number;
|
||||
maxRelayConnections: number;
|
||||
peerIdFile: string;
|
||||
pubsub?: PubsubType;
|
||||
enableDebugInfo: boolean;
|
||||
}
|
||||
|
||||
@ -60,6 +62,7 @@ export class PeerCmd {
|
||||
maxConnections: argv.maxConnections,
|
||||
dialTimeout: argv.dialTimeout,
|
||||
maxRelayConnections: argv.maxRelayConnections,
|
||||
pubsub: argv.pubsub,
|
||||
enableDebugInfo: argv.enableDebugInfo
|
||||
};
|
||||
|
||||
@ -112,9 +115,13 @@ function _getArgv (): any {
|
||||
alias: 'f',
|
||||
describe: 'Peer id file path (json)'
|
||||
},
|
||||
pubsub: {
|
||||
type: 'string',
|
||||
describe: "Pubsub to use ('floodsub' | 'gossipsub')"
|
||||
},
|
||||
enableDebugInfo: {
|
||||
type: 'boolean',
|
||||
describe: 'Whether to participate in exchanging debug info over floodsub',
|
||||
describe: 'Whether to participate in exchanging debug info over pubsub',
|
||||
default: false
|
||||
}
|
||||
}).argv;
|
||||
|
@ -187,6 +187,7 @@ export class ServerCmd {
|
||||
redialInterval: relayConfig.redialInterval ?? RELAY_REDIAL_INTERVAL,
|
||||
maxDialRetry: relayConfig.maxDialRetry ?? RELAY_DEFAULT_MAX_DIAL_RETRY,
|
||||
peerIdObj,
|
||||
pubsub: relayConfig.pubsub,
|
||||
enableDebugInfo: relayConfig.enableDebugInfo
|
||||
};
|
||||
await createRelayNode(relayNodeInit);
|
||||
@ -212,6 +213,7 @@ export class ServerCmd {
|
||||
relayRedialInterval: peerConfig.relayRedialInterval,
|
||||
maxConnections: peerConfig.maxConnections,
|
||||
dialTimeout: peerConfig.dialTimeout,
|
||||
pubsub: peerConfig.pubsub,
|
||||
enableDebugInfo: peerConfig.enableDebugInfo
|
||||
};
|
||||
await this._peer.init(peerNodeInit, peerIdObj);
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@cerc-io/codegen",
|
||||
"version": "0.2.55",
|
||||
"version": "0.2.56",
|
||||
"description": "Code generator",
|
||||
"private": true,
|
||||
"main": "index.js",
|
||||
@ -20,7 +20,7 @@
|
||||
},
|
||||
"homepage": "https://github.com/cerc-io/watcher-ts#readme",
|
||||
"dependencies": {
|
||||
"@cerc-io/util": "^0.2.55",
|
||||
"@cerc-io/util": "^0.2.56",
|
||||
"@graphql-tools/load-files": "^6.5.2",
|
||||
"@poanet/solidity-flattener": "https://github.com/vulcanize/solidity-flattener.git",
|
||||
"@solidity-parser/parser": "^0.13.2",
|
||||
|
@ -41,12 +41,12 @@
|
||||
"homepage": "https://github.com/cerc-io/watcher-ts#readme",
|
||||
"dependencies": {
|
||||
"@apollo/client": "^3.3.19",
|
||||
"@cerc-io/cli": "^0.2.55",
|
||||
"@cerc-io/ipld-eth-client": "^0.2.55",
|
||||
"@cerc-io/solidity-mapper": "^0.2.55",
|
||||
"@cerc-io/util": "^0.2.55",
|
||||
"@cerc-io/cli": "^0.2.56",
|
||||
"@cerc-io/ipld-eth-client": "^0.2.56",
|
||||
"@cerc-io/solidity-mapper": "^0.2.56",
|
||||
"@cerc-io/util": "^0.2.56",
|
||||
{{#if (subgraphPath)}}
|
||||
"@cerc-io/graph-node": "^0.2.55",
|
||||
"@cerc-io/graph-node": "^0.2.56",
|
||||
{{/if}}
|
||||
"@ethersproject/providers": "^5.4.4",
|
||||
"apollo-type-bigint": "^0.1.3",
|
||||
|
@ -1,10 +1,10 @@
|
||||
{
|
||||
"name": "@cerc-io/graph-node",
|
||||
"version": "0.2.55",
|
||||
"version": "0.2.56",
|
||||
"main": "dist/index.js",
|
||||
"license": "AGPL-3.0",
|
||||
"devDependencies": {
|
||||
"@cerc-io/solidity-mapper": "^0.2.55",
|
||||
"@cerc-io/solidity-mapper": "^0.2.56",
|
||||
"@ethersproject/providers": "^5.4.4",
|
||||
"@graphprotocol/graph-ts": "^0.22.0",
|
||||
"@nomiclabs/hardhat-ethers": "^2.0.2",
|
||||
@ -51,9 +51,9 @@
|
||||
"dependencies": {
|
||||
"@apollo/client": "^3.3.19",
|
||||
"@cerc-io/assemblyscript": "0.19.10-watcher-ts-0.1.2",
|
||||
"@cerc-io/cache": "^0.2.55",
|
||||
"@cerc-io/ipld-eth-client": "^0.2.55",
|
||||
"@cerc-io/util": "^0.2.55",
|
||||
"@cerc-io/cache": "^0.2.56",
|
||||
"@cerc-io/ipld-eth-client": "^0.2.56",
|
||||
"@cerc-io/util": "^0.2.56",
|
||||
"@types/json-diff": "^0.5.2",
|
||||
"@types/yargs": "^17.0.0",
|
||||
"bn.js": "^4.11.9",
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@cerc-io/ipld-eth-client",
|
||||
"version": "0.2.55",
|
||||
"version": "0.2.56",
|
||||
"description": "IPLD ETH Client",
|
||||
"main": "dist/index.js",
|
||||
"scripts": {
|
||||
@ -20,7 +20,7 @@
|
||||
"homepage": "https://github.com/cerc-io/watcher-ts#readme",
|
||||
"dependencies": {
|
||||
"@apollo/client": "^3.7.1",
|
||||
"@cerc-io/cache": "^0.2.55",
|
||||
"@cerc-io/cache": "^0.2.56",
|
||||
"cross-fetch": "^3.1.4",
|
||||
"debug": "^4.3.1",
|
||||
"ethers": "^5.4.4",
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@cerc-io/peer",
|
||||
"version": "0.2.55",
|
||||
"version": "0.2.56",
|
||||
"description": "libp2p module",
|
||||
"main": "dist/index.js",
|
||||
"exports": "./dist/index.js",
|
||||
@ -25,11 +25,13 @@
|
||||
"dev": "node dist/index.js",
|
||||
"create-peer": "node dist/cli/create-peer.js",
|
||||
"relay-node": "DEBUG='laconic:*' node dist/cli/relay.js",
|
||||
"test": "mocha dist/peer.test.js"
|
||||
"test": "mocha dist/peer.test.js --bail"
|
||||
},
|
||||
"dependencies": {
|
||||
"@cerc-io/libp2p": "0.42.2-laconic-0.1.3",
|
||||
"@cerc-io/libp2p": "0.42.2-laconic-0.1.4",
|
||||
"@cerc-io/prometheus-metrics": "1.1.4",
|
||||
"@cerc-io/util": "^0.2.56",
|
||||
"@chainsafe/libp2p-gossipsub": "^6.0.0",
|
||||
"@chainsafe/libp2p-noise": "^11.0.0",
|
||||
"@libp2p/floodsub": "^6.0.0",
|
||||
"@libp2p/mplex": "^7.1.1",
|
||||
|
@ -3,6 +3,8 @@ import { hideBin } from 'yargs/helpers';
|
||||
import fs from 'fs';
|
||||
import path from 'path';
|
||||
|
||||
import { PubsubType } from '@cerc-io/util';
|
||||
|
||||
import { RelayNodeInitConfig, createRelayNode } from '../relay.js';
|
||||
import { PeerIdObj } from '../peer.js';
|
||||
import {
|
||||
@ -25,6 +27,7 @@ interface Arguments {
|
||||
pingInterval: number;
|
||||
redialInterval: number;
|
||||
maxDialRetry: number;
|
||||
pubsub?: PubsubType;
|
||||
enableDebugInfo?: boolean;
|
||||
}
|
||||
|
||||
@ -81,12 +84,13 @@ async function main (): Promise<void> {
|
||||
pingInterval: argv.pingInterval,
|
||||
redialInterval: argv.redialInterval,
|
||||
maxDialRetry: argv.maxDialRetry,
|
||||
pubsub: argv.pubsub,
|
||||
enableDebugInfo: argv.enableDebugInfo
|
||||
};
|
||||
await createRelayNode(relayNodeInit);
|
||||
}
|
||||
|
||||
function _getArgv (): Arguments {
|
||||
function _getArgv (): any {
|
||||
return yargs(hideBin(process.argv)).parserConfiguration({
|
||||
'parse-numbers': false
|
||||
}).options({
|
||||
@ -141,6 +145,10 @@ function _getArgv (): Arguments {
|
||||
describe: 'Maximum number of dial retries to be attempted to a relay peer',
|
||||
default: RELAY_DEFAULT_MAX_DIAL_RETRY
|
||||
},
|
||||
pubsub: {
|
||||
type: 'string',
|
||||
describe: "Pubsub to use ('floodsub' | 'gossipsub')"
|
||||
},
|
||||
enableDebugInfo: {
|
||||
type: 'boolean',
|
||||
describe: "Whether to broadcast node's info over floodsub on request"
|
||||
|
@ -7,6 +7,8 @@ export const P2P_CIRCUIT_ID = 'p2p-circuit';
|
||||
export const CHAT_PROTOCOL = '/chat/1.0.0';
|
||||
export const DEBUG_INFO_TOPIC = 'debug-info';
|
||||
|
||||
export const DEFAULT_PUBSUB_TYPE = 'floodsub';
|
||||
|
||||
// How often a peer should broadcast it's peer data over pubsub discovery topic
|
||||
// (interval at which other peers get corresponding discovery event)
|
||||
export const PUBSUB_DISCOVERY_INTERVAL = 10000; // 10 seconds
|
||||
|
@ -61,6 +61,12 @@ describe('basic p2p tests', () => {
|
||||
const otherPeersId = peers[1 - index].node?.peerId.toString();
|
||||
|
||||
return new Promise<void>((resolve, reject) => {
|
||||
// Resolve if already connected to the other peer
|
||||
const alreadyConnected = peer.node?.getPeers().some(peerId => peerId.toString() === otherPeersId);
|
||||
if (alreadyConnected) {
|
||||
resolve();
|
||||
}
|
||||
|
||||
peer.node?.addEventListener('peer:connect', async (event) => {
|
||||
const connection: Connection = event.detail;
|
||||
|
||||
|
@ -12,6 +12,7 @@ import { fromString as uint8ArrayFromString } from 'uint8arrays/from-string';
|
||||
import { toString as uint8ArrayToString } from 'uint8arrays/to-string';
|
||||
import debug from 'debug';
|
||||
|
||||
import { PubsubType } from '@cerc-io/util';
|
||||
import { createLibp2p, Libp2p, Libp2pInit } from '@cerc-io/libp2p';
|
||||
import { webSockets } from '@libp2p/websockets';
|
||||
import { noise } from '@chainsafe/libp2p-noise';
|
||||
@ -22,7 +23,6 @@ import type { Message } from '@libp2p/interface-pubsub';
|
||||
import type { PeerId } from '@libp2p/interface-peer-id';
|
||||
import { createFromJSON, createEd25519PeerId } from '@libp2p/peer-id-factory';
|
||||
import { multiaddr, Multiaddr } from '@multiformats/multiaddr';
|
||||
import { floodsub } from '@libp2p/floodsub';
|
||||
import { pubsubPeerDiscovery } from '@libp2p/pubsub-peer-discovery';
|
||||
import { PrometheusMetrics } from '@cerc-io/prometheus-metrics';
|
||||
|
||||
@ -32,7 +32,6 @@ import {
|
||||
MIN_CONNECTIONS,
|
||||
DIAL_TIMEOUT,
|
||||
PUBSUB_DISCOVERY_INTERVAL,
|
||||
PUBSUB_SIGNATURE_POLICY,
|
||||
RELAY_TAG,
|
||||
RELAY_REDIAL_INTERVAL,
|
||||
DEFAULT_MAX_RELAY_CONNECTIONS,
|
||||
@ -43,7 +42,7 @@ import {
|
||||
P2P_WEBRTC_STAR_ID
|
||||
} from './constants.js';
|
||||
import { PeerHearbeatChecker } from './peer-heartbeat-checker.js';
|
||||
import { debugInfoRequestHandler, dialWithRetry, getConnectionsInfo, getPseudonymForPeerId, getSelfInfo, isMultiaddrBlacklisted, wsPeerFilter } from './utils/index.js';
|
||||
import { debugInfoRequestHandler, dialWithRetry, getConnectionsInfo, getPseudonymForPeerId, getSelfInfo, initPubsub, isMultiaddrBlacklisted, wsPeerFilter } from './utils/index.js';
|
||||
import { ConnectionType, DebugPeerInfo, DebugRequest, PeerConnectionInfo, PeerSelfInfo } from './types/debug-info.js';
|
||||
|
||||
const log = debug('laconic:peer');
|
||||
@ -66,6 +65,7 @@ export interface PeerInitConfig {
|
||||
maxConnections?: number;
|
||||
minConnections?: number;
|
||||
dialTimeout?: number;
|
||||
pubsub?: PubsubType;
|
||||
enableDebugInfo?: boolean;
|
||||
transports?: Libp2pInit['transports'];
|
||||
listenMultiaddrs?: string[];
|
||||
@ -158,7 +158,7 @@ export class Peer {
|
||||
},
|
||||
connectionEncryption: [noise()],
|
||||
streamMuxers: [mplex()],
|
||||
pubsub: floodsub({ globalSignaturePolicy: PUBSUB_SIGNATURE_POLICY }),
|
||||
pubsub: initPubsub(initOptions.pubsub),
|
||||
peerDiscovery: [
|
||||
// Use pubsub based discovery; relay server acts as a peer discovery source
|
||||
pubsubPeerDiscovery({
|
||||
|
@ -2,15 +2,15 @@
|
||||
// Copyright 2022 Vulcanize, Inc.
|
||||
//
|
||||
|
||||
import { Libp2p, createLibp2p } from '@cerc-io/libp2p';
|
||||
import debug from 'debug';
|
||||
import assert from 'assert';
|
||||
import { toString as uint8ArrayToString } from 'uint8arrays/to-string';
|
||||
|
||||
import { PubsubType } from '@cerc-io/util';
|
||||
import { Libp2p, createLibp2p } from '@cerc-io/libp2p';
|
||||
import { noise } from '@chainsafe/libp2p-noise';
|
||||
import { mplex } from '@libp2p/mplex';
|
||||
import { webSockets } from '@libp2p/websockets';
|
||||
import { floodsub } from '@libp2p/floodsub';
|
||||
import { pubsubPeerDiscovery } from '@libp2p/pubsub-peer-discovery';
|
||||
import type { Message } from '@libp2p/interface-pubsub';
|
||||
import type { Connection } from '@libp2p/interface-connection';
|
||||
@ -23,12 +23,11 @@ import {
|
||||
HOP_TIMEOUT,
|
||||
DEFAULT_PING_TIMEOUT,
|
||||
PUBSUB_DISCOVERY_INTERVAL,
|
||||
PUBSUB_SIGNATURE_POLICY,
|
||||
MAX_CONCURRENT_DIALS_PER_PEER,
|
||||
DEBUG_INFO_TOPIC
|
||||
} from './constants.js';
|
||||
import { PeerHearbeatChecker } from './peer-heartbeat-checker.js';
|
||||
import { debugInfoRequestHandler, dialWithRetry, getConnectionsInfo, getPseudonymForPeerId, getSelfInfo, isMultiaddrBlacklisted } from './utils/index.js';
|
||||
import { debugInfoRequestHandler, dialWithRetry, getConnectionsInfo, getPseudonymForPeerId, getSelfInfo, initPubsub, isMultiaddrBlacklisted } from './utils/index.js';
|
||||
import { PeerIdObj } from './peer.js';
|
||||
import { SelfInfo, ConnectionInfo } from './types/debug-info.js';
|
||||
|
||||
@ -46,6 +45,7 @@ export interface RelayNodeInitConfig {
|
||||
pingTimeout?: number;
|
||||
redialInterval: number;
|
||||
maxDialRetry: number;
|
||||
pubsub?: PubsubType;
|
||||
enableDebugInfo?: boolean;
|
||||
}
|
||||
|
||||
@ -75,7 +75,7 @@ export async function createRelayNode (init: RelayNodeInitConfig): Promise<Libp2
|
||||
transports: [webSockets()],
|
||||
connectionEncryption: [noise()],
|
||||
streamMuxers: [mplex()],
|
||||
pubsub: floodsub({ globalSignaturePolicy: PUBSUB_SIGNATURE_POLICY }),
|
||||
pubsub: initPubsub(init.pubsub),
|
||||
peerDiscovery: [
|
||||
pubsubPeerDiscovery({
|
||||
interval: PUBSUB_DISCOVERY_INTERVAL
|
||||
|
@ -12,10 +12,13 @@ import { Libp2p } from '@cerc-io/libp2p';
|
||||
import { Multiaddr } from '@multiformats/multiaddr';
|
||||
import type { PeerId } from '@libp2p/interface-peer-id';
|
||||
import type { Connection } from '@libp2p/interface-connection';
|
||||
import { floodsub } from '@libp2p/floodsub';
|
||||
import { gossipsub } from '@chainsafe/libp2p-gossipsub';
|
||||
|
||||
import { ConnectionInfo, ConnectionType, DebugMsg, DebugPeerInfo, DebugResponse, SelfInfo } from '../types/debug-info.js';
|
||||
import { DEBUG_INFO_TOPIC, P2P_WEBRTC_STAR_ID } from '../constants.js';
|
||||
import { DEBUG_INFO_TOPIC, DEFAULT_PUBSUB_TYPE, P2P_WEBRTC_STAR_ID, PUBSUB_SIGNATURE_POLICY } from '../constants.js';
|
||||
import { PeerHearbeatChecker } from '../peer-heartbeat-checker.js';
|
||||
import { PubsubType } from '@cerc-io/util';
|
||||
|
||||
const log = debug('laconic:utils');
|
||||
|
||||
@ -23,6 +26,8 @@ const log = debug('laconic:utils');
|
||||
export const CODE_P2P = 421;
|
||||
export const CODE_CIRCUIT = 290;
|
||||
|
||||
const ERR_INVALID_PUBSUB_TYPE = 'Invalid pubsub type';
|
||||
|
||||
interface DialWithRetryOptions {
|
||||
redialInterval: number
|
||||
maxRetry: number
|
||||
@ -172,3 +177,22 @@ export const wsPeerFilter = (multiaddrs: Multiaddr[]): Multiaddr[] => {
|
||||
mafmt.WebSocketsSecure.matches(testMa);
|
||||
});
|
||||
};
|
||||
|
||||
export const initPubsub = (pubsubType?: PubsubType): any => {
|
||||
let pubsub: any;
|
||||
switch (pubsubType || DEFAULT_PUBSUB_TYPE) {
|
||||
case 'floodsub':
|
||||
pubsub = floodsub({ globalSignaturePolicy: PUBSUB_SIGNATURE_POLICY });
|
||||
break;
|
||||
case 'gossipsub':
|
||||
pubsub = gossipsub({
|
||||
globalSignaturePolicy: PUBSUB_SIGNATURE_POLICY,
|
||||
allowPublishToZeroPeers: true
|
||||
});
|
||||
break;
|
||||
default:
|
||||
throw new Error(`${ERR_INVALID_PUBSUB_TYPE}: ${pubsubType}`);
|
||||
}
|
||||
|
||||
return pubsub;
|
||||
};
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@cerc-io/rpc-eth-client",
|
||||
"version": "0.2.55",
|
||||
"version": "0.2.56",
|
||||
"description": "RPC ETH Client",
|
||||
"main": "dist/index.js",
|
||||
"scripts": {
|
||||
@ -19,9 +19,9 @@
|
||||
},
|
||||
"homepage": "https://github.com/cerc-io/watcher-ts#readme",
|
||||
"dependencies": {
|
||||
"@cerc-io/cache": "^0.2.55",
|
||||
"@cerc-io/ipld-eth-client": "^0.2.55",
|
||||
"@cerc-io/util": "^0.2.55",
|
||||
"@cerc-io/cache": "^0.2.56",
|
||||
"@cerc-io/ipld-eth-client": "^0.2.56",
|
||||
"@cerc-io/util": "^0.2.56",
|
||||
"chai": "^4.3.4",
|
||||
"ethers": "^5.4.4",
|
||||
"left-pad": "^1.3.0",
|
||||
|
@ -1,10 +1,10 @@
|
||||
{
|
||||
"name": "@cerc-io/solidity-mapper",
|
||||
"version": "0.2.55",
|
||||
"version": "0.2.56",
|
||||
"main": "dist/index.js",
|
||||
"license": "AGPL-3.0",
|
||||
"devDependencies": {
|
||||
"@cerc-io/ipld-eth-client": "^0.2.55",
|
||||
"@cerc-io/ipld-eth-client": "^0.2.56",
|
||||
"@ethersproject/abi": "^5.3.0",
|
||||
"@nomiclabs/hardhat-ethers": "^2.0.2",
|
||||
"@nomiclabs/hardhat-waffle": "^2.0.1",
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@cerc-io/test",
|
||||
"version": "0.2.55",
|
||||
"version": "0.2.56",
|
||||
"main": "dist/index.js",
|
||||
"license": "AGPL-3.0",
|
||||
"private": true,
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@cerc-io/tracing-client",
|
||||
"version": "0.2.55",
|
||||
"version": "0.2.56",
|
||||
"description": "ETH VM tracing client",
|
||||
"main": "dist/index.js",
|
||||
"scripts": {
|
||||
|
@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "@cerc-io/util",
|
||||
"version": "0.2.55",
|
||||
"version": "0.2.56",
|
||||
"main": "dist/index.js",
|
||||
"license": "AGPL-3.0",
|
||||
"dependencies": {
|
||||
"@apollo/utils.keyvaluecache": "^1.0.1",
|
||||
"@cerc-io/nitro-node": "^0.1.8",
|
||||
"@cerc-io/solidity-mapper": "^0.2.55",
|
||||
"@cerc-io/solidity-mapper": "^0.2.56",
|
||||
"@cerc-io/ts-channel": "1.0.3-ts-nitro-0.1.1",
|
||||
"@ethersproject/providers": "^5.4.4",
|
||||
"@graphql-tools/schema": "^9.0.10",
|
||||
@ -40,7 +40,7 @@
|
||||
"yargs": "^17.0.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@cerc-io/cache": "^0.2.55",
|
||||
"@cerc-io/cache": "^0.2.56",
|
||||
"@nomiclabs/hardhat-waffle": "^2.0.1",
|
||||
"@types/express": "^4.17.14",
|
||||
"@types/fs-extra": "^9.0.11",
|
||||
|
@ -12,6 +12,8 @@ import { Config as CacheConfig } from '@cerc-io/cache';
|
||||
|
||||
const log = debug('vulcanize:config');
|
||||
|
||||
export type PubsubType = 'floodsub' | 'gossipsub';
|
||||
|
||||
export interface JobQueueConfig {
|
||||
dbConnectionString: string;
|
||||
maxCompletionLagInSecs: number;
|
||||
@ -63,7 +65,10 @@ export interface RelayConfig {
|
||||
// Max number of dial retries to be attempted to a relay peer
|
||||
maxDialRetry?: number;
|
||||
|
||||
// Broadcast node's info over floodsub on requests
|
||||
// Pubsub to use ('floodsub' | 'gossipsub')
|
||||
pubsub?: PubsubType;
|
||||
|
||||
// Broadcast node's info over pubsub on requests
|
||||
enableDebugInfo?: boolean;
|
||||
}
|
||||
|
||||
@ -111,7 +116,10 @@ export interface PeerConfig {
|
||||
// Peer id file path (json)
|
||||
peerIdFile?: string;
|
||||
|
||||
// Participate in exchange of debug info over floodsub
|
||||
// Pubsub to use ('floodsub' | 'gossipsub')
|
||||
pubsub?: PubsubType;
|
||||
|
||||
// Participate in exchange of debug info over pubsub
|
||||
enableDebugInfo?: boolean;
|
||||
|
||||
// Enable sending txs to L2 chain for every message received in P2P network
|
||||
|
156
yarn.lock
156
yarn.lock
@ -350,6 +350,78 @@
|
||||
wherearewe "^2.0.0"
|
||||
xsalsa20 "^1.1.0"
|
||||
|
||||
"@cerc-io/libp2p@0.42.2-laconic-0.1.4":
|
||||
version "0.42.2-laconic-0.1.4"
|
||||
resolved "https://git.vdb.to/api/packages/cerc-io/npm/%40cerc-io%2Flibp2p/-/0.42.2-laconic-0.1.4/libp2p-0.42.2-laconic-0.1.4.tgz#ac9347e70d6d3cee040ad02074cae3070b91a8fb"
|
||||
integrity sha512-gTC62YvkK3P7cWlaH8gQ6lDbqusNiaYI1q7y/+vQ/1s35uStwRn7fvXHC0aY9s36L4S3p1S0sxDzGXM8rtg6+w==
|
||||
dependencies:
|
||||
"@achingbrain/nat-port-mapper" "^1.0.3"
|
||||
"@libp2p/crypto" "^1.0.4"
|
||||
"@libp2p/interface-address-manager" "^2.0.0"
|
||||
"@libp2p/interface-connection" "^3.0.2"
|
||||
"@libp2p/interface-connection-encrypter" "^3.0.1"
|
||||
"@libp2p/interface-connection-manager" "^1.1.1"
|
||||
"@libp2p/interface-content-routing" "^2.0.0"
|
||||
"@libp2p/interface-dht" "^2.0.0"
|
||||
"@libp2p/interface-keychain" "^2.0.4"
|
||||
"@libp2p/interface-libp2p" "^1.0.0"
|
||||
"@libp2p/interface-metrics" "^4.0.0"
|
||||
"@libp2p/interface-peer-discovery" "^1.0.1"
|
||||
"@libp2p/interface-peer-id" "^2.0.0"
|
||||
"@libp2p/interface-peer-info" "^1.0.3"
|
||||
"@libp2p/interface-peer-routing" "^1.0.1"
|
||||
"@libp2p/interface-peer-store" "^1.2.2"
|
||||
"@libp2p/interface-pubsub" "^3.0.0"
|
||||
"@libp2p/interface-registrar" "^2.0.3"
|
||||
"@libp2p/interface-stream-muxer" "^3.0.0"
|
||||
"@libp2p/interface-transport" "^2.1.0"
|
||||
"@libp2p/interfaces" "^3.0.3"
|
||||
"@libp2p/keychain" "^1.0.0"
|
||||
"@libp2p/logger" "^2.0.1"
|
||||
"@libp2p/multistream-select" "^3.0.0"
|
||||
"@libp2p/peer-collections" "^3.0.0"
|
||||
"@libp2p/peer-id" "^2.0.0"
|
||||
"@libp2p/peer-id-factory" "^2.0.0"
|
||||
"@libp2p/peer-record" "^5.0.0"
|
||||
"@libp2p/peer-store" "^6.0.0"
|
||||
"@libp2p/tracked-map" "^3.0.0"
|
||||
"@libp2p/utils" "^3.0.2"
|
||||
"@libp2p/webrtc-peer" "^2.0.2"
|
||||
"@multiformats/mafmt" "^11.0.2"
|
||||
"@multiformats/multiaddr" "^11.0.0"
|
||||
abortable-iterator "^4.0.2"
|
||||
any-signal "^3.0.0"
|
||||
datastore-core "^8.0.1"
|
||||
err-code "^3.0.1"
|
||||
interface-datastore "^7.0.0"
|
||||
it-all "^2.0.0"
|
||||
it-drain "^2.0.0"
|
||||
it-filter "^2.0.0"
|
||||
it-first "^2.0.0"
|
||||
it-handshake "^4.1.2"
|
||||
it-length-prefixed "^8.0.2"
|
||||
it-map "^2.0.0"
|
||||
it-merge "^2.0.0"
|
||||
it-pair "^2.0.2"
|
||||
it-pipe "^2.0.3"
|
||||
it-pushable "^3.1.2"
|
||||
it-sort "^2.0.1"
|
||||
it-stream-types "^1.0.4"
|
||||
merge-options "^3.0.4"
|
||||
multiformats "^11.0.0"
|
||||
p-fifo "^1.0.0"
|
||||
p-settle "^5.0.0"
|
||||
private-ip "^3.0.0"
|
||||
protons-runtime "^4.0.1"
|
||||
rate-limiter-flexible "^2.3.11"
|
||||
retimer "^3.0.0"
|
||||
set-delayed-interval "^1.0.0"
|
||||
timeout-abort-controller "^3.0.0"
|
||||
uint8arraylist "^2.3.2"
|
||||
uint8arrays "^4.0.2"
|
||||
wherearewe "^2.0.0"
|
||||
xsalsa20 "^1.1.0"
|
||||
|
||||
"@cerc-io/nitro-node@^0.1.8":
|
||||
version "0.1.8"
|
||||
resolved "https://git.vdb.to/api/packages/cerc-io/npm/%40cerc-io%2Fnitro-node/-/0.1.8/nitro-node-0.1.8.tgz#d2e90f4464645f3dab1ded8aa14e912c3f31ddcf"
|
||||
@ -411,6 +483,36 @@
|
||||
resolved "https://registry.yarnpkg.com/@chainsafe/is-ip/-/is-ip-2.0.1.tgz#62cb285669d91f88fd9fa285048dde3882f0993b"
|
||||
integrity sha512-nqSJ8u2a1Rv9FYbyI8qpDhTYujaKEyLknNrTejLYoSWmdeg+2WB7R6BZqPZYfrJzDxVi3rl6ZQuoaEvpKRZWgQ==
|
||||
|
||||
"@chainsafe/libp2p-gossipsub@^6.0.0":
|
||||
version "6.3.0"
|
||||
resolved "https://registry.yarnpkg.com/@chainsafe/libp2p-gossipsub/-/libp2p-gossipsub-6.3.0.tgz#0ef8b8548a4c8307233b01dfb23bfa605df6b0e2"
|
||||
integrity sha512-yRgMB5JpyPROjmhOeOmzJUAKci19qBEnpH80201f8JkkviUJo7+X8i3MUkammlbFg0VhaTKBT98Osbko9+rT1w==
|
||||
dependencies:
|
||||
"@libp2p/crypto" "^1.0.3"
|
||||
"@libp2p/interface-connection" "^4.0.0"
|
||||
"@libp2p/interface-connection-manager" "^1.3.0"
|
||||
"@libp2p/interface-keys" "^1.0.3"
|
||||
"@libp2p/interface-peer-id" "^2.0.0"
|
||||
"@libp2p/interface-peer-store" "^1.2.2"
|
||||
"@libp2p/interface-pubsub" "^3.0.0"
|
||||
"@libp2p/interface-registrar" "^2.0.3"
|
||||
"@libp2p/interfaces" "^3.2.0"
|
||||
"@libp2p/logger" "^2.0.0"
|
||||
"@libp2p/peer-id" "^2.0.0"
|
||||
"@libp2p/peer-record" "^5.0.0"
|
||||
"@libp2p/pubsub" "^6.0.0"
|
||||
"@libp2p/topology" "^4.0.0"
|
||||
"@multiformats/multiaddr" "^12.0.0"
|
||||
abortable-iterator "^4.0.2"
|
||||
denque "^1.5.0"
|
||||
it-length-prefixed "^8.0.2"
|
||||
it-pipe "^2.0.4"
|
||||
it-pushable "^3.1.0"
|
||||
multiformats "^11.0.0"
|
||||
protobufjs "^6.11.2"
|
||||
uint8arraylist "^2.3.2"
|
||||
uint8arrays "^4.0.2"
|
||||
|
||||
"@chainsafe/libp2p-noise@^11.0.0":
|
||||
version "11.0.1"
|
||||
resolved "https://registry.yarnpkg.com/@chainsafe/libp2p-noise/-/libp2p-noise-11.0.1.tgz#f3176bf416d799c892d899890dc7b11619d098d9"
|
||||
@ -2318,6 +2420,21 @@
|
||||
protons-runtime "^4.0.1"
|
||||
uint8arrays "^4.0.2"
|
||||
|
||||
"@libp2p/crypto@^1.0.3":
|
||||
version "1.0.17"
|
||||
resolved "https://registry.yarnpkg.com/@libp2p/crypto/-/crypto-1.0.17.tgz#e64043328c0c866bf7f4cc8560b4f483e9c745dc"
|
||||
integrity sha512-Oeg0Eb/EvAho0gVkOgemXEgrVxWaT3x/DpFgkBdZ9qGxwq75w/E/oPc7souqBz+l1swfz37GWnwV7bIb4Xv5Ag==
|
||||
dependencies:
|
||||
"@libp2p/interface-keys" "^1.0.2"
|
||||
"@libp2p/interfaces" "^3.2.0"
|
||||
"@noble/ed25519" "^1.6.0"
|
||||
"@noble/secp256k1" "^1.5.4"
|
||||
multiformats "^11.0.0"
|
||||
node-forge "^1.1.0"
|
||||
protons-runtime "^5.0.0"
|
||||
uint8arraylist "^2.4.3"
|
||||
uint8arrays "^4.0.2"
|
||||
|
||||
"@libp2p/floodsub@^6.0.0":
|
||||
version "6.0.3"
|
||||
resolved "https://registry.yarnpkg.com/@libp2p/floodsub/-/floodsub-6.0.3.tgz#38a5440449ea87bb9be90933a4bca0dbdddfb69c"
|
||||
@ -2358,6 +2475,16 @@
|
||||
"@libp2p/interfaces" "^3.0.0"
|
||||
"@multiformats/multiaddr" "^11.0.0"
|
||||
|
||||
"@libp2p/interface-connection-manager@^1.3.0":
|
||||
version "1.5.0"
|
||||
resolved "https://registry.yarnpkg.com/@libp2p/interface-connection-manager/-/interface-connection-manager-1.5.0.tgz#959dedb26c3859677f0c889406d1814978e60386"
|
||||
integrity sha512-luqYVMH3yip12JlSwVmBdo5/qG4YnXQXp2AV4lvxWK0sUhCnI2r3YL4e9ne8o3LAA5CkH3lPqTQ2HSRpmOruFg==
|
||||
dependencies:
|
||||
"@libp2p/interface-connection" "^4.0.0"
|
||||
"@libp2p/interface-peer-id" "^2.0.0"
|
||||
"@libp2p/interfaces" "^3.0.0"
|
||||
"@multiformats/multiaddr" "^12.0.0"
|
||||
|
||||
"@libp2p/interface-connection@^3.0.0", "@libp2p/interface-connection@^3.0.1":
|
||||
version "3.1.1"
|
||||
resolved "https://registry.yarnpkg.com/@libp2p/interface-connection/-/interface-connection-3.1.1.tgz#f43180e64de118c29f311ee7111f8bbe50e252bf"
|
||||
@ -2424,6 +2551,11 @@
|
||||
resolved "https://registry.yarnpkg.com/@libp2p/interface-keys/-/interface-keys-1.0.7.tgz#ad09ee7dc9c1495f1dd3e1785133c317befb4d7b"
|
||||
integrity sha512-DRMPY9LfcnGJKrjaqIkY62U3fW2dya3VLy4x986ExtMrGn4kxIHeQ1IKk8/Vs9CJHTKmXEMID4of1Cjnw4aJpA==
|
||||
|
||||
"@libp2p/interface-keys@^1.0.3":
|
||||
version "1.0.8"
|
||||
resolved "https://registry.yarnpkg.com/@libp2p/interface-keys/-/interface-keys-1.0.8.tgz#2c6b55136113ae7cf78133d3c459cdf0455b29ae"
|
||||
integrity sha512-CJ1SlrwuoHMquhEEWS77E+4vv7hwB7XORkqzGQrPQmA9MRdIEZRS64bA4JqCLUDa4ltH0l+U1vp0oZHLT67NEA==
|
||||
|
||||
"@libp2p/interface-libp2p@^1.0.0":
|
||||
version "1.1.1"
|
||||
resolved "https://registry.yarnpkg.com/@libp2p/interface-libp2p/-/interface-libp2p-1.1.1.tgz#0e75af940dcc0f48c6abd677902d3eafc69ac7e8"
|
||||
@ -6976,6 +7108,11 @@ delegates@^1.0.0:
|
||||
resolved "https://registry.npmjs.org/delegates/-/delegates-1.0.0.tgz"
|
||||
integrity sha1-hMbhWbgZBP3KWaDvRM2HDTElD5o=
|
||||
|
||||
denque@^1.5.0:
|
||||
version "1.5.1"
|
||||
resolved "https://registry.yarnpkg.com/denque/-/denque-1.5.1.tgz#07f670e29c9a78f8faecb2566a1e2c11929c5cbf"
|
||||
integrity sha512-XwE+iZ4D6ZUB7mfYRMb5wByE8L74HCn30FBN7sWnXksWc1LO1bPDl67pBR9o/kC4z/xSNAwkMYcGgqDV3BE3Hw==
|
||||
|
||||
depcheck@^1.4.2:
|
||||
version "1.4.3"
|
||||
resolved "https://registry.yarnpkg.com/depcheck/-/depcheck-1.4.3.tgz#faa4c143921f3fe25d5a7a633f9864327c250843"
|
||||
@ -13529,6 +13666,25 @@ protobufjs@^6.10.2:
|
||||
"@types/node" ">=13.7.0"
|
||||
long "^4.0.0"
|
||||
|
||||
protobufjs@^6.11.2:
|
||||
version "6.11.4"
|
||||
resolved "https://registry.yarnpkg.com/protobufjs/-/protobufjs-6.11.4.tgz#29a412c38bf70d89e537b6d02d904a6f448173aa"
|
||||
integrity sha512-5kQWPaJHi1WoCpjTGszzQ32PG2F4+wRY6BmAT4Vfw56Q2FZ4YZzK20xUYQH4YkfehY1e6QSICrJquM6xXZNcrw==
|
||||
dependencies:
|
||||
"@protobufjs/aspromise" "^1.1.2"
|
||||
"@protobufjs/base64" "^1.1.2"
|
||||
"@protobufjs/codegen" "^2.0.4"
|
||||
"@protobufjs/eventemitter" "^1.1.0"
|
||||
"@protobufjs/fetch" "^1.1.0"
|
||||
"@protobufjs/float" "^1.0.2"
|
||||
"@protobufjs/inquire" "^1.1.0"
|
||||
"@protobufjs/path" "^1.1.2"
|
||||
"@protobufjs/pool" "^1.1.0"
|
||||
"@protobufjs/utf8" "^1.1.0"
|
||||
"@types/long" "^4.0.1"
|
||||
"@types/node" ">=13.7.0"
|
||||
long "^4.0.0"
|
||||
|
||||
protobufjs@^7.0.0:
|
||||
version "7.2.2"
|
||||
resolved "https://registry.yarnpkg.com/protobufjs/-/protobufjs-7.2.2.tgz#2af401d8c547b9476fb37ffc65782cf302342ca3"
|
||||
|
Loading…
Reference in New Issue
Block a user