New Ethereum talks, every Monday. The week's conference uploads by event, in your inbox.

Loading player…

Developer Console: Learn, Create, and Operate All in One Place - Josh Quintal

Ethereum DenverSun, Oct 9, 2022, 12:00 AM

Transcript

Good afternoon everyone. I'm glad to see you all here. I hope everything is going well in East Denver so far. Today I'm going to talk about Near's developer console, where you can learn, create, and operate everything in one place. First of all, who am I ?

I'm Josh Quintel. I am a product manager on the developer platform team at Near, which is changing its name to Pagoda. You may have seen it at our booth. So, what is Near? Near is a sharded layer one blockchain with proof of stake.

It has a couple of excellent additional features that are useful for developers. We have native accounts with a name and a unique access key model. This is really great for its users, of course. They get a named account like the one they are used to on their more traditional web 2.0 platforms .

All of this is integrated. They don't need ENS or anything like that. Access keys allow them to control access to their contracts in a more granular way than simply allowing everyone to call everything, but without requiring them to modify the contract. Which is very interesting. Gas tariffs, a part of network tariffs, actually go to the developers.

So, the contract that is responsible for processing a transaction actually receives a portion of the network fees involved in that transaction. In fact, you can update contracts on the spot. As long as the serialization of the state does not change, you can make an update in place of a contract. In fact, I'll demonstrate that here today in a moment. The virtual machine in NEAR runs WebAssembly, so you can target it with languages ​​you are already familiar with.

Currently, we support Rust and AssemblyScript, but we are also working on a basic JavaScript SDK, which we hope will be very attractive to Web 2.0 developers. So, speaking of the developer console, do you know how it actually fits into the software development lifecycle? And here we are taking a look at this very simplified version, but you know, you're going to create your DApp. Let's say you've planned it, right?

You know what you're going to create. So, you actually need to do the coding work, you know, you use our CLI, you write your smart contracts. Then it's time to try them out. You create an isolated environment node. You have your workspaces.

Test your smart contracts. Finally, they are implemented on a network. But what happens after that point? You'll need to monitor and manage these contracts, and that's where the developer console comes in. So, with that, I'm going to do a little demonstration here.

We're going to talk about analysis and some contract aggregation that relates to the monitoring part I just talked about. But another interesting thing is that, since this is a trading platform and your dApps, you know, will hopefully be using it once it launches, we have an opportunity to bring people on board in an interesting way. So instead of just sending you to a tutorial, there's actually an interactive element on top of this where, as you go through it, you see feedback on what you're doing in a quick-info card. So, without further ado, let me show you what I'm talking about, instead of you continuing to watch me talk about comics. This is the developer console.

And what we're seeing right now is the tutorial. So, when you start it, you know, you've registered, of course, you can create a blank project, which is just for your existing dapp or for a new dapp you want to develop, but there's also another option to create a tutorial project. This is one of them. You can see that badge up there. And this one in particular is really cool, it's a zero-to-hero NFT that our DevRel team put together.

This takes you from knowing nothing about development to a smart contract system for a complete NFT market. Today I'm going to focus on the minting part in particular. You won't have to watch me code live or anything. We'll simply go directly to the contract that's already been created. You can see in the bottom right corner that there is a live contract data card.

This is what I was talking about while you were doing the tutorial. This card will be updated and will show you information about your progress and about the contract itself. This makes these tutorials much more fun and engaging. Upon arriving here, I already have the repository cloned. I 've already checked the correct branch.

I'll show it to you here. Around the coining branch because I wanted to implement the full version for you. With that, we're going to create it here. You don't need to worry about the warnings, as they are part of a tutorial. This code is not used because you will use it in the next step, but in this case we will not.

So now we have created our contract now we have created our contract . We're going to implement it here, but before we do, we need to tell the network who we are. Ready. And in this case, I'm going to do it one more time because I want to create a new account here so you can see this. Ready.

