-
Notifications
You must be signed in to change notification settings - Fork 9
/
index.ts
43 lines (37 loc) · 1.06 KB
/
index.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
import { connectTests } from './connect.js'
import { dhtTests } from './dht/index.js'
import { pubsubTests } from './pubsub/index.js'
import { streamTests } from './streams/index.js'
import type { DaemonClient } from '@libp2p/daemon-client'
export interface Daemon {
stop: () => Promise<void>
client: DaemonClient
}
export type NodeType = 'js' | 'go'
export type PeerIdType = 'rsa' | 'ed25519' | 'secp256k1'
export type PubSubRouter = 'gossipsub' | 'floodsub'
export type Muxer = 'mplex' | 'yamux'
export interface SpawnOptions {
type: NodeType
key?: string
noise?: true
dht?: boolean
pubsub?: boolean
pubsubRouter?: PubSubRouter
muxer?: Muxer
}
export interface DaemonFactory {
spawn: (options: SpawnOptions) => Promise<Daemon>
}
export async function interopTests (factory: DaemonFactory) {
await connectTests(factory)
await dhtTests(factory)
await pubsubTests(factory)
await streamTests(factory)
}
export {
connectTests as connectInteropTests,
dhtTests as dhtInteropTests,
pubsubTests as pubsubInteropTests,
streamTests as streamInteropTests
}