skip to content
Video cover art for Dash Platform Walkthroughs Part 8 - Rishi Raj Jain
Video

Dash Platform Walkthroughs Part 8 - Rishi Raj Jain

Rishi Raj Jain joins Anthony Campolo for a Dash Platform walkthrough building a Node.js app with identities, documents, and contracts.

Open .md

Episode Description

Rishi Raj Jain joins Anthony Campolo for a Dash Platform walkthrough, building a Node.js app with identities, documents, and contracts while exploring Stripe crypto integration possibilities.

Episode Summary

In this eighth installment of the Dash Platform walkthrough series, Anthony Campolo guides Rishi Raj Jain, an Indian developer with no prior crypto experience, through building a Node.js application on Dash Platform's testnet. Rishi, the creator of LaunchFast (a starter kit for Next.js, SvelteKit, and Astro), works through setting up a project, creating a wallet, funding it via the testnet faucet, registering an identity, claiming a name, and building data contracts and documents that simulate CRUD operations on a decentralized database. While most steps proceed smoothly, the update and delete document operations fail due to internal SDK errors, which the pair pragmatically skip. The tutorial culminates in exposing the identity through an Express API consumed by a Next.js frontend. The conversation broadens into a discussion of LaunchFast's architecture, Astro's recent releases including server islands and content layer, and how Stripe's crypto integrations could enable Dash payments without currency conversion friction—particularly relevant for international developers like Rishi.

Speakers

  • Anthony Campolo
  • Rishi Raj Jain

Chapters

00:00:01 - Introductions and Crypto Primer

Anthony welcomes Rishi, a former Edgeo coworker now building solo, who introduces himself as a developer from India who started with Angular and TypeScript before launching LaunchFast, a collection of starter kits for Next.js, SvelteKit, and Astro with integrations like AWS S3, Cloudflare R2, Stripe, and Lemon Squeezy. Rishi mentions he's been pushing new integrations daily to make LaunchFast a comprehensive starter solution.

When asked about crypto experience, Rishi admits he has none beyond hearing about Bitcoin's price volatility. Anthony provides a foundational explanation of how Dash originated as a Bitcoin fork focused on payments rather than store-of-value, and introduces Dash Platform as adding identity and storage layers atop the currency. He explains how blockchain consensus works through decentralized nodes maintaining ledgers, comparing it loosely to BitTorrent seeding, and warns that network instability can cause unexpected failures during the live demo.

00:05:22 - Project Setup and Wallet Creation

Rishi shares his screen and begins the tutorial, setting up a Node 20 project configured as an ES module with the Dash SDK installed at its dev version. Anthony notes that mainnet is launching in roughly two months, after which the SDK will progress to alpha and beta releases. They configure the package.json scripts and create the initial directory structure with API and REST folders, plus a client.js file pointing to the testnet network.

The wallet creation script generates a 12-word mnemonic seed phrase and a Dash address. Anthony emphasizes the critical security implications of mnemonics in production—anyone with the phrase can drain the wallet—but reassures Rishi that testnet funds are imaginary. They establish a workflow pattern of copying generated values into a .env file for use in subsequent commands, a pattern that recurs throughout the tutorial.

00:11:21 - Funding the Wallet via Testnet Faucet

Rishi navigates to the testnet faucet, which Anthony describes as notoriously flaky—nine times out of ten the site crashes after submitting a request, which paradoxically signals success. The faucet distributes 1.5 fake Dash to the supplied address, providing the funds needed for subsequent platform operations like identity creation. Rishi briefly mistakes the promo code field for the address field, which Anthony notes is a common error.

They move to the Dash block explorer to verify the transaction, where unconfirmed Dash appears in Rishi's wallet. Anthony explains that block explorers serve as UIs to the blockchain itself, allowing inspection of transactions without hitting RPC endpoints directly. Even with only unconfirmed funds, they can proceed to the next step since the platform will recognize the pending transaction during identity registration.

00:14:25 - Creating and Funding an Identity

Rishi creates an identity.js script that calls platform.identities.register, generating a unique identity ID associated with the wallet. Anthony draws an analogy to Ethereum's .eth namespace, where users like ajcweb.eth could receive payments through a human-readable name rather than a long address—Dash will offer similar functionality with .dash names. The identity creation completes successfully, allowing them to view it in the Platform Explorer, which exposes identity and storage data not visible in the basic block explorer.

The discussion shifts to the credit system: Dash from the wallet must be converted into credits and assigned to specific identities before those identities can perform actions on the platform. Rishi writes scripts for retrieving identities and topping up credit balances, with Anthony noting that occasional bad nodes can cause read operations to fail, but these are recoverable since the underlying data persists.

00:20:44 - Registering a Name on the Platform

Rishi diligently reads through the naming constraint documentation—a habit Anthony notes is unusual among walkthrough participants—learning that labels must be 3-63 characters, alphanumeric with hyphens, and cannot start or end with hyphens. He chooses "rishi-90" as his label and stores it in the .env file. The register-name script takes the identity ID and label and submits a name registration transaction to the network.

While waiting for confirmation, the conversation touches on JSON schema, which Anthony admits caused him significant frustration during initial development due to undefined value errors. After successful registration, the Platform Explorer displays the identity with both a label and a "normalized label" field. Anthony explains the normalization is a security measure preventing visual spoofing attacks where attackers might substitute zeros for O's or ones for I's, similar to why the encoding uses base 58 rather than base 64.

00:26:26 - Data Contracts and Document Schemas

The tutorial introduces data contracts as blueprints defining the JSON schema for storable data, enabling the platform to validate documents at runtime. Rishi grasps the concept quickly, comparing it to defining expected incoming data structures before performing what amounts to PUT operations. He writes a register-contract script that defines a schema for notes, then publishes it to the network. The first attempt fails, but a retry succeeds and produces an identical contract ID, suggesting the platform may hash schemas deterministically similar to IPFS.

Anthony clarifies the architectural separation: the original Dash chain handles currency, while Dash Platform handles identities and storage. Contracts establish what data can be written, while documents are the actual data instances conforming to those contracts. Rishi adds the contract ID to his .env, updates the client configuration to recognize the contract namespace, and writes a script to retrieve the contract back from the network for verification.

00:32:34 - Submitting and Updating Documents

Rishi creates an updateContract.js script that adds an "author" property to the existing schema, then writes scripts for submitting note documents containing messages with timestamps. The submit operation succeeds, allowing him to fetch the document back via the get-documents endpoint and confirm the message and metadata persisted correctly. Anthony observes that Rishi is moving through the tutorial faster than any previous participant, attributing it to his careful reading of documentation.

A side conversation explores Rishi's database preferences—he's primarily a NoSQL developer with DynamoDB experience rather than MongoDB, currently learning relational databases. The platform's distributed-database abstraction appeals to him because it removes the need to manage underlying infrastructure. However, when Rishi attempts to update an existing document, the operation fails with an internal server error about storage protocol structure values. The delete operation similarly fails, leading them to skip these CRUD operations and move forward.

00:41:25 - Building the Express API

The pair pivots to constructing an Express server that exposes the identity data through HTTP endpoints. They briefly discuss Node framework preferences, with Rishi advocating for Hono as currently popular while Anthony notes he typically chooses Express for tutorials due to its universal recognition despite being suboptimal for production compared to Fastify or Hono. The server.js file establishes a CORS-enabled Express app with a dynamic /:name route that fetches identity information from the platform.

Rishi opts to test the endpoint in a browser rather than using curl, prompting Anthony to note he's the first participant to do so. They subsequently demonstrate curl with jq for pretty-printed JSON output, with Rishi noting he doesn't have jq installed and prefers visual browser inspection. The endpoint successfully returns the identity payload including the normalized label and identity ID.

00:45:24 - Next.js Frontend Integration

Rishi creates a Next.js application using TypeScript, the App Router, and a custom source directory. He shares that LaunchFast's Next.js variant currently uses Pages Router but he's actively migrating to App Router based on Twitter community feedback, encountering challenges along the way—including discovering experimental server components configuration needed for Telegram bot integration via the Grammy SDK. He documents these journeys in articles to help others avoid the same friction.

The page.tsx file initially has Anthony's hardcoded name in the API endpoint, which Rishi fixes by extracting it into a NEXT_PUBLIC environment variable accessible to client-side code. After running both the Express server and Next.js dev server, clicking the "Fetch Data" button displays a loading state before successfully retrieving the identity data from the API and rendering it in the browser.

00:52:08 - Use Cases and Crypto Architecture Discussion

Reflecting on potential applications, Rishi proposes building something like Splitwise—a shared expense tracker—where the document update functionality could attach human-readable labels to transactions rather than just IDs and amounts. Anthony introduces Dash's DAO funding mechanism, which sets aside network funds for paying contributors who submit proposals, suggesting Rishi could pursue this idea once flexibility allows.

