use new api
This commit is contained in:
parent
22ec6ae33b
commit
52c62fea12
|
@ -1,8 +1,7 @@
|
||||||
import * as React from "react";
|
import * as React from "react";
|
||||||
import protobuf from "protobufjs";
|
import protobuf from "protobufjs";
|
||||||
import { createRelayNode } from "@waku/create";
|
import { createRelayNode } from "@waku/create";
|
||||||
import { waitForRemotePeer } from "@waku/core";
|
import { createDecoder, createEncoder, waitForRemotePeer } from "@waku/core";
|
||||||
import { createDecoder, createEncoder } from "@waku/core";
|
|
||||||
|
|
||||||
const ContentTopic = `/js-waku-examples/1/chat/proto`;
|
const ContentTopic = `/js-waku-examples/1/chat/proto`;
|
||||||
const Encoder = createEncoder(ContentTopic);
|
const Encoder = createEncoder(ContentTopic);
|
||||||
|
|
|
@ -1,12 +1,11 @@
|
||||||
import * as React from "react";
|
import * as React from "react";
|
||||||
import protobuf from "protobufjs";
|
import protobuf from "protobufjs";
|
||||||
import { createLightNode } from "@waku/create";
|
import { createLightNode } from "@waku/create";
|
||||||
import { waitForRemotePeer } from "@waku/core";
|
import { waitForRemotePeer, createDecoder } from "@waku/core";
|
||||||
import { Decoder } from "@waku/core/lib/message/version_0";
|
|
||||||
import { bytesToUtf8 } from "@waku/byte-utils";
|
import { bytesToUtf8 } from "@waku/byte-utils";
|
||||||
|
|
||||||
const ContentTopic = "/toy-chat/2/huilong/proto";
|
const ContentTopic = "/toy-chat/2/huilong/proto";
|
||||||
const decoder = new Decoder(ContentTopic);
|
const decoder = createDecoder(ContentTopic);
|
||||||
|
|
||||||
const ProtoChatMessage = new protobuf.Type("ChatMessage")
|
const ProtoChatMessage = new protobuf.Type("ChatMessage")
|
||||||
.add(new protobuf.Field("timestamp", 1, "uint64"))
|
.add(new protobuf.Field("timestamp", 1, "uint64"))
|
||||||
|
|
Loading…
Reference in New Issue