GithubHelp home page GithubHelp logo

hexafluoride / chordette Goto Github PK

View Code? Open in Web Editor NEW
4.0 4.0 3.0 547 KB

Simplified implementation of the Chord DHT model for learning purposes

License: MIT License

C# 100.00%
chord chord-protocol csharp dht p2p

chordette's People

Contributors

hexafluoride avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar

chordette's Issues

Implement networking

To facilitate communication across Chordette peers running in different processes, there needs to be a networking layer. I see two practical approaches to this:

  • making sure that all accesses to the Nodes[id] object communicate with the real peer identified by id, by creating a type (RemoteNode?) that inherits from Node (or perhaps an INode) and exposes remote properties/methods, therefore acting like a first-class Node
  • replacing all instances of Nodes[id] with explicit networking code

I'm using the notation Nodes[id] to refer to how it is used in Node.cs (click for an example)

The former approach would be more elegant, but would also introduce more complexity. The latter approach would be simpler, with less elegant code. I'm leaning heavily towards the former. I will collect data on how the code I've written makes use of Nodes[id], and I'll document my findings under this issue.

Error in building on Windows Visual Studio 2022

Hello,

I just started looking at your library and tried to compile it with my C# VS 2022 but got an error.

Severity	Code	Description	Project	File	Line	Suppression State

Error	CS1061	'Node' does not contain a definition for 'Peers' and no accessible extension method 'Peers' accepting a first argument of type 'Node' could be found (are you missing a using directive or an assembly reference?)	Chordette.Benchmark	C:\NET\P2P\Chord-p2p\Chordette\Chordette.Benchmark\Program.cs	200	Active

Warning	CS0168	The variable 'ex' is declared but never used	Chordette	C:\NET\P2P\Chord-p2p\Chordette\Chordette\Node.cs	167	Active

Warning	NETSDK1138	The target framework 'netcoreapp2.2' is out of support and will not receive security updates in the future. Please refer to https://aka.ms/dotnet-core-support for more information about the support policy.	Chordette	C:\Program Files\dotnet\sdk\6.0.202\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.EolTargetFrameworks.targets	28	

Warning	NETSDK1138	The target framework 'netcoreapp2.2' is out of support and will not receive security updates in the future. Please refer to https://aka.ms/dotnet-core-support for more information about the support policy.	Chordette.Benchmark	C:\Program Files\dotnet\sdk\6.0.202\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.EolTargetFrameworks.targets	28	

Warning	NETSDK1138	The target framework 'netcoreapp2.2' is out of support and will not receive security updates in the future. Please refer to https://aka.ms/dotnet-core-support for more information about the support policy.	Chordette.Tests	C:\Program Files\dotnet\sdk\6.0.202\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.EolTargetFrameworks.targets	28	

Can you please help?

Sometimes bootstrapping fails

As "joiner" nodes are picked randomly, this can be remedied by simply restarting Chordette until you get a "good" combination of nodes joining through other nodes.

If you get a "bad" combination, Chordette seems to hang with no error messages and 100% CPU usage. Breaking with a debugger shows that FindPredecessor never exits its while loop.

Dockerize Peer Nodes + Deploy Load-Balanced Kubernetes Swarm

Hi hexafluoride,

great work! But wouldn't it be nice to deploy your peers as docker microservice containers? I've seen that your code already uses the localhost network interface, so communication between real nodes via ethernet should already be possible.

The solution is not too hard, as Microsoft offers official docker images with pre-installed dotnet core on DockerHub, so the Dockerfile for creating images is pretty simple by implementing following commands (see https://docs.docker.com/engine/examples/dotnetcore/):

  1. copy the source code into the image
  2. build the source code, do some unit tests and package the build output
  3. copy the binary files to the runtime image
  4. create an entrypoint that starts a daemon process serving a chord protocol endpoint

Starting real peer tests could be done by some kubernetes files, starting a load-balanced swarm of peers that can then be triggered from outside to perform some key lookups as test.

I don't know the focus of this project, but I could help you with the dockerization if you're interested.

Best wishes
Marco

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.