The conversation deepens into blockchain architecture, with Anthony explaining the distinction between Dash Platform's document-based model and Ethereum's smart contracts, where actual programs deployed to the chain can manipulate state autonomously—introducing both flexibility and substantial security risks. He describes how Ethereum smart contracts can be malicious in ways users won't detect without reading the code, contrasting with Dash's more constrained but predictable platform protocol. Anthony also discusses wallet security, noting that browser extension wallets create persistent attack surfaces while desktop wallet apps provide better isolation.

01:01:12 - LaunchFast Tour and Astro Discussion

Rishi demonstrates LaunchFast, his starter kit project inspired by ShipFast and started in October after leaving Edgeo. The Astro variant initially gained traction in the Astro community, and the project has evolved from a boilerplate into a full starter kit with configurable authentication (Google and Twitter by default), database flexibility through environment variables (Postgres or Redis), and integrated payments. He hasn't yet experimented with Astro DB, which Anthony mentions has closed its preview pending the official release.

They discuss Astro's recent major announcements—server islands and the upcoming content layer—with Anthony comparing the content layer to Gatsby's content mesh, useful for integrating CMS systems like Contentful. Rishi confirms LaunchFast doesn't yet include CMS integration but expresses interest once he learns the new content layer features. He also mentions a pain point relevant to Indian developers: the inability to accept foreign currency directly, requiring per-region currency conversion logic.

01:05:19 - Stripe Crypto Integration Exploration

Anthony sees opportunity in Dash payments to bypass currency conversion entirely—if both parties hold crypto, no fiat conversion is needed until the recipient cashes out into local currency. He plans to build a tutorial demonstrating Stripe-Dash integration via providers like NowPayments. They search Stripe's documentation together, finding a sample integration at docs.stripe.com/crypto that supports converting fiat to USDC (Coinbase's stablecoin) through a pre-built fiat-to-crypto on-ramp.

Anthony hypothesizes this on-ramp could potentially be configured to output Dash directly, though the exact integration steps with NowPayments or similar providers still need verification. The pre-built Stripe pages and JavaScript samples provide a foundation that Rishi could potentially incorporate into LaunchFast as a future integration once the workflow is documented.

01:10:38 - Closing and Contact Information

Rishi shares his contact information, directing viewers to his Twitter handle and his portfolio site at rishi.app, which is built with SvelteKit rather than Astro. He explains his appreciation for SvelteKit's HTML-near syntax and excitement about the upcoming Runes feature in SvelteKit 5. Anthony shares that he previously enjoyed SvelteKit but has settled into Astro and React as his primary stack due to development speed.

The conversation concludes with mutual appreciation—Anthony commends Rishi's polished Astro project, while Rishi jokingly suggests rewriting the Dash tutorial in Astro. Anthony wraps up the stream at 01:12:26, asking Rishi to remain on the call afterward and thanking viewers as they prepare for the next walkthrough installment.

Transcript

00:00:01 - Anthony Campolo

Alright, hello everyone. Welcome to part 8 of the Dash walkthroughs. We got one of my former coworkers, Rishi, who I met— I think I met you before actually I was working at Edgeo, but that's where we got to know each other better. And you kind of went solo, I think, and you do— you have this project that is under your name. But why don't you introduce yourself and tell talk a little bit about, you know, your dev background and what you're doing.

00:00:31 - Rishi Raj Jain

Uh, sure. Thank you for having me on the stream. I am Rishi from India, and, uh, the dev experience always starts from building static websites to— so the first thing that I learned in my dev experience was Angular with TypeScript, and so that was a whole lot of learning. And so, uh, that made, uh, you know, switching between frameworks much easier, I would say. Um, recently I launched LaunchFast, which which are collection of starter kits in Next.js, SvelteKit, and Astro. I am pushing new integrations every day. In the last 2 days, I've added AWS S3 as the storage provider and Cloudflare R2 as another. So, I'm really pushing into being the right starter kit for you to get started. Yeah.

00:01:17 - Anthony Campolo

Do you have payments integrated with any of them?

00:01:20 - Rishi Raj Jain

Yes, I have Stripe and Lemon Squeezy integrated in both of them with the webhooks and checkout support.

00:01:27 - Anthony Campolo

Lemon Squeezy, I don't know if I know that one. I'll have to check that out. But yes, that's one of the things I'm like, ooh, we should have you build in a Dash integration for it. But that would be its whole own stream. But so we've been doing, you know, you're number 8, so you'll be the 8th person to do this. We're bringing devs on to kind of try out Dash Platform, which is Actually, first, what's your experience with crypto?

00:01:55 - Rishi Raj Jain

I have literally no experience with crypto. I do have friends who are enthusiastic about it, but I have no experience.

00:02:01 - Anthony Campolo

Okay, cool. Yeah, well, then this will be good. You'll be going in totally fresh. You probably at least heard of Bitcoin, I would assume.

00:02:10 - Rishi Raj Jain

Yeah, I've heard of it and its fluctuating rates. That's all I've heard.

00:02:14 - Anthony Campolo

Sorry, I didn't hear what you said. What about Bitcoin?

00:02:18 - Rishi Raj Jain

What I heard is there's Bitcoin and it's been fluctuating quite up and down, and that's all I know about it.

00:02:26 - Anthony Campolo

Yeah, the price is very volatile, and that's, um, for crypto in general, it was such a huge problem they had to invent a new type of cryptocurrency that was called a stablecoin that would specifically not change in price. It would be pegged to like the US dollar. But Dash was originally a fork of Bitcoin and And it evolved because Bitcoin evolved to be more of what you call a store of value, where it's like you own like a— like if you own a big hunk of gold, you're not gonna like parse that to pieces and go out and spend them or like kind of thing. So Dash was more like, we want this to be a way to like do payments, so you can use it to like buy all sorts of stuff and has like extremely low transaction fees. So if you're doing like cross-border payments be really good for that. So that's cool. And then it's— that's been around for like 10 years or even longer. And now there's been this like 5 to 7 year long development of the Dash platform. And that— this is probably pretty easy to explain actually, because you know enough about web apps. It takes the, the currency and the ability to transact with people and adds an identity layer and a storage layer. So that now you can actually have your own specific identity that you could make public or private and you could transact with people privately. And then you could also store kind of like JSON-like blobs in there. So if you wanted to have like an app that had user-generated content, you could do all of that. So that all makes sense so far?

00:04:00 - Rishi Raj Jain

Yeah, totally. Sounds new and, uh, cool. Yeah, yeah.

00:04:06 - Anthony Campolo

And so I think, so the most important thing is how you— to really know about working with blockchain is that the way it works and the way it's able to, um, secure your funds is by having the ledger itself and everyone's balances decentralized across various computers. So it's kind of like, um, if you ever downloaded movies on BitTorrent or something like that, You know, once you download the movie, you got the seed, and then other people can seed from you. So it's kind of like that. You got all these nodes, and they each have ledgers, and then you have a transaction is made, it gets added to a new block. And then once a block is full and enough blocks have been confirmed, they all come to a consensus and they said, this is the canonical block, now we go to the next block. And that's what the blockchain is. So the challenge with that is it is the same challenges that come with a decentralized system where sometimes the network will just get confused or slow and sometimes you'll hit a bad node. So if you want to put that out there, except may or may not happen. We'll see. I haven't tested the network today, so I have no idea what's going to happen. But, um, that's kind of the fun of doing these live streams. So, um, we should probably get into it now if you want.

00:05:22 - Rishi Raj Jain

Yeah, let's get started. Sweet.

00:05:26 - Anthony Campolo

So let's get your screen sharing. And you'll probably want like your code editor on like one side, the blog post on the other side. So you can kind of just scroll along.

00:05:39 - Rishi Raj Jain

Yeah, let me share my screen. So, yep. Yep.

00:05:46 - Anthony Campolo

Cool.

00:05:48 - Rishi Raj Jain

Does this look correct?

00:05:49 - Anthony Campolo

Yeah, and do it the other way so that the blog post is a little smaller than the code editor.

00:05:55 - Rishi Raj Jain

Ah, I see. How do I switch? I really don't know, I'm just going to compress.

00:06:00 - Anthony Campolo

Just drag them. Yeah, just drag them, yeah. Yeah, all right. That should be good. I would say bump up your font in each of them like 1 or 2 times.

00:06:09 - Rishi Raj Jain

In the code editor?

00:06:10 - Anthony Campolo

Yeah, let's do 1 up in the code editor and then 2 up in the browser.

00:06:15 - Rishi Raj Jain

Got it. Yeah. Yep.

00:06:18 - Anthony Campolo

Cool. Then you can start at the setup and configure Node project. That's where the code actually starts.

00:06:25 - Rishi Raj Jain

Yeah, this one.

00:06:26 - Anthony Campolo

That's the one. Cool.

00:06:29 - Rishi Raj Jain

What I have right now is Node 20. Yeah. This is n, correct? Yeah. Let's do it. I'm going to create a directory.

00:06:40 - Anthony Campolo

I already have.

00:06:41 - Rishi Raj Jain

And then I create a packages on, and then I'm— okay, setting up the type module. So we are operating on ESM.

00:06:53 - Anthony Campolo

That's right.

