<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: Sandeep Sarkar</title>
    <description>The latest articles on Forem by Sandeep Sarkar (@sandeep_sarkar_48188c8362).</description>
    <link>https://forem.com/sandeep_sarkar_48188c8362</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3572811%2F5f577a42-4f4a-400b-9940-8267f59b13dd.png</url>
      <title>Forem: Sandeep Sarkar</title>
      <link>https://forem.com/sandeep_sarkar_48188c8362</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/sandeep_sarkar_48188c8362"/>
    <language>en</language>
    <item>
      <title>CodeMood - Git Commit Emotions Spotify Playlists (Copilot CLI)</title>
      <dc:creator>Sandeep Sarkar</dc:creator>
      <pubDate>Mon, 02 Feb 2026 19:38:20 +0000</pubDate>
      <link>https://forem.com/sandeep_sarkar_48188c8362/codemood-git-commit-emotions-spotify-playlists-copilot-cli-46oj</link>
      <guid>https://forem.com/sandeep_sarkar_48188c8362/codemood-git-commit-emotions-spotify-playlists-copilot-cli-46oj</guid>
      <description>&lt;h2&gt;
  
  
  What I Built
&lt;/h2&gt;

&lt;p&gt;AI-powered CLI that analyzes your git commit emotions and generates Spotify playlists matching your coding mood.&lt;/p&gt;

&lt;h2&gt;
  
  
  Demo
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fsmbv55w1yug1v0whmyln.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fsmbv55w1yug1v0whmyln.png" alt="7 days commits analyzer" width="800" height="517"&gt;&lt;/a&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fa0ncbh55269ufghe9an0.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fa0ncbh55269ufghe9an0.png" alt="90 days commits analyzer" width="785" height="543"&gt;&lt;/a&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmj05qmb155b40hnlntuu.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmj05qmb155b40hnlntuu.png" alt="Mock data Spotify Playlist" width="725" height="230"&gt;&lt;/a&gt;&lt;em&gt;This is a submission for the &lt;a href="https://dev.to/challenges/github-2026-01-21"&gt;GitHub Copilot CLI Challenge&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  My Experience with GitHub Copilot CLI
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Built in 45 minutes using Copilot CLI agent mode:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;create git commit emotion analyzer with VADER sentiment&lt;/li&gt;
&lt;li&gt;add rich terminal UI with colored emotion tables&lt;/li&gt;
&lt;li&gt;build ASCII mood timeline visualization&lt;/li&gt;
&lt;li&gt;create spotify mood-to-music mapping logic&lt;/li&gt;
&lt;li&gt;scaffold click CLI with analyze + playlist commands&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Productivity boost:&lt;/strong&gt; Natural language → production code. No boilerplate, no docs lookup, instant scaffolding.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Key wins:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Zero setup for complex libraries (Rich, VADER, GitPython, Spotipy)&lt;/li&gt;
&lt;li&gt;ASCII art timeline generated perfectly on first try&lt;/li&gt;
&lt;li&gt;Complex emotion→music mapping logic in 3 prompts&lt;/li&gt;
&lt;li&gt;Professional CLI structure without framework knowledge&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Copilot CLI transformed&lt;/strong&gt;  fun experiment → challenge-winning app in under an hour.&lt;/p&gt;

</description>
      <category>devchallenge</category>
      <category>githubchallenge</category>
      <category>cli</category>
      <category>githubcopilot</category>
    </item>
    <item>
      <title>I Built a P2P Blockchain in Rust — Here’s What Actually Went Wrong</title>
      <dc:creator>Sandeep Sarkar</dc:creator>
      <pubDate>Thu, 22 Jan 2026 17:00:31 +0000</pubDate>
      <link>https://forem.com/sandeep_sarkar_48188c8362/i-built-a-p2p-blockchain-in-rust-heres-what-actually-went-wrong-4oi</link>
      <guid>https://forem.com/sandeep_sarkar_48188c8362/i-built-a-p2p-blockchain-in-rust-heres-what-actually-went-wrong-4oi</guid>
      <description>&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;I recently finished building &lt;strong&gt;Toki&lt;/strong&gt;, a peer-to-peer blockchain written entirely in &lt;strong&gt;Rust&lt;/strong&gt;.&lt;br&gt;