Let's see how I want to log in. Let 's go here to NEAR Wallet. We will create an account. And F Denver 2022-5 sounds good. We'll reserve it.

Don't do this next part. Obviously, I'm not going to use this after this tutorial. Therefore, it doesn't matter that the passphrase is here. But obviously, never show your seed phrase to anyone, especially on stage. Now we need to get word number eight here just to confirm.

It seems that everything is going well. Wi-Fi. Once the account is created, here we go. Here, it only asks us to connect. Here is a list of the permissions.

Since it's the CLI and we're going to implement contracts and things, it needs full permissions. We just confirm the concession and that's it. We are already logged in. So, let's go back to the CLI and implement that contract. So, first things first , let's set up a variable in our console here to make this a little more convenient for us.

Ready. And now, for the remaining steps, we no longer need to write that ETHDenver 2022 address. And here we just confirm, yes, that variable is definitely our name. Now, let's move on to the actual implementation. So, once we did that compilation step earlier, it created a web assembly file because, as I mentioned, the virtual machine in NEAR runs web assembly.

Then, we point to that wasm file and provide an account ID. And look at that, that was very fast even with the internet. Brilliant. That's already confirmed. We can see that transaction in the browser right here .

It will reach its conclusion here in a moment. And now this really gets to the part where we can start to see some interactivity here. So, let's go to ETH Denver 2022-5 down here in our quick information card. And look at that, we can see that I created the account and it knows there's a contract there, but it also knows that it's not initialized also knows that it's not initialized . So we'll do that next.

And I'll keep both on screen so you can see that the card will respond in real time here. And look at that, there it is . So, you see that it's initialized. We obtain some metadata about the contract, including the name, specification, and symbol. But oh, this is rare when it comes to coining in this area of ​​tokens.

We don't have this NFT function implemented, but you know what? It's not a big deal. Let's continue. We can ignore that for now. So now that we have it implemented, let's coin an NFT.

It's calling the function here. And look, it's already done. But, oh no. Oh, that's right. Oh, I needed a full supply in this token function to see my NFT down here.

And the one I just implemented doesn't have it. What am I going to do? Well, as I mentioned before, in Near you can update it on the spot in Near you can update it on the spot . Once again, the only asterisk here is that you cannot change the serialization of the data state. But luckily, in this case, we're only adding access features.

So, we won't have any problem with this. Then I switched to the enumeration branch. That's the next step in the tutorial, where you'll add these functions that will allow you to, you know, display the tokens per user and also get an enumerated list of the total number that have been minted. So let's create that new version. And now it's complete.

Now we'll simply run that implementation again. And look at that. And he lets me know. Yes, there is already a contract in place here. And he asks me if I want to continue.

In this case, as we have said, I know it is safe. I'm not going to change any status safe. I'm not going to change any status . So he's going to do it. And look at that.

And lo and behold, now I can see the minted number and also the one that had already been minted previously. So we were able to update that contract without anything going wrong. So I encourage you to go back and read the whole tutorial. As I said, he starts from scratch, as if he had never developed anything like this before. You start interacting with a pre-compiled contract and then it is built through the steps we just saw, from minting and deploying your NFT contract, to...

Let me explain. Even adding enumeration, approvals, royalties, and finally building it into a complete system of contracts for a market. Oh, and in fact, since I'm here, once we 've implemented it, let's say we've completed this tutorial, we can turn it into a full project. But there are other things, obviously, that the console can do. As I mentioned, it is a platform focused on operations outside of this tutorial project.

We have this contract screen here, which allows us to view aggregated data about our various contracts. In this case, we only have one, but if you had several, you would see a list of merged transactions below. You can quickly link to the browser. Well, you know, we're moving towards this vision where you would be the nerve center of your dapp, essentially. And then, of course, the analyses here.

Therefore, there is an RPC service attached to this that has an API key. And so, by using it, we can now give you information about your use of RPC. Including, yes, your response codes, total calls. Breakdown of calls by method, things of that nature. Very good, really, at the end of the book about your experience with NEAR, right?