00:06:54 - Rishi Raj Jain

And then we're installing a dash version which is in dev. All right.

00:07:01 - Anthony Campolo

Yeah, and that's because, like I said, they've been working on this for years and years and years and years. But what's funny is actually they're launching like the first kind of official mainnet version in probably 2 months or so. And then the SDK that you're using is going to be an alpha version. So it's going to go from dev to alpha, then eventually a beta, and the network will then get more stable as the new versions go up.

00:07:28 - Rishi Raj Jain

Makes sense. Makes sense. All right. So I'm going to do the next step, which is add the.gitignore while it installs. So copy there. Yep. Um, we will create each script file individually throughout the tutorial, but for the sake of simplifying life while following along this tutorial, I would recommend adding— all right, yeah, sounds good.

00:07:49 - Anthony Campolo

Um, yeah, so then you'll get— so you're going to basically build each of these files, scripts individually, but then you'll just be able to run the command after you, you've done that.

00:07:58 - Rishi Raj Jain

Got it. Um, let this install command complete, and then we can add the scripts.

00:08:05 - Anthony Campolo

Cool. Yeah, while you're— while that's going, you can go to the next step and create some of the first files and directories if you want.

00:08:11 - Rishi Raj Jain

Uh, we create two directories, which is API and REST. And then in API, I am to create a client.js.

00:08:29 - Anthony Campolo

How's the internet connection in India? I am not sure what's happening though, but yeah, yes, yes, this tends to, tends to happen when I'm streaming. As if I were trying to do anything involving npm, it goes very slow.

00:08:45 - Rishi Raj Jain

No worries, I am still proceeding with the rest of the parts. It's good for now. Let me quickly copy this. So we install the Dash module. We are using Dash module We get the process env, and then we specify client on the current network. The network is testnet. Ah yeah, I've heard this as well. There are two, correct? Testnet and mainnet, if I'm not wrong.

00:09:07 - Anthony Campolo

Yes, and that's what I was saying. You cannot do this on mainnet today, but you will be able to in like 2 months.

00:09:13 - Rishi Raj Jain

Got it, got it.

00:09:14 - Anthony Campolo

And this also means all the money is pretend money. So like you're gonna get some Dash, you're gonna spend some Dash, but it's not real Dash. Whereas like a Dash, like one Dash is like $25 or something right now.

00:09:26 - Rishi Raj Jain

Okay, cool. Um, so we create a script which is to install Apollo.js. Do that. So we're doing is creating all it— finally it installed, that's great. Um, let me quickly jump to my package steps and go to the JSON, replace what we have in here. What we're doing in here is we are basically running the scripts that we will add. Okay. And then there is this command for running the API server. Makes sense.

00:09:58 - Anthony Campolo

Yeah.

00:09:58 - Rishi Raj Jain

All right, sounds good to me. Let me add the create wallet. So we get the wallet. I have no idea what this is doing. And then we get address for this particular thing and then we just Logging them out makes sense to me.

00:10:16 - Anthony Campolo

Yeah, I'll have you run it first and then I'll explain kind of what happened.

00:10:20 - Rishi Raj Jain

Let me do npm run create wallet now.

00:10:23 - Anthony Campolo

And now I own your computer. No, I'm kidding. So for this you have two things. The mnemonic is a 12-word seed phrase and that is kind of like your password is basically how you think about it. So since this is on testnet, all the funds are made up. It doesn't matter that it's like on a stream, but When you have a real wallet, you have real money in, you never ever want to expose this. Because anyone who has this can take all your money. And then the address is going to be if you want to transact with someone. Like, that's the thing. So if I wanted to pay you $10 because you bought me a coffee the other day, you would send me that address. Then I would go into my Dash wallet, put in that address, and say give, you know, a half a Dash or something to him.

00:11:06 - Rishi Raj Jain

Got it. So it's like every time payments—

00:11:10 - Anthony Campolo

yeah, yeah. And every time you have a command where it outputs something that looks like this, you're going to want to copy paste and put into your.env because this will be integrated into the following commands as you go.

00:11:21 - Rishi Raj Jain

All right, let's put them here. Great, done. Um, yeah, so we have copied them into.env and now we have to add Funds to my fake wallet. Wait for the funds to be confirmed. So how do I go about this? How do I go about this? You can check the status of information.

00:11:48 - Anthony Campolo

Yeah, there's two links in here. So first go to the testnet faucet. So open that guy up and then this site is notoriously awful and flaky. So you're going to have to continue through that. Yeah. And so grab that address and put it into the top field. The one that was— no, not— sorry, not that one. The one that's in your terminal. Yeah.

00:12:09 - Rishi Raj Jain

Got it. Got it. This one is what I put in here.

00:12:12 - Anthony Campolo

And don't put it there. That's the promo code. I absolutely hate this website.

00:12:18 - Rishi Raj Jain

I see. I see. Put it in here.

00:12:21 - Anthony Campolo

You're not the first one to do that. Don't worry. And then click get coins and then wait for the site to crash. And then we're good. Like, 1 out of 10 times it will give you a message saying you now have 1.5 Dash. But 9 out of 10 times the site crashes and that means it completed.

00:12:44 - Rishi Raj Jain

Something that needs to be fixed in here is for sure.

00:12:48 - Anthony Campolo

Yeah, totally. And what this is doing— so a faucet, a testnet faucet, that's good. That's what we want. The testnet faucet is just a way to load up some Dash. And so like I said, it's all pretend Dash. So this is not just like a pile of money sitting on the internet. It's a pile of fake money that everyone can kind of pull in if they want to test out different functionality. Because the next thing we're going to do is we're going to create an identity, and that requires Dash to do. Don't even— yeah. So are you trying to go to the block explorer? Was that the one?

00:13:22 - Rishi Raj Jain

That was— we are done here.

00:13:23 - Anthony Campolo

Yeah, we're done with the faucet. Yeah. So go to the next link, the Dash block explorer. And then now let's see. Try them.

00:13:35 - Rishi Raj Jain

Okay. Yeah, I think now it's starting to load. Yeah.

00:13:40 - Anthony Campolo

And then the same address you're going to put that very top field and search for it.

00:13:44 - Rishi Raj Jain

You can hear?

00:13:46 - Anthony Campolo

Uh-huh. And so what this is, this is like a UI to the blockchain itself. That's what a block explorer is. So when you have a transaction that's on the blockchain, you can go look at it through a block explorer. So you don't have to access it through like an RPC endpoint or something like that. You can just have this nice kind of front end. And if you see here, you don't have Dash, but it does say you have unconfirmed Dash. That means that it's— the transaction is being added to a bunch of blocks and they all need to come to consensus eventually, and then you'll have your Dash. But this is good. We can move on because you have the stuff to make the identity.

00:14:25 - Rishi Raj Jain

So we have searched for the wallet and then we are— it needs to click on my transaction link, which I think I can skip for now.

00:14:36 - Anthony Campolo

Yeah, we can skip those parts. Yeah, that's just because every— you'll have your wallet which will be on the block explorer, then every individual transaction Transaction will have its own specific transaction ID with like some steps of what happened in the transaction.

00:14:49 - Rishi Raj Jain

Got it. All right, um, let's create the identity.js which will be in here. So to create an identity, we will run.register. All right, so this is pretty easy to understand, I believe. I'm creating my own identity on the platform. Yep.

00:15:11 - Anthony Campolo

Give you an identity ID.

00:15:14 - Rishi Raj Jain

And then just run this, you get—

00:15:17 - Anthony Campolo

and this takes usually about 15 to 20 seconds to go through. So the identity ID will then be associated with a name. And the name— did you ever see a couple of years ago a lot of people had like.eth after their Twitter names?

00:15:37 - Rishi Raj Jain

Yeah, yeah, yeah.

00:15:38 - Anthony Campolo

So that was like an Ethereum namespace. It's both a namespace and a wallet. So that if so, I had ajcweb.eth, and if someone wanted to send me some ETH, they could just plug that in and send it because I bought that. So the name is going to be the Dash version of that. You'll have, you know, rishi.dash or something like that.

00:15:59 - Rishi Raj Jain

Got it. I'm just waiting for this to—

00:16:05 - Anthony Campolo

this is always the fun part. Okay, so I can explain this next section. So then we're going to have a slightly different explorer. We're going to go to the Platform Explorer, which is actually really nice. And it's because I was saying how we had the original Dash, which was just the wallets and the payments kind of thing, and now Platform has identities and storage, the Platform Explorer is going to expose those things. So this identity ID you're creating right now, that wouldn't be in the first Block Explorer because that's not part of the original Dash system. It's part of the Dash Platform system. And this is something that I only really know this at a high level. So— yes, it worked! Oh my god, that means the rest of the stream is going to go smooth. So much better. All right, I'm going to kick back now and let you do your thing.

00:16:58 - Rishi Raj Jain

I have added the identity ID to my env.

00:17:01 - Anthony Campolo

And click that link that it gave you to— in your terminal is a link right there. You can click.

00:17:10 - Rishi Raj Jain

