skip to content
Video cover art for Kicking Off Building for Dash Incubator - 1
Video

Kicking Off Building for Dash Incubator - 1

Anthony Campolo tests Dash Platform JavaScript SDK docs live, walking through examples, debugging issues, and noting improvements for developers.

Open .md

Episode Description

Anthony Campolo walks through the Dash Platform JavaScript SDK documentation in a live coding session, testing examples, troubleshooting issues, and identifying areas for improvement.

Episode Summary

In this solo coding stream kicking off his work for the Dash Incubator, Anthony Campolo dives into the Dash Platform JavaScript SDK documentation to evaluate its current state and identify improvements. He begins with basic curl commands to test endpoints directly, then progresses to using the JavaScript SDK methods, encountering issues along the way with deprecated libraries like request, confusion between require and ESM syntax, and outdated Node.js version recommendations. Throughout the session, he highlights structural problems with the documentation being spread across multiple sites and GitHub organizations (dash-hive, dashpay, dash-evo), making it difficult to know which packages and examples are current. He works through methods like getBestBlockHash, getBlockHash, and getMnListDiff, using ChatGPT to help fix syntax errors and rewriting examples with node-fetch instead of deprecated alternatives. By the end, Anthony has a clearer picture of what needs updating and plans to consolidate the scattered documentation, eventually building toward integrating these examples into a React application in future streams.

Speakers

  • Anthony Campolo

Chapters

00:00:00 - Stream Kickoff and Setup

Anthony introduces the stream, explaining he's broadcasting simultaneously across his personal Twitch and YouTube channels along with Dash's official channels. He references a previous appearance with Ryan and Amanda on the Dash channel where they discussed his upcoming work for the Dash Incubator, which will involve building JavaScript tools and examples.

He gets his streaming setup configured properly, ensuring he can see comments from viewers across platforms, and greets early arrivals to the stream. Anthony notes this will be a fairly off-the-cuff coding session rather than a polished presentation, setting expectations for an exploratory approach to the work ahead.

00:01:43 - JavaScript SDK Documentation State

Anthony begins examining the Dash documentation, particularly the JavaScript SDK, noting common JavaScript challenges around different Node versions and the require versus import dichotomy. He points out a specific example using the deprecated request library and discusses how node-fetch is being phased out in favor of native fetch in newer Node versions.

He navigates between different documentation sources, finding the dash.org developer portal docs, and explains his typical workflow for evaluating APIs. His approach starts with simple curl commands to verify endpoints work before moving to client libraries, ensuring each layer of abstraction can be debugged independently when problems arise.

00:04:09 - Working with Curl Commands and JSON RPC

Anthony demonstrates using curl commands to interact with the Dash testnet, sending POST requests with JSON-RPC formatted bodies. He explains the basic structure of JSON-RPC calls, including the method name, parameters, and ID fields, while acknowledging some uncertainty about what the ID field actually does.

He shares his earlier troubleshooting experience with TLS/SSL encryption errors that ChatGPT helped him resolve. Anthony provides context for viewers unfamiliar with blockchain development, mentioning his previous year working at QuickNode and offering his perspective that despite the recent crypto downturn, the technology has long-term promise based on historical cycles.

00:08:22 - Finding the Right SDK and GitHub Repositories