This wasn’t a tutorial project or a copy-paste experiment—it was an attempt to truly understand how blockchains and P2P systems work under the hood.&lt;/p&gt;

&lt;p&gt;What I &lt;em&gt;didn’t&lt;/em&gt; expect was how many things would break along the way.&lt;/p&gt;

&lt;p&gt;This post isn’t a step-by-step tutorial.&lt;br&gt;
It’s a &lt;strong&gt;developer log&lt;/strong&gt; about what I built, what failed, and what I learned by fixing it.&lt;/p&gt;




&lt;h2&gt;
  
  
  What is Toki?
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Toki&lt;/strong&gt; is an educational blockchain node with the following features:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Proof-of-Work consensus&lt;/li&gt;
&lt;li&gt;Wallets using &lt;strong&gt;Ed25519&lt;/strong&gt; public/private key cryptography&lt;/li&gt;
&lt;li&gt;Signed transactions and a mempool&lt;/li&gt;
&lt;li&gt;Block mining and validation&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;libp2p&lt;/strong&gt;-based peer-to-peer networking&lt;/li&gt;
&lt;li&gt;Gossip-based transaction and block propagation&lt;/li&gt;
&lt;li&gt;Multi-node support (real nodes, real connections)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Each node runs independently and communicates over a P2P network—no central server.&lt;/p&gt;

&lt;p&gt;GitHub repo:&lt;br&gt;
👉 &lt;a href="https://github.com/sandy4242/Toki" rel="noopener noreferrer"&gt;https://github.com/sandy4242/Toki&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  Wallets &amp;amp; Transactions
&lt;/h2&gt;

&lt;p&gt;Each wallet generates an Ed25519 keypair.&lt;br&gt;
Transactions are signed using the private key and verified using the public key before being accepted.&lt;/p&gt;

&lt;p&gt;This immediately taught me an important lesson:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;If your transaction format or hashing logic is even slightly inconsistent, &lt;strong&gt;nothing works&lt;/strong&gt;.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Rust’s strict typing helped catch mistakes early—but cryptography is unforgiving by design.&lt;/p&gt;




&lt;h2&gt;
  
  
  Mining &amp;amp; Blocks
&lt;/h2&gt;

&lt;p&gt;Mining uses a simple Proof-of-Work mechanism:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Increment a nonce&lt;/li&gt;
&lt;li&gt;Hash the block&lt;/li&gt;
&lt;li&gt;Check for a required number of leading zeros&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;It’s intentionally simple, but even here, small design choices matter:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;What exactly goes into the hash?&lt;/li&gt;
&lt;li&gt;How are transactions serialized?&lt;/li&gt;
&lt;li&gt;When is a block considered valid?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Getting deterministic hashing across nodes was harder than expected.&lt;/p&gt;




&lt;h2&gt;
  
  
  The Hard Part: P2P Networking
&lt;/h2&gt;

&lt;p&gt;This is where most of my time went.&lt;/p&gt;

&lt;p&gt;I used &lt;strong&gt;libp2p&lt;/strong&gt;, the same networking stack used by IPFS and Polkadot.&lt;br&gt;
It’s powerful—but very strict.&lt;/p&gt;