I see. So basically this is going to open the particular link that I'll be getting from these steps. Yeah, yeah. And all right, let this open up. Um, we have an identifier, some balance for me, and then right time. Then we have a transaction, um, that has been performed already, and that transaction is creating the identity, correct?

00:17:37 - Anthony Campolo

That's right.

00:17:39 - Rishi Raj Jain

All right, um, sounds good. And then for creating my identity, I got this much credits.

00:17:47 - Anthony Campolo

Yeah, the— so the credits are the, the very next part of the blog post explains this. I always forget the conversions because there's like hundreds of millions of something as a something, and then there's a thousand of another thing. So you have credits and duffs, which are both— one is like 100 million Dash and one is like a billion Dash or something like that. These numbers are definitely wrong, but that's kind of the gist of it.

00:18:12 - Rishi Raj Jain

All right. Let me create the retrieval of my identity. What's this doing is getting the wallet, getting the identities, and for all of what it detects, it's trying to print the balance of them.

00:18:31 - Anthony Campolo

Yeah, this is your read or your get. You'll notice almost every command you create is basically going to be some part of a CRUD operation.

00:18:42 - Rishi Raj Jain

Okay, this is going to take the same time. I'm going to skip this for now. Let's see what it comes back with. Um, let me create top-up identity, which is probably going to add some balance. Uh, let's add the script. What's it doing here is getting the wallet, getting the IDs, and then it's trying to top up with this much of credits. And then identity credit balance for this ID is— so once it has topped the account, it will try to print it. Uh, yeah, it says—

00:19:17 - Anthony Campolo

and so the reason why this needs to be done, this, this took me so long to understand, is because you have the, the Dash which you got from the faucet, but then your identities are on the platform. For them to do things, you have to turn some of that Dash into credits and then give it to the specific identity ID.

00:19:35 - Rishi Raj Jain

Yeah, got it. Makes sense. Um, all right, so let me run this. I think this should be done after this is done. Yeah, this is— this has come up.

00:19:47 - Anthony Campolo

It says so. Yeah, this happens sometimes. So this is the type of error that we get occasionally on the create identity, and it totally nerfs everything. This means you hit a bad node, basically. There's a way to go into your client to give a specific node, but we don't really need to do this command because we're just reading back the identity we just created. So let's just skip this one. This one breaks half the time anyway, so it is what it is. I know, like, the exact percentage of time specific things break because I've gone through this so many times.

00:20:21 - Rishi Raj Jain

No worries, things are meant to be broken in software, so it's fine.

00:20:28 - Anthony Campolo

Yeah, no, totally. And hopefully once we get to mainnet, things will be a little more stable because it's hard to really have an incentive to make sure the testnet is always up. Just like, oh, you can't get your pretend money right now. Sorry.

00:20:44 - Rishi Raj Jain

All that's just now trying to top up my identity. Let's see. What it comes back with. Meanwhile, I'm going to create another script that I can run and then wait for. So we have register name and then create a label in your env with your desired name. See the implementation details for naming constraints. Okay, so I have to name something in my env. So first go to my env and then I'm going to set label So maximum length is 63 and then 0 to 9 in the Z.

00:21:25 - Anthony Campolo

You're the first person to go to this section and actually read this part.

00:21:30 - Rishi Raj Jain

The labels are— I actually love documentation, so I always try to go to the links that I see in the blog. Like, I didn't see some of them before, but now I do.

00:21:39 - Anthony Campolo

No, you've followed every line and like read them all out. Like, you're dialed in. I can totally tell.

00:21:46 - Rishi Raj Jain

Yeah, all right, so I have to have numbers, hyphen, and characters. Sounds good. Um, let me do something. I don't know, um, let's name it online. Does this look correct as a label?

00:22:03 - Anthony Campolo

So I think it says that it cannot be at the end, so that's where it says the note, ah, use them a prefix or suffix is not allowed. Yeah, that's good. You born in 1990?

00:22:16 - Rishi Raj Jain

Uh, no, I'm 2000.

00:22:17 - Anthony Campolo

Okay, what's the 94?

00:22:20 - Rishi Raj Jain

Uh, I just picked this up, these two numbers. I had no idea.

00:22:23 - Anthony Campolo

Cool. I was just like, thought people do like the year they're born or something like that, you know?

00:22:29 - Rishi Raj Jain

Got it. Uh, so yeah, identity credit balance, um, it come up fine and I do have some credits. Um, we have created the label, which is great. Where is the script for register name? Okay, here is it.

00:22:43 - Anthony Campolo

It's right there. Yeah, that's the next part.

00:22:46 - Rishi Raj Jain

So what it's trying to do is get my identity based off the env variable. Makes sense. Then we get the ID, get the name, and then what it's trying to do after that. So it's trying to register, uh, based on my -label and It's just printing my label. Is that correct? Or is this going to be something different?

00:23:12 - Anthony Campolo

It's going to— yes. So it's just going to give you the same label you already have to confirm that it worked. And it's also going to give you a link to see it on the block explorer.

00:23:22 - Rishi Raj Jain

Got it. Yeah. And the link to it. Got it. Makes sense.

00:23:29 - Anthony Campolo

Do you know much about JSON schema?

00:23:33 - Rishi Raj Jain

I have heard of it. So it's what, um, it's basically you define how, how would a JSON basically look like.

00:23:41 - Anthony Campolo

It's like, because if you look over at the end of this console.log, so just scroll to the right a little bit in your, your code editor, in, in the code part.

00:23:52 - Rishi Raj Jain

Yeah, in the core part. Okay, got it.

00:23:53 - Anthony Campolo

Yeah, yeah. So how it's name-registration.tojson with the dollar sign ID. This is something that took me so long to figure out. I kept getting undefined and stuff, like what the hell is going on? So this has to do with JSON schema, which I don't really know anything about.

00:24:09 - Rishi Raj Jain

Got it. Yeah, those are usually the links of what the schema JSON is, and then it gets configured during— picked during the runtime, whether in editor or, um, when you're deploying something. I, I've seen this in probably ShadCN. being used or in another project. But yeah, I've, I've seen JSON schema before.

00:24:31 - Anthony Campolo

Cool.

00:24:32 - Rishi Raj Jain

All right, so this is going to wait for, uh, some time, but we know what it's going to say. So let's create the script for retrieve name now. Retrieve name. Yes. And then paste this here. What's this trying to do is pick up my label and get the document associated. That will be probably just getting out from this one. And yeah, all right, so I've got this. If I click on this thing, uh, it has some identifier, the owner ID, and then has my label. Sounds good.

00:25:13 - Anthony Campolo

So now this is kind of both— this is the identity part, it's also already the data storage parts. Like you need your, your own kind of account information saved in there. So now you got this. This is your identity on the Dash platform.

00:25:29 - Rishi Raj Jain

Got it. What's this normalized label? Like, probably this is for internal use, but it somehow changed my I's to 1s.

00:25:36 - Anthony Campolo

Yeah, this is a, this is a very specific security thing, and it takes out basically attack vectors so people wouldn't accidentally put like a 0 for an O or a 1 for an I or something like that. So I think that's also why it's like 58 base instead of 64. Mm-hmm.

00:25:55 - Rishi Raj Jain

Okay. So yeah, we have added the script for retrieve name. Let's do that. Run it.

00:26:05 - Anthony Campolo

And that's gonna give you back basically the exact same thing you just saw.

00:26:08 - Rishi Raj Jain

I think that we saw here. Yeah, yeah, makes sense, makes sense. Okay, so it did give me those. We should see label and normalized label. Yeah, all right, uh, makes sense. Now we come to data contracts. A data contract on Dash serves as a blueprint for the data that is intended to be stored. Um, it defines the JSON schema, as you're talking about. So contracts enable the platform to validate. They're crucial, and, um, they're used for runtime retrieval. Okay, so this is basically going to, um, look at the data that we just saw. Pertaining to my ID.

00:26:44 - Anthony Campolo

And it's going to allow you to create your own kind of data blob that you want. So this was your, your name was already predefined and they already had a schema, whereas you're going to now be able to define, like, if you wanted to write Hacker News, you would be creating, you know, users with posts that can make comments on other posts. This is going to be like just a single string with some text that will have like an author. So it's like there's going to be very, very little actually happening here. But it's like the— again, this is— you need to— it's kind of like this, this part is hard to map to CRUD exactly. You have to first create the data contract, which defines the kind of data you're going to give it, and then you create a document, which is the actual data that the data contracts understand. So that will make sense once we do this.

00:27:35 - Rishi Raj Jain

Yeah, I think it does. We're just defining what will be incoming, and then we said what is incoming, and then we're sending a document, um, which is like what, um, what is bound to receive. Like, we have configured, hey, this is what will, what will be coming to you, and then we are, uh, let's say, doing a PUT operation of the schema that we have defined. So that's what I understand, I believe. Yeah. All right, so, um, in register contract, we are trying to get my ID, we're defining the data that will go out, and then we create a contract on basis of that, and then we are sending the actual data. All right, that's good. Then we done register contact. This is going to give me the contract ID, and this is there.