Anthony searches for the official Dash JavaScript SDK GitHub repository, encountering confusion between multiple organizations including dash-hive (Ryan's) and dashpay. He highlights a fundamental challenge with decentralized blockchain projects: documentation and code repositories are often scattered across many locations, making it unclear which are official and current.

He references a previous stream by Dan Tan that critiqued the Dash docs structurally, and emphasizes the importance of GitHub readmes staying synchronized with the actual published npm packages. Anthony stresses that without this alignment, developers face significant confusion about which package and version they should actually be using.

00:14:21 - Setting Up the First Project

Anthony begins building his project from scratch, walking through the setup steps that he feels are often left out of documentation but are crucial for newcomers. He emphasizes the importance of explicitly addressing whether to set type: module in package.json for ESM versus CommonJS.

He discusses Node version recommendations, criticizing the docs for suggesting Node 12 which is past long-term support. Anthony advocates for using ESM since it's the modern standard and integrates better with newer tools like Vite, especially when the goal is eventually building React applications. He uses pnpm and walks through initializing the project structure.

00:21:01 - Building the Tutorial Structure

Anthony explains his methodology of writing documentation as he codes, treating each project as both a learning exercise and a potential blog post or tutorial. This approach helps him concretize each step and provides better feedback for upstream documentation improvements.

He sets up the project's README with sections for resources and creates the initial example for getting the best block hash. Anthony continues advocating for ESM as the future-proof choice, discussing how the heat death of the universe might come before everyone fully migrates off require, but moving forward with new docs in ESM is still the right call.

00:27:31 - First Working SDK Example

Anthony installs the dash package and creates his first JavaScript file using the SDK. He demonstrates switching between require and ESM syntax by adding type: module to package.json and converting the import statements. The simple getBestBlockHash example successfully runs and returns a hash value.

He notes how clean the conversion process is when it works smoothly, while acknowledging this isn't always the case. The example structure becomes a template for further exploration, with Anthony planning to build up a collection of self-contained Node scripts that can each be run independently from the command line.

00:32:05 - Understanding Block Hash Methods

Anthony explores the getBestBlockHash method's documentation, learning that it returns the block hash of the chain tip. He discusses the basic concept of blockchains for less familiar viewers, explaining how blocks are added periodically containing recent transactions.

He builds out three different ways to interact with the same endpoint: a curl command, a direct fetch request, and the SDK method. This progression helps developers understand what's happening at each layer of abstraction. Anthony saves these examples in separate files so users can troubleshoot at whatever level they're comfortable with.

00:38:32 - Implementing Fetch Examples

Anthony works on creating a fetch-based example to replace the deprecated request library example in the docs. He addresses the version 2 requirement for node-fetch to work properly with ESM and notes that the previous TLS errors he encountered seem to have resolved themselves overnight.

He compares the output formats between the SDK method (which returns just the result) and the fetch approach (which returns the full JSON-RPC response object), then refactors the fetch example to destructure just the result for cleaner output. Anthony recommends Ryan should accept a PR updating the docs to use node-fetch instead of the deprecated request library.

00:46:52 - Tackling getBlockHash

Anthony moves on to the getBlockHash method, noting there's no JavaScript example provided in the docs at all, only a curl example. He sees this as an opportunity to contribute even more value by writing examples that don't yet exist.

He explores the concept of block height, discovering it represents how many blocks separate a given block from the first Dash block. After running into a parameter formatting issue, Anthony successfully gets the method working with the height value passed correctly as a parameter.

00:53:33 - Using ChatGPT for Debugging

When Anthony hits a syntax issue with his fetch implementation, he turns to ChatGPT for help fixing what he calls his "junior JavaScript mistakes." ChatGPT correctly identifies the need for JSON.stringify and provides a try-catch wrapper for better error handling.

Anthony reflects on how AI tools like ChatGPT are particularly valuable for junior and mid-level developers who need quick syntax fixes or basic bug solutions. He pushes back against developers who don't see ChatGPT's utility, suggesting they need to think more creatively about how to integrate it into their workflow for routine debugging tasks.

01:00:03 - Exploring gRPC and Endpoint Architecture

Anthony works through getMnListDiff and discovers the docs mention that most endpoints are migrating from JSON-RPC to gRPC. This raises questions about whether updating the JSON-RPC examples is still worthwhile if they'll be deprecated soon.

He learns that JSON-RPC currently exposes layer-one information while gRPC supports layer-two and event streaming. Anthony notes he'd need additional incentive to learn gRPC, joking that learning it should be paid work rather than something he picks up as a tangent. He focuses on understanding what client libraries (DAPI client, DAPI gRPC, JavaScript DAPI request) are appropriate for which use cases.

01:08:42 - Initializing the Dash Client Properly

Anthony refines his approach by creating a single client initialization file that can be exported and imported across multiple example scripts, avoiding redundant client setup. He discusses the wallet-related options like setting mnemonic to null for new wallet generation and offline mode for skipping chain sync.

He searches for TypeScript typings to understand all available SDK methods, exploring both the dash-evo and dashpay GitHub repositories. The exploration reveals just how scattered the relevant code is across multiple repos and packages, reinforcing his earlier complaints about the fragmented documentation ecosystem.

01:14:21 - Discovering Better Documentation

Anthony stumbles upon what he describes as the documentation page he should have started with from the beginning, containing a comprehensive reference of methods and capabilities. However, he notes the lack of syntax highlighting makes it less readable than it could be.

He continues exploring the relationships between dash, dash-evo, dashpay, and the wallet library, getting clarification from a viewer named Pete that the SDK contains the wallet functionality. Anthony appreciates the help understanding how all these pieces fit together as someone still learning the Dash ecosystem.

01:21:51 - Testing HTML Script Tag Example

Anthony attempts to run a single-page HTML example from the docs that uses a script tag to load the Dash library from unpkg. He encounters MIME type errors and finds the example doesn't work as documented, suggesting it should either be fixed or removed from the documentation.

He prefers examples like this when they work because they avoid build step complexity, but emphasizes that broken examples in docs are worse than no examples at all. Anthony makes a note to follow up on this issue when consolidating documentation improvements.

01:26:14 - Consolidating Documentation Vision

Anthony articulates his vision for documentation consolidation, arguing that the entire separate docs site shouldn't exist and everything should be unified under dashplatform.readme.io. Having two separate documentation sites with overlapping content creates maintenance burden and confusion for developers.

He acknowledges that his work might seem like endless bike-shedding to viewers expecting to see things actually built, but explains that systematic evaluation of all examples is necessary first. His plan involves identifying broken examples, deprecated dependencies, and missing JavaScript examples, then submitting comprehensive PRs to clean everything up.

01:32:05 - DAPI Client vs SDK Methods

Anthony discovers important distinctions between using client.core methods directly versus going through the DAPI client. He successfully runs getBestBlockHash through the DAPI client interface and explores the getStatus method, which returns extensive information about the chain, masternodes, and network state.

He gets clarification from viewer Pete that the documentation discrepancy is real and the existing docs need updating. Anthony confirms his understanding that the standalone DAPI client package mentioned in some examples is deprecated, and the current approach should be importing dash and accessing client methods through the unified SDK.

01:39:17 - Final Examples and Wrap-up

Anthony works through getBlockByHeight, encountering a buffer return value that needs conversion to a string. With help from a viewer suggesting toString(), he gets the method returning readable output, though notes there's still more work to do on properly formatting these responses.

He wraps up the stream noting he has a meeting coming up, thanks viewer Pete for helpful clarifications throughout, and outlines his plan for future streams. Anthony intends to continue evaluating documentation examples weekly before transitioning to building actual React frontends, with a "getting started" tutorial likely being his next major contribution to clean up the onboarding experience for new Dash developers.

Transcript

00:00:04 - Anthony Campolo

All right, hello, we are live.

00:00:09 - Anthony Campolo

What's up everybody?

00:00:11 - Anthony Campolo

My name is Anthony Campolo.

00:00:13 - Anthony Campolo

I'm coming at you from four different places right now.

00:00:18 - Anthony Campolo

I'm coming from my Twitch, YouTube, and

00:00:22 - Anthony Campolo

Dashes Twitch and YouTube.

00:00:25 - Anthony Campolo

So if people saw me on Monday, I was on the Dash channel with Ryan and Amanda, and we were talking about

00:00:38 - Anthony Campolo

what I'm going to be kind of doing for the dash incubator.

00:00:41 - Anthony Campolo

And it's going to be building out some cool JavaScript stuff.

00:00:47 - Anthony Campolo

It's going to be fairly kind of like off the cuff coding stuff.

00:00:54 - Anthony Campolo

And real quick, I'm just going to make sure.

00:00:57 - Anthony Campolo

I'm actually coming in good.

00:01:02 - Anthony Campolo

Yep, I can hear myself there.

00:01:04 - Anthony Campolo

Great.

00:01:05 - Anthony Campolo

All right.

00:01:06 - Anthony Campolo

And I'm just going to have to make sure I position this so that I can see the comments.

00:01:14 - Anthony Campolo

That's the only thing.

00:01:16 - Anthony Campolo

So...

00:01:18 - Anthony Campolo

Let me go ahead and, oh, let's see if I can screen share.

00:01:28 - Anthony Campolo

Sweet.

00:01:30 - Anthony Campolo

Okay, hello learner.

00:01:33 - Anthony Campolo

What is up?

00:01:34 - Anthony Campolo

You're the first guest on this fun new stream we'll be doing.

00:01:39 - Anthony Campolo

Okay, that's probably pretty good.

00:01:43 - Anthony Campolo

So,

00:01:49 - Anthony Campolo

Great, I was actually playing around a bit with the dash docs and trying to get a feel for how they work and kind of what state they're in,

00:02:02 - Anthony Campolo

especially in terms of the JavaScript SDK.

00:02:06 - Anthony Campolo

So this is something that

00:02:09 - Anthony Campolo

is always a challenge with JavaScript.

00:02:13 - Anthony Campolo

You will frequently have different versions of node, different versions of require versus import, and a lot of confusion there.

00:02:25 - Anthony Campolo

You also now have this problem with fetch, where you may be using an older fetch library.

00:02:33 - Anthony Campolo

Like one of the examples in here is using request, which is something that I didn't really even know about.

00:02:38 - Anthony Campolo

It's a deprecated fetch library that was not node fetch.

00:02:44 - Anthony Campolo

So node fetch is like...

00:02:46 - Anthony Campolo

I don't know if we can say deprecated or not, but it's something that people are now moving off of because fetch is just in node now.

00:02:54 - Anthony Campolo

But I want to get to, it's not the docs I wanted, a couple of

00:03:00 - Anthony Campolo

I have a couple different docs.

00:03:02 - Anthony Campolo

I want the dash.org docs.

00:03:07 - Anthony Campolo

And developers, developer portal.

00:03:11 - Anthony Campolo

Okay, because here's where they give you a lot of the stuff I'll actually be doing.

00:03:17 - Anthony Campolo

There's a couple things in here also that did not work.

00:03:21 - Anthony Campolo

So a couple things that I kind of wanted to do.

00:03:26 - Anthony Campolo

Eventually the point is going to be getting to actually building like React apps and stuff like that.

00:03:31 - Anthony Campolo

But before you even do that, you want your JavaScript general stuff to work.

00:03:38 - Anthony Campolo

So I usually go in a couple steps here.

00:03:40 - Anthony Campolo

I start by just trying to get something to work with.

00:03:45 - Anthony Campolo

It's just like a curl command.

00:03:48 - Anthony Campolo

Let me just open up what we got here.

00:03:52 - Anthony Campolo

It's all nice and big.

00:04:06 - Anthony Campolo

Great, great, great.

00:04:08 - Anthony Campolo

Okay.

00:04:09 - Anthony Campolo

So for example,

00:04:12 - Anthony Campolo

There's one curl command that I had for...

00:04:30 - Anthony Campolo

Here we go.

00:04:31 - Anthony Campolo

This is all on.

00:04:32 - Anthony Campolo

Okay.

00:04:33 - Anthony Campolo

So I like starting off like something here where you can just run a curl command and get a response back.

00:04:39 - Anthony Campolo

This is like the simplest, most basic way to interact with an endpoint or an API, right?

00:04:45 - Anthony Campolo

You hit a URL.

00:04:47 - Anthony Campolo

Yes.

00:04:48 - Anthony Campolo

Either get it or you post it usually.

00:04:51 - Anthony Campolo

And an example like this, so this is a blockchain.

00:04:56 - Anthony Campolo

How much you know about blockchain or not is going to depend on whether you're someone who is coming at this from the Dash channel or the AJC channel.

00:05:08 - Anthony Campolo

Because most of my followers and friends and people who tend to watch my content are less blockchain oriented, even though I spent close to a year working at a blockchain company.

00:05:21 - Anthony Campolo

But I actually really enjoyed it.

00:05:24 - Anthony Campolo

ended up getting out of blockchain just because I got an opportunity at this company, Edgio.

00:05:31 - Anthony Campolo

I wanted to do that instead, but I actually think the technology has a lot of promise, even though people think it's kind of quote unquote over, thanks to the whole blow up last year.

00:05:43 - Anthony Campolo

But these things, they go in cycles like we had ups and downs in the past.

00:05:48 - Anthony Campolo

And each time it came back up again, even higher than the time before it.

00:05:53 - Anthony Campolo

So if history repeats itself, we will be here again in 2024, 25, 26, hard to say.

00:06:07 - Anthony Campolo

But with this example here, so it's curl command.

00:06:13 - Anthony Campolo

We're sending a post.

00:06:14 - Anthony Campolo

We're sending a post to this endpoint.

00:06:17 - Anthony Campolo

The testnets are a little interesting.

00:06:21 - Anthony Campolo

I was having issues with them at first that ChatGPT helped me figure out because some sort of TLS SSL.

00:06:30 - Anthony Campolo

Encryption thing that was throwing errors.

00:06:34 - Anthony Campolo

If we find that in examples as we go, I'll kind of point it out.

00:06:38 - Anthony Campolo

And then you set the header to JSON.

00:06:40 - Anthony Campolo

And this is a JSON RPC, which is the way that a lot of developers interact with these blockchains.

00:06:49 - Anthony Campolo

You have

00:06:51 - Anthony Campolo

just like data that you post to an endpoint and then you specify a method.

00:06:58 - Anthony Campolo

And then if there's like the specific JSON RPC API, if there's a version, these are the version.

00:07:05 - Anthony Campolo

And then if there's any parameters, so.

00:07:09 - Anthony Campolo

In this one, this is get best block hash.

00:07:14 - Anthony Campolo

Not sure.

00:07:16 - Anthony Campolo

Let's see what the ID differentials the same endpoint.

00:07:21 - Anthony Campolo

Yes, I'm a little confused what the ID is for, but for

00:07:29 - Anthony Campolo

Let's see.

00:07:29 - Anthony Campolo

So, yeah.

00:07:30 - Anthony Campolo

So for this one, get block hash.

00:07:32 - Anthony Campolo

You set a parameter.

00:07:34 - Anthony Campolo

And so this is like, what is the block hash you actually want to get back?

00:07:46 - Anthony Campolo

Yeah, and so with any of these things, you have...

00:07:51 - Anthony Campolo

Yo.

00:07:52 - Anthony Campolo

I should have told you in about 15 minutes.

00:07:55 - Anthony Campolo

All right, cool.

00:07:56 - Anthony Campolo

We haven't missed much so far.

00:08:03 - Anthony Campolo

But once you catch up to me, I will have some questions for you.

00:08:08 - Anthony Campolo

And if you wanted to hop on, actually.

00:08:13 - Anthony Campolo

Feel free to join and then just hit me up in the comments so I know and I can just add you to the stream.

00:08:22 - Anthony Campolo

So what I was going to do is anytime I kind of want to figure out how to work with an endpoint and get to the state where I can actually like do stuff with it in a JavaScript project, I start with a curl command like this.

00:08:34 - Anthony Campolo

And now with Dash, there is a Dash JavaScript library.

00:08:41 - Anthony Campolo

And these client libraries are usually useful because they allow you to not have to worry about just making a straight up fetch request yourself.

00:08:52 - Anthony Campolo

It'll kind of give you something nicer and more integrated to do it.

00:08:58 - Anthony Campolo

Hey, what's up, Nikki T?

00:08:59 - Anthony Campolo

I'll be curious if you find any of this stuff interesting, as I know you're not a very big blockchain developer, but I also know you're open-minded and like to learn, so that is a good thing.

00:09:12 - Anthony Campolo

But, so I was saying, we usually have...

00:09:16 - Anthony Campolo

The ability to bring in some sort of JavaScript library like so.

00:09:23 - Anthony Campolo

You bring in dash and then you initialize a dash client and then you will just have like methods on it.

00:09:32 - Anthony Campolo

And when I was doing this, I hit a couple weird things.

00:09:37 - Anthony Campolo

First off, it's not entirely clear what version you should be on.

00:09:42 - Anthony Campolo

Because if you go to...

00:09:46 - Anthony Campolo

That's first off.

00:09:47 - Anthony Campolo

That's not good.

00:09:48 - Anthony Campolo

So is that just GitHub being down?

00:09:59 - Anthony Campolo

So if you go to the, I want to go to the GitHub for it.

00:10:07 - Anthony Campolo

There is a GitHub for it somewhere.

00:10:10 - Anthony Campolo

GitHub dash SDK.

00:10:15 - Anthony Campolo

Was deprecated.

00:10:38 - Anthony Campolo

Okay, so this is not it at all.

00:10:49 - Anthony Campolo

Here we go, this is what I want.

00:10:50 - Anthony Campolo

Okay, so this is the dash hive.

00:10:54 - Anthony Campolo

This is Ryan.

00:10:56 - Anthony Campolo

So this is where, you can actually get the SDK.

00:11:14 - Anthony Campolo

That's not it, actually.

00:11:16 - Anthony Campolo

There's a link in the docs here.

00:11:40 - Anthony Campolo

This is the link.

00:11:42 - Anthony Campolo

There we go.

00:11:43 - Anthony Campolo

Okay, here we go.

00:11:44 - Anthony Campolo

This is what I want.

00:11:46 - Anthony Campolo

So let me grab, start grabbing links, make sure I save these places.

00:11:50 - Anthony Campolo

Okay.

00:12:01 - Anthony Campolo

SDK.

00:12:14 - Anthony Campolo

Okay, this is great.

00:12:16 - Anthony Campolo

This is actually, I think, what I wasn't able to find yesterday.

00:12:20 - Anthony Campolo

Or not that I wasn't able to find it, but...

00:12:24 - Anthony Campolo

So there's this huge problem with general blockchain projects, which is that they're very decentralized.

00:12:31 - Anthony Campolo

It's like part of the whole point.

00:12:32 - Anthony Campolo

But sometimes you end up with a lot of different documentation and GitHub repos and GitHub organizations.

00:12:39 - Anthony Campolo

And so like this is dash pay.

00:12:43 - Anthony Campolo

So that's different from dash hive from what we were looking at before.

00:12:47 - Anthony Campolo

And then with the docs, like I was saying, you know, you have these docs here.

00:12:52 - Anthony Campolo

We also had the, there's like a different kind of docs here, docs-dash.org.

00:13:01 - Anthony Campolo

And actually, Dan Tan did a stream.

00:13:07 - Anthony Campolo

On this already.

00:13:11 - Anthony Campolo

Docs roasting.

00:13:13 - Anthony Campolo

So this is him kind of talking more structurally about the docs.

00:13:22 - Anthony Campolo

And I imagine he gave a lot of that feedback.

00:13:25 - Anthony Campolo

about making sure it's clear where you need to go to find things and then where said things are that you need to find.

00:13:35 - Anthony Campolo

So as I was going through this last night, I was just trying out different examples and looking at different repos.

00:13:43 - Anthony Campolo

And it wasn't always clear what was actually supported and official.

00:13:49 - Anthony Campolo

And so these GitHub readmes right here that go along with the code you're actually installing on NPM, that's what's really important.

00:13:58 - Anthony Campolo

I want to make sure it's at least syncing up there or else you're going to end up.

00:14:04 - Anthony Campolo

A lot of weirdness happening because there was also, I can tell if it was supposed to be dash or dash JSA.

00:14:10 - Anthony Campolo

That's because I was looking at one of the wrong packages before, but this is definitely the right stuff now.

00:14:21 - Anthony Campolo

Okay, cool.

00:14:22 - Anthony Campolo

So with this you have dash client methods, but what I had also done, I think I wanna, oh, I know what I wanna do.

00:14:32 - Anthony Campolo

I wanna move this.

00:14:34 - Anthony Campolo

This is my usual setup.

00:14:37 - Anthony Campolo

Boom.

00:14:39 - Anthony Campolo

Except this is, yeah, usually this is on the other side of the screen.

00:14:44 - Anthony Campolo

That's why it's throwing me off.

00:14:46 - Anthony Campolo

There we go.

00:14:48 - Anthony Campolo

Okay.

00:14:53 - Anthony Campolo

No, we're good.

00:14:56 - Anthony Campolo

Okay, so there's straight up curl request, then there's using a client library, but the client library, if it doesn't work, it's good to be able to just make a straight up fetch request and know how to do that.

00:15:11 - Anthony Campolo

So I have some examples.

00:15:15 - Anthony Campolo

I'll write out that art like this where you just have a JavaScript function that runs a fetch method, feeds it the endpoint, and then sets the

00:15:29 - Anthony Campolo

all of the body stuff just straight up in JSON here.

00:15:35 - Anthony Campolo

And then you can console log the results.

00:15:38 - Anthony Campolo

So that's kind of like the different ways you can start working with the endpoint and figure out how do you interact with it.

00:15:45 - Anthony Campolo

And since this is all just through this JSON RPC, it's all pretty much the same.

00:15:50 - Anthony Campolo

You have an endpoint that you're posting to and you're hitting it with some stuff.

00:15:57 - Anthony Campolo

So let's take a look at, so I wanted to just basically go through a whole bunch of the examples that are in the docs and see where they break and make some notes.

00:16:11 - Anthony Campolo

And then that'll be useful for the, any other people who happen to end up on these docs and may not know what's happening.

00:16:17 - Anthony Campolo

There's also some places where

00:16:20 - Anthony Campolo

it will probably make sense to just rewrite the example entirely, especially the ones that are using requests, because it's a clearly deprecated library.

00:16:29 - Anthony Campolo

So that's not something that should probably be in use.

00:16:37 - Anthony Campolo

This is what I'm talking about, this example right here.

00:16:39 - Anthony Campolo

So this is using request.

00:16:42 - Anthony Campolo

So request.

00:16:46 - Anthony Campolo

HTTP request.

00:16:47 - Anthony Campolo

So boom, right at the top.

00:16:48 - Anthony Campolo

This package has been deprecated, published three years ago as of February 11, 2020, for even my boot camp a long time ago.

00:16:57 - Anthony Campolo

So don't really want super old, deprecated libraries in your docs for obvious reasons.

00:17:07 - Anthony Campolo

But thankfully, I will be able to rewrite it with a slightly less deprecated library because NodeFetch...

00:17:18 - Anthony Campolo

Not necessarily deprecated.

00:17:20 - Anthony Campolo

In fact, it's not deprecated at all.

00:17:22 - Anthony Campolo

Let's see, update in the last two months.

00:17:26 - Anthony Campolo

But version 2 docs are the ones that actually work, and version 2 is what actually works with ESM.

00:17:35 - Anthony Campolo

So that's another thing.

00:17:38 - Anthony Campolo

If you look at these examples, they're all written with require.

00:17:45 - Anthony Campolo

Versus imports.

00:17:48 - Anthony Campolo

And so this is where, again, you find these little examples, things can be really confusing

00:17:54 - Anthony Campolo

because you may have some things in require, but you need to have the ESM, especially if the goal is to eventually get this into something that's gonna work in a React component because React,

00:18:04 - Anthony Campolo

tends to be using ESM at this point.

00:18:07 - Anthony Campolo

You can probably do require with React, I don't see.

00:18:10 - Anthony Campolo

Why not?

00:18:13 - Anthony Campolo

But you'd be way out of step with like the current versions of React, how everyone writes React, you know, everyone's gonna be using ESM in any current React example you see.

00:18:23 - Anthony Campolo

So,

00:18:26 - Anthony Campolo

The places I wanted to hit.

00:18:27 - Anthony Campolo

So this is the very, very first example for JavaScript connected to dash platform.

00:18:38 - Anthony Campolo

So let me.

00:18:42 - Anthony Campolo

Close that guy.

00:18:45 - Anthony Campolo

Okay, this is the curl request for this, I think.

00:19:05 - Anthony Campolo

Hold on.

00:19:05 - Anthony Campolo

No, that's back here.

00:19:07 - Anthony Campolo

Okay, here it is.

00:19:11 - Anthony Campolo

Do, do, do.

00:19:17 - Anthony Campolo

Not sure what happened there.

00:19:19 - Anthony Campolo

Okay.

00:19:20 - Anthony Campolo

Anyway, let's just...

00:19:25 - Anthony Campolo

So...

00:19:41 - Anthony Campolo

Okay, there we go.

00:19:42 - Anthony Campolo

Dash connect.

00:19:44 - Anthony Campolo

So let me grab the...

00:20:01 - Anthony Campolo

So what I always do when I'm doing this kind of stuff is, and this is giving me one of the things with these streams is this will be more so me kind of working through just like how I actually do this and less me like building something before the stream and then presenting it to

00:20:17 - Anthony Campolo

people, which is what I do for a lot of my streams.

00:20:19 - Anthony Campolo

Usually this is giving more so me like, how do I go through docs and try examples and troubleshoot them and then potentially upstream changes if I think things are broken or unclear.

00:20:32 - Anthony Campolo

And then as I'm doing that, I'm basically writing docs as I'm doing it, both for myself so I can kind of make sense of what's actually happening as I'm doing it.

00:20:41 - Anthony Campolo

And it's more easy to give that feedback.

00:20:43 - Anthony Campolo

Or if I actually want it to end up as like a blog post, or if I'm trying to just build a new example, I'll still go through this project.

00:20:50 - Anthony Campolo

And so essentially everything I ever build has a tutorial attached to it just because it's like it's how I kind of think through this stuff.

00:20:56 - Anthony Campolo

It helps me concretize every single step.

00:21:01 - Anthony Campolo

So, yeah.

00:21:04 - Anthony Campolo

And then, you know, he's going to have an outline.

00:21:07 - Anthony Campolo

So let me just take what I've got right now already.

00:21:15 - Anthony Campolo

We'll run through kind of each example.

00:21:28 - Anthony Campolo

Let's just have some.

00:21:50 - Anthony Campolo

Usually resources will go at the end, but for, I'll keep at the top for now.

00:22:07 - Anthony Campolo

Project X dash platform.

00:22:11 - Anthony Campolo

Get best block hash.

00:23:06 - Anthony Campolo

So basically the structure of what's happening right now is, I'll start by building a project from scratch and even like showing how do you actually even get a package.json and the dependencies into your project?

00:23:18 - Anthony Campolo

Because you'll notice here, this example just says npm install dash.

00:23:22 - Anthony Campolo

Great.

00:23:23 - Anthony Campolo

And then we just all dash into what?

00:23:26 - Anthony Campolo

So.

00:23:26 - Anthony Campolo

So I think that this is a step that sometimes are left out, but it's kind of really important, especially if you're dealing with stuff like this.

00:23:35 - Anthony Campolo

If you're dealing with whether it's going to be required or import, you need to know, do you need to set type to module and all this stuff that goes along with that.

00:23:45 - Anthony Campolo

So since I think the goal should always be to end up at ESM because eventually in 20 years or right before the heat death of the universe, they will probably stop using require.

00:23:56 - Anthony Campolo

And it's just better to be on ESM because then it'll be easier to integrate with newer tools like V.

00:24:03 - Anthony Campolo

And right now, I think this tells you to use Node 12.

00:24:09 - Anthony Campolo

You should not be using Node 12 if you're someone writing Node still.

00:24:13 - Anthony Campolo

I think that's considered off of long-term support by now, which means you don't really have a lot of good guarantees around.

00:24:23 - Anthony Campolo

A lot of stuff.

00:24:24 - Anthony Campolo

I mean, I think they'll still fix security vulnerabilities.

00:24:29 - Anthony Campolo

But yeah, exactly.

00:24:31 - Anthony Campolo

Yeah, security issue.

00:24:32 - Anthony Campolo

So you want stuff to be on the newer versions of Node if you ever can.

00:24:37 - Anthony Campolo

I think I'll be running Node 16.

00:24:43 - Anthony Campolo

Right now.

00:24:45 - Anthony Campolo

Yeah, because Node 18 might have some breaking stuff, but if you notice, so I like to actually include all the steps.

00:24:54 - Anthony Campolo

So let's

00:24:59 - Anthony Campolo

this.

00:25:00 - Anthony Campolo

So I want to keep this around.

00:25:03 - Anthony Campolo

Get rid of that.

00:25:05 - Anthony Campolo

And then

00:25:15 - Anthony Campolo

Then I'll run through these commands.

00:25:20 - Anthony Campolo

So directory into it.

00:25:24 - Anthony Campolo

I'll be using PNPM for this.

00:25:28 - Anthony Campolo

Nikki T, since you are still around and watching, I'm curious, have you ever

00:25:33 - Anthony Campolo

written any code at all related to any of this blockchain web3 type stuff or even like had a sense of like how you would interact with it through like

00:25:44 - Anthony Campolo

json rpc methods and stuff like that because this is something that i did not know at all even though i've been following crypto

00:25:50 - Anthony Campolo

for many years.

00:25:51 - Anthony Campolo

It wasn't until I started working for QuickNode that I really learned like how to actually interact with a blockchain, what is, you know, the blockchain is currently running in production, how they work, because

00:26:04 - Anthony Campolo

QuickNode actually pretty cool.

00:26:09 - Anthony Campolo

Don't do that, Google.

00:26:11 - Anthony Campolo

Pretty cool company that hosts blockchain nodes for you.

00:26:15 - Anthony Campolo

So if you wanted to interact with Ethereum, you can see how to do that through all of their methods here.

00:26:26 - Anthony Campolo

documentation is actually really fantastic.

00:26:29 - Anthony Campolo

So if you go to this one, you'll see they have similar type deal where got like a curl request here that is sending some data.

00:26:42 - Anthony Campolo

And you can also see they have JavaScript examples as well.

00:26:56 - Anthony Campolo

And what was I saying?

00:27:06 - Anthony Campolo

Doesn't matter.

00:27:06 - Anthony Campolo

Okay.

00:27:07 - Anthony Campolo

Anyway.

00:27:08 - Anthony Campolo

So, MPM and knit, and then...

00:27:16 - Anthony Campolo

Pull this back over now.

00:27:24 - Anthony Campolo

Okay, let me clean up some tabs real quick.

00:27:32 - Anthony Campolo

That's good.

00:27:33 - Anthony Campolo

That's good.

00:27:36 - Anthony Campolo

Tutorials.

00:27:45 - Anthony Campolo

So.

00:27:48 - Anthony Campolo

Here

00:27:52 - Anthony Campolo

I'm going to do is I'm going to grab the read me.

00:27:57 - Anthony Campolo

Whoops, this should be outside of here.

00:28:08 - Anthony Campolo

I can have just one thing open.

00:28:25 - Anthony Campolo

I'm just going to do this from the terminal here.

00:28:30 - Anthony Campolo

And if we look here, I have my NPM, PMPM, auto-configured to do this.

00:28:38 - Anthony Campolo

When most people run this command, it will not do this.

00:28:44 - Anthony Campolo

And that can be an issue if you want to.

00:28:49 - Anthony Campolo

Use imports and so this can be changed to type common JS and

00:28:59 - Anthony Campolo

Yeah, so that's where some of the challenges come into play.

00:29:03 - Anthony Campolo

You have to kind of just play around and see whether you need to have the type module set or not.

00:29:09 - Anthony Campolo

And especially once you get into tools like V in the front end, then things are also a little bit different.

00:29:16 - Anthony Campolo

But now we want to npm add dash.

00:29:20 - Anthony Campolo

So you see here, just dash, no JS.

00:29:25 - Anthony Campolo

And then.

00:29:27 - Anthony Campolo

If we look at this example and try and run it,

00:29:36 - Anthony Campolo

I've got it written right here, I think.

00:29:40 - Anthony Campolo

It's the same one.

00:29:41 - Anthony Campolo

Yep.

00:29:44 - Anthony Campolo

So also then, actually create the files as well.

00:29:50 - Anthony Campolo

So I think that's useful.

00:29:53 - Anthony Campolo

I can't tell if this works or not.

00:30:01 - Anthony Campolo

Ryan, have you caught up yet?

00:30:04 - Anthony Campolo

If so, let me know.

00:30:09 - Anthony Campolo

I think this ends up just hanging for a while.

00:30:33 - Anthony Campolo

But for now, let's take these off.

00:30:44 - Anthony Campolo

And run this.

00:30:47 - Anthony Campolo

So I think if I'm more correctly, we're gonna get an error.

00:30:50 - Anthony Campolo

Oh wait, it worked.

00:30:52 - Anthony Campolo

Huh.

00:30:53 - Anthony Campolo

Sweet, that's good.

00:30:57 - Anthony Campolo

Cool, so if we see here, we got, this came out.

00:31:15 - Anthony Campolo

So that's doing this part.

00:31:19 - Anthony Campolo

Then new line.

00:31:22 - Anthony Campolo

Okay, so let's try this then.

00:31:30 - Anthony Campolo

Great.

00:31:31 - Anthony Campolo

See, there you go.

00:31:31 - Anthony Campolo

So that's all you got to do to switch between require and ESM.

00:31:36 - Anthony Campolo

You add type module to your package.json, and then you import blank from blank, whatever this was becomes that, whatever this was becomes that.

00:31:48 - Anthony Campolo

There you go.

00:31:50 - Anthony Campolo

If only it were that simple all the time.

00:31:56 - Anthony Campolo

So I'm just going to go ahead and delete that.

00:32:05 - Anthony Campolo

Okay, and then what it tells you to do next is you can connect to DevNet.

00:32:19 - Anthony Campolo

And you can connect via address or via seed.

00:32:29 - Anthony Campolo

Yeah, I'm not sure this is really super duper relevant.

00:32:36 - Anthony Campolo

Okay, this is what I was trying to do before.

00:32:40 - Anthony Campolo

This is connected directly to Gabby.

00:32:51 - Anthony Campolo

Okay, so I'm gonna not worry about that one.

00:32:57 - Anthony Campolo

There was that other curl command I had before.

00:33:04 - Anthony Campolo

was, I think that was it.

00:33:08 - Anthony Campolo

This is a good one, though.

00:33:09 - Anthony Campolo

That's how I'll save this one.

00:33:24 - Anthony Campolo

That's basically get best block hash.

00:33:26 - Anthony Campolo

That's what we were doing in this example here.

00:33:32 - Anthony Campolo

Get best block hash.

00:33:35 - Anthony Campolo

What does that mean?

00:33:36 - Anthony Campolo

Best block hash.

00:33:39 - Anthony Campolo

Check the...

00:33:42 - Anthony Campolo

API, DX, so...

00:33:48 - Anthony Campolo

So this one, I think this is the page I'm going to end up on a lot, I think.

00:33:55 - Anthony Campolo

Okay, so get this block hash returns the block hash of the chain tip ID or chain tip.

00:34:05 - Anthony Campolo

That would be ID twice.

00:34:08 - Anthony Campolo

So let's do this.

00:34:13 - Anthony Campolo

Let's close that for now.

00:34:24 - Anthony Campolo

Since this has no parameters, it's fairly straightforward in terms of how you interact with it.

00:34:32 - Anthony Campolo

You're not going to be passing anything into it.

00:34:34 - Anthony Campolo

You just literally run that method, and then it's going to give you back the block hash of the chain tip.

00:34:42 - Anthony Campolo

Let's see if they define chain tip anywhere.

00:34:47 - Anthony Campolo

That would probably be in the dash core docs.

00:35:03 - Anthony Campolo

I guess that's just like the current block, like whatever the latest block is right now.

00:35:09 - Anthony Campolo

If you don't know, blockchain, you have blocks in a chain.

00:35:14 - Anthony Campolo

Whoa.

00:35:15 - Anthony Campolo

And you add a block every some amount of time.

00:35:19 - Anthony Campolo

And every time you do that, it has all the transactions from the last 10, 15 minutes, some amount of time.

00:35:27 - Anthony Campolo

So I'm just going to assume that's what it means until someone tells me otherwise.

00:35:36 - Anthony Campolo

Okay, so I had the curl example, which was this, and that's this.

00:35:46 - Anthony Campolo

I'm going to do this by method.

00:35:51 - Anthony Campolo

Too so.

00:36:35 - Anthony Campolo

Yeah, for now, I'm gonna ignore these different ways to connect.

00:36:41 - Anthony Campolo

This is not super important right now, I don't think.

00:37:00 - Anthony Campolo

Okay, cool.

00:37:09 - Anthony Campolo

So this will have get block hash, get best block hash, get block by height.

00:37:16 - Anthony Campolo

So those are more of the other client methods.

00:37:26 - Anthony Campolo

Okay, cool.

00:37:27 - Anthony Campolo

Let's just keep going from where I am right now.

00:37:31 - Anthony Campolo

And let's delete this.

00:37:42 - Anthony Campolo

Keep that.

00:37:44 - Anthony Campolo

Okay.

00:37:50 - Anthony Campolo

So what I'm doing now is I'm basically building up different files that will have self-contained node scripts.

00:37:59 - Anthony Campolo

And then that can be run from the command line.

00:38:01 - Anthony Campolo

So the idea being that you build up from, first you have a curl command.

00:38:05 - Anthony Campolo

And so that curl command, like literally anyone could just copy paste this sucker and run it in their terminal and should get a response back, which I should have.

00:38:15 - Anthony Campolo

I'll put right after it.

00:38:17 - Anthony Campolo

So grab that.

00:38:24 - Anthony Campolo

And that this way, as you're going from the different steps, people can kind of make sure that everything's working.

00:38:32 - Anthony Campolo

So in this kind of like baseline case, you're just like, all right, am I able to even hit the endpoint and get something back?

00:38:39 - Anthony Campolo

Because then as soon as you introduce JavaScript stuff and you're already in the wrong mode, okay, well, did they get their pirates.json right?

00:38:46 - Anthony Campolo

Was their version of Node on their own individual machine?

00:38:49 - Anthony Campolo

And so the...

00:38:50 - Anthony Campolo

That's the stuff that then you need to kind of work through step by step.

00:38:58 - Anthony Campolo

Crab all of these.

00:39:02 - Anthony Campolo

Actually, no, those are fine where they are.

00:39:12 - Anthony Campolo

So I already have this example and that's already working.

00:39:20 - Anthony Campolo

Good.

00:39:28 - Anthony Campolo

Okay, so this is what this should have been called, actually.

00:39:47 - Anthony Campolo

And then for now, we'll call the other one.

00:40:12 - Anthony Campolo

So let's do that one now.

00:40:14 - Anthony Campolo

And so I'm pretty sure this has been the case for a while.

00:40:18 - Anthony Campolo

So I think it's still the case that you need to specify you want version two of node fetch or else you get weird ESM issues.

00:40:27 - Anthony Campolo

And now if we take this stuff here, one, two,

00:40:41 - Anthony Campolo

And then the thing that I had to ask ChatGPT to help me with was, let me show you this.

00:40:47 - Anthony Campolo

Let's see if this will still happen.

00:40:49 - Anthony Campolo

If we don't have that and we just try running this.

00:40:55 - Anthony Campolo

See what happens.

00:40:59 - Anthony Campolo

Okay.

00:41:01 - Anthony Campolo

For some reason, there was something weird happening with the endpoint yesterday.

00:41:07 - Anthony Campolo

And there's all these like TLS stuff.

00:41:09 - Anthony Campolo

I'm aged because maybe there's a certificate that was out of date that was updated this morning.

00:41:15 - Anthony Campolo

And so now everything's fixed.

00:41:16 - Anthony Campolo

Who knows?

00:41:19 - Anthony Campolo

That is nice, though, because...

00:41:23 - Anthony Campolo

That's a lot of extra stuff.

00:41:25 - Anthony Campolo

And you had to, I'd like bring in an HTTPS library.

00:41:28 - Anthony Campolo

So I'm curious that was an actual error or not, but anyway, so if we look at the output we were getting

00:41:41 - Anthony Campolo

in this example,

00:41:44 - Anthony Campolo

It is...

00:41:47 - Anthony Campolo

Running this method and it just gives you the result.

00:41:54 - Anthony Campolo

Whereas in this fetch example, we're getting back something more similar to what we got back from the curl command.

00:42:02 - Anthony Campolo

It's just giving us back the JSON object.

00:42:05 - Anthony Campolo

So if we wanted to

00:42:08 - Anthony Campolo

modify that.

00:42:11 - Anthony Campolo

I think we would want to do this.

00:42:29 - Anthony Campolo

You structure that.

00:42:31 - Anthony Campolo

Oh, no, that's it.

00:42:31 - Anthony Campolo

Yeah.

00:42:32 - Anthony Campolo

So if we do that, now we'll just get the straight up result part of the object instead of the whole thing.

00:42:49 - Anthony Campolo

Nice.

00:42:51 - Anthony Campolo

For now, I'm going to leave that stuff in there, but uncommented, just in case that error comes up again.

00:43:02 - Anthony Campolo

So if we see right here now, this is using node fetch instead of request.

00:43:08 - Anthony Campolo

So Ryan, I would recommend changing that so I can open a pull request to make some adjustments to the docs.

00:43:18 - Anthony Campolo

I also would really recommend having

00:43:21 - Anthony Campolo

steps of actually creating a project from scratch and then NPM and knitting and maybe address the issue of require versus import.

00:43:35 - Anthony Campolo

If you want to

00:43:38 - Anthony Campolo

upgrade to using ESM, you'd want to do it kind of all at once.

00:43:42 - Anthony Campolo

You wouldn't want some of the docs to be in ESM, some to be in Node require syntax.

00:43:48 - Anthony Campolo

That would be, that could be a huge issue.

00:43:50 - Anthony Campolo

So that's why I get why a lot of people are, will still have docs now that are still using require just because everything is required.

00:43:58 - Anthony Campolo

They have to rewrite their entire docs to get ESM in there.

00:44:01 - Anthony Campolo

But ideally, we could get there.

00:44:05 - Anthony Campolo

But I would say first, update it to the more pressing concern is the deprecated require library that is being used, the deprecated request library.

00:44:21 - Anthony Campolo

So this is the thing you want to change first.

00:44:24 - Anthony Campolo

So I'll probably open a PR, but not use ESM node.

00:44:29 - Anthony Campolo

fetch but still use node fetch and then update the example because

00:44:40 - Anthony Campolo

Yeah, this is like this stuff right here.

00:44:43 - Anthony Campolo

I'm like, this is where I get all confused.

00:44:48 - Anthony Campolo

Because you have response and body.

00:44:50 - Anthony Campolo

And it's like, this is all the fetch code.

00:44:54 - Anthony Campolo

I always see it looks like this now.

00:44:59 - Anthony Campolo

But obviously there's a million ways to do fetch.

00:45:02 - Anthony Campolo

Nicky T knows all about that.

00:45:04 - Anthony Campolo

He knows back when it was called Ajax.

00:45:08 - Anthony Campolo

Okay, so this is pretty much all working pretty well right now.

00:45:33 - Anthony Campolo

adds a space automatically.

00:45:40 - Anthony Campolo

But I think I do want to actually...

00:45:47 - Anthony Campolo

That's all good, right?

00:45:50 - Anthony Campolo

I've done the same.

00:45:51 - Anthony Campolo

So let's do...

00:46:52 - Anthony Campolo

Yeah, yeah, I agree.

00:46:54 - Anthony Campolo

It's always good to just go on a stream.

00:46:58 - Anthony Campolo

We'll see.

00:47:00 - Anthony Campolo

Yeah, because I want to have, so if I'm going to open a PR, it's better if I can update a lot of examples all at once.

00:47:10 - Anthony Campolo

All right, so we got get best block hash and then get block hash.

00:47:18 - Anthony Campolo

So let's do that now.

00:47:42 - Anthony Campolo

So for this one, there actually isn't a JavaScript example at all.

00:47:47 - Anthony Campolo

So.

00:47:51 - Anthony Campolo

That's interesting.

00:47:54 - Anthony Campolo

That would be even more useful for you if I wrote you examples you didn't even have.

00:48:09 - Anthony Campolo

Did it work even though?

00:48:10 - Anthony Campolo

Hold on, why is it yelling at me right now?

00:48:33 - Anthony Campolo

Reason the colors are off but look like it actually worked so

00:48:54 - Anthony Campolo

So this is doing block hash for the given height.

00:48:58 - Anthony Campolo

God bless, man.

00:48:58 - Anthony Campolo

Right, fire around, Nicky.

00:49:10 - Anthony Campolo

For the given heights.

00:49:21 - Anthony Campolo

What is the height?

00:49:22 - Anthony Campolo

The block height.

00:49:39 - Anthony Campolo

I only addressed my block height.

00:49:41 - Anthony Campolo

The blocks between them and the first dash block.

00:49:43 - Anthony Campolo

Okay, so it's how far away is the block from the first dash block.

00:49:50 - Anthony Campolo

Okay, that makes sense.

00:49:52 - Anthony Campolo

So it's just counting up as the each block.

00:49:55 - Anthony Campolo

Okay, yeah, great.

00:49:57 - Anthony Campolo

This is part of the thing with like, blockchains all have their own names for all this stuff.

00:50:04 - Anthony Campolo

So this was get block hash.

00:50:09 - Anthony Campolo

This I want to have a...

00:50:39 - Anthony Campolo

And now I can just kind of take most of what I have before.

00:50:46 - Anthony Campolo

And just change the...

00:50:49 - Anthony Campolo

Data in the body.

00:50:51 - Anthony Campolo

So let's do,

00:51:21 - Anthony Campolo

Change this part.

00:51:29 - Anthony Campolo

It's going to be.

00:51:34 - Anthony Campolo

And that's going to be params.

00:51:37 - Anthony Campolo

So this work.

00:51:40 - Anthony Campolo

Interesting.

00:51:51 - Anthony Campolo

Oh, yeah, that's right.

00:51:51 - Anthony Campolo

Mickey T's got his own stream.

00:51:54 - Anthony Campolo

So, we have Prams.

00:51:59 - Anthony Campolo

And then in there, we're gonna have another object.

00:52:18 - Anthony Campolo

Where sometimes.

00:52:21 - Anthony Campolo

Plot.

00:52:23 - Anthony Campolo

I think that should be it.

00:52:38 - Anthony Campolo

It happens.

00:52:48 - Anthony Campolo

Wait, I gotta actually put it in the file.

00:53:05 - Anthony Campolo

Why is it get a festival?

00:53:07 - Anthony Campolo

Okay, that's...

00:53:23 - Anthony Campolo

I'm not surprised.

00:53:31 - Anthony Campolo

So I messed something up here.

00:53:33 - Anthony Campolo

And this is where GPT can come in handy.

00:53:39 - Anthony Campolo

Helps me fix my junior JavaScript mistakes.

00:53:42 - Anthony Campolo

All right.

00:53:43 - Anthony Campolo

So I have this code.

00:54:18 - Anthony Campolo

And that takes a second.

00:54:20 - Anthony Campolo

Answer.

00:54:21 - Anthony Campolo

And now I know basically what the issue is.

00:54:24 - Anthony Campolo

I just want to shortcut straight to the answer.

00:54:28 - Anthony Campolo

Let's close some of this stuff.

00:54:36 - Anthony Campolo

That's not.

00:55:12 - Anthony Campolo

Okay, so sweet.

00:55:14 - Anthony Campolo

So it's going to just throw in JSON.stringify for me.

00:55:17 - Anthony Campolo

Nice.

00:55:19 - Anthony Campolo

I had to check to make sure HPC was lost.

00:55:21 - Anthony Campolo

Okay.

00:55:22 - Anthony Campolo

So you can give me a try catch.

00:55:24 - Anthony Campolo

It's incredible.

00:55:30 - Anthony Campolo

And the server is definitely returning a JSON response.

00:55:35 - Anthony Campolo

Cool, cool, cool, cool.

00:55:49 - Anthony Campolo

This is the future.

00:55:52 - Anthony Campolo

Oh, my God.

00:55:56 - Anthony Campolo

This is why I keep saying, like, some developers don't really see how chat GBT could be useful to them, which I would first say you need to think a little more creatively about it.

00:56:08 - Anthony Campolo

But for junior devs or even people who are kind of like in the middle, I guess, like me, who just want to fix basic errors that they should know how to fix.

00:56:18 - Anthony Campolo

Maybe either don't like quite have like some syntax on hand or there's like something that they would have to then Google to look up to find out fixing like one kind of small bug that like through experience you'll be able to very easily do.

00:56:31 - Anthony Campolo

Just chat to you, but you can just give you the answer, which is really incredible.

00:56:39 - Anthony Campolo

I should actually take that last example and do the same thing.

00:56:42 - Anthony Campolo

Have it give me nice try catch and all that.

00:56:46 - Anthony Campolo

So this was here.

00:56:49 - Anthony Campolo

Oops, that's not what I wanted to do.

00:57:03 - Anthony Campolo

Actually, it's giving me a, it's still giving me an error.

00:57:07 - Anthony Campolo

Must be an integer.

00:57:09 - Anthony Campolo

Okay, that one I can fix on my own.

00:57:20 - Anthony Campolo

So that was because we had quotes around the one in height, which was parsing it into a string.

00:57:43 - Anthony Campolo

Okay, cool.

00:57:45 - Anthony Campolo

So these are the examples that I'll be able to add to the docs because you don't have a JavaScript example at all here.

00:57:55 - Anthony Campolo

So let's see how many are there on this page.

00:58:02 - Anthony Campolo

Yeah.

00:58:04 - Anthony Campolo

One, two, three.

00:58:11 - Anthony Campolo

There are no recently deprecated.

00:58:14 - Anthony Campolo

Cool.

00:58:18 - Anthony Campolo

Okay, so that can't be all the RPC methods, can it be?

00:58:34 - Anthony Campolo

So this is GRPC, which I sure don't know nothing about.

00:58:40 - Anthony Campolo

And we'll not mess around with at all, probably.

00:58:49 - Anthony Campolo

I just feel like there should be way more methods.

00:58:54 - Anthony Campolo

Next here we have like get block, get transaction, stuff like that.

00:58:59 - Anthony Campolo

So maybe it is, there's more methods.

00:59:01 - Anthony Campolo

This just isn't like, this is detail endpoint reference.

00:59:05 - Anthony Campolo

So here we go.

00:59:08 - Anthony Campolo

That's all I think.

00:59:11 - Anthony Campolo

Nope, that's just JSON RPC.

00:59:28 - Anthony Campolo

Okay, well, either way, there's three examples on here.

00:59:33 - Anthony Campolo

So I will, this one I would recommend, I'll update that one.

00:59:39 - Anthony Campolo

And then I'll add JavaScript examples here and here.

00:59:45 - Anthony Campolo

So let's go to the next one.

00:59:57 - Anthony Campolo

We already got get block hash.

01:00:03 - Anthony Campolo

So get master node, got to change that name, list diff for the provided block hashes.

01:00:13 - Anthony Campolo

Cool.

01:00:15 - Anthony Campolo

So.

01:00:19 - Anthony Campolo

Let me make sure my readme is in sync with all my files.

01:00:27 - Anthony Campolo

Okay, cool.

01:00:36 - Anthony Campolo

There we go.

01:01:00 - Anthony Campolo

See if this curl works.

01:01:08 - Anthony Campolo

Looks like it did.

01:01:11 - Anthony Campolo

Yeah.

01:01:13 - Anthony Campolo

Cool.

01:01:14 - Anthony Campolo

That's a big response.

01:01:17 - Anthony Campolo

Let's see what's going on here.

01:01:58 - Anthony Campolo

Most of all of our BSM points from Jason.

01:02:01 - Anthony Campolo

Interesting.

01:02:02 - Anthony Campolo

Okay.

01:02:03 - Anthony Campolo

So, well then, so what's going to happen with the JavaScript client libraries and stuff?

01:02:10 - Anthony Campolo

Is that going to just be like an internal implementation change?

01:02:20 - Anthony Campolo

Ultimately, it's not going to matter a whole lot for what I'm doing since it's eventually going to end up in React.

01:02:28 - Anthony Campolo

This is just me trying to understand how the endpoint works in a way that makes sense to me.

01:02:33 - Anthony Campolo

And I wouldn't know how to just mess around with gRPC.

01:02:39 - Anthony Campolo

If I have to learn gRPC, then you can pay me to learn gRPC as opposed to...

01:02:45 - Anthony Campolo

I was like, you pay me for building this stuff and I learn it in the process.

01:02:58 - Anthony Campolo

I'll just go with JSON for that.

01:03:13 - Anthony Campolo

Do this.

01:03:22 - Anthony Campolo

Check that in just a second.

01:03:39 - Anthony Campolo

See some of that in the menu above JSON and the docs hierarchy.

01:03:42 - Anthony Campolo

So this one.

01:03:44 - Anthony Campolo

Currently revised two types of endpoints.

01:03:47 - Anthony Campolo

Okay, so JSON RPC exposes layer one information while GRPC support layer two as well as streaming of events.

01:03:55 - Anthony Campolo

Okay, there you go.

01:03:56 - Anthony Campolo

Remaining endpoints will be migrated to your upcoming future release.

01:04:01 - Anthony Campolo

Interesting.

01:04:02 - Anthony Campolo

So these are the layer one endpoints, like so.

01:04:09 - Anthony Campolo

And then these are the core gRPC services.

01:04:16 - Anthony Campolo

Hello, hello.

01:04:19 - Anthony Campolo

How is it going?

01:04:21 - Anthony Campolo

So then these are happening here.

01:04:27 - Anthony Campolo

So you'll need to use

01:04:32 - Anthony Campolo

the DAPI client or DAPI gRPC, JavaScript DAPI request.

01:04:40 - Anthony Campolo

Interesting, interesting.

01:04:43 - Anthony Campolo

So I guess then my question is, what's the difference between JavaScript, DAPI client, and DAPI gRPC?

01:04:50 - Anthony Campolo

Is this related to

01:04:53 - Anthony Campolo

the JSON RPC.

01:04:55 - Anthony Campolo

And does that mean this will be deprecated too?

01:04:59 - Anthony Campolo

Or is this good?

01:05:00 - Anthony Campolo

Because if so, then this is what I should be using right now.

01:05:03 - Anthony Campolo

If this is what's not going to be deprecated.

01:05:10 - Anthony Campolo

Let me try doing this one, see what happens.

01:05:17 - Anthony Campolo

So this is get block by height.

01:05:20 - Anthony Campolo

You only need dash SDK.

01:05:22 - Anthony Campolo

Okay.

01:05:24 - Anthony Campolo

So I guess we just need more examples with the dash SDK because I want just something like this, the dash and 10 package.

01:05:35 - Anthony Campolo

Yeah, so I want...

01:05:37 - Anthony Campolo

A reference of all of the methods in the dash SDK dash JavaScript SDK.

01:05:45 - Anthony Campolo

So that was one that was here.

01:05:49 - Anthony Campolo

So.

01:05:52 - Anthony Campolo

Let's see what's going on here.

01:05:54 - Anthony Campolo

So we got these guys.

01:06:00 - Anthony Campolo

Yes, this is all the other stuff.

01:06:06 - Anthony Campolo

Okay, so I guess this is what's handling whether it's using the JSON RPC or the gRPC stuff.

01:06:13 - Anthony Campolo

So there's a touch of typings in the platform.

01:06:17 - Anthony Campolo

Yeah.

01:06:19 - Anthony Campolo

Okay.

01:06:31 - Anthony Campolo

So I guess my question is, is this stuff somewhere in here?

01:06:39 - Anthony Campolo

Let's see.

01:07:10 - Anthony Campolo

Okay, so I know that I ended up creating a wallet.

01:07:15 - Anthony Campolo

So let me just make sure I don't.

01:07:20 - Anthony Campolo

Lose the thread here though.

01:07:23 - Anthony Campolo

These are all the examples that needed updating.

01:07:27 - Anthony Campolo

And let's see, so I had that one.

01:07:31 - Anthony Campolo

So what's going on here?

01:07:33 - Anthony Campolo

So this was

01:07:39 - Anthony Campolo

a list diff for the provided block hashes.

01:07:43 - Anthony Campolo

Got it.

01:07:44 - Anthony Campolo

So the curl request, this was the curl request itself.

01:07:55 - Anthony Campolo

And we're specifying the base block hash and then the block hash we want to diff against.

01:08:01 - Anthony Campolo

And then it's giving us...

01:08:07 - Anthony Campolo

List here of transaction hash confirmed hash pub key operator voting address

01:08:19 - Anthony Campolo

Okay.

01:08:22 - Anthony Campolo

Cool.

01:08:23 - Anthony Campolo

Interesting.

01:08:26 - Anthony Campolo

And then we needed, okay, so I guess then my question is, if this is gonna be deprecated, does it matter whether I update the examples or not?

01:08:34 - Anthony Campolo

Like deprecated in the next month, year, 10 years, like,

01:08:42 - Anthony Campolo

Yeah, I don't know.

01:08:44 - Anthony Campolo

But it sounds like we want to just stick to the dash client here.

01:08:49 - Anthony Campolo

So let's get into.

01:08:52 - Anthony Campolo

How those are going to work.

01:08:54 - Anthony Campolo

So,

01:08:59 - Anthony Campolo

Let's do this.

01:09:04 - Anthony Campolo

What I like to do is create just a single, initialize a single client and then export it and then import because with this example here, we're seeing the whole thing in one file, which is nice.

01:09:18 - Anthony Campolo

That's kind of what I would expect anyway, but I mean, I don't want to have different files.

01:09:24 - Anthony Campolo

With different examples showing different SDK methods.

01:09:28 - Anthony Campolo

And then you can avoid having to initialize a client each time for each script.

01:09:40 - Anthony Campolo

here and then this stuff.

01:09:46 - Anthony Campolo

Boom.

01:09:49 - Anthony Campolo

Things happening here that I want some notes on.

01:09:55 - Anthony Campolo

So this is just from the comments.

01:09:58 - Anthony Campolo

So setting new mod to null indicates you want a new wallet to be generated.

01:10:02 - Anthony Campolo

And then setting offline mode to true indicates you don't want to sync the chain.

01:10:12 - Anthony Campolo

And then we're going to have a...

01:10:16 - Anthony Campolo

Wallet method.

01:10:23 - Anthony Campolo

This is basically this example here.

01:10:34 - Anthony Campolo

This is going to do a couple things as we have get wallet account, export wallet, and get unused address.

01:10:44 - Anthony Campolo

So let me see if I can find the...

01:10:49 - Anthony Campolo

TypeScript typings.

01:11:03 - Anthony Campolo

So this is all the stuff that we had when I was just in here.

01:11:35 - Anthony Campolo

Dash platform is currently available on the Dash testnet only.

01:11:40 - Anthony Campolo

How long is that going to be the case?

01:11:47 - Anthony Campolo

Because eventually you won't be able to work with main net rolls.

01:11:50 - Anthony Campolo

You're not really working with real money.

01:11:54 - Anthony Campolo

This is using Wasm.

01:11:56 - Anthony Campolo

Look at that.

01:12:05 - Anthony Campolo

Okay.

01:12:15 - Anthony Campolo

Back to the package.

01:12:18 - Anthony Campolo

Might have been in there somewhere.

01:12:25 - Anthony Campolo

Tests.

01:12:42 - Anthony Campolo

Probably easier if I just clone this down, but for now I'm just gonna keep popping a bit just to see.

01:12:49 - Anthony Campolo

In here.

01:12:57 - Anthony Campolo

Interesting.

01:12:58 - Anthony Campolo

Okay.

01:13:02 - Anthony Campolo

So this would be like get contract.

01:13:22 - Anthony Campolo

Interesting.

01:13:23 - Anthony Campolo

Okay.

01:13:24 - Anthony Campolo

Yeah, so if there's not currently just a reference of all of the JavaScript methods in the dash SDK, that's the thing you really want, and that there should be a page for somewhere.

01:13:40 - Anthony Campolo

Otherwise,

01:13:42 - Anthony Campolo

You kind of just have to go find examples and see what's available and then start pulling examples and make them work for your use case.

01:13:51 - Anthony Campolo

So it's more extensive documentation here.

01:13:53 - Anthony Campolo

Ah, look at this.

01:13:57 - Anthony Campolo

A different separate page entirely with important documentation on it.

01:14:01 - Anthony Campolo

Great, okay, so this is probably where I should have started with, honestly.

01:14:06 - Anthony Campolo

No syntax highlighting, so that is not super tight.

01:14:11 - Anthony Campolo

I'm sorry, I should move this thing to a Pintaki source site for you.

01:14:15 - Anthony Campolo

Be quite a bit nicer.

01:14:18 - Anthony Campolo

Okay, yeah, this is, wow, this is,

01:14:21 - Anthony Campolo

Exactly where I should have been from the start.

01:14:23 - Anthony Campolo

This has basically all the stuff I want.

01:14:26 - Anthony Campolo

There's even a wallet library.

01:14:31 - Anthony Campolo

So that'd be a question, should I use the wallet library or not?

01:14:35 - Anthony Campolo

Is the wallet library important?

01:14:37 - Anthony Campolo

And what is dash EVO?

01:14:38 - Anthony Campolo

Now this is a whole nother place now.

01:14:42 - Anthony Campolo

I see a big deprecated word somewhere.

01:14:47 - Anthony Campolo

I have it archived as active film.

01:14:49 - Anthony Campolo

It shifted to here.

01:14:51 - Anthony Campolo

Okay.

01:14:56 - Anthony Campolo

So does that just mean that?

01:15:00 - Anthony Campolo

Things like, where was I?

01:15:08 - Anthony Campolo

So is there still a wallet library, but in dash pay?

01:15:15 - Anthony Campolo

Yeah, right.

01:15:16 - Anthony Campolo

So.

01:15:19 - Anthony Campolo

I mean, everything got moved from that repository to the other, or did they just start building new stuff in DashPay?

01:15:46 - Anthony Campolo

It looks like.

01:15:48 - Anthony Campolo

Okay, here we go.

01:15:51 - Anthony Campolo

Great, great, great, great.

01:15:55 - Anthony Campolo

So we're still npm installing it from here though.

01:15:59 - Anthony Campolo

So does that mean, let's look at what I wanna do.

01:16:07 - Anthony Campolo

Just dash.

01:16:09 - Anthony Campolo

Dash, dash.

01:16:10 - Anthony Campolo

Okay, hold on.

01:16:13 - Anthony Campolo

Where was...

01:16:16 - Anthony Campolo

NPM library.

01:16:25 - Anthony Campolo

Let's do this.

01:16:41 - Anthony Campolo

I guess you just want the NPM.

01:17:07 - Anthony Campolo

What is the name of the new NPM location?

01:17:12 - Anthony Campolo

If dash or is the idea that dash EVO stays on NPM, but the GitHub migrated off of it.

01:17:22 - Anthony Campolo

I don't know.

01:17:29 - Anthony Campolo

Okay, I'm just going to keep following the examples then and not worry about it too much.

01:17:36 - Anthony Campolo

So let's go back to here.

01:17:40 - Anthony Campolo

So this now.

01:17:44 - Anthony Campolo

We're going to have a lot, a lot more code examples, it looks like.

01:18:00 - Anthony Campolo

SDK contains wallet.

01:18:01 - Anthony Campolo

Okay.

01:18:02 - Anthony Campolo

Gotcha.

01:18:02 - Anthony Campolo

Makes sense.

01:18:05 - Anthony Campolo

Thank you for being here and explaining things to me.

01:18:10 - Anthony Campolo

I am a Dash noob still, and so I'm just kind of playing around, figuring out how all this stuff works.

01:18:18 - Anthony Campolo

A whole lot of stuff in here.

01:18:30 - Anthony Campolo

So let's take a look.

01:18:31 - Anthony Campolo

I think just creating a wallet would be the thing to do.

01:18:37 - Anthony Campolo

Let's see.

01:18:38 - Anthony Campolo

Actually, let's just go through the top, see what we hit.

01:18:52 - Anthony Campolo

Here's the quick start.

01:18:55 - Anthony Campolo

See an example usage here.

01:18:57 - Anthony Campolo

Oh, dead like.

01:19:04 - Anthony Campolo

So that's because we're here.

01:19:18 - Anthony Campolo

I want to end up here and I want to get to examples web.

01:19:27 - Anthony Campolo

And then web usage.

01:19:30 - Anthony Campolo

So that link to this link.

01:19:39 - Anthony Campolo

Does this have a button to...

01:19:44 - Anthony Campolo

Open a PR.

01:19:45 - Anthony Campolo

Nope.

01:19:47 - Anthony Campolo

Put it on go.

01:19:48 - Anthony Campolo

All packs just failing.

01:19:53 - Anthony Campolo

Cool, cool, cool.

01:20:01 - Anthony Campolo

Okay, well it looks like this is where I would open the PR.

01:20:20 - Anthony Campolo

SDK app client.

01:20:32 - Anthony Campolo

Happy client.

01:20:38 - Anthony Campolo

Yes, yes, yes, yes, yes.

01:20:40 - Anthony Campolo

Here.

01:20:42 - Anthony Campolo

And that's, well, that's off.

01:20:46 - Anthony Campolo

Yep.

01:21:51 - Anthony Campolo

This example here they're showing you, it's just a single HTML page.

01:21:56 - Anthony Campolo

It's kind of funny.

01:21:59 - Anthony Campolo

I'll see if this works.

01:22:06 - Anthony Campolo

We like examples like this though, because you don't have to worry about all the build step stuff.

01:22:13 - Anthony Campolo

You just throw in a script tag and hopefully it works.

01:22:26 - Anthony Campolo

There's no body.

01:22:30 - Anthony Campolo

Just gonna console log some stuff.

01:22:34 - Anthony Campolo

We can run this with live server.

01:22:42 - Anthony Campolo

My VS code, so all my extensions are not on right now.

01:22:54 - Anthony Campolo

And then there should be this.

01:22:56 - Anthony Campolo

Okay.

01:22:58 - Anthony Campolo

Refuse to execute scripts because its mime type is not executable and strict mime type checking is enabled.

01:23:08 - Anthony Campolo

I think that might be.

01:23:13 - Anthony Campolo

Not yet.

01:23:17 - Anthony Campolo

Not defined.

01:23:26 - Anthony Campolo

This is not defined.

01:23:28 - Anthony Campolo

So I'm not importing it.

01:23:59 - Anthony Campolo

Yeah, yeah, I just want to see this because the reason why I want to check it says the example is linked to this from the docs.

01:24:07 - Anthony Campolo

So you want to either make sure it works or yeah, exactly.

01:24:12 - Anthony Campolo

So if it doesn't work on unpackage, then it shouldn't be in the docs as an example here.

01:24:17 - Anthony Campolo

So this should just be removed then if that's the case.

01:24:24 - Anthony Campolo

Anyway, okay, so I probably shouldn't mess around with that then.

01:24:29 - Anthony Campolo

Leave that here just for now.

01:24:33 - Anthony Campolo

Okay, so if we go back here.

01:24:41 - Anthony Campolo

This is going to initialize the client.

01:24:48 - Anthony Campolo

So that was what I had.

01:24:52 - Anthony Campolo

I had a file.

01:24:57 - Anthony Campolo

Right here.

01:24:58 - Anthony Campolo

Okay.

01:25:10 - Anthony Campolo

So it looks like, right, actually this is the Dappy client examples.

01:25:17 - Anthony Campolo

Still a little bit confused about what's the difference between the DAPI client and not.

01:25:24 - Anthony Campolo

And I'm not sure if I should be saying that DAPI or pronounce it some other way.

01:25:34 - Anthony Campolo

into the SDK methods for interacting with all that stuff.

01:25:37 - Anthony Campolo

I'll also provide direct access to the client methods.

01:25:51 - Anthony Campolo

Yeah, interesting.

01:25:53 - Anthony Campolo

Okay, so these were the, this is one of the examples I was getting to.

01:26:02 - Anthony Campolo

That's the thing is that the requires or demos, that's probably updated to just do this.

01:26:27 - Anthony Campolo

So first off, I never checked whether this worked or not.

01:26:41 - Anthony Campolo

Dash Darks or Dark Forest right now.

01:26:43 - Anthony Campolo

That's the reason I have you guys.

01:26:44 - Anthony Campolo

Yeah, great.

01:26:44 - Anthony Campolo

Well, I'm glad that this is useful then because I do enjoy doing this.

01:26:49 - Anthony Campolo

But it can be, like, frustrating for people who want to see something actually get built.

01:26:54 - Anthony Campolo

It's just, like, seems like endless bike shedding.

01:26:56 - Anthony Campolo

But mostly I just need to basically go through.

01:27:00 - Anthony Campolo

All the examples and then just try and run them, see whether they work or not, and then figure out which ones are broken, which ones aren't, which ones maybe work, but are using things that are kind of deprecated and shouldn't be.

01:27:12 - Anthony Campolo

And then you can kind of get them all into a nice place.

01:27:15 - Anthony Campolo

The thing is though is,

01:27:16 - Anthony Campolo

I feel like this whole site shouldn't really exist.

01:27:20 - Anthony Campolo

This should all be contained within the dash platform.remy.io.

01:27:24 - Anthony Campolo

You should get as many things as you possibly can into this one, especially if you're coming to it from dash.org.

01:27:31 - Anthony Campolo

Because it just doesn't really make sense to have people hop off to this other one with...

01:27:36 - Anthony Campolo

No syntax highlighting and stuff's like super deprecated.

01:27:39 - Anthony Campolo

And then you're going to have to like keep this up to date.

01:27:42 - Anthony Campolo

with the other stuff.

01:27:43 - Anthony Campolo

So I would really recommend just getting rid of this entirely.

01:27:47 - Anthony Campolo

And moving everything you can into here.

01:27:54 - Anthony Campolo

So let's see.

01:27:56 - Anthony Campolo

So I want to actually try these examples in here.

01:28:01 - Anthony Campolo

So let's just start with this one.

01:28:07 - Anthony Campolo

I'm actually not going to mess around with.

01:28:11 - Anthony Campolo

I'm actually going to get that semi-cold in there.

01:28:28 - Anthony Campolo

Let's see if this works.

01:28:30 - Anthony Campolo

So this will be get best block hash.

01:28:39 - Anthony Campolo

Point.

01:29:10 - Anthony Campolo

It might be that or it might be this.

01:29:14 - Anthony Campolo

Or it might be that.

01:29:18 - Anthony Campolo

Let's see, where's the other one?

01:29:21 - Anthony Campolo

Dash import, dash hash.

01:29:31 - Anthony Campolo

Okay, so it's gonna be one of these four.

01:29:37 - Anthony Campolo

Maybe one's gonna work.

01:29:39 - Anthony Campolo

So let's start with, cause I'm curious,

01:29:46 - Anthony Campolo

It'll probably be...

01:29:49 - Anthony Campolo

Or maybe it would actually be that.

01:29:53 - Anthony Campolo

It's all just in this one bash NPM.

01:30:06 - Anthony Campolo

So let's start with this one.

01:30:17 - Anthony Campolo

Block hash dappy.

01:30:20 - Anthony Campolo

I gotta create that one.

01:30:54 - Anthony Campolo

And we haven't installed that.

01:30:55 - Anthony Campolo

So before I start, I'm installing stuff.

01:31:13 - Anthony Campolo

Okay, so that makes sense.

01:31:14 - Anthony Campolo

That makes sense.

01:31:16 - Anthony Campolo

So I think I might need to just install this unless something about it.

01:31:26 - Anthony Campolo

So, ah, this is what I need to do.

01:31:29 - Anthony Campolo

I need to do the dash dot client.

01:31:33 - Anthony Campolo

Then I can do these things, I think.

01:31:45 - Anthony Campolo

This says get.

01:31:48 - Anthony Campolo

Have a client, whereas this is .core, best block hash, essentially, and it provides you with dash network players, classic dash, blockchain, and platform.

01:32:05 - Anthony Campolo

Interesting.

01:32:07 - Anthony Campolo

Okay.

01:32:11 - Anthony Campolo

Just talking with Tabby House.

01:32:12 - Anthony Campolo

Okay.

01:32:13 - Anthony Campolo

Gotcha.

01:32:17 - Anthony Campolo

Okay, and so what I'm getting at is now, so the Dabby client stuff is in just this one dash package,

01:32:27 - Anthony Campolo

but these examples are still using the old one and are initializing the client this way.

01:32:34 - Anthony Campolo

This case is using Dabby client as well.

01:32:39 - Anthony Campolo

So, then.

01:32:44 - Anthony Campolo

Let's just do this.

01:33:03 - Anthony Campolo

And to me, your value is not a function.

01:33:10 - Anthony Campolo

Yeah, so I'm guessing this may be because this is the deprecated one.

01:33:17 - Anthony Campolo

Okay, so let's try.

01:33:28 - Anthony Campolo

This is going to be get best block hash.

01:33:34 - Anthony Campolo

Let me just grab this whole thing.

01:33:41 - Anthony Campolo

It's just, you know.

01:33:55 - Anthony Campolo

Let's see if that works.

01:34:11 - Anthony Campolo

This is the type of thing I was having issues with last time.

01:34:15 - Anthony Campolo

There's some TLS stuff.

01:34:16 - Anthony Campolo

It looks like it still did it for us.

01:34:19 - Anthony Campolo

Okay, cool.

01:34:20 - Anthony Campolo

So we're getting...

01:34:24 - Anthony Campolo

Course status?

01:34:28 - Anthony Campolo

Course status is here.

01:34:29 - Anthony Campolo

Okay.

01:34:34 - Anthony Campolo

Let's just call her get status.

01:34:37 - Anthony Campolo

Okay, so first it console logs this.

01:34:39 - Anthony Campolo

That's what's happening here.

01:34:42 - Anthony Campolo

So that's what this is.

01:34:47 - Anthony Campolo

That's get best block.

01:34:49 - Anthony Campolo

Okay.

01:34:49 - Anthony Campolo

I see.

01:34:51 - Anthony Campolo

Okay.

01:34:51 - Anthony Campolo

So actually let's,

01:34:57 - Anthony Campolo

Okay.

01:35:02 - Anthony Campolo

So what's in the status information?

01:35:06 - Anthony Campolo

Looking at the chain, got the master node, and then the network.

01:35:13 - Anthony Campolo

Okay, I'm not as interested in that.

01:35:17 - Anthony Campolo

I think I want to.

01:35:21 - Anthony Campolo

Just return the best block hash.

01:35:30 - Anthony Campolo

I'm just going to do this.

01:35:35 - Anthony Campolo

It's...

01:35:39 - Anthony Campolo

Okay, cool.

01:35:41 - Anthony Campolo

That's a little simpler.

01:35:47 - Anthony Campolo

I think what I'm going to do is I'm going to pull this.

01:36:12 - Anthony Campolo

So I have a meeting in 20 minutes.

01:36:14 - Anthony Campolo

So I'm going to want to hop off probably in 10.

01:36:16 - Anthony Campolo

So I'll have some time.

01:36:20 - Anthony Campolo

Ready.

01:36:33 - Anthony Campolo

Awesome.

01:36:41 - Anthony Campolo

That's very clean.

01:37:00 - Anthony Campolo

There.

01:37:06 - Anthony Campolo

Okay.

01:37:17 - Anthony Campolo

So yeah, so really importing dash from dash with ESM and then initializing the client like this then gives you access to the client methods here.

01:37:30 - Anthony Campolo

So this is what you want.

01:37:33 - Anthony Campolo

So all of this is all wrong.

01:37:38 - Anthony Campolo

And this, if that's kind of the case throughout these examples,

01:37:46 - Anthony Campolo

then it might make sense to just start rewriting these and bringing them in here, kind of one by one.

01:37:59 - Anthony Campolo

I could see why it might take a little while.

01:38:02 - Anthony Campolo

There's not really examples for these ones, though.

01:38:15 - Anthony Campolo

Okay, this is, so this stuff, okay, so the DAPI client, I think you need to get rid of DAPI client here, and then just have this SDK be the thing.

01:38:24 - Anthony Campolo

This is what you want.

01:38:29 - Anthony Campolo

here.

01:38:31 - Anthony Campolo

I think dash pay dot gam.io is supposed to be dead.

01:38:34 - Anthony Campolo

Confirm with our docs kind of description.

01:38:36 - Anthony Campolo

Yeah.

01:38:36 - Anthony Campolo

Okay, cool.

01:38:38 - Anthony Campolo

Great, great, great.

01:38:41 - Anthony Campolo

Looks like there's a lot of information in here, though, that is not anywhere else in information index form.

01:38:52 - Anthony Campolo

Just things like showing you a lot of this stuff.

01:38:57 - Anthony Campolo

So, yeah, that's kind of the challenge is...

01:39:03 - Anthony Campolo

Is there a reference for that somewhere around here?

01:39:08 - Anthony Campolo

Yeah, it doesn't look...

01:39:13 - Anthony Campolo

Yeah, it's just like everything is all mixed up into everything.

01:39:17 - Anthony Campolo

So it's really hard to tell what's what.

01:39:22 - Anthony Campolo

Okay, let me separate out these two other ones.

01:39:26 - Anthony Campolo

So I want to have scripts just for each of these standalone ones using the Dappy client then.

01:39:36 - Anthony Campolo

This should be get best block hash.

01:39:49 - Anthony Campolo

It's still working great.

01:39:55 - Anthony Campolo

So that all goes away.

01:40:01 - Anthony Campolo

Okay, and it's not that.

01:40:04 - Anthony Campolo

It's with, eh, kind of, yeah, okay.

01:40:25 - Anthony Campolo

What I want to do is I want to break this off into the client.

01:41:43 - Anthony Campolo

Okay, let's move this up.

01:42:08 - Anthony Campolo

And then I wanted the other examples here.

01:42:11 - Anthony Campolo

So get blocked by height.

01:42:22 - Anthony Campolo

Every kind.

01:43:04 - Anthony Campolo

And then I can just grab all of this here now.

01:43:11 - Anthony Campolo

And change this.

01:43:21 - Anthony Campolo

Let's see if that works.

01:43:40 - Anthony Campolo

Except I probably haven't created it yet.

01:43:51 - Anthony Campolo

Okay, great.

01:43:53 - Anthony Campolo

That's one of the things that always challenges me with doing this is I'll write something, you gotta read me and then run a command like I just wrote it in an actual file because I'm silly like that.

01:44:08 - Anthony Campolo

Something's happening.

01:44:12 - Anthony Campolo

Interesting.

01:44:14 - Anthony Campolo

Interesting.

01:44:21 - Anthony Campolo

So it's giving me a buffer.

01:44:25 - Anthony Campolo

Best block hash buffer.

01:44:27 - Anthony Campolo

A whole bunch more bytes.

01:44:30 - Anthony Campolo

Don't think that's...

01:44:33 - Anthony Campolo

Is that what I wanted?

01:44:37 - Anthony Campolo

Huh.

01:44:43 - Anthony Campolo

Not sure if that's coming in some format that I need to

01:44:49 - Anthony Campolo

Transform.

01:44:51 - Anthony Campolo

But let's just try this one.

01:44:55 - Anthony Campolo

Let's see what happens.

01:45:01 - Anthony Campolo

Okay, this one, that one works.

01:45:04 - Anthony Campolo

Cool.

01:45:05 - Anthony Campolo

So let's just get block hash to string.

01:45:08 - Anthony Campolo

Cool, thank you.

01:45:18 - Anthony Campolo

I need to hop off so that I'll be next time.

01:45:24 - Anthony Campolo

Cool.

01:45:24 - Anthony Campolo

Oh, duh.

01:45:25 - Anthony Campolo

Whoops.

01:45:29 - Anthony Campolo

Yeah.

01:45:40 - Anthony Campolo

And then JSON.stringify it.

01:45:56 - Anthony Campolo

We're getting somewhere, but I need to hop off.

01:45:59 - Anthony Campolo

Cool.

01:45:59 - Anthony Campolo

Well, thank you.

01:46:01 - Anthony Campolo

Not sure what your name is, P.

01:46:04 - Anthony Campolo

Shenmick, but thank you so much for hanging out and for super useful help.

01:46:10 - Anthony Campolo

Also, let me stop screen sharing.

01:46:14 - Anthony Campolo

And yeah, so I think I'll be doing this around this time every week.

01:46:19 - Anthony Campolo

And once I get through kind of checking out all the docs examples and orienting myself of where things are, then we'll start building things with actual like React front ends and stuff like that.

01:46:31 - Anthony Campolo

But as you can see, there are a lot of things I was confused about in terms I didn't know.

01:46:35 - Anthony Campolo

Things that could probably be smoothed out if you have like kind of one getting started tutorial that very clearly

01:46:43 - Anthony Campolo

walks you through these are the things you need this is the things you should import and stuff like that so that's probably what i'll end up creating before i get into the react stuff but i'll probably be able to do most of that on the next stream

01:46:56 - Anthony Campolo

and um ryan will chat i'll chat with you after this and just kind of uh yeah see see what you thought and how it went and all that so um yeah i will catch you guys next week

On this pageJump to section