🚀 Dev Research Project!
Tags: devgrad2020, octograd2020, githubsdp
Published: 2020-05-20 21:32:32

### `Info!`
In my fall 2019 semester (meant to be my last but became 2nd last), I applied for Undergrad research and worked on researching how blockchain works. My part of the research was to implement a simple yet functional blockchain that demonstrates the basics of it. It was a definitely a challenge considering I was taking 18 credits and had little room for another semester long project but worth it! 

### `Demo Link`
 The demo link can be found on `http://localhost:5000/`! You will notice the webpage will say *Unable to connect :(* and you read that right! You will need to fork the project from GitHub and follow the setup process to run it: https://github.com/Yucked/Breadloaf#%EF%B8%8F-setup

### `Link to Code`
The code can be found on GitHub, it is by no means a finished or polished product.

{% github Yucked/Breadloaf %}

### `How I built it?`
You ask an amazing question, wizard! It took me sometime to decide on what language/framework I wanted to use. For language it was either going to be C# or Python but since I'm a sucker for C# so yeah... that was a no brainer for me. 

Next up was the application design and framework. Initially, I went with a simple .NET Core console application but once I realized I was going to be presenting to an audience that may not understand what my console is outputting, it became crucial for me to have some sort of visuals in my application.

Just around that time, Blazor was popping up and I thought hmmmm. Yes, all it took was a hmmmm and I moved everything to Blazor.

So, now my project breakdown was as follow:
`Breadloaf.Models:` Everything regarding my "blockchain".
`Breadloaf:` Where Blazor and Models come together in harmony.
`tests:` Testing models to make sure they do what I need them to do.

Blazor is essentially ASP.NET Core MVC template with additional stuff added.

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/plrzr46olel4hhkgtdl0.jpg)

So anyway, I started blasting. Bulma came to the rescue and I started designing. 

> The main page with my research abstract.
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/v4jf2s9bxjl4j6uocpex.png)


> Explaining what a block is and let's you generate blocks.
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/lv8sm8urgz84n2sbaoc3.png)

> Visualizing the whole chain.
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/5jxkw6wdoyf9v36agzcx.png)

I was able to visualize my project and I'm proud of it! The only thing left was to create some sort of P2P and that's where everything went downhill. Since, Blazor supports SignalR and encourages using that, I just wanted plain WebSocket's without much hassle.

Luckily, at the time of writing this I have figured out a way to use `ConnectEndpointRouteBuilderExtensions#MapConnectionHandler<T>()`. Perhaps, I'll get back to finishing it once I finish rest of my never ending projects unless... I come up with more project ideas and none of them can be finished 😩.

I'm not exactly sure why Azure pipelines never built my project🤔🤔.

### `Final Note:`
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/j0pcozncia49l3d2w8lx.jpg)

Thank you for reading!