00:28:27 - Anthony Campolo

Make sure you let this finish. This is not done yet. This is something a couple of people have messed up. So now that it has a contract ID, it needs to then publish command after console logging.

00:28:39 - Rishi Raj Jain

Yeah, totally. I see that. So yeah, this has defined the destination. Now it's sending the data to destination is what I understand from this. So contract is registered and then it will go to the contract. Okay. While this finishes, I'll probably get—

00:28:58 - Anthony Campolo

You're flying through this tutorial, by the way. You're probably going to be you're probably gonna have the fastest completion time. And like half the people didn't even get to get to the end because the network was so messed up. We didn't really know how to fix it for a couple of the episodes. Then we learned how, so then we had a better way of recovering after that. But for the ones that actually just worked the first time, everyone has gotten to the end.

00:29:21 - Rishi Raj Jain

That's great. I think they should come to India.

00:29:23 - Anthony Campolo

All right, so that's good.

00:29:27 - Rishi Raj Jain

Which is the one for registering the contract and this was actually the publish command that failed.

00:29:35 - Anthony Campolo

Okay, so this is—

00:29:37 - Rishi Raj Jain

should I—

00:29:37 - Anthony Campolo

a moment. I would say first just try running it again and let's see what happens. It might fix itself, but if not, then we're going to go into our client and configure a specific IP address.

00:29:52 - Rishi Raj Jain

But isn't that going to create another contract?

00:29:56 - Anthony Campolo

It will, but both the contracts will have been the same thing. Yeah, actually you didn't change your code and you can see, are they the same or are they different?

00:30:06 - Rishi Raj Jain

I do think they are the same. So 5, I'm just checking with the first few letters, so 5Y and K and YQ2.

00:30:14 - Anthony Campolo

Because what it might be doing is it might be taking the schema itself and then running some kind of hash on it. So if would always be the same if it's not changed. I don't know if that's the case or not, that's just my guess, because that's how IPFS does stuff. Mm-hmm. But, um, give me one second. I think I know exactly where the code is that I need if this is still broken.

00:30:38 - Rishi Raj Jain

That's—

00:30:40 - Anthony Campolo

here's a good node.

00:30:43 - Rishi Raj Jain

While this is getting resolved, I'm going to create my scripts.

00:30:47 - Anthony Campolo

Keep on, keep on rolling.

00:30:52 - Rishi Raj Jain

UpdateContract.js. Um, let's add that and then use our identity ID along with contract ID, um, to create the document schema and then update it. Okay, uh, this probably makes sense to me. You're trying to get my identity, you get my contract that I have created, and then get the schema of it, and then we are updating it with my note and then we send out the command to update it. All right, uh, this is done for update contract. Uh, add an apps object to client options and pass the contract ID to enable name and document syntax while accessing contract documents. For example, this particular.node, that's what we did in I think update. So yeah, let's update in client. So the client is now basically aware of— okay, I think this worked. So yeah, contract is now registered. Um, we have the contract ID, and I believe I need to add this to my env because we are picking this up later. So let me quickly add that. Cool. Um, So we have now updated the client to specify the particular contract ID this is all about. Let me go back to some commands now. So this one in particular was about register contract. Um, let's run retrieve contract. So I'm going to retrieve contract.

00:32:34 - Anthony Campolo

So the sense I'm getting that even though you don't know anything about crypto or blockchain or anything, all of this code has made perfect sense to you so far for the most part. Yeah.

00:32:43 - Rishi Raj Jain

Looks, looks fine to me. Like, I'm able to understand what's happening. So, um, right now what I've got is that there are two platforms. One has the currency, then we're converting the currency to another, and then we're specifying two things. That is my storage area, and then one is my ID area. And then we are operating on creating transactions, um, in form of contracts, I believe. Yeah, that's all, uh I have got for now.

00:33:10 - Anthony Campolo

Yeah, yeah, nailed it.

00:33:13 - Rishi Raj Jain

All right, um, so I've run retrieve contract and this is now trying to— this has printed the JSON.

00:33:21 - Anthony Campolo

That's it, that's the output, I think.

00:33:24 - Rishi Raj Jain

Yeah, and it has the note to the schema.

00:33:28 - Anthony Campolo

All right, yeah, you should take a look at that link to the, the Platform Explorer, the one that it gave you. Yeah. I think this will be the last time we'll do this, or maybe not, but, um, this is just a good way to always kind of like double-check exactly what happened. So I think you can go to the schema on the bottom. Yeah, yep, there you go.

00:33:47 - Rishi Raj Jain

Yeah, there has been no message, and, uh, we do— we can attach basically a note to the transaction. So that's what I get. All right. Well, now let's move on to creating the update contract, which is— yeah, I think I walked through this. This will get the existing note and then, uh, specify a string, uh, which has author and then set it to the note itself. Okay, so let's run this, which is update contract. So it should be updating in this particular thing, correct? Where we have the schema already, um, and then—

00:34:35 - Anthony Campolo

yeah, that's a good question. If the contract ID is not changing, then yeah, that should be the same place.

00:34:41 - Rishi Raj Jain

Got it. Let's see, how does this go? It's just going to take time. I'll use this time to create my own scripts for now. Uh, I have updated this client. I will now create a script that is submitNoteDocument.js. Then we put it in here, which is going to take my identity, get— create a document and it says hello from this particular user at this particular time. And then we're sending it out to all the nodes as described earlier. And then we have document ID, which is the new document that we have created, the, um, schema ID of it. Um, and then yeah, we just printing JSON of it. Sounds good. So this will give me the document ID and the JSON and stuff. Sounds good. Let's pick up documents while this runs. All right, so this worked, which is update the contract. So this updated the contract to have a note. Let's go here and refresh the page to see the updated schema. And yes, in the note we see the author here with some message. Um, but yeah, I, I do see the author updated in the schema. So that's great. All right, let me quickly copy the get documents thing. Now I'm going to first run the get documents to see what all is there in my particular documents, and then we'll update it using submit document. Okay, so I have no message because I've not run submit not document. Let me run that now. Submit What is the script for running this one? All right, so we are now publishing another document which has a note, and then we'll fetch it using get document. Sounds good to me. Cool.

00:37:13 - Anthony Campolo

You would probably assume they'll all take a decent amount of time. So, if you want to just— as soon as you run the thing, you just start doing the next part every time.

00:37:23 - Rishi Raj Jain

Let's do it. We create update. No documents. Right now I am able to create one. I am able to fetch all of them. Next is updating them. Yeah, this is starting to feel like CRUD actually. And yeah, I think I'm getting the hang of it. I don't know what's happening really underneath it. But yeah.

00:37:44 - Anthony Campolo

Yeah, that's one of the nice things about the platform is you don't have to worry about any of that. The idea is it's just like a globally distributed database that you can interact with.

00:37:53 - Rishi Raj Jain

Yeah, all right, let's rename this file. I added an extra S.

00:37:58 - Anthony Campolo

Are you a relational guy or a NoSQL guy?

00:38:02 - Rishi Raj Jain

I am learning relational now, but I am a sort of a NoSQL guy.

00:38:08 - Anthony Campolo

You probably grew up on the MERN stack if I had to guess, or I guess it would be MEAN for you.

00:38:14 - Rishi Raj Jain

Uh, yes, that was Angular, uh, first, and yeah, yeah, really not, not using Mongo really. Um, Dynamo was the one that I— but yeah, more or less.

00:38:23 - Anthony Campolo

Oh, that's way better.

00:38:27 - Rishi Raj Jain

All right, so, uh, we have submitted the document. Now let's try to fetch it using the get documents. And now I have added two scripts which is going to update it and delete it. Yeah, all right, makes sense. So I have this message that I added in submit node document. Where is that? Yeah, this one. So we have added a message with the name and the time, which is here. Sounds good. Now let's update the document. So this will try to get my identity, get my documents, the specific one with the ID, and then update the message with the new time zone, uh, new, new time, uh, label. Let's update it. Update node And then it's going to again broadcast it everyone with the replace command instead of adding to it. Okay, makes sense. And then we're going to delete this node. This is fun. That's cool.

00:39:28 - Anthony Campolo

Yeah, I remember the first time I, I went through this process with, um, oh, looks like it broke.

00:39:36 - Rishi Raj Jain

Yeah. Yeah, let's run this again.

00:39:45 - Anthony Campolo

Interesting. I didn't used to have it give you the label in there. I used to have my own name hardcoded. I'm not sure if that might be the issue.

00:40:00 - Rishi Raj Jain

This says internal server error for storage protocol.

00:40:05 - Anthony Campolo

Try getting rid of label and writing your thing directly in it. So, hello, rishi-90.

00:40:13 - Rishi Raj Jain

Got it. Let's do reconnect ID.

00:40:16 - Anthony Campolo

Just so I can narrow down whether that's what's actually happening or if this is a different error. And if we can't get this one working, it's not the end of the world because we just need something to be written there.

00:40:31 - Rishi Raj Jain

