Chris Swithinbank
Chris Swithinbank
For the full state to be present on all clients, the host would presumably have to send over the full database state to a connecting peer on connection. This would...
Nice idea! Do you think we could implement that already? Currently each client has a metadata object for itself: https://github.com/boardgameio/p2p/blob/7066e90777c10a5eea85ce261f57579714de1711/src/index.ts#L106-L108 Which we send as part of the initial connection to...
Cool, thanks! I’ll try to read through those changes soon (I don’t know much about cryptography so I’m a bit slow). If you want to try it out in a...
Great to hear! I should have time over the weekend to take a look at your changes — look forward to it 😄
Hi @jonaswre, I’m just trying out your changes with the example code and I get a `TypeError: invalid encoding` thrown by [the call to `decodeBase64` in `verifyMessage`](https://github.com/jonaswre/p2p/blob/798e8cc835fd8ebfe2d91ef1b44452fc6dab3202/src/authentication.ts#L8). Did you see...
The tests pass. I’m reading through in detail and now I see the `keyPair` option. I’m guessing I maybe have to provide that for this to work?
Oh, I see now that actually you provide a default in the constructor, so it’s not that… My steps to reproduce are: 1. Run `npm start` to serve the demo....
Ahh, I think I see the issue. If `credentials` is set, that value gets sent (instead of the public key, which is only used when `credentials` isn’t provided): https://github.com/boardgameio/p2p/blob/5241c4deb16b18a2ce0d6e5422fc086f29910a7f/src/index.ts#L118-L119 The...
> Ahh I see the Issue... Exactly! I need to think what could be a better public API for this.
That looks good. I was trying something like this, but just using `decodeUTF8` looks much nicer 🤣 ```js const credentials = "my-wordy-credentials"; const seed = Uint8Array.from( [...credentials] .slice(0, 32) //...