mirror of
https://github.com/waku-org/js-waku.git
synced 2025-01-11 21:15:01 +00:00
Rename package to waku-js
This commit is contained in:
parent
18b8a9f23e
commit
43627d27d8
@ -4,16 +4,16 @@ A JavaScript implementation of the [Waku v2 protocol](https://rfc.vac.dev/spec/1
|
|||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
Install `web3-waku` package:
|
Install `waku-js` package:
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
npm install web3-waku
|
npm install waku-js
|
||||||
```
|
```
|
||||||
|
|
||||||
Start a waku node:
|
Start a waku node:
|
||||||
|
|
||||||
```javascript
|
```javascript
|
||||||
import { Waku } from 'web3-waku';
|
import { Waku } from 'waku-js';
|
||||||
|
|
||||||
const waku = await Waku.create();
|
const waku = await Waku.create();
|
||||||
```
|
```
|
||||||
@ -47,7 +47,7 @@ waku.relay.addObserver((msg) => {
|
|||||||
Send a message on the waku relay network:
|
Send a message on the waku relay network:
|
||||||
|
|
||||||
```javascript
|
```javascript
|
||||||
import { WakuMessage } from 'web3-waku';
|
import { WakuMessage } from 'waku-js';
|
||||||
|
|
||||||
const msg = WakuMessage.fromUtf8String("Here is a message!", "waku/2/my-cool-app/proto")
|
const msg = WakuMessage.fromUtf8String("Here is a message!", "waku/2/my-cool-app/proto")
|
||||||
await waku.relay.send(msg);
|
await waku.relay.send(msg);
|
||||||
|
6
examples/cli-chat/package-lock.json
generated
6
examples/cli-chat/package-lock.json
generated
@ -11,7 +11,7 @@
|
|||||||
"dependencies": {
|
"dependencies": {
|
||||||
"libp2p-tcp": "^0.15.4",
|
"libp2p-tcp": "^0.15.4",
|
||||||
"prompt-sync": "^4.2.0",
|
"prompt-sync": "^4.2.0",
|
||||||
"web3-waku": "../../build/main"
|
"waku-js": "../../build/main"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@istanbuljs/nyc-config-typescript": "^1.0.1",
|
"@istanbuljs/nyc-config-typescript": "^1.0.1",
|
||||||
@ -7509,7 +7509,7 @@
|
|||||||
"integrity": "sha512-jkjy6pjU1fxUvI51P+gCsxg1u2n8LSt0W6KrCNQceaziKzff74GoWmjVG46KieVzybO1sttPQmYfrwSHey7GUA==",
|
"integrity": "sha512-jkjy6pjU1fxUvI51P+gCsxg1u2n8LSt0W6KrCNQceaziKzff74GoWmjVG46KieVzybO1sttPQmYfrwSHey7GUA==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"node_modules/web3-waku": {
|
"node_modules/waku-js": {
|
||||||
"resolved": "../../build/main",
|
"resolved": "../../build/main",
|
||||||
"link": true
|
"link": true
|
||||||
},
|
},
|
||||||
@ -13563,7 +13563,7 @@
|
|||||||
"integrity": "sha512-jkjy6pjU1fxUvI51P+gCsxg1u2n8LSt0W6KrCNQceaziKzff74GoWmjVG46KieVzybO1sttPQmYfrwSHey7GUA==",
|
"integrity": "sha512-jkjy6pjU1fxUvI51P+gCsxg1u2n8LSt0W6KrCNQceaziKzff74GoWmjVG46KieVzybO1sttPQmYfrwSHey7GUA==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"web3-waku": {
|
"waku-js": {
|
||||||
"version": "file:../../build/main"
|
"version": "file:../../build/main"
|
||||||
},
|
},
|
||||||
"which": {
|
"which": {
|
||||||
|
@ -33,7 +33,7 @@
|
|||||||
"dependencies": {
|
"dependencies": {
|
||||||
"libp2p-tcp": "^0.15.4",
|
"libp2p-tcp": "^0.15.4",
|
||||||
"prompt-sync": "^4.2.0",
|
"prompt-sync": "^4.2.0",
|
||||||
"web3-waku": "../../build/main"
|
"waku-js": "../../build/main"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@istanbuljs/nyc-config-typescript": "^1.0.1",
|
"@istanbuljs/nyc-config-typescript": "^1.0.1",
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import { expect } from 'chai';
|
import { expect } from 'chai';
|
||||||
import { ChatMessage } from 'web3-waku';
|
import { ChatMessage } from 'waku-js';
|
||||||
|
|
||||||
import { formatMessage } from './chat';
|
import { formatMessage } from './chat';
|
||||||
|
|
||||||
|
@ -3,7 +3,7 @@ import util from 'util';
|
|||||||
|
|
||||||
import TCP from 'libp2p-tcp';
|
import TCP from 'libp2p-tcp';
|
||||||
import { multiaddr, Multiaddr } from 'multiaddr';
|
import { multiaddr, Multiaddr } from 'multiaddr';
|
||||||
import { ChatMessage, StoreCodec, Waku, WakuMessage } from 'web3-waku';
|
import { ChatMessage, StoreCodec, Waku, WakuMessage } from 'waku-js';
|
||||||
|
|
||||||
const ChatContentTopic = 'dingpu';
|
const ChatContentTopic = 'dingpu';
|
||||||
|
|
||||||
|
18
examples/web-chat/package-lock.json
generated
18
examples/web-chat/package-lock.json
generated
@ -11,8 +11,8 @@
|
|||||||
"react": "^16.14.0",
|
"react": "^16.14.0",
|
||||||
"react-dom": "^16.14.0",
|
"react-dom": "^16.14.0",
|
||||||
"server-name-generator": "^1.0.5",
|
"server-name-generator": "^1.0.5",
|
||||||
"web-vitals": "^1.1.1",
|
"waku-js": "../../build/main",
|
||||||
"web3-waku": "../../build/main"
|
"web-vitals": "^1.1.1"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@testing-library/jest-dom": "^5.11.10",
|
"@testing-library/jest-dom": "^5.11.10",
|
||||||
@ -22885,6 +22885,10 @@
|
|||||||
"node": ">=10"
|
"node": ">=10"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/waku-js": {
|
||||||
|
"resolved": "../../build/main",
|
||||||
|
"link": true
|
||||||
|
},
|
||||||
"node_modules/walker": {
|
"node_modules/walker": {
|
||||||
"version": "1.0.7",
|
"version": "1.0.7",
|
||||||
"resolved": "https://registry.npmjs.org/walker/-/walker-1.0.7.tgz",
|
"resolved": "https://registry.npmjs.org/walker/-/walker-1.0.7.tgz",
|
||||||
@ -23226,10 +23230,6 @@
|
|||||||
"resolved": "https://registry.npmjs.org/web-vitals/-/web-vitals-1.1.1.tgz",
|
"resolved": "https://registry.npmjs.org/web-vitals/-/web-vitals-1.1.1.tgz",
|
||||||
"integrity": "sha512-jYOaqu01Ny1NvMwJ3dBJDUOJ2PGWknZWH4AUnvFOscvbdHMERIKT2TlgiAey5rVyfOePG7so2JcXXZdSnBvioQ=="
|
"integrity": "sha512-jYOaqu01Ny1NvMwJ3dBJDUOJ2PGWknZWH4AUnvFOscvbdHMERIKT2TlgiAey5rVyfOePG7so2JcXXZdSnBvioQ=="
|
||||||
},
|
},
|
||||||
"node_modules/web3-waku": {
|
|
||||||
"resolved": "../../build/main",
|
|
||||||
"link": true
|
|
||||||
},
|
|
||||||
"node_modules/webidl-conversions": {
|
"node_modules/webidl-conversions": {
|
||||||
"version": "6.1.0",
|
"version": "6.1.0",
|
||||||
"resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-6.1.0.tgz",
|
"resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-6.1.0.tgz",
|
||||||
@ -43270,6 +43270,9 @@
|
|||||||
"xml-name-validator": "^3.0.0"
|
"xml-name-validator": "^3.0.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"waku-js": {
|
||||||
|
"version": "file:../../build/main"
|
||||||
|
},
|
||||||
"walker": {
|
"walker": {
|
||||||
"version": "1.0.7",
|
"version": "1.0.7",
|
||||||
"resolved": "https://registry.npmjs.org/walker/-/walker-1.0.7.tgz",
|
"resolved": "https://registry.npmjs.org/walker/-/walker-1.0.7.tgz",
|
||||||
@ -43568,9 +43571,6 @@
|
|||||||
"resolved": "https://registry.npmjs.org/web-vitals/-/web-vitals-1.1.1.tgz",
|
"resolved": "https://registry.npmjs.org/web-vitals/-/web-vitals-1.1.1.tgz",
|
||||||
"integrity": "sha512-jYOaqu01Ny1NvMwJ3dBJDUOJ2PGWknZWH4AUnvFOscvbdHMERIKT2TlgiAey5rVyfOePG7so2JcXXZdSnBvioQ=="
|
"integrity": "sha512-jYOaqu01Ny1NvMwJ3dBJDUOJ2PGWknZWH4AUnvFOscvbdHMERIKT2TlgiAey5rVyfOePG7so2JcXXZdSnBvioQ=="
|
||||||
},
|
},
|
||||||
"web3-waku": {
|
|
||||||
"version": "file:../../build/main"
|
|
||||||
},
|
|
||||||
"webidl-conversions": {
|
"webidl-conversions": {
|
||||||
"version": "6.1.0",
|
"version": "6.1.0",
|
||||||
"resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-6.1.0.tgz",
|
"resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-6.1.0.tgz",
|
||||||
|
@ -8,8 +8,8 @@
|
|||||||
"react": "^16.14.0",
|
"react": "^16.14.0",
|
||||||
"react-dom": "^16.14.0",
|
"react-dom": "^16.14.0",
|
||||||
"server-name-generator": "^1.0.5",
|
"server-name-generator": "^1.0.5",
|
||||||
"web-vitals": "^1.1.1",
|
"waku-js": "../../build/main",
|
||||||
"web3-waku": "../../build/main"
|
"web-vitals": "^1.1.1"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@testing-library/jest-dom": "^5.11.10",
|
"@testing-library/jest-dom": "^5.11.10",
|
||||||
|
@ -2,7 +2,7 @@ import { multiaddr } from 'multiaddr';
|
|||||||
import PeerId from 'peer-id';
|
import PeerId from 'peer-id';
|
||||||
import { useEffect, useState } from 'react';
|
import { useEffect, useState } from 'react';
|
||||||
import './App.css';
|
import './App.css';
|
||||||
import { ChatMessage, WakuMessage, StoreCodec, Waku } from 'web3-waku';
|
import { ChatMessage, WakuMessage, StoreCodec, Waku } from 'waku-js';
|
||||||
import handleCommand from './command';
|
import handleCommand from './command';
|
||||||
import Room from './Room';
|
import Room from './Room';
|
||||||
import { WakuContext } from './WakuContext';
|
import { WakuContext } from './WakuContext';
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import { useEffect, useRef, useState } from 'react';
|
import { useEffect, useRef, useState } from 'react';
|
||||||
import { ChatMessage } from 'web3-waku';
|
import { ChatMessage } from 'waku-js';
|
||||||
import {
|
import {
|
||||||
Message,
|
Message,
|
||||||
MessageText,
|
MessageText,
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { ChatMessage, WakuMessage } from 'web3-waku';
|
import { ChatMessage, WakuMessage } from 'waku-js';
|
||||||
import { ChatContentTopic } from './App';
|
import { ChatContentTopic } from './App';
|
||||||
import ChatList from './ChatList';
|
import ChatList from './ChatList';
|
||||||
import MessageInput from './MessageInput';
|
import MessageInput from './MessageInput';
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import { createContext, useContext } from 'react';
|
import { createContext, useContext } from 'react';
|
||||||
import { Waku } from 'web3-waku';
|
import { Waku } from 'waku-js';
|
||||||
|
|
||||||
export type WakuContextType = {
|
export type WakuContextType = {
|
||||||
waku?: Waku;
|
waku?: Waku;
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import { multiaddr } from 'multiaddr';
|
import { multiaddr } from 'multiaddr';
|
||||||
import PeerId from 'peer-id';
|
import PeerId from 'peer-id';
|
||||||
import { Waku } from 'web3-waku';
|
import { Waku } from 'waku-js';
|
||||||
|
|
||||||
function help(): string[] {
|
function help(): string[] {
|
||||||
return [
|
return [
|
||||||
|
4
package-lock.json
generated
4
package-lock.json
generated
@ -1,11 +1,11 @@
|
|||||||
{
|
{
|
||||||
"name": "web3-waku",
|
"name": "waku-js",
|
||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
"lockfileVersion": 2,
|
"lockfileVersion": 2,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "web3-waku",
|
"name": "waku-js",
|
||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
"license": "MIT OR Apache-2.0",
|
"license": "MIT OR Apache-2.0",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"name": "web3-waku",
|
"name": "waku-js",
|
||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
"description": "TypeScript implementation of the Waku v2 protocol",
|
"description": "TypeScript implementation of the Waku v2 protocol",
|
||||||
"main": "build/main/index.js",
|
"main": "build/main/index.js",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user