Yeah, so yeah, it says internal server error for storage protocol structure value are not bytes, a string, or array of values. And this looks particularly internal, um, SDK, uh, issue probably. I don't know, but I think for now we can skip this part because it's just updating the document. How about we delete it? Let's delete document with the ID. So let's delete that. All right, so this is now going to fetch the document and then delete it. And the delete failed as well. Uh, so there's probably something on the address.

00:41:25 - Anthony Campolo

Okay. Yeah, this is— so this is the last part where you're, you're writing to the, to the chain. So, um, I'm gonna say we should just move on because you, you understand what the updating and deleting is gonna do. So from here, this is— you now turn this into like an actual full-stack app. You're gonna build Express endpoint to expose your name endpoint essentially that will return your name information. We can just go ahead on that part.

00:42:01 - Rishi Raj Jain

I'm just trying to fetch the documents again to see if the message is there, and that's there. It's in particular to delete or update functionality, I believe.

00:42:08 - Anthony Campolo

Yes, I'll have to do some testing on that to figure out what's going on there.

00:42:14 - Rishi Raj Jain

Now we have Now we are just basically going to map this to— yeah, experts and CRS. All right, makes sense. So we creating server.js.

00:42:25 - Anthony Campolo

If you were to build a Node backend with like a Node framework, what would you use? If you're— or would you not use a framework?

00:42:33 - Rishi Raj Jain

Right now I think, um, Hono is quite hot right now, so I'll go with that.

00:42:39 - Anthony Campolo

Hono is tight. I'm just starting to learn Hono.

00:42:42 - Rishi Raj Jain

Yeah, that's great. Um, but yeah, Express is a good old thing for us too.

00:42:47 - Anthony Campolo

Yeah, a lot of times I'll go with Express if I'm just doing like a tutorial like this because I know everyone's gonna understand it. It's like, it's probably the worst choice for like an actual production server compared to things like Fastify and Hono and like all these other amazing ones out there, but it gets the job done.

00:43:05 - Rishi Raj Jain

Yes. Uh, cool. So we have created an Express app with CRS enabled, and then we— on each route that is dynamic to name, it will get the identity and try to get the— basically the ID of the person, as I understand. Yeah, so it's trying to say no identity found in case it's not done, and that's going to disconnect. Makes sense. Now we run the Express, which is now running on 3001, and then I'm trying to Curl. So, the name I should be entering here is rishi-90, correct?

00:43:40 - Anthony Campolo

Yeah, that will be the one. Gotcha there.

00:43:41 - Rishi Raj Jain

Because that's my label dot dash here. All right. Yeah, that's right. Let's open this in my new tab instead of doing the curl. So, rishi-90. What does this give me? Okay, so it's probably using something from—

00:44:03 - Anthony Campolo

cool, that's, that's funny. I think you're the first one to do that, just actually put into a browser. So yeah, that's great.

00:44:09 - Rishi Raj Jain

Yeah, super not fan of cURLs. I like to see, see something in there, and probably that's because I didn't have JSONPP installed and I was hesitant to do it. That's why I just went ahead with this one. But yeah, I see the data coming in for particular ID. I have the normalized table and the label. So this is basically just getting the—

00:44:26 - Anthony Campolo

could you try running that command? Because I'm just, I'm just curious because I don't think you need to explicitly install the JSONPP, but I, I'm be curious to figure out.

00:44:34 - Rishi Raj Jain

All right, let's do curl and then we take the output to be JSON compatible. Uh, this actually failed for some reason, which says cannot—

00:44:45 - Anthony Campolo

you didn't put, um, quotes around it.

00:44:48 - Rishi Raj Jain

Oh no, it actually disconnected the dash line, so the script exited. Run the Express and then another terminal, we will do that. So curl and then— yeah, this is going to fetch. Okay, I do have it. Yeah, exactly, it's coming in. Nice to know that I have this on BP.

00:45:16 - Anthony Campolo

Um, yeah, it's just specifically to pretty print your curl outputs. That's the only thing it does, at least that I use it for.

00:45:24 - Rishi Raj Jain

Right. So now we are creating our Next app, which is what I'm super familiar with. So let's name it as Dash app. Yes. Oh, wait. Do you want me to use TypeScript? I don't know. All right.

00:45:44 - Anthony Campolo

You should try it out. We'll see what happens. The version I build, I usually don't use TypeScript. It should still work.

00:45:52 - Rishi Raj Jain

Yes, we're using the source. Okay. App Router, yes. And more customization required.

00:45:59 - Anthony Campolo

Do you do everything on App Router now?

00:46:02 - Rishi Raj Jain

No. LaunchFiles Next.js is on Pages Router. I had people and a poll on Twitter which allowed me to start migrating it to the App Router. I migrated the APIs and now I'm migrating each component. To App Router.

00:46:17 - Anthony Campolo

I've heard a lot of—

00:46:21 - Rishi Raj Jain

it's sort of tricky because there's some things that just don't work with App Router. I recently learned about how to use Grammy SDK, that is for creating Telegram bots. So, I wrote an article about it because I didn't know that there's experimental server components config that you can use in Next.js. So yeah, uh, there's a learning curve, but I'm doing it so that other people don't have to. Uh, okay, gotcha.

00:46:50 - Anthony Campolo

Yeah, I think I got the link right here. I think I can flash that on the screen real quick. Bam. Yeah, once we're finished with this, we could take like 5 minutes. You can kind of show the home page and stuff for LaunchFast?

00:47:09 - Rishi Raj Jain

Sure, I'd be happy to.

00:47:12 - Anthony Campolo

We're going to be done like 25 minutes early and then I'll be curious, like your thoughts on the platform and what you would want to build with it if you were to.

00:47:22 - Rishi Raj Jain

Sure. So let's walk through LaunchFast pretty quickly.

00:47:27 - Anthony Campolo

Once we finish the tutorial, I'll say we should take a look at this. Let's get to the end of the tutorial first.

00:47:32 - Rishi Raj Jain

All right, sure, makes sense. I'll hide this for now.

00:47:35 - Anthony Campolo

You'll get a chance to make your pitch, don't worry.

00:47:38 - Rishi Raj Jain

Oh, that's fine, that's fine. I'm here to work on Dash. It's totally fine. This is going to take time, I believe. Let's just put the script for now. So we have page.tsx. Let's put it here. So this is just going to fetch something and then print my identity. There's no JSON for it.

00:48:02 - Anthony Campolo

So this is just to double-check that you got your Next.js thing set up and just have a kind of boilerplate page set up. It doesn't— you'll then, you'll add the logic to actually get your stuff after that.

00:48:15 - Rishi Raj Jain

Got it. Let's do npm run dev, which is 3000. And yeah, this, the starter app is ready. Then we are to replace this with this particular code which is going to do the same thing that we did. Then yeah.

00:48:36 - Anthony Campolo

Actually, I have an error in here that I still need to fix. It has my own name hardcoded in the endpoint. Look where you're hitting that. Yeah.

00:48:44 - Rishi Raj Jain

Rishi 90. Then I need to also have the server running, correct?

00:48:51 - Anthony Campolo

That's something that— Yeah, that's right.

00:48:54 - Rishi Raj Jain

So, we do npm run express.

00:48:58 - Anthony Campolo

You might still be running it, yeah.

00:49:07 - Rishi Raj Jain

Okay.

00:49:08 - Anthony Campolo

Cool.

00:49:11 - Rishi Raj Jain

Let's go to actually reload this page. So, this should—

00:49:18 - Anthony Campolo

You actually might— Need to fetch.

00:49:20 - Rishi Raj Jain

I think this is—

00:49:21 - Anthony Campolo

no, there we go. Yeah, cool. I need a loading state. Uh, yes, need some of them spinning. Yeah, you kind of need lots of spinners for, for this one.

00:49:30 - Rishi Raj Jain

Yeah. Uh, so now we have the loading state that we were just referring to.

00:49:35 - Anthony Campolo

Ah, right, I already did that. I forgot we need the fetch button though to get it.

00:49:39 - Rishi Raj Jain

Yes, so we have fetch data. Let's click on fetch data.

00:49:44 - Anthony Campolo

There's your loading. It doesn't spin, but it does tell you it's loading.

00:49:52 - Rishi Raj Jain

Yeah. Useful design.

00:49:55 - Anthony Campolo

This is exactly what— I probably just do this by habit because RedwoodJS, they have this concept of the cell, which will have a built-in loading state. And that's when you first create your boilerplate cell, it just says loading...

00:50:10 - Rishi Raj Jain

Got it. Uh, still loading, loading, loading.

00:50:18 - Anthony Campolo

Yeah, it worked last time, so it definitely—

00:50:22 - Rishi Raj Jain

again, again, this is the— yeah, let's redo the page. Uh, it should be much faster now.

00:50:30 - Anthony Campolo

Yeah, once we get this to work, actually, since you know Next very well, could you just make an environment variable for me to fix that?

00:50:37 - Rishi Raj Jain

Oh, sure. Yep.

00:50:38 - Anthony Campolo

