mirror of
https://github.com/waku-org/js-waku.git
synced 2025-01-13 22:15:04 +00:00
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]
|
## [Unreleased]
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
|
||||||
|
- Correct options type for `createFullNode` & `createPrivacy` to enable passing gossipsub options.
|
||||||
|
|
||||||
## [0.27.0] - 2022-09-13
|
## [0.27.0] - 2022-09-13
|
||||||
|
|
||||||
### Added
|
### Added
|
||||||
|
@ -12,7 +12,7 @@ import { getPredefinedBootstrapNodes } from "./predefined_bootstrap_nodes";
|
|||||||
import { WakuNode, WakuOptions } from "./waku";
|
import { WakuNode, WakuOptions } from "./waku";
|
||||||
import { WakuFilter } from "./waku_filter";
|
import { WakuFilter } from "./waku_filter";
|
||||||
import { WakuLightPush } from "./waku_light_push";
|
import { WakuLightPush } from "./waku_light_push";
|
||||||
import { WakuRelay } from "./waku_relay";
|
import { CreateOptions as RelayCreateOptions, WakuRelay } from "./waku_relay";
|
||||||
import { WakuStore } from "./waku_store";
|
import { WakuStore } from "./waku_store";
|
||||||
|
|
||||||
export interface CreateOptions {
|
export interface CreateOptions {
|
||||||
@ -87,7 +87,7 @@ export async function createLightNode(
|
|||||||
* enabling some privacy preserving properties.
|
* enabling some privacy preserving properties.
|
||||||
*/
|
*/
|
||||||
export async function createPrivacyNode(
|
export async function createPrivacyNode(
|
||||||
options?: CreateOptions & WakuOptions
|
options?: CreateOptions & WakuOptions & Partial<RelayCreateOptions>
|
||||||
): Promise<WakuPrivacy> {
|
): Promise<WakuPrivacy> {
|
||||||
const libp2pOptions = options?.libp2p ?? {};
|
const libp2pOptions = options?.libp2p ?? {};
|
||||||
const peerDiscovery = libp2pOptions.peerDiscovery ?? [];
|
const peerDiscovery = libp2pOptions.peerDiscovery ?? [];
|
||||||
@ -115,7 +115,7 @@ export async function createPrivacyNode(
|
|||||||
* @internal
|
* @internal
|
||||||
*/
|
*/
|
||||||
export async function createFullNode(
|
export async function createFullNode(
|
||||||
options?: CreateOptions & WakuOptions
|
options?: CreateOptions & WakuOptions & Partial<RelayCreateOptions>
|
||||||
): Promise<WakuFull> {
|
): Promise<WakuFull> {
|
||||||
const libp2pOptions = options?.libp2p ?? {};
|
const libp2pOptions = options?.libp2p ?? {};
|
||||||
const peerDiscovery = libp2pOptions.peerDiscovery ?? [];
|
const peerDiscovery = libp2pOptions.peerDiscovery ?? [];
|
||||||
@ -144,7 +144,7 @@ export async function createFullNode(
|
|||||||
* { @link index.waku.WakuNode.constructor } instead.
|
* { @link index.waku.WakuNode.constructor } instead.
|
||||||
*/
|
*/
|
||||||
export async function createWaku(
|
export async function createWaku(
|
||||||
options?: CreateOptions & WakuOptions
|
options?: CreateOptions & WakuOptions & Partial<RelayCreateOptions>
|
||||||
): Promise<Waku> {
|
): Promise<Waku> {
|
||||||
const libp2pOptions = options?.libp2p ?? {};
|
const libp2pOptions = options?.libp2p ?? {};
|
||||||
const peerDiscovery = libp2pOptions.peerDiscovery ?? [];
|
const peerDiscovery = libp2pOptions.peerDiscovery ?? [];
|
||||||
|
@ -444,6 +444,7 @@ describe("Waku Relay [node only]", () => {
|
|||||||
[waku1, waku2] = await Promise.all([
|
[waku1, waku2] = await Promise.all([
|
||||||
createPrivacyNode({
|
createPrivacyNode({
|
||||||
staticNoiseKey: NOISE_KEY_1,
|
staticNoiseKey: NOISE_KEY_1,
|
||||||
|
emitSelf: true,
|
||||||
}).then((waku) => waku.start().then(() => waku)),
|
}).then((waku) => waku.start().then(() => waku)),
|
||||||
createPrivacyNode({
|
createPrivacyNode({
|
||||||
staticNoiseKey: NOISE_KEY_2,
|
staticNoiseKey: NOISE_KEY_2,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user