Start with that tutorial and then monitor and operate your application. So, looking a little bit into the future, you saw a little bit of what was available today, but in the future, that included the RPC service, some of those basic usage analyses around RPC, the contract screen, and those interactive tutorials. But in the future, we're going to add things like an indexing service. So, if you've interacted with an NFT marketplace or something that has to deal with, filter, and sort a lot of on-chain data, you'd typically employ an indexer in between to make that manipulation a little easier . We're going to make it even easier by offering you a turnkey indexing service.

Regarding monitoring, we will add alerts and actions so you can activate certain functions in your contract if a certain condition is met . And then better visual analyses and implementations. And finally, to make all of this clear finally, to make all of this clear , especially the part about alerts and triggers, let's quickly review a scenario, or actually a series of scenarios, to give you a glimpse into the future of this. The first scenario is that a DeFi smart contract has been hacked. How could the developer console have prevented this ?

Using those alerts and actions I mentioned earlier, you can see here that we would set one up. In this case, we have our vault contract up here. We established some conditions. We want to know if the balance changes by 20% and if this transaction does not come from our allowed list. So, as owners of the dapp, we might want to withdraw funds from the treasury, so we mitigated that.

And what will actually happen is that we will receive a notification by email or text message, but the most important thing here is that we will call a pause function in this contract and mitigate the loss of our funds. So, when that happens, you'll see something like this in your inbox. So, we know that the balance was running out on this contract. It dropped by 20% when we established that threshold. We see the conditions and we also see the actions down there.

That will link to the browser so you can see exactly what happened. In this case, we simply saved 80% of your hacked DeFi dapp's treasury instead of losing it all. So, next, we'll talk more about the analytical side of things. As an NFT marketplace that wants to see its collections and artists perform better. How would we do it?

Well, you'll be able to create your own panel in the future. Currently it's like a pre-configured analysis, but combined with that indexing service, we're working on the ability for you to query any type of contract data, combine them, visualize them, etc. And so combine them, visualize them, etc. And so , in this case, we only have our top 10 artists by income and we're going to visualize them as a bar chart. So, a quick reminder before I say goodbye, what's here now?

Definitely go to console.pagoda.co and try all of this. We have that interactive tutorial you saw me go through, the RPC service with operational analysis, that well-integrated contracts screen, and of course, well-integrated contracts screen, and of course, all of that links very conveniently with the browser. And there are a lot of people from the development platform team here.

You know, I couldn't put everyone's name here, but there you have it. If you see any faces on this screen, come up to any of us and let's talk about everything that's happening at Near. And of course, we have a stand in the shill area, P5. And finally, I will post these slides online on my Twitter. And Near will probably retweet them.

Then you can click on all these links here. I have suggestions for our new CLI, links to all our tools, ways to participate, and some interesting applications like Astro Dao in the bottom right corner. Very well, thank you all. That was it. In fact, we still have some time, so if you'd like to answer some questions from the audience.

I would love to do it, yes. Anything? I would love to do it, yes. Anything? Anything you've presented about development in NEAR, the NEAR protocol in general?

I'll also be happy not to answer questions. Or perhaps there are some projects at NEAR that you are particularly excited about and would like to mention briefly. Yes, definitely. Well, the one in the bottom right corner of my appendix slide, Astro DAO, is basically the easiest way to start a DAO. So yes, there you have it.

Thank you. In the bottom right corner, Astro DAO, definitely check it out. It allows you to start a DAO simply using a graphical interface and set many different parameters. It's a very flexible and user-friendly system. On the DeFi side, Ref Finance, r e f dot finance, at NEAR is really great.

And the two NFT marketplaces that I would highlight are Paras.io, which is paras, and Mintbase are the two most prominent here. So , definitely check them out . Well, if there are no more questions, you can always meet Josh at the NEAR booth. And thank you, a warm round of applause for Josh Katzel.

Automatic transcript — names and jargon may be misspelled.