Yep. So you should be able to just access— well, I guess you create the— because of the Next app is now inside of your project, you would need— it won't necessarily be able to reach out to the.env. You'd need a separate.env.local file, I guess.

00:50:56 - Rishi Raj Jain

Probably it's somehow not responding. Okay, this is responding now. Uh, where is my Next app? Okay.

00:51:03 - Anthony Campolo

Let's make sure to refresh that.

00:51:07 - Rishi Raj Jain

Yeah, refresh page first. Um, this is working. And now we have to set up an env, as you said. So let's do an env. We're going to say next public, uh, name, or let's label, and then 3090. And then we can use this. Fetch. So I think it should be it.

00:51:37 - Anthony Campolo

There we go.

00:51:39 - Rishi Raj Jain

Reload the page, fetch data, and it comes in. So it's coming in now from an env. Um, I think using next/public is important because you're loading the page on the client side and— that's right, yeah. So yeah, cool. Uh, this is done and this is Great, I would say. Um, we do have— we did have some of the commands that failed, and that was for updating the, you know, doc. But apart from that, I think all worked fine for me.

00:52:08 - Anthony Campolo

Yeah, yeah, totally. Um, yeah, it was good. The stuff that needed to work pretty much worked. And now you could imagine, like, you could build out endpoints to do all the other kind of functionality that we just implemented in scripts and then you could expose that through your UI. And then you have kind of just— it's just a general app building platform with, you know, your, your basic kind of CRUD operations. So you could probably imagine things you could build with this, I would assume.

00:52:39 - Rishi Raj Jain

Yes, I do. So basically using these scripts, uh, probably— I don't know if it's the right use case for crypto, but as I see that I can have transaction with documents, so I'm using something called Splitwise, and that allows me to showcase, uh, allow me to add or maintain the expenses with other people.

00:52:56 - Anthony Campolo

And so what is it called?

00:52:58 - Rishi Raj Jain

Uh, Splitwise.

00:53:00 - Anthony Campolo

Splitwise. Yeah, I've heard you talk about this.

00:53:03 - Rishi Raj Jain

Splitwise, the easy way. Um, and yeah, so we are always adding note about what this transaction or expense is for, and I, I'm really, really liking this update in, uh, Submit Note document, which will allow me to have a label to a transaction apart from just the transaction ID and some numbers that I don't understand. So, yeah, I think I would straight up go ahead and build that for an example. It's like a to-do for finance is where you can showcase.

00:53:36 - Anthony Campolo

No, that's awesome. And yeah, we're like, so the Dash itself, The way it funds this development is has something called a DAO, Decentralized Autonomous Organization. Where basically there's a certain amount of funds in the network that get set aside for paying people who submit proposals to build stuff. So if you wanted to like build that and integrate Dash, then we could get in touch with Ryan. We could figure that out. Because we're always looking for more contributors. And that was kind of one of the things we were hoping we would be able to get people in and show them this. And then they'd be like, "Oh cool, I can build this thing with it now." The fact you already have an idea for it is great. If you don't do it, then I can do it, but it'd be better if you did it.

00:54:18 - Rishi Raj Jain

Sure, I will do it once I have some flexibility on my plate, for sure.

00:54:23 - Anthony Campolo

And it'll be more useful once we're on mainnet, like a month or two as well. So no rush on that. But do you have any kind of remaining questions about this whole deal?

00:54:37 - Rishi Raj Jain

Yeah, I think I understood the flow and what's happening here, but probably it's great to have a distinction between the contract, the document, and what is— where does my ID lie? So I don't know, I'm not a crypto expert and that's why I'm asking for this. So we have a document which has the ability to have a note that's representing a transaction, I would say, but having a walkthrough of what's a document, what's a contract, and how are they separated. Is probably, um, good to know because I'm always assuming that there are transactions underneath, uh, but what's happening inside of that is sort of unclear. Probably we can have—

00:55:20 - Anthony Campolo

yeah, so yeah, for me, the way I, I wrote it and the way I make sense of this stuff is through the Explorer. So that's why if I wrote it in a way where every time you do one of those steps, you can then go look at the Explorer to see kind of what has changed. But you're right that a lot of this is kind of like jargon that might not necessarily make a whole bunch of sense. And this is kind of one of the big problems with like blockchain in general is just like it's the whole network and all the data is public and anyone can look at it, but it's just like, but how? You know, it's just like this huge hunk of code that has different ways of interacting with it because most blockchains will have like an RPC endpoint and then they'll have these client libraries. You're using the JavaScript SDK is also a Rust SDK, and they also are just exposing like gRPC endpoints. So you could just hit the, the endpoints on testnet or your own node and kind of introspect it, but then you're getting like really deep into reading all this docs to make sense of that. So that's why I think it— the explorers can be a good way to kind of get some visibility into what's happening here in terms of like how it's happening, like how the transactions are being written and stuff like that. That's kind of being handled by the network, and you can go learn about how the network does it. But the network itself, like, there's a clear separation with blockchain where the— once the blockchain network itself is created, you just interact with it and it shouldn't change. And you'll write code that's like the app layer on top, but it's like a protocol. It's like you, you can learn how TCP works, but you don't have to worry about changing underneath you, you know.

00:57:06 - Rishi Raj Jain

Yeah, I think I get it. Uh, I am yet to use, uh, gRPC for building a, you know, a super cool app.

00:57:13 - Anthony Campolo

Uh, but yeah, I've never used gRPC, and I, uh, I've used like JSON-RPC because that's how you would interact with, like Ethereum, is it gives you— you can just curl it and send JSON objects that kind of say, like, the information, how it works. And so this is kind of closer to that. Ethereum has also— they have something called smart contracts, which is totally like— there's no way of mapping these things onto each other because with Ethereum, you can actually put a program on the blockchain that has the ability to read, write, and manipulate variables and do all this stuff. Whereas you can't do that here. The, the actual logic is in the platform, and you can only write documents to it and then update those documents, interact with those documents. Whereas with Ethereum, you can actually put a brand new program on that could do anything. It just, it could just take all your money. You have no idea until you read the code.

00:58:14 - Rishi Raj Jain

I see. That's why probably I'm not going into crypto, I believe. I see a lot of things happening which sort of have me scared.

00:58:22 - Anthony Campolo

It's crazy, man. Yeah, you got to be really careful about it and make sure you're using proper— it really makes you think about security a lot more because people like everyone's worried or should be worried about getting hacked. But in the back of our minds, like a lot of people will still kind of skip steps and will be vulnerable in certain ways. Whereas once you've actually had your wallet hacked and your money just like stolen, you're like, oh, wow. This is why you don't click random links on the internet that are fed to you with a random popup.

00:58:56 - Rishi Raj Jain

Damn. Yeah, that sounds somewhat scary, I would say. But yeah, I don't know.

00:59:05 - Anthony Campolo

Well, with Dash, it's, um, they really think about security and they've been around for a really long time. So the newer a network is, the more kind of attack vectors are going to be, especially if they're trying to do like brand new things you couldn't do before. So in terms of like having a vulnerable wallet that someone could phish you, there's ways of doing that with different cryptos. Like if you just have your wallet as like an extension in your browser, you're exposed anytime you click a link anywhere in your browser because you have this extension running all the time. But with— a lot of times with Dash, I don't think there even is a browser extension. You can download a desktop app or a wallet app And then that will let you generate a wallet like we did here, except it'll be a wallet on mainnet on the original Dash. So that's where you would have money, and then that is kind of like secure, like a banking app or something like that, you know.

01:00:05 - Rishi Raj Jain

Yeah, that's a much-needed gap to cover. Yeah, we are using testnet for this. Probably have mainnet, but that would require real money, so definitely not going there for now.

01:00:18 - Anthony Campolo

Yeah. Ryan was saying that doing that, even once this is on mainnet, it's still going to be pretty cheap to create an identity. He was saying it should be like just a couple of dollars or something like that. When I got my Ethereum name, you know what I paid for? Ajcwebdev.eth, $200. Because this is when the market was like super run up. And once the network gets congested, you have to pay more to get it on there. Because I was trying to use this as like a supply and demand. Type thing. And the, the.eth namespace, that's the only one you want. Like, you don't want.e-ether, like, because that— you're gonna be the only weirdo who uses this one other thing. That you want the Ethereum namespace. There's like a scarcity to it as well. But, um, yeah, according to Ryan, it's not gonna be super expensive to buy one, but we shall see. So you gotta make sure you gotta get rishi.dash as soon as it's available.

01:01:12 - Rishi Raj Jain

Uh, sure. Uh, where do I check it? Are you checking it for me?

01:01:16 - Anthony Campolo

Uh, so let's, um, since we got some time now, um, do you want to show, um, your launch project for a bit?

01:01:25 - Rishi Raj Jain

Uh, sure, happy to, always. Uh, let me—

01:01:28 - Anthony Campolo

how long have you been building this for now? Because you were— did you start this before or after you left Edgeo?

01:01:34 - Rishi Raj Jain

Uh, this was after, um, definitely after Edgeo, and I think after 6 months after that.