&lt;p&gt;Some things that tripped me up:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;SwarmConfig&lt;/code&gt; vs &lt;code&gt;swarm::Config&lt;/code&gt; (API changes)&lt;/li&gt;
&lt;li&gt;Futures not in scope (&lt;code&gt;libp2p::futures::StreamExt&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;Async event loops that look “stuck” but are actually idle&lt;/li&gt;
&lt;li&gt;Multiaddr formatting (&lt;code&gt;/p2p/&amp;lt;PeerId&amp;gt;&lt;/code&gt; is &lt;strong&gt;mandatory&lt;/strong&gt;)&lt;/li&gt;
&lt;li&gt;Nodes don’t auto-connect—you must explicitly dial peers&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;At one point, both nodes were running perfectly…&lt;br&gt;
and doing absolutely nothing.&lt;/p&gt;

&lt;p&gt;Because in P2P systems:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;If no one connects, nothing happens.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Once I understood that mental model, things finally clicked.&lt;/p&gt;




&lt;h2&gt;
  
  
  Gossip, Mempool, and Sync
&lt;/h2&gt;

&lt;p&gt;Transactions are:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Created on one node&lt;/li&gt;
&lt;li&gt;Gossiped to peers&lt;/li&gt;
&lt;li&gt;Validated and added to the mempool&lt;/li&gt;
&lt;li&gt;Mined into a block&lt;/li&gt;
&lt;li&gt;Broadcast back to the network&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;To avoid infinite rebroadcast loops, I had to implement basic message de-duplication.&lt;/p&gt;

&lt;p&gt;This was the moment Toki stopped being “code” and started behaving like a &lt;strong&gt;networked system&lt;/strong&gt;.&lt;/p&gt;




&lt;h2&gt;
  
  
  A Quick Git Lesson (Yes, Really)
&lt;/h2&gt;

&lt;p&gt;At one point, I accidentally committed the entire &lt;code&gt;target/&lt;/code&gt; directory.&lt;/p&gt;

&lt;p&gt;Thousands of files.&lt;br&gt;
GitHub repo size exploded.&lt;/p&gt;

&lt;p&gt;Lesson learned:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;.gitignore&lt;/code&gt; does &lt;strong&gt;not&lt;/strong&gt; untrack files&lt;/li&gt;
&lt;li&gt;You must &lt;code&gt;git rm --cached&lt;/code&gt; them&lt;/li&gt;
&lt;li&gt;Nested project directories make this worse&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Not blockchain-related—but very real.&lt;/p&gt;




&lt;h2&gt;
  
  
  What I Learned
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;P2P systems are &lt;strong&gt;event-driven&lt;/strong&gt;, not request-driven&lt;/li&gt;
&lt;li&gt;libp2p is powerful but demands correctness&lt;/li&gt;
&lt;li&gt;Rust forces you to think clearly about ownership and state&lt;/li&gt;
&lt;li&gt;Cryptography has zero tolerance for “almost right”&lt;/li&gt;
&lt;li&gt;If your system compiles &lt;em&gt;and&lt;/em&gt; connects, you’re probably doing something right&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  What’s Next for Toki?
&lt;/h2&gt;

&lt;p&gt;This is &lt;strong&gt;v1.0&lt;/strong&gt;. Planned next steps include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Longest-chain fork resolution&lt;/li&gt;
&lt;li&gt;Account balances and state tracking&lt;/li&gt;
&lt;li&gt;Bootstrap nodes&lt;/li&gt;
&lt;li&gt;Persistent storage&lt;/li&gt;
&lt;li&gt;Better CLI tooling&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Final Thoughts
&lt;/h2&gt;

&lt;p&gt;Building Toki taught me more about distributed systems than any tutorial ever could.&lt;/p&gt;

&lt;p&gt;If you’re learning Rust, blockchain, or P2P networking—my advice is simple:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Build something that breaks. Then fix it.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;That’s where the real learning happens.&lt;/p&gt;

&lt;p&gt;Thanks for reading&lt;br&gt;&lt;br&gt;
~sandy&lt;/p&gt;

</description>
      <category>rust</category>
      <category>blockchain</category>
      <category>p2p</category>
      <category>opensource</category>
    </item>
  </channel>
</rss>
