mirror of https://github.com/waku-org/js-waku.git
Merge pull request #957 from waku-org/relay-type
This commit is contained in:
commit
0c83953e55
|
@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||
|
||||
## [Unreleased]
|
||||
|
||||
### Changed
|
||||
|
||||
- Correct options type for `createFullNode` & `createPrivacy` to enable passing gossipsub options.
|
||||
|
||||
## [0.27.0] - 2022-09-13
|
||||
|
||||
### Added
|
||||
|
|
|
@ -12,7 +12,7 @@ import { getPredefinedBootstrapNodes } from "./predefined_bootstrap_nodes";
|
|||
import { WakuNode, WakuOptions } from "./waku";
|
||||
import { WakuFilter } from "./waku_filter";
|
||||
import { WakuLightPush } from "./waku_light_push";
|
||||
import { WakuRelay } from "./waku_relay";
|
||||
import { CreateOptions as RelayCreateOptions, WakuRelay } from "./waku_relay";
|
||||
import { WakuStore } from "./waku_store";
|
||||
|
||||
export interface CreateOptions {
|
||||
|
@ -87,7 +87,7 @@ export async function createLightNode(
|
|||
* enabling some privacy preserving properties.
|
||||
*/
|
||||
export async function createPrivacyNode(
|
||||
options?: CreateOptions & WakuOptions
|
||||
options?: CreateOptions & WakuOptions & Partial<RelayCreateOptions>
|
||||
): Promise<WakuPrivacy> {
|
||||
const libp2pOptions = options?.libp2p ?? {};
|
||||
const peerDiscovery = libp2pOptions.peerDiscovery ?? [];
|
||||
|
@ -115,7 +115,7 @@ export async function createPrivacyNode(
|
|||
* @internal
|
||||
*/
|
||||
export async function createFullNode(
|
||||
options?: CreateOptions & WakuOptions
|
||||
options?: CreateOptions & WakuOptions & Partial<RelayCreateOptions>
|
||||
): Promise<WakuFull> {
|
||||
const libp2pOptions = options?.libp2p ?? {};
|
||||
const peerDiscovery = libp2pOptions.peerDiscovery ?? [];
|
||||
|
@ -144,7 +144,7 @@ export async function createFullNode(
|
|||
* { @link index.waku.WakuNode.constructor } instead.
|
||||
*/
|
||||
export async function createWaku(
|
||||
options?: CreateOptions & WakuOptions
|
||||
options?: CreateOptions & WakuOptions & Partial<RelayCreateOptions>
|
||||
): Promise<Waku> {
|
||||
const libp2pOptions = options?.libp2p ?? {};
|
||||
const peerDiscovery = libp2pOptions.peerDiscovery ?? [];
|
||||
|
|
|
@ -444,6 +444,7 @@ describe("Waku Relay [node only]", () => {
|
|||
[waku1, waku2] = await Promise.all([
|
||||
createPrivacyNode({
|
||||
staticNoiseKey: NOISE_KEY_1,
|
||||
emitSelf: true,
|
||||
}).then((waku) => waku.start().then(() => waku)),
|
||||
createPrivacyNode({
|
||||
staticNoiseKey: NOISE_KEY_2,
|
||||
|
|
Loading…
Reference in New Issue