01:01:40 - Anthony Campolo

Okay.

01:01:41 - Rishi Raj Jain

Yeah. This started in October. So, I had another— like, this is an inspired project for sure. And I saw Mark launching ShipFast. And then I was like, I can do something but for Astro. Because people are building websites in Astro for static content, but they can also use it for dynamic as well. So, that's what the intention was initially. And that did receive great love. Even from the Astro community as well. And then, yeah, it has been a great project. I'm also learning while I'm building this. So it's basically like I've initially started out to be a boilerplate. Now it's more like a starter kit because you get everything configured for you. You can accept logins using various methods. Right now it's Google and Twitter. Of course, you can expand. By default, it's Google and Twitter, but it can use several methods. I recently transformed it to use any Postgres or Redis. It's like flip a switch. You change an environment variable and you can now use Redis or you can now use Postgres. You just need to define some URLs.

01:02:44 - Anthony Campolo

Were you in the Astro DB preview at all?

01:02:47 - Rishi Raj Jain

No, it's not using Astro DB for now. I've tried to focus this project on building it on REST APIs.

01:02:56 - Anthony Campolo

Yeah, and I was asking if— if you had just done the, the DB, like if you played around with it at all, not if it was in this. I know it's not in this.

01:03:04 - Rishi Raj Jain

I see. No, I didn't get a chance at it. I, yeah, I need to, uh, definitely look into it and what's it.

01:03:11 - Anthony Campolo

So I'm— it's a bummer because I was good, I was planning on doing it and then they closed it because they are— it was a preview and then they're like, we're gonna close this until we release the real thing. If you're in the preview, you can still keep using it, but now they're not taking new users. So like, oh, now I gotta wait for the The real thing.

01:03:27 - Rishi Raj Jain

I see. Yeah.

01:03:29 - Anthony Campolo

Okay. Hopefully it won't be too long. They ship pretty fast. So I'm assuming in the next 3 to 6 months they'll launch the actual one. But, um, the database is one you gotta make sure you don't mess up.

01:03:39 - Rishi Raj Jain

By the time I make some updates, I see new Astro version coming up, uh, all the time. So Astro is moving super fast and I like it. Um, I like it.

01:03:46 - Anthony Campolo

Well, the content layer they're about to add will probably be really useful for something like this, cause that's gonna allow you to bring in a whole bunch of other crap.

01:03:56 - Rishi Raj Jain

Uh, what's that?

01:03:56 - Anthony Campolo

So did you hear that? So the, they did that big release where they had 3 big announcements. They had the server islands and then they had the content. Yeah. So server and content. Yeah. So it's like Gatsby. It's just Astro now has a Gatsby thing, like a content mesh that lets you hit different endpoints and mash them all together.

01:04:17 - Rishi Raj Jain

Got it. I see. Yeah, I'm yet to use this. Definitely when this, um, I'm excited for this and I can probably merge this back into LaunchFast.

01:04:27 - Anthony Campolo

You don't have like CMS integrations yet, do you?

01:04:31 - Rishi Raj Jain

No, there is no CMS as of now.

01:04:34 - Anthony Campolo

Um, yeah, so that's kind of with this, I imagine what this is for, for someone who wants to bring in, you know, something because they're using Contentful or whatever.

01:04:43 - Rishi Raj Jain

Ah, I, I get it now. So using this I can build components that correspond to parts in my CMS, and then I can plug them anywhere in my project. Okay, but yeah, let's see how does that turn out, because I need— probably I need to learn it first and then add it to— or play around it and then probably add it. Yeah, and then the payments thing that you were talking about is already configured. I'm yet to add a script where it auto-converts the currency, because in India you cannot accepting foreign currency, so you have to convert every time you go to a particular country user.

01:05:19 - Anthony Campolo

So yeah, so that's what crypto is, is really interesting. So it takes that whole thing away. If someone has crypto, I'll pay someone else in crypto. They can just— they have the Dash, they give someone else the Dash, and there's— there doesn't need to be a conversion. Then they can convert the Dash to whatever their national currency is once they have it. And Stripe integrates with a couple crypto solutions that support Dash. So whatever, as long as you have Stripe integrated in the project already, it should be trivial. This is actually something I'm planning on building, like a quick start guide of how to just build a quick Stripe integration. Then show the actual steps of doing the Dash part of like, because there's— I forget what the two things are that it integrates with. I could, um, let me look this up real quick.

01:06:05 - Rishi Raj Jain

Real quick.

01:06:06 - Anthony Campolo

So, um, look up, um, just Stripe crypto integrations. Okay, so, um, keep going. Keep going. Keep going.

01:06:38 - Rishi Raj Jain

NFT. And then we are covering. Yeah.

01:06:46 - Anthony Campolo

So I think at the very top it showed a bunch of— hold on. Stop right there. Yeah, that's not it. Hold on. I do know where this is on the the actual Dash website. I just gotta pull it up.

01:07:02 - Rishi Raj Jain

Let's see. Providers and tools.

01:07:13 - Anthony Campolo

Yeah, this is it. Okay, so NowPayments is one. And the other one I think was—

01:07:23 - Rishi Raj Jain

NowPayments was Dash? What I should search?

01:07:25 - Anthony Campolo

So look up Now Payments and Stripe.

01:07:29 - Rishi Raj Jain

I see Now Payments and then Stripe. PayNow Payments, is that the one? No, this is Singapore. Okay, probably this one.

01:07:41 - Anthony Campolo

I think that's the one.

01:07:50 - Rishi Raj Jain

Yeah, yeah, I see it. A lot of providers here. Where do you find the one for Stripe in this one?

01:07:57 - Anthony Campolo

I don't know, I've never, I've never done this before, so we don't need to necessarily get too deep into this. But, um, if you just go to their docs, or just actually, um, let me do this now.

01:08:10 - Rishi Raj Jain

Accept payments, correct. Let's open this one.

01:08:21 - Anthony Campolo

Oh, pay now is nice.

01:08:26 - Rishi Raj Jain

Uh, Stripe. Yeah, I don't see this, uh, Stripe in here in Now Payments API, but anyways, yeah, I think we can I think—

01:08:48 - Anthony Campolo

okay, here's something that's basically gonna get the idea across. Go to docs.stripe.com.

01:09:14 - Rishi Raj Jain

/cripto. Okay, there you go.

01:09:18 - Anthony Campolo

And just kind of scroll through that. Try the sample integration. Let's see what that is.

01:09:30 - Rishi Raj Jain

Okay, so this is using, uh, pre-built page with Stripe fiat to crypto on-ramp. And what is that? That's something I need to learn.

01:09:39 - Anthony Campolo

You go to the JS instead of Ruby. There we go.

01:09:44 - Rishi Raj Jain

Yeah, it's loading. It's time for now. I'm creating a session.

01:09:48 - Anthony Campolo

Okay, cool. So what this is doing is it says USDC, that's the destination currency. So USDC is a stablecoin. Pretty sure that's Coinbase's stablecoin. So this is where you would turn basically whatever your country's native currency is into that. So for there, if this may not necessarily work, this may not be integrated with the right things, but ideally you could just change that to say Dash and then it would turn into Dash. There might be more steps, like I said. I know that you need to use NowPayments or what the other thing that integrates with it. So these are things I need to figure out, and that's why I need to try the tutorial. But this kind of gives you an idea of once you have Stripe integrated, they have already built in a lot of crypto tooling and endpoints and client stuff for you.

01:10:38 - Rishi Raj Jain

Nice. That's great. I'm happy to add an integration once I learn about it. Sweet. Yes, looks good.

01:10:49 - Anthony Campolo

Awesome, man. Well, is there anything else you want to talk about? Or you could probably give your contact information and stuff if anyone watching wants to check your things out or contact you?

01:11:01 - Rishi Raj Jain

Sure, you could find me on Twitter. So that's rishi.chen. I'm always building LaunchFast, as you can see here, for sure. And then we have rishi.app where you can find my portfolio and you can have a lot of social links to reach out to me.

01:11:18 - Anthony Campolo

So yeah, is this built with Astro also?

01:11:21 - Rishi Raj Jain

This is built with SvelteKit, I believe. Yeah, this is with SvelteKit. So, I'm trying out different things, but I love the near HTML syntax of SvelteKit. But I heard that Runes in SvelteKit 5 is going to be something new. So, I'm excited to try that out once that comes out.

01:11:41 - Anthony Campolo

Yeah, yeah, no, I liked SvelteKit when it first came out. I haven't really kept up with it recently because I just have been sticking with Astro and React for the most part, which is just like so, so fast to work with. And I really like, I love Astro. So that's why I was stoked that you like built this really cool Astro project.

01:12:03 - Rishi Raj Jain

Yes, for sure. You should change that tutorial to use Astro instead then. Just kidding. Awesome, man.

01:12:10 - Anthony Campolo

Cool. So thanks so much for doing this. I'm gonna end the stream here, but stay on. Just, um, once we go live so we can talk afterwards. And thanks everyone for watching. We'll catch you at the next one.

On this pageJump to section