# Registering a Data Contract for Dash Incubator - 4b

> Anthony Campolo registers and retrieves a Dash Platform data contract on testnet, then hits an error while submitting a note document.

- **Collection:** Video
- **Published:** 2023-06-28
- **Author:** Anthony Campolo
- **Canonical URL:** https://ajcwebdev.com/videos/2023-06-28-registering-a-data-contract-for-dash-incubator-4b/
- **Markdown URL:** https://ajcwebdev.com/videos/2023-06-28-registering-a-data-contract-for-dash-incubator-4b/index.md
- **JSON URL:** https://ajcwebdev.com/videos/2023-06-28-registering-a-data-contract-for-dash-incubator-4b/index.json
- **Channel:** [Dash Incubator](https://www.youtube.com/channel/UCZVi0jeaBJ-bYcXQabnE9jA)
- **Original URL:** https://www.youtube.com/watch?v=AgPD5yuhCJs
- **Original Label:** Watch original

---

## Episode Description

Anthony Campolo continues his Dash Platform tutorial by registering and retrieving a data contract on testnet, then hits an error while submitting a note document.

## Episode Summary

Picking up from a previous session cut short by internet issues, Anthony walks through the next phase of building on Dash Platform: working with data contracts and documents. He successfully registers a data contract on testnet, examines the JSON output, and gets the retrieve data contract script working using the returned contract ID. Along the way he organizes his tutorial repository into clean sections covering register, retrieve, update, and delete operations for both contracts and documents. As he scaffolds out scripts for submitting, updating, and deleting note documents, he begins to understand that the actual string message lives in the document rather than the contract itself, clearing up earlier confusion about where data is stored. Progress stalls when submitting a note document throws a null getId error, prompting him to consult ChatGPT for debugging help. After verifying the identity, contract reference, and document properties all look correct, he concludes the issue may be internal to the Dash library and ends the stream planning to escalate the question to Ryan, the Dash team contact, before continuing.

## Speakers

- Anthony Campolo

## Chapters

### 00:00:00 - Picking Up From the Previous Stream

Anthony opens episode 4.1, framing it as a continuation of episode 4 after his internet failed at the worst possible moment last time. He recaps the trajectory so far: creating a wallet, using it to spin up an identity, registering a name against that identity, and then doing whatever the application needs from there. With a working registered data contract already in hand, he can finally start the segment he had planned to begin previously.

He shares his screen and walks through the register data contract script, pointing out the testnet client setup, the hardcoded mnemonic he is using for sanity rather than environment variables, and the platform.identities.get call that fetches the account from the prior session. He then introduces the contract documents object with its note property, message string field, and additionalProperties: false, admitting he is still figuring out exactly how this object maps to the conceptual idea of a data contract.

### 00:03:00 - Inspecting the Contract Output and Wrangling the Console

Anthony fights with console output to see the full structure of what registerDataContract returns. He tries pulling the dataContract field, then drilling further with .contract, and finds himself bouncing between layers that all look similar at first glance. A brief greeting to a viewer, BJ Campolo, breaks up the troubleshooting before he commits to reading the documentation more carefully to see what the next official step looks like.

While preparing to look at retrieve data contract, the console finally spits out the full JSON blob he was hunting for, revealing the documents and note structure with its type: object definition. This matches the code he wrote, so the mental model snaps into place. He copies the output into his README so the tutorial captures what readers should expect to see when running the script themselves.

### 00:06:30 - Structuring the Tutorial and Confusion About Messages

Anthony pivots to organizing the README, slotting the new register and retrieve sections between the existing create wallet content and a planned backend section. He gives himself a clean meta layout so future scripts can be added in the same pattern. Along the way he reflects that a Dash data contract is not a contract in the Ethereum smart contract sense, but more like a JSON blob storage schema for objects you want stored on-chain.

What still bothers him is where the actual string content lives. The schema declares a message of type string, but nowhere in the registered contract output does he see anything like a literal "hello world" payload. He flags this as the open question to resolve and presses on, trusting that the retrieve and update steps in the docs will eventually surface where the real message data sits.

### 00:09:00 - Retrieving the Data Contract Successfully

Anthony notices that the docs example for retrieving a contract uses a contract ID rather than an identity ID, which is a meaningful distinction he wants to verify works in practice. He copies the script into a new retrieve contract file, adds the matching npm script entry, and reflects on the consistent naming pattern Dash uses across register/retrieve verbs for both names and contracts.

After a small misstep running the wrong command, he plugs in the contract ID returned from his earlier registration and the retrieval works on the first real try. He celebrates the milestone of having both registered and retrieved a data contract end to end, then turns toward the next docs section on updating a contract while still puzzling over what an update even means when no message field is visible.

### 00:14:00 - Scaffolding Update, Submit, and Delete Scripts

Working through the docs, Anthony realizes there are separate flows for updating a data contract versus updating a document, which strongly suggests the document is where the actual message string lives. He decides to scaffold out all the remaining scripts at once: update contract, submit note document, retrieve documents, update document, and delete document, plus their corresponding npm script entries.

He renames things for consistency, dropping the redundant "data" word from filenames since the rest of the codebase already uses contract and document directly. He also riffs on the fact that being able to read, write, update, and delete is essentially the sum total of programming, then methodically copies template code into each new file, removes JavaScript semicolons to match his style, and adds the shared client initialization block to each script.

### 00:21:00 - Wiring Up Identity, Contract IDs, and Running the Pipeline

With all the scripts in place, Anthony hardcodes the various identity IDs and contract IDs across the files for now, planning to abstract them into environment variables later. He confirms the retrieve contract script still works, then moves on to the update contract script. The script runs without throwing, but he is honest that he cannot tell what was actually changed since the example does not modify the schema in any obvious way.

He then opens submit note document, recognizing this as the meaningful step where his actual message will be stamped onto the platform. He customizes the payload to read "Hello from AJC Web Dev" and runs it, expecting this to be the moment his message lands on testnet. Instead the script errors out, kicking off a debugging spiral.

### 00:30:00 - Discovering the Tutorial Contract Client Config

The error message complains that no contract is defined, which sends Anthony back to the docs hunting for what he might have skipped. He finds a configuration block he had not seen before: an apps.tutorialContract entry on the client object that maps a friendly name to the contract ID. This is the first time the docs require it, and he notes how easy it is to miss when speed-reading through earlier sections.

He adds the apps block to his client setup, carefully placing it as a sibling of wallet rather than nested inside it, then copies the change into his README so the tutorial captures the requirement. Running the script again surfaces a new and more cryptic error: "Cannot read properties of null reading getId," indicating something is now null when the SDK expects a real identity.

### 00:32:00 - Debugging With ChatGPT and Hitting a Wall

Anthony pastes the script, the client configuration, and the error into ChatGPT to get a second opinion. The model suggests the identity returned from the get call may itself be null, possibly because the identity does not exist or the platform connection is failing. He adds a console log for the identity object, runs again, and confirms the identity does come back populated and does have a getId method.

ChatGPT then walks him through deeper checks: verifying tutorialContract.note exists, logging the inputs to platform.documents.create, and confirming the document properties look right. Everything appears correct on his side. Notably, the message "Hello from AJC Web Dev" does show up in the logged document object, so something is propagating correctly. He concludes the failure may be internal to the Dash library, jokes that he never makes it to step four of any debugging suggestion list, and ends the stream at 00:39:20 planning to escalate to Ryan from the Dash team for help in the next session.

## Transcript

[00:00:04] - Anthony Campolo
Okay, hello everybody.

[00:00:07] - Anthony Campolo
This is episode 4.1 of the Dash streaming with me.

[00:00:15] - Anthony Campolo
Yeah, if last time I got to the point where I was about to start doing the thing I wanted to start doing at the stream and then my internet decided to die, so that was sad face.

[00:00:25] - Anthony Campolo
But we are here now and I have registered data contract working.

[00:00:31] - Anthony Campolo
So we'll be able to start off right where we need to start off and do the thing that we want to do.

[00:00:38] - Anthony Campolo
So last time I kind of walked through basically what I have done in the past, which is show how to create a wallet, use that wallet to create an identity, use that identity to register a name, and then use that name to do whatever you want to do.

[00:00:52] - Anthony Campolo
Whatever you want to do.

[00:00:55] - Anthony Campolo
So let's just jump right into it here.

[00:00:58] - Anthony Campolo
And I'm going to share my screen.

[00:01:02] - Anthony Campolo
Boom, boom, boom, boom, boom.

[00:01:05] - Anthony Campolo
Okay, so here we have, this is the registered data contract script.

[00:01:11] - Anthony Campolo
So we're importing our client here.

[00:01:14] - Anthony Campolo
Our client is set to testnet and it has this mnemonic here.

[00:01:19] - Anthony Campolo
Just for the sake of my sanity, as I'm going through this, I'm going to leave out process.env environment variables and things of that nature.

[00:01:26] - Anthony Campolo
Eventually, that's what we're going to want to do is have all this stuff in environment variables.

[00:01:30] - Anthony Campolo
But I'm just kind of throwing this data in here with some test accounts just to get everything working.

[00:01:38] - Anthony Campolo
And so here we have, we're initializing the client and pulling out this platform object and then doing platform.identities.get.

[00:01:49] - Anthony Campolo
And this is our ID for the account we created last time.

[00:01:55] - Anthony Campolo
And then this is where the really important stuff is.

[00:01:58] - Anthony Campolo
As far as I can tell, this is the contract documents, which is a note that is type object that has properties and a message.

[00:02:07] - Anthony Campolo
That message is a type string.

[00:02:10] - Anthony Campolo
And the additional properties is false.

[00:02:12] - Anthony Campolo
So what exactly this object is and how it relates to what a data contract is, is what I still am kind of figuring out here.

[00:02:21] - Anthony Campolo
But I do know that when I run this, I will get this right here.

[00:02:29] - Anthony Campolo
This is what is being outputted when we run it.

[00:02:34] - Anthony Campolo
So after we create the data contract, the contract documents, we both feed that and the identity into this contracts.create function.

[00:02:45] - Anthony Campolo
Then we have the contract and we can display it in the console.

[00:02:50] - Anthony Campolo
We also then have this validate thing going on.

[00:02:55] - Anthony Campolo
This then signs and submits the data contract as this.

[00:03:00] - Anthony Campolo
Little note tells us here.

[00:03:03] - Anthony Campolo
And then if we get an error, then we throw out the error.

[00:03:06] - Anthony Campolo
So within this output, we're getting this.

[00:03:13] - Anthony Campolo
So it looks like what I really want to see is this here.

[00:03:18] - Anthony Campolo
So I want to see the documents.

[00:03:20] - Anthony Campolo
And then note.

[00:03:21] - Anthony Campolo
So let me try pulling out the dot data contract first off.

[00:03:28] - Anthony Campolo
So D dot.

[00:03:30] - Anthony Campolo
See what happens here.

[00:03:40] - Anthony Campolo
Okay, good.

[00:03:41] - Anthony Campolo
So that gave us just the contract.

[00:03:43] - Anthony Campolo
So now let's do .contract.

[00:03:47] - Anthony Campolo
Whoops.

[00:03:54] - Anthony Campolo
That gave us the same thing.

[00:04:01] - Anthony Campolo
Hmm.

[00:04:10] - Anthony Campolo
Okay.

[00:04:13] - Anthony Campolo
Contract.

[00:04:16] - Anthony Campolo
So we're actually getting it here, I think.

[00:04:22] - Anthony Campolo
So that might be where we want to destructure it from this point.

[00:04:27] - Anthony Campolo
Let's try that.

[00:04:33] - Anthony Campolo
Contract.

[00:04:34] - Anthony Campolo
And then let's go const.

[00:04:38] - Anthony Campolo
Already contract, so.

[00:04:45] - Anthony Campolo
Actually, instead of doing that, let me see if I can see the whole blob.

[00:05:01] - Anthony Campolo
Hey, what's up?

[00:05:05] - Anthony Campolo
BJ Campolo.

[00:05:08] - Anthony Campolo
Fellow Italian, I would assume.

[00:05:13] - Anthony Campolo
Okay, so whatever I'm doing, it's still just kind of giving me this contract here.

[00:05:20] - Anthony Campolo
I want to kind of introspect it to the point where I can see this guy right there.

[00:05:24] - Anthony Campolo
Let's go into the docs now and see what is the next couple steps here.

[00:05:30] - Anthony Campolo
Because this was the kind of first step.

[00:05:33] - Anthony Campolo
Just to get to the section of the docs I wanted to go through.

[00:05:37] - Anthony Campolo
But then as with creating and registering an identity, there's a whole bunch of steps here.

[00:05:44] - Anthony Campolo
So now that we have registered a data contract, let's just take a look at the retrieve data contract.

[00:05:49] - Anthony Campolo
This is probably how we're gonna be able to, oh, this probably did what I wanted to, look at that.

[00:05:54] - Anthony Campolo
So this just popped out, this whole JSON blob here, which is what I was curious to take a look at.

[00:06:01] - Anthony Campolo
So before there's documents, note, object, documents, note.

[00:06:11] - Anthony Campolo
Okay, so that's type object.

[00:06:12] - Anthony Campolo
So that's what we had in the code here, basically, is what that's showing.

[00:06:18] - Anthony Campolo
Okay, that makes sense.

[00:06:21] - Anthony Campolo
Let me just grab this and make sure that gets in here in the readme.

[00:06:32] - Anthony Campolo
Okay.

[00:06:33] - Anthony Campolo
Right at this point, this is where the next kind of meta section starts.

[00:06:37] - Anthony Campolo
So before we had, if we look at,

[00:06:44] - Anthony Campolo
Let's just break this down real quick.

[00:06:50] - Anthony Campolo
So we got dash platform.

[00:06:53] - Anthony Campolo
Boom, boom, boom, boom, boom.

[00:07:08] - Anthony Campolo
We want this before we do the backend section.

[00:07:11] - Anthony Campolo
So we have the create wallet, it's kind of the big chunk here.

[00:07:15] - Anthony Campolo
And before backend, this is gonna be register, get contract.

[00:07:42] - Anthony Campolo
Okay, there we go.

[00:07:43] - Anthony Campolo
So when we register a data contract, it kind of outputs this right here.

[00:07:50] - Anthony Campolo
And as I was saying last time, the data contract, as far as I can tell, is like a JSON blob storage kind of thing.

[00:07:59] - Anthony Campolo
It's not really a contract in the Ethereum sense where it's giving us logic and all programming language.

[00:08:06] - Anthony Campolo
It's just a way to store some objects that you want stored somewhere.

[00:08:17] - Anthony Campolo
That's confusing me right now, though.

[00:08:20] - Anthony Campolo
As far as I can tell, this is a document with a note with a message.

[00:08:23] - Anthony Campolo
So it's just like a hunk of chunk of string that is being saved in there.

[00:08:28] - Anthony Campolo
But what is the string?

[00:08:30] - Anthony Campolo
Like, to me, this should...

[00:08:32] - Anthony Campolo
What I would expect here is that there would actually be a string with a message like, hello, world.

[00:08:39] - Anthony Campolo
Somewhere, but I don't see like an actual string here, but that was saying it's a message of type string property.

[00:08:46] - Anthony Campolo
So that's what I'm currently kind of confused about here.

[00:08:51] - Anthony Campolo
But let's forge on and go to the retrieve a data contract step because

[00:09:00] - Anthony Campolo
Look at that.

[00:09:00] - Anthony Campolo
So before they had this here, they said identity ID goes here.

[00:09:09] - Anthony Campolo
Then right here, they actually have a contract ID.

[00:09:13] - Anthony Campolo
Let's see what that's going to do for us.

[00:09:18] - Anthony Campolo
So before actually I do that, let me make sure I actually get this code in here.

[00:09:25] - Anthony Campolo
So this was registered data contract.

[00:09:29] - Anthony Campolo
This is the code we're looking at at the beginning.

[00:09:33] - Anthony Campolo
Drop that there.

[00:09:35] - Anthony Campolo
And then it's also important that

[00:09:38] - Anthony Campolo
You have to add this to your scripts.json.

[00:09:47] - Anthony Campolo
This is something that I drop in at the very beginning of the tutorial.

[00:09:52] - Anthony Campolo
Go back up here.

[00:09:56] - Anthony Campolo
Yep, right here.

[00:09:57] - Anthony Campolo
And yeah, that gives us everything we want.

[00:10:24] - Anthony Campolo
Great.

[00:10:25] - Anthony Campolo
And the way you run it, it should just,

[00:10:30] - Anthony Campolo
npm run registerDataContract.

[00:10:34] - Anthony Campolo
Cool, cool, cool, cool.

[00:10:37] - Anthony Campolo
This will eventually be abstracted out into an environment variable.

[00:10:46] - Anthony Campolo
Like this one.

[00:10:57] - Anthony Campolo
Yeah, that this would have.

[00:11:05] - Anthony Campolo
Just hold it out for now.

[00:11:15] - Anthony Campolo
Okay, cool.

[00:11:19] - Anthony Campolo
That's all good.

[00:11:21] - Anthony Campolo
So, let's do this.

[00:11:25] - Anthony Campolo
contracts.

[00:11:28] - Anthony Campolo
I have individual sections for each of these scripts.

[00:11:31] - Anthony Campolo
So this will be the next one, retrieve data contract.

[00:11:45] - Anthony Campolo
Same sort of deal here.

[00:11:47] - Anthony Campolo
Create this file.

[00:11:49] - Anthony Campolo
Instead of register data contract,

[00:11:51] - Anthony Campolo
It'll be retrieve.

[00:11:55] - Anthony Campolo
Seeing some kind of similarities here in naming.

[00:12:00] - Anthony Campolo
Previously we registered a name.

[00:12:02] - Anthony Campolo
And retrieved identities.

[00:12:04] - Anthony Campolo
Now we're registering data contract and retrieving data contract.

[00:12:09] - Anthony Campolo
So I like that.

[00:12:12] - Anthony Campolo
There's a thought out meta naming structure here.

[00:12:17] - Anthony Campolo
That's pretty easy to follow along with.

[00:12:43] - Anthony Campolo
I'm curious if this is just going to work with this contract ID.

[00:12:47] - Anthony Campolo
They're including what that's going to do.

[00:12:54] - Anthony Campolo
I can retrieve the one I just created.

[00:12:58] - Anthony Campolo
That's the whole point.

[00:12:59] - Anthony Campolo
But let's see what happens if I just run what they got here in their docs.

[00:13:03] - Anthony Campolo
What's going to happen?

[00:13:04] - Anthony Campolo
Who knows?

[00:13:06] - Anthony Campolo
Anything could happen.

[00:13:10] - Anthony Campolo
Let me add this one though.

[00:13:25] - Anthony Campolo
It's not five.

[00:13:25] - Anthony Campolo
Oh, right.

[00:13:29] - Anthony Campolo
Jump the gun there.

[00:13:41] - Anthony Campolo
Okay.

[00:13:42] - Anthony Campolo
That's not surprising.

[00:13:44] - Anthony Campolo
Going back to this, though, we have data contract.

[00:13:47] - Anthony Campolo
It looks like we have an ID.

[00:13:49] - Anthony Campolo
Let's see what happens.

[00:13:51] - Anthony Campolo
We include that right there.

[00:13:54] - Anthony Campolo
That will do a thing that we want to do.

[00:13:58] - Anthony Campolo
There we go.

[00:13:59] - Anthony Campolo
All right.

[00:14:00] - Anthony Campolo
That's good.

[00:14:01] - Anthony Campolo
We've both registered and retrieved a data contract.

[00:14:04] - Anthony Campolo
We are making progress here.

[00:14:09] - Anthony Campolo
Yeah, that's something cool out of here.

[00:14:13] - Anthony Campolo
Okay, good, good, good.

[00:14:22] - Anthony Campolo
Update a data contract.

[00:14:24] - Anthony Campolo
Okay, so this is where I would assume, what are we updating?

[00:14:28] - Anthony Campolo
There's no message here.

[00:14:31] - Anthony Campolo
Then what is an update?

[00:14:33] - Anthony Campolo
I'm still confused about that.

[00:14:34] - Anthony Campolo
What is the actual message?

[00:14:35] - Anthony Campolo
Where is it?

[00:14:42] - Anthony Campolo
But I can grab this hunk of code and do the thing.

[00:14:47] - Anthony Campolo
I'm sure it will work.

[00:14:59] - Anthony Campolo
So this is going to be update data contract.

[00:15:03] - Anthony Campolo
Yeah, it's including data contract redundant.

[00:15:07] - Anthony Campolo
Here it's just update contract, retrieve contract.

[00:15:11] - Anthony Campolo
Yeah, I should probably take data out now that I'm seeing that a little bit wordy for no reason.

[00:15:50] - Anthony Campolo
Good.

[00:15:55] - Anthony Campolo
Do this.

[00:16:12] - Anthony Campolo
Okay.

[00:16:16] - Anthony Campolo
Cool.

[00:16:17] - Anthony Campolo
All right, great.

[00:16:18] - Anthony Campolo
So now we're going to have update contract.

[00:16:22] - Anthony Campolo
That's right.

[00:16:32] - Anthony Campolo
Let's just go ahead and see.

[00:16:35] - Anthony Campolo
This one.

[00:16:38] - Anthony Campolo
Submit note document.

[00:16:42] - Anthony Campolo
Okay.

[00:16:47] - Anthony Campolo
We're going to have get documents.

[00:16:52] - Anthony Campolo
Okay.

[00:17:01] - Anthony Campolo
Okay, so updating a document is different from updating a data contract.

[00:17:06] - Anthony Campolo
So maybe the document is where the actual string message comes into play.

[00:17:21] - Anthony Campolo
Delete document.

[00:17:22] - Anthony Campolo
Delete.

[00:17:23] - Anthony Campolo
You're not supposed to be able to delete things on the blockchain.

[00:17:25] - Anthony Campolo
That's absurd.

[00:17:28] - Anthony Campolo
Or delete something.

[00:17:31] - Anthony Campolo
Okay.

[00:17:35] - Anthony Campolo
All that.

[00:17:38] - Anthony Campolo
Back up here.

[00:17:44] - Anthony Campolo
Okay, cool.

[00:17:46] - Anthony Campolo
All right, bunch of new scripts.

[00:18:00] - Anthony Campolo
Okay.

[00:18:03] - Anthony Campolo
So this is going to be update contract.

[00:18:15] - Anthony Campolo
Put the contract in the titles.

[00:18:17] - Anthony Campolo
Does that make sense?

[00:18:20] - Anthony Campolo
And then we're going to have submit documents.

[00:18:32] - Anthony Campolo
Retrieve documents.

[00:18:37] - Anthony Campolo
Update documents and delete documents.

[00:18:45] - Anthony Campolo
These right here.

[00:20:00] - Anthony Campolo
Right now, I'm just jumping ahead and creating both the script to create the file.

[00:20:06] - Anthony Campolo
Oh, these all need .js at the end.

[00:20:10] - Anthony Campolo
And then the script to run it.

[00:20:12] - Anthony Campolo
And then we each have some code in the middle.

[00:20:15] - Anthony Campolo
And that'll be it.

[00:20:47] - Anthony Campolo
It's not update document.

[00:20:49] - Anthony Campolo
That's this one.

[00:20:49] - Anthony Campolo
Yeah.

[00:20:50] - Anthony Campolo
Okay.

[00:20:55] - Anthony Campolo
There, there, there.

[00:21:01] - Anthony Campolo
Here.

[00:21:04] - Anthony Campolo
Documents goes up here.

[00:21:09] - Anthony Campolo
document.

[00:21:12] - Anthony Campolo
here.

[00:21:14] - Anthony Campolo
It goes there.

[00:21:15] - Anthony Campolo
Great.

[00:21:16] - Anthony Campolo
And then in between each, we'll have the actual code.

[00:21:22] - Anthony Campolo
Basically be this for each one.

[00:21:25] - Anthony Campolo
Let's do this.

[00:21:48] - Anthony Campolo
Cool.

[00:21:48] - Anthony Campolo
So we also then want to have this client code in each of them.

[00:22:12] - Anthony Campolo
Okay.

[00:22:15] - Anthony Campolo
It's created already or not?

[00:22:16] - Anthony Campolo
I don't think so.

[00:22:18] - Anthony Campolo
I can actually run these guys.

[00:22:25] - Anthony Campolo
Cool.

[00:22:28] - Anthony Campolo
That.

[00:22:39] - Anthony Campolo
Note document.

[00:22:44] - Anthony Campolo
Delete note document.

[00:22:50] - Anthony Campolo
Docs and grab all that code.

[00:23:01] - Anthony Campolo
Update data contract from here to there.

[00:23:09] - Anthony Campolo
Yes, we have update contract, update note document.

[00:23:12] - Anthony Campolo
So the document itself is where the thing is going to, the message is going to live.

[00:23:18] - Anthony Campolo
While gathering here.

[00:23:22] - Anthony Campolo
document.

[00:23:34] - Anthony Campolo
Message tutorial test.

[00:23:35] - Anthony Campolo
There we go.

[00:23:36] - Anthony Campolo
That's the stuff.

[00:23:38] - Anthony Campolo
That's where it's at.

[00:23:41] - Anthony Campolo
It all makes sense.

[00:23:42] - Anthony Campolo
It all makes sense.

[00:23:48] - Anthony Campolo
This is going to be submit note document.

[00:23:56] - Anthony Campolo
document.

[00:23:58] - Anthony Campolo
It's a nice short one.

[00:24:08] - Anthony Campolo
This is that when you want to change that note in the document.

[00:24:22] - Anthony Campolo
Last one, delete.

[00:24:24] - Anthony Campolo
Okay, this is clean.

[00:24:27] - Anthony Campolo
This is very, very simple.

[00:24:31] - Anthony Campolo
Tells you how to read, or write, read, update, delete.

[00:24:38] - Anthony Campolo
What else do you need?

[00:24:40] - Anthony Campolo
That's sum total of programming.

[00:24:43] - Anthony Campolo
Okay, I'll just delete all these freaking semicolons.

[00:25:09] - Anthony Campolo
Cool.

[00:25:16] - Anthony Campolo
Ça va.

[00:25:17] - Anthony Campolo
There we go.

[00:25:18] - Anthony Campolo
There we go.

[00:25:42] - Anthony Campolo
Right now, deleting semicolons.

[00:25:45] - Anthony Campolo
More fun.

[00:25:52] - Anthony Campolo
That's good.

[00:25:53] - Anthony Campolo
Cool.

[00:25:55] - Anthony Campolo
Okay.

[00:25:56] - Anthony Campolo
So as long as these all work.

[00:25:59] - Anthony Campolo
And that'll pretty much be all I want to do.

[00:26:04] - Anthony Campolo
So let's run through these.

[00:26:08] - Anthony Campolo
Now that we have been able to retrieve it, we can update it.

[00:26:14] - Anthony Campolo
Let's grab the same.

[00:26:17] - Anthony Campolo
Ooh, this is, okay.

[00:26:19] - Anthony Campolo
So now we have contract ID, we have an identity ID, two different things.

[00:26:28] - Anthony Campolo
important.

[00:26:38] - Anthony Campolo
All the necessary identity IDs in here.

[00:26:42] - Anthony Campolo
I'm going to hard code all these right now for simplicity's sake.

[00:26:55] - Anthony Campolo
Cool.

[00:26:57] - Anthony Campolo
Let's go back.

[00:27:08] - Anthony Campolo
All right, let's start doing this.

[00:27:12] - Anthony Campolo
Retrieve contract.

[00:27:17] - Anthony Campolo
Make sure that's all copacetic.

[00:27:35] - Anthony Campolo
Okay, we have a contract.

[00:27:38] - Anthony Campolo
Next step, we want to update said contract.

[00:27:45] - Anthony Campolo
Let's grab this.

[00:27:48] - Anthony Campolo
Update contract.

[00:28:06] - Anthony Campolo
It's thinking and thinking and thinking about what to do.

[00:28:11] - Anthony Campolo
He doesn't know what to do, but he's going to do the thing.

[00:28:22] - Anthony Campolo
Let's look at this code.

[00:28:24] - Anthony Campolo
We have update contract, getting an identity, getting a contract, running existing data contract.getDocuments.

[00:28:37] - Anthony Campolo
And then make sure it passes the validation check.

[00:28:41] - Anthony Campolo
So where is it update?

[00:28:43] - Anthony Campolo
What is changing here?

[00:28:47] - Anthony Campolo
Okay, I seem to have done a thing.

[00:28:52] - Anthony Campolo
Not entirely sure what I just updated, but we're gonna keep going.

[00:28:58] - Anthony Campolo
And we got submit note document.

[00:29:00] - Anthony Campolo
Now this seems important.

[00:29:02] - Anthony Campolo
This is where we have a thing.

[00:29:03] - Anthony Campolo
So I need to rewrite this obviously.

[00:29:09] - Anthony Campolo
Hello from AJC Web Dev.

[00:29:14] - Anthony Campolo
Do that.

[00:29:15] - Anthony Campolo
Submit note document.

[00:29:16] - Anthony Campolo
This is where we are stamping our intention on the universe right here.

[00:29:31] - Anthony Campolo
And you broke it.

[00:29:40] - Anthony Campolo
You did not give it a name.

[00:29:48] - Anthony Campolo
Interesting.

[00:29:49] - Anthony Campolo
Interesting.

[00:30:00] - Anthony Campolo
So I have to define that name previously.

[00:30:18] - Anthony Campolo
Ah, skip step.

[00:30:21] - Anthony Campolo
Here we go.

[00:30:22] - Anthony Campolo
Okay, so there's something I needed to add to the client.

[00:30:26] - Anthony Campolo
apps.tutorialContract, contractId.

[00:30:30] - Anthony Campolo
That is interesting.

[00:30:35] - Anthony Campolo
Not what I expected.

[00:30:37] - Anthony Campolo
So that is, hmm, was this earlier?

[00:30:43] - Anthony Campolo
Nope.

[00:30:47] - Anthony Campolo
Nope.

[00:30:52] - Anthony Campolo
Okay, so it seems like this is the first time this needs to be in the client.

[00:30:56] - Anthony Campolo
It's important, though.

[00:30:58] - Anthony Campolo
Very important.

[00:31:02] - Anthony Campolo
We've got apps.tutorialContract, right below wallet.

[00:31:07] - Anthony Campolo
Not inside of wallet.

[00:31:09] - Anthony Campolo
That would be incorrect.

[00:31:13] - Anthony Campolo
Okay.

[00:31:14] - Anthony Campolo
And while we're just kind of grabbing code here, let me just grab that and make sure.

[00:31:23] - Anthony Campolo
Lose track of this.

[00:31:26] - Anthony Campolo
In this state at this point.

[00:31:30] - Anthony Campolo
Cool.

[00:31:32] - Anthony Campolo
Okay.

[00:31:32] - Anthony Campolo
Well, let's run that again.

[00:31:34] - Anthony Campolo
See what happens.

[00:31:41] - Anthony Campolo
Cannot read properties of null reading getId.

[00:31:46] - Anthony Campolo
Did I give it an ID?

[00:32:01] - Anthony Campolo
I believe.

[00:32:03] - Anthony Campolo
Identity?

[00:32:05] - Anthony Campolo
Hmm.

[00:32:09] - Anthony Campolo
Right?

[00:32:14] - Anthony Campolo
Let us consult the GPT chat.

[00:32:36] - Anthony Campolo
I have the following file.

[00:32:45] - Anthony Campolo
Scripts for slash submit note documents dot JS.

[00:32:53] - Anthony Campolo
And the following client information.

[00:33:05] - Anthony Campolo
When I run.

[00:33:09] - Anthony Campolo
this, I get the following error.

[00:33:28] - Anthony Campolo
Let's see what happens.

[00:33:30] - Anthony Campolo
Pretty good recently.

[00:33:32] - Anthony Campolo
I'm getting Dash errors.

[00:33:33] - Anthony Campolo
It seems to be able to figure it out.

[00:33:41] - Anthony Campolo
Okay.

[00:33:42] - Anthony Campolo
You're trying to retrieve an identity object with the ID.

[00:33:45] - Anthony Campolo
When the promise resolves, the identity variable is supposed to contain object, but instead it is null.

[00:33:50] - Anthony Campolo
This is if the identity doesn't exist or if there's a problem with the connection to the Dash platform.

[00:33:55] - Anthony Campolo
Okay.

[00:33:58] - Anthony Campolo
So it's telling us to console log the identity right after in the relevant file.

[00:34:04] - Anthony Campolo
And then also catch errors right at the point of fetching the identity to get more details about what's wrong.

[00:34:10] - Anthony Campolo
Okay.

[00:34:14] - Anthony Campolo
Interesting, interesting.

[00:34:17] - Anthony Campolo
So.

[00:34:20] - Anthony Campolo
out of these two.

[00:34:24] - Anthony Campolo
Try this one first.

[00:34:40] - Anthony Campolo
Identity.

[00:34:52] - Anthony Campolo
Okay, something came out.

[00:35:09] - Anthony Campolo
Okay, I successfully retrieved an identity.

[00:35:12] - Anthony Campolo
I thought I did.

[00:35:13] - Anthony Campolo
I'm still encountering the error because the identity instance doesn't have the necessary fields or methods required for the documents.create method.

[00:35:24] - Anthony Campolo
The error message you received suggests the getId method is being called on a null object somewhere in the create method in Dash module's documents API.

[00:35:33] - Anthony Campolo
Might be that the identity object you're passing.

[00:35:37] - Anthony Campolo
Might not be in the correct format or that doesn't have a getId method.

[00:35:42] - Anthony Campolo
It's hard to say without more information about the dash module, identity class, try to check the identity object, whether it has a getId. Okay.

[00:35:54] - Anthony Campolo
So after we console log identity, console log this.

[00:36:02] - Anthony Campolo
Let's do it.

[00:36:11] - Anthony Campolo
Okay.

[00:36:16] - Anthony Campolo
We have hasGetId equals true.

[00:36:23] - Anthony Campolo
The identity does have the getId method, which is good news.

[00:36:29] - Anthony Campolo
You're seeing an error specifically in the issue.

[00:36:33] - Anthony Campolo
Let's dive deeper into the create method call.

[00:36:44] - Anthony Campolo
So the tutorialContract.note might not exist or might not be accessible.

[00:36:50] - Anthony Campolo
Verify this contract.

[00:36:53] - Anthony Campolo
There might be a problem with doc properties.

[00:36:56] - Anthony Campolo
The identity instance might be valid, but the platform might be failing to recognize it.

[00:37:00] - Anthony Campolo
Or debug further, log the inputs just before platform.documents.create method to ensure they're what you expect.

[00:37:11] - Anthony Campolo
Okay, that's a lot of stuff.

[00:37:18] - Anthony Campolo
That's all above note document.

[00:37:31] - Anthony Campolo
Oh, look at that.

[00:37:33] - Anthony Campolo
There's my message.

[00:37:34] - Anthony Campolo
It's somewhere in the ether.

[00:37:37] - Anthony Campolo
Cool.

[00:37:59] - Anthony Campolo
All those things appear as expected.

[00:38:02] - Anthony Campolo
All right.

[00:38:04] - Anthony Campolo
It might be an internal issue with the Dash library.

[00:38:10] - Anthony Campolo
That'd be nice.

[00:38:15] - Anthony Campolo
Okay.

[00:38:16] - Anthony Campolo
Check my environment's date.

[00:38:18] - Anthony Campolo
Check my configuration.

[00:38:19] - Anthony Campolo
Reach out for help.

[00:38:22] - Anthony Campolo
Check the Dash source code.

[00:38:23] - Anthony Campolo
Yeah, see, I would never, ever go to step four.

[00:38:27] - Anthony Campolo
I'm always going to do step three.

[00:38:29] - Anthony Campolo
And if step three doesn't work, I give up.

[00:38:32] - Anthony Campolo
Never go to step four.

[00:38:34] - Anthony Campolo
Okay, cool.

[00:38:35] - Anthony Campolo
Well, this was good progress.

[00:38:38] - Anthony Campolo
I'm going to stop here and I will escalate this.

[00:38:43] - Anthony Campolo
This may or may not be an issue with my code, but this seems to be at an impasse.

[00:38:48] - Anthony Campolo
But I was able to get the information read out here.

[00:38:54] - Anthony Campolo
You can see it.

[00:38:55] - Anthony Campolo
Hello from AJC Web Dev at the time.

[00:38:58] - Anthony Campolo
So something happened, but it's broken.

[00:39:02] - Anthony Campolo
Don't know why.

[00:39:04] - Anthony Campolo
Thus is programming.

[00:39:05] - Anthony Campolo
But for anyone who is out there watching, thank you for joining.

[00:39:09] - Anthony Campolo
And Ryan, when you watch this back, please let me know what the heck is going on because I think I need some help going forward.

[00:39:17] - Anthony Campolo
All right.

[00:39:18] - Anthony Campolo
Later.
