Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Peer Discovery Code #40

Merged
merged 3 commits into from
Jun 15, 2020
Merged

Add Peer Discovery Code #40

merged 3 commits into from
Jun 15, 2020

Conversation

robert-cronin
Copy link
Contributor

@robert-cronin robert-cronin commented Jun 4, 2020

This PR will include a PeerStore for keeping track of PeerInfo. A multicast broadcasting class for peer discovery on the same LAN and various other bug fixes (e.g. relative @ imports).

Edit: this PR now also includes a mechanism for discovering a social user via a handle (robert-cronin) and a service (github) - relates to #41

Fixes MatrixAI/TypeScript-Demo-Lib#1

Copy link
Member

@CMCDragonkai CMCDragonkai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As a general note. This is awesome. But we need to discuss domain modelling details.

bin/initPolykey.ts Show resolved Hide resolved
bin/initPolykey.ts Show resolved Hide resolved
bin/keymanager/KeyManager.ts Outdated Show resolved Hide resolved
dist/P2P/MulticastPeerDiscovery.js Outdated Show resolved Hide resolved
src/KeyManager.ts Outdated Show resolved Hide resolved
src/P2P/PeerDiscovery.ts Outdated Show resolved Hide resolved
src/PeerStore/PeerStore.ts Outdated Show resolved Hide resolved
src/Polykey.ts Outdated Show resolved Hide resolved
src/RPC/PeerInfoMessage.proto Outdated Show resolved Hide resolved
tests/RPC/RPCMessage.test.ts Show resolved Hide resolved
@CMCDragonkai
Copy link
Member

CMCDragonkai commented Jun 11, 2020 via email

@CMCDragonkai
Copy link
Member

CMCDragonkai commented Jun 11, 2020 via email

@robert-cronin robert-cronin force-pushed the add-peer-discovery branch 3 times, most recently from d8b891a to e7c592c Compare June 12, 2020 05:51
@robert-cronin
Copy link
Contributor Author

robert-cronin commented Jun 15, 2020

So from our previous meeting I have removed a lot of methods from the Polykey class and put them in their respective classes according to which domain model they belong to.

@CMCDragonkai
Copy link
Member

Can you give a brief description of what was done so I know what was applied on a high level from our discussion.

webpack.config.js Outdated Show resolved Hide resolved
@robert-cronin
Copy link
Contributor Author

robert-cronin commented Jun 15, 2020

Can you give a brief description of what was done so I know what was applied on a high level from our discussion.

So the main changes are:

  • Move domain model concerns to relevant classes (i.e. vault operations to Vault.ts, crypto operations to KeyManager.ts etc.)
  • Added a web worker for the crypto operations (KeyManagerWorker.ts)
  • Tied the starting of the multicast peer discovery server to its initialisation
  • Made UDP multicast port optional environment variables
  • Added ability to add more social discovery services to PeerDiscovery class

Note: I think it's probably better if I do WIP commits with good descriptions from now on and leave the squashing to the end for more clarity for the reviewer.

@CMCDragonkai
Copy link
Member

I'd like to see more integration tests in the near future for this kind of code especially as it interacts with the network. But also all the edgecases, we'll have to plan that out.

I'm going to approve for merging so you can start synchronizing the other work.

@CMCDragonkai CMCDragonkai merged commit 3c1c487 into master Jun 15, 2020
@CMCDragonkai
Copy link
Member

Woops I was trying the Github merge options. But I think it just left the WIP commits there. Not a big deal, but need to remember to use the squash option, not rebase option.

@CMCDragonkai
Copy link
Member

I've rebased and squashed so the master is clean again.

@CMCDragonkai
Copy link
Member

Delete the above branch if you don't need it again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
development Standard development
Development

Successfully merging this pull request may close these issues.

Using ts-node with @ imports
2 participants