Skip to content

Commit

Permalink
chore: move P2POptions definition to node
Browse files Browse the repository at this point in the history
  • Loading branch information
GabrielMartinezRodriguez committed May 12, 2023
1 parent 9485318 commit 3330a80
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/EventEmitterP2P.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import LibP2P, { Libp2p } from 'libp2p'
import { Libp2p } from 'libp2p'
import { Disposable, IEventEmitter, Listener } from './IEventEmitter.js'
import { getNode } from './node.js'
import { fromString as uint8ArrayFromString, toString as uint8ArrayToString } from 'uint8arrays'
import { error, info } from './logger.js'
import { P2POptions } from "./node.js"

export type P2POptions = { overridedOptions?: LibP2P.Libp2pOptions; bootstrapList?: string[], nodeKey?: string }

export class EventEmitterP2P<T extends string> implements IEventEmitter<T> {
p2pnode!: Libp2p
Expand Down
3 changes: 2 additions & 1 deletion src/node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,11 @@ import { bootstrap } from '@libp2p/bootstrap'
import { kadDHT } from '@libp2p/kad-dht'
import { gossipsub } from '@chainsafe/libp2p-gossipsub'
import { pubsubPeerDiscovery } from '@libp2p/pubsub-peer-discovery'
import { P2POptions } from "./EventEmitterP2P"
import { unmarshalPrivateKey } from "@libp2p/crypto/keys";
import { createFromPrivKey } from "@libp2p/peer-id-factory";

export type P2POptions = { overridedOptions?: LibP2P.Libp2pOptions; bootstrapList?: string[], nodeKey?: string }

const topics = ['__stability__._peer-discovery._p2p._pubsub']

export const defaultOptions: LibP2P.Libp2pOptions = {
Expand Down

0 comments on commit 3330a80

Please sign in to comment.