Commit Graph

370 Commits

Author SHA1 Message Date
Franck Royer 3b32987ecf
Add check in case user tries with incompatible wallet 2021-08-12 16:42:35 +10:00
Franck Royer 1e69811d8d
Use Web3 wallet for encryption instead of generated keys 2021-08-12 16:42:35 +10:00
Franck Royer 42ace51f35
Init commit Eth-PM Wallet 2021-08-12 16:06:09 +10:00
Franck Royer 6038007d40
No need for a wallet to send messages 2021-08-12 15:15:56 +10:00
Franck Royer a1218c1223
Refresh peer stats every second 2021-08-12 15:14:15 +10:00
Franck Royer 278439df82
Store encryption public key as byte array 2021-08-12 15:14:15 +10:00
Franck Royer 0bbe52ebb1
Rename ethdm*key to encryption*key
The naming was just confusing.
2021-08-12 15:14:15 +10:00
Franck Royer a2b6947b73
Add button to connect to wallet 2021-08-12 15:08:40 +10:00
Franck Royer 19c355e36b
Remove unnecessary parameter 2021-08-11 15:57:37 +10:00
Franck Royer 85231a288f
Simplify expression 2021-08-11 15:34:02 +10:00
Franck Royer eb04acd1a0
Fix format 2021-08-09 14:40:57 +10:00
Franck Royer 332d05e31d
Not sure why npm does that 2021-08-09 14:22:14 +10:00
Franck Royer fb89b78754
Do not run react tests
Unfortunately, there are issue with react-scripts (jest) and
multiformats: https://github.com/multiformats/js-multiformats/issues/110
2021-08-09 14:21:47 +10:00
Franck Royer be771d6619
This would have failed if the first node we connect to is NOT store 2021-08-09 12:36:53 +10:00
Franck Royer d3877ac26c
Simplify 2021-08-09 12:36:29 +10:00
Franck Royer 884190c971
Phrasing 2021-08-09 12:36:29 +10:00
Franck Royer ee5d627d14
Correct grammar 2021-08-09 12:36:28 +10:00
Franck Royer e52e564a31
Any value can be undefined 2021-08-09 12:36:28 +10:00
Franck Royer 8322d24ac1
Always clean up listeners! 2021-08-09 12:36:28 +10:00
Franck Royer f700367e62
Demonstrate how to wait for a store node peer 2021-08-09 12:36:28 +10:00
Franck Royer 3767dd75a7
store-react-js retrieves messages from store 2021-08-09 12:36:27 +10:00
Franck Royer dc9ea6dfac
Add Store example 2021-08-09 12:36:27 +10:00
Franck Royer 319f44a0b1
`WakuStore.queryHistory` throws when encountering an error
Instead of returning a `null` value.
2021-08-09 12:36:24 +10:00
Franck Royer b422c9a10b
Move `contentTopics` out the `WakuStore.queryHistory`'s optional params 2021-08-09 12:36:12 +10:00
Franck Royer ad9d629daa
`ChatMessage` has been moved from js-waku to web-chat example
It is a type used for the [TOY-CHAT](https://rfc.vac.dev/spec/22/)
 protocol;
js-waku users should not build on top if this toy protocol and instead
design message data structures appropriate to their use case.
2021-08-06 17:25:12 +10:00
Franck Royer 0c3995a810
Remove cli-chat example
The focus of this library is on Web environment; Several examples now
cover usage of Waku Relay and Waku Store; web-chat POC should be
preferred to use the [TOY-CHAT](https://rfc.vac.dev/spec/22/) protocol.
2021-08-06 17:25:11 +10:00
Franck Royer c13beae0d2
Include ReactJS in name min web chat name 2021-08-05 13:39:42 +10:00
Franck Royer 27feaaac4b
Revert "Run tests in parallel"
This reverts commit b8e7079b67.
2021-08-04 14:53:07 +10:00
Franck Royer b8e7079b67
Run tests in parallel
React build is quite long so best to run other linters in parallel.
2021-08-02 14:12:39 +10:00
Franck Royer dbc6662082
Touch up 2021-08-02 12:22:18 +10:00
Franck Royer 5a4f7d4468
Test by building
Cannot run react-scripts test with libp2p
due to
https://github.com/libp2p/js-libp2p/issues/961
2021-08-02 11:04:41 +10:00
Franck Royer f0fe7dce02
Fix TextDecoder error in tests 2021-08-02 10:45:11 +10:00
Franck Royer 943b1c2456
Add ReactJS Relay guide 2021-08-02 10:45:10 +10:00
Franck Royer f95e52c2ea
Remove reducer, fix timestamp 2021-08-02 10:45:10 +10:00
Franck Royer 2306bb1708
Add breakdown of what examples demonstrate
Also move explanation to each readme.
2021-08-02 10:45:10 +10:00
Franck Royer 1f370ae53e
Use protobuf 2021-08-02 10:45:09 +10:00
Franck Royer 7c715d8fa7
Display messages 2021-08-02 10:45:09 +10:00
Franck Royer 8a7f2401ea
Process incoming messages 2021-08-02 10:45:08 +10:00
Franck Royer 7c5382dfff
Send message 2021-08-02 10:45:08 +10:00
Franck Royer 3f6497634f
Bootstrap 2021-08-02 10:45:08 +10:00
Franck Royer 2ae9a6ca00
Create Waku 2021-08-02 10:45:08 +10:00
Franck Royer 1e64ac8f7c
create react app min-js-web-chat 2021-08-02 10:45:08 +10:00
Franck Royer d307342f7e
Simplify message handling to avoid re-rendering
Only retrieve historical messages when starting the app.

This allows avoid re-rendering issues. This is an example dApp. No need
to waste time on React optimisation.
2021-07-29 17:23:03 +10:00
Franck Royer 9aaac20981
Examples: Content Topic moved out of options parameter 2021-07-28 12:03:51 +10:00
Franck Royer 53ef23362c
Remove faulty fleet feature
It does not work as it can lead to infinite loops due to the handling of
the Waku instance. It should disconnect and reconnect to peers instead
of starting a new waku instance.
2021-07-28 11:58:02 +10:00
Franck Royer 36a5a51aa8
Upgrade to libp2p 0.32.0 2021-07-27 14:31:06 +10:00
Franck Royer 3bff44432a
Remove some vulnerable packages
Thanks to `npm audit`.
2021-07-20 15:30:15 +10:00
Franck Royer 1d4137e2c4
Rename so that it does make dev thinks it's for asymmetric enc only 2021-07-16 10:24:29 +10:00
Franck Royer addf9543a2
Export `generatePrivateKey` and `getPublicKey` directly from the root 2021-07-16 09:43:10 +10:00
Franck Royer 5c790a41c9
Add network info in toolbar 2021-07-15 14:37:30 +10:00
Franck Royer 53412e2fb4
New `/fleet` command to change target Status fleet 2021-07-15 14:25:59 +10:00
Franck Royer 9ffb33cdde
Make fleet environment part of the state 2021-07-15 14:14:45 +10:00
Franck Royer bc3b00b13e
Use `const` as setter should be used to change values 2021-07-15 14:11:00 +10:00
Franck Royer a8e2b908ba
Cleanup observers
And name function to avoid commenting.
2021-07-15 14:09:58 +10:00
Franck Royer 6e22897f74
Rename `stateWaku` to `waku`
There should only be one.
2021-07-15 14:08:07 +10:00
Franck Royer c2cef05c2d
Use protobuf instead of JSON for direct messages 2021-07-12 17:29:52 +10:00
Franck Royer 4ca440d27e
List relay and light push peers numbers instead of any peer 2021-07-12 17:13:28 +10:00
Franck Royer 7a0b947553
Add logs on light push 2021-07-12 17:10:05 +10:00
Franck Royer 48bdb0b3f2
Use WakuMessage version 1 instead of eth-crypto 2021-07-12 17:09:44 +10:00
Franck Royer 63923f4368
Prefer usage of utils 2021-07-09 16:06:49 +10:00
Franck Royer 8cd5a52eba
Provide hex/bytes utils as part of js-waku 2021-07-09 15:50:17 +10:00
Franck Royer 9ff1d87a8d
Use util function 2021-07-09 15:50:16 +10:00
Franck Royer 4f50ca1732
Align examples 2021-07-09 15:50:16 +10:00
Franck Royer 2266f31d30
Move optional parameters to a single `Options` object. 2021-07-09 15:50:15 +10:00
Franck Royer d00c1c874a
Do not fail if connection to one peer fails
As long as we connect to at least one peer then we can move forward.
2021-07-09 14:35:06 +10:00
Franck Royer 66d450ae36
Fix bad comparison logic 2021-07-09 14:35:06 +10:00
Franck Royer 44db58d2fd
Fix the dependencies 2021-07-09 14:35:04 +10:00
Franck Royer eec6de9f0c
Remove InitWaku component
There was an issue where the observers are added/removed continously.
This is due to using `useEffect` on props.

By removing this component then `useEffect` ends only being called when
 waku changes, ie, at initialisation.
2021-07-09 14:34:33 +10:00
Franck Royer 707979bf4c
Only use Prod nodes
js-waku maintains compatibility with latest nim-waku release, deployed
in the prod fleet.

js-waku may not be compatible with nim-waku master branch if backward
compatible changes were introduced.
2021-07-02 15:28:26 +10:00
Franck Royer c5419630fc
Define util function for hex<>buf conversions 2021-07-02 13:52:10 +10:00
Franck Royer a4dd8771f6
re-arrange app bar and display address in use 2021-07-02 13:45:22 +10:00
Franck Royer 5c3f768c83
Do not crash if Ethereum is locked 2021-07-02 13:27:50 +10:00
Franck Royer e59e9f4162
Fix typo 2021-07-02 11:44:04 +10:00
Franck Royer e9a1d88512
Fix Public Key Message validation and use it 2021-07-02 11:29:42 +10:00
Franck Royer 2f2f89cf65
Fix filtering of own messages 2021-07-02 11:29:41 +10:00
Franck Royer f020aa7a8c
Improve logging upon receiving messages 2021-07-02 10:54:56 +10:00
Franck Royer 3c618f435e
Fix typo 2021-07-02 10:52:46 +10:00
Franck Royer f9174cd3d2
Do not process Public Key Message if field is missing 2021-07-02 10:52:35 +10:00
Franck Royer 75297b9987
Display # of connections 2021-07-01 19:58:08 +10:00
Franck Royer dc2c09bd41
Change public key message encoding to protobuf 2021-07-01 14:37:07 +10:00
Franck Royer 90cdd5385c
Fix typo 2021-06-29 16:38:54 +10:00
Franck Royer 8c62105d95
Replace empty div with react fragment 2021-06-29 16:38:43 +10:00
Franck Royer 4284be142f
Fix spelling 2021-06-29 16:21:32 +10:00
Franck Royer b1a1c82de3
Use material ui list 2021-06-29 16:14:27 +10:00
Franck Royer a46a05a5ea
Move messaging components to single component 2021-06-29 15:53:59 +10:00
Franck Royer 5bc0eddd3a
Move messaging components to module 2021-06-29 15:46:07 +10:00
Franck Royer 31d0efc8d2
Organise elements in fieldboxes 2021-06-29 15:32:29 +10:00
Franck Royer 5661c7d1ec
Do not attempt to decrypt other's messages 2021-06-29 12:46:42 +10:00
Franck Royer 6921242877
Extract waku initialisation in separate component 2021-06-29 12:30:57 +10:00
Franck Royer 5de030d3ca
Deconstruct properties for more concise code 2021-06-29 12:10:24 +10:00
Franck Royer 53182e834d
Extract Key Pair Handling as separate component 2021-06-29 12:05:16 +10:00
Franck Royer b677b0eb7b
Use Key Pair terminology for eth-dm keypair 2021-06-29 11:56:49 +10:00
Franck Royer f9152f24b0
Move key handling modules to common dir 2021-06-29 11:52:48 +10:00
Franck Royer 9a68cc2a86
Encrypt KeyPair before saving to storage 2021-06-28 16:18:12 +10:00
Franck Royer 47a27a0969
Replace deprecated method 2021-06-28 13:54:22 +10:00
Franck Royer 820307ef8c
Do not list own public key as recipient 2021-06-25 16:18:15 +10:00
Franck Royer 452f4285eb
Move most EthCrypto usage to crypto.ts 2021-06-25 16:18:15 +10:00
Franck Royer 93665feac8
Generate fresh new keypair, do not use signature as entropy 2021-06-25 16:18:15 +10:00
Franck Royer bd0ad81d17
Disable generate button if key is already present 2021-06-25 16:18:15 +10:00
Franck Royer d6d548a09e
Save private key in storage
In clear for now.
2021-06-25 16:18:14 +10:00
Franck Royer 01c1c253b4
Install linter 2021-06-22 13:21:24 +10:00
Franck Royer 3a7c7a1bb7
Fix spelling 2021-06-22 13:21:23 +10:00
Franck Royer ce2bfde12d
Remove webvitals 2021-06-22 13:21:23 +10:00
Franck Royer b3bb363a50
Upgrade node types 2021-06-22 13:21:23 +10:00
Franck Royer 0425821ea3
Remove all tests
Issue with `TextDecoder is not defined` and we are not testing anything
at the moment.
2021-06-22 13:21:23 +10:00
Franck Royer 891897fe63
Remove test as not able to run it with waffle
The PoC works so we know the functionality is here, this was here
to prevent regression.
2021-06-22 13:21:23 +10:00
Franck Royer 68faba24c1
Move Eth-DM notes to root dir 2021-06-21 15:48:56 +10:00
Franck Royer 73abcdda46
Prod build uses prod fleet 2021-06-21 14:49:18 +10:00
Franck Royer 85b4879410
Concatenate signature to have enough entropy for eth-crypto 2021-06-21 13:51:11 +10:00
Franck Royer af2b2691f1
The signature is an hex string, not utf-8 2021-06-21 13:26:33 +10:00
Franck Royer f05e3a6bb3
Add key to list items 2021-06-18 15:18:37 +10:00
Franck Royer c6f73199cb
Remove unused import 2021-06-18 15:12:12 +10:00
Franck Royer 66fcb2e48b
Enable recipient selection and message input 2021-06-18 15:11:54 +10:00
Franck Royer 0c825fe391
Use lightpush for all messages 2021-06-18 15:11:09 +10:00
Franck Royer 6e54e65131
Use material UI 2021-06-18 13:53:12 +10:00
Franck Royer 41533d51e5
Prettier message display 2021-06-18 10:04:38 +10:00
Franck Royer 11f92df0ba
Use light push instead of relay
See #209.
2021-06-17 16:24:05 +10:00
Franck Royer 0c6cb64b72
Ensure observers are deleted 2021-06-17 16:24:05 +10:00
Franck Royer 8e8e3a366c
Only use test fleet for now 2021-06-17 16:24:05 +10:00
Franck Royer ddf6a9501a
Fix for metamask 2021-06-17 16:24:04 +10:00
Franck Royer fc987f8f58
Publish eth-dm on GH pages 2021-06-17 16:24:04 +10:00
Franck Royer 7dcb52444b
Display waku readiness 2021-06-17 16:24:04 +10:00
Franck Royer 4e7f75868f
Clean up observer when component dismount 2021-06-17 10:41:00 +10:00
Franck Royer 1d3f0e4c8a
Use npm
As it better handles file dependencies by creating a symlink.
2021-06-17 10:41:00 +10:00
Franck Royer 3fa1574696
Display direct messages 2021-06-17 10:41:00 +10:00
Franck Royer 329ed71fb6
Remove unused component 2021-06-17 10:40:59 +10:00
Franck Royer ed5b7ba542
Send Dummy messages 2021-06-17 10:40:59 +10:00
Franck Royer 69033f4ea5
Receive public key from network and verify it 2021-06-17 10:40:59 +10:00
Franck Royer 3bd6b76916
Publish public key to waku network 2021-06-17 10:40:59 +10:00
Franck Royer ee38388326
Init repo, add crypto functions 2021-06-17 10:40:59 +10:00
Franck Royer 939b5fb20a
Auto select peer if none provided for store and light push protocols 2021-06-16 23:51:20 +10:00
Franck Royer c293e268e8
Do not send message if a modifier is pressed to enable multiline msgs 2021-06-11 14:38:31 +10:00
Franck Royer 8073021d82
Do not fail if a chat message is malformed 2021-06-11 14:38:22 +10:00
Franck Royer 1bb1f8f6b6
Use tcp protocol only
Due to #201, Websocket protocol is not added by default if the caller
specifies a protocol for libp2p.

In the case cli-chat. We were using both tcp and ws.
As the web-chat already demonstrates usage of websocket protocol, we
cli-chat to tcp only.
2021-06-09 16:58:08 +10:00
Franck Royer f17a008278
Separate the libp2p create options from Waku's 2021-06-09 15:00:02 +10:00
Franck Royer 0d00328715
Split useEffect calls
Better React practice.
2021-06-04 15:25:53 +10:00
Franck Royer 6b48c55266
Persist nick 2021-06-04 15:15:07 +10:00
Franck Royer b90b66c5f6
Add comment 2021-06-04 14:59:40 +10:00
Franck Royer 03febcc276
Update toy-chat content topic
As per https://github.com/status-im/nim-waku/pull/583
2021-06-03 17:54:46 +10:00
Franck Royer 553c0154d9
Use waku message timestamp as better unique key 2021-05-28 22:38:00 +10:00
Franck Royer ca74f7f87a
Update chat content topic to new testnet value
Resolves #180
2021-05-28 14:32:05 +10:00
Franck Royer f23310aaf5
Remove outdated comment 2021-05-19 12:29:30 +10:00
Franck Royer 90e224577f
Add `--help` command 2021-05-19 12:29:30 +10:00
Franck Royer 2ea17bfdfa
Use light push to send messages if it's passed 2021-05-19 12:29:29 +10:00
Franck Royer fb7e9f2b9e
Get messages from store in chronological order 2021-05-19 12:29:29 +10:00
Franck Royer c4c259f47a
Connect cli chat to prod fleet upon passing `--prod` 2021-05-18 13:51:11 +10:00
Franck Royer a69c483c46
Connect to prod fleet by default, test fleet for local development 2021-05-18 13:51:11 +10:00
Franck Royer 3f5484f6ed
Use callback option in web-chat 2021-05-17 16:32:34 +10:00
Franck Royer 4b6fe84392
Use one object as we are increasing the number of parameters 2021-05-17 16:32:33 +10:00
Franck Royer 79bef35460
Add and use `getStatusFleetNodes` to connect to Status' wakunodes 2021-05-15 19:52:05 +10:00
Franck Royer c6ce32dc54
Enable dialing several nodes 2021-05-15 19:45:24 +10:00
Franck Royer 0dc2ee8d40
Use status fleet instead of jdev 2021-05-14 15:49:35 +10:00
Franck Royer 89b35eb4df
Disable send button if no peer available
Yet keep it enabled if user tries to send a command.

Resolves #136
2021-05-13 20:48:33 +10:00
Franck Royer 065593b0cf
Revert naming to js-waku
To align with go-waku and nim-waku and keep bors working.
2021-05-13 20:27:38 +10:00
Franck Royer 6f7c1e0ca3
Enhance addPeerToAddressBook
So that consumer does not need to import multiaddr and peer-id.
2021-05-13 13:42:40 +10:00
Franck Royer 82d026c6d5
Rename repo to waku-js 2021-05-13 11:01:41 +10:00
Franck Royer 702201f7be
Set first release version to 0.1.0 2021-05-13 11:01:41 +10:00
Franck Royer 43627d27d8
Rename package to waku-js 2021-05-13 10:36:28 +10:00
Franck Royer 28572fccff
Rename to web3-waku in examples 2021-05-11 14:05:13 +10:00
Franck Royer 3663ce260d
Rework exports for an easy use of the library 2021-05-10 16:41:58 +10:00
Franck Royer 83c17fdcc2
Remove ChatMessage
The aim of this class was to remove the items in the chat list
with duplicate keys. However, the implementation does not achieve this
goal.
2021-05-10 16:35:55 +10:00
Franck Royer e91f7933c9
Pass proto in constructor
Makes the relation between the protobuf class and the wrapper more
direct. Conversion only happens at creates or on getters.
2021-05-10 16:29:25 +10:00
Franck Royer ba6b67cc53
Enable observers to filter by contentTopic 2021-05-10 14:54:08 +10:00
Franck Royer 54f32bacad
Use new observer interface in examples 2021-05-10 12:38:44 +10:00
Franck Royer a6d815974e
Connect to 2 test fleet nodes 2021-05-07 10:41:38 +10:00
Franck Royer 775a288a5c
Log more around usage of waku store 2021-05-07 10:41:38 +10:00
Franck Royer 381151a29a
Connect directly to websockify
To avoid websocket timeout issue
2021-05-06 11:48:01 +10:00
Franck Royer 94ff4ca40f
Use one cspell file for all project inc examples 2021-05-05 16:40:23 +10:00
Franck Royer 316edff778
Move web-chat to examples folder 2021-05-05 16:35:14 +10:00
Franck Royer abd5709f86
Move cli chat to examples folder 2021-05-05 10:53:40 +10:00