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

Loading player…

Pocket Network 🛠 Decentralize your Application Service with Pocket Network - Joe Habel

ETHGlobalMon, Oct 9, 2023, 12:00 AM

Join Joe Habel from Pocket Network for a workshop titled "Decentralize your Application Service with Pocket Network." Thank you to everyone who joined us for ETHBogotá 🇨🇴 and helped us kick off Devcon Week. With over 1400 attendees from 62 different countries, ETHBogotá was our biggest hackathon in Latin America ever! --------------------------------------------- Follow us: https://twitter.com/ETHGlobal​ Check us out: https://ethglobal.co​m Email us at: hello@ethglobal.com #ethereum #web3 #blockchain #eth

Transcript

foreign [Applause] [Music] let's go ahead and get started so let's start off with the basics what even is pocket Network so in short uh we're a decentralized RPC provider um let's go ahead and give a quick background of what that means and why that might exist so on the ethereum network there's two ways to send a transaction out to the network you can run an ethereum client yourself and broadcast that direction transaction directly or you can send a request to a node that has exposed its port to offer our PC service publicly um talk about what a client is because that might not be a word that kind of rings with you with when we're talking about ethereum so formally these would have been mining nodes in Ethan now we're here uh they're validator nodes there's what are called Full nodes which hold the most recent 128 blocks available there's what's called archival nodes which hold the historical state of all blocks in existence and what does it take to run these nodes what exactly does that mean um it means that you need essentially a server running 24 7. uh is that going to be an old computer is that going to be a Raspberry Pi is it going to be a rack server you're going to put that in the cloud are you going to be able to make sure that you can securely access that are you going to figure out how to scale that if your demand grows um there's a lot of work that is completely unrelated to someone building a smart contract on ethereum when it comes to actually standing up the infrastructure needed to get your applications out to users but wait what about like clients unfortunately while I'd love for them to exist they're not really here for web browsers yet um they still need to handle a bunch of complex behavior in communicating across the network and they offer a considerable amount of latency and bandwidth costs for historical lookups and they always will unfortunately and so in comes your RPC service this is what metamask uses whenever you use it to talk to an application it's what Ledger smart contract integration uses and Trust wallet and guard a wallet and my ether wallet and basically every web app that you've used but what exactly is that RPC stands for remote procedure call what happens is messages are communicated between the application and the node in Json nodes expose it via an https API as well as web sockets it provides the lowest technical barrier of entry for application Developers almost everything can communicate strictly through Json and http who handles this was the miners now validators it's a little outdated and sorry about that is this what gas is for no it's not validators can choose to serve RPC but they have no obligation to do so on the network there is no on-chain incentive for nodes to service applications with RPC even though it's the primary way that applications interact with the ethereum blockchain there's off-train solutions that we can use private entities have really stepped up to fill the need and some examples of these are inferior Alchemy anchor while these are accessible they're all centralized and require monthly Fiat payments to keep that application Live and running typically the only solution for smart contract developers who and this is really the only way that smart contractors or smart contract developers who don't have the know-how to manage infrastructure are able to interact with the blockchain until pocket Network um what are we we're an independent blockchain with a native token called pot and node Runners can come onto our Network and earn pox for servicing RPC relays apps can stake up that pot to get access to that RPC layer what this does is it provides a utilitarian market for blockchain infrastructure it makes RPC permissionless and decentralized it all sounds neat but how does that help you as a developer here one thing is you have less risks from outages uh pocket nodes running in a pretty variety of configurations we have people self-hosting their own Hardware running computers right out of their their worker home office if some people choose to host up on cloud providers AWS Azure digitalocean all the works there's services that offer rented Hardware directly that we have no runners run on talking here ovh IBM Cloud bare metal it's it's not really running in the cloud they're renting that Hardware directly this makes pocket resilient to outages at the cloud provider and data center level also gives you the availability for the first time to own your access once an app is staked on the network that relay rate is locked in as long as that app remains staked what this means is there will always be some guarantee of service as long as you keep those tokens locked up what that means for you as an app developer so you don't have to worry about that monthly bill coming in you can't accidentally run up a massive uh compute Bill charge without realizing it because your users decided to go Cog Wild on the interface you can recoup some of that initial infrastructure investment by unstaking and selling in short with pocket Network web for the infrastructure becomes an investment and not a recurring cost to end Developers so let's get started with what you can actually do at the gate we offer a free tier through our portal so that you can get started right away building today it's an application that we've built on top of pocket Network it's available directly at portal.pocket.network and it gives developers the user experience of the centralized options that they're used to building with today gives them a dedicated RPC URL gives them security configurations for how they protect that URL give some dashboards about any full meaningful metrics about where that service is flowing through gives you a large when you're approaching your bandwidth limits and the free tier is currently offering it's a quarter million relays a day um and just simple as going up getting started registering creating an app you have all that data available to you on that application page your availability to set up security set up your notifications and you're ready to get rolling once you have that URL so let's actually see how when you get that URL how you use it we'll start with solidity development environments if you're building a smart contract we'll get hard hat as a popular example it's as simple as in your hardcat config.js JS file specifying in your Networks mainnet here example is our ethernet endpoint and specifying robsten just drop in that Ralston URL that you get from the portal same with rank B and Gourley and coven all right there that when you run anything in hard hat you can just dash dash Network specify the name you're running in that live environment so you're building in truffle very similar in your module.

exports in your Networks basically the same thing except you have to specify that the port it's going through is 443 because it's it's SSL protected and you have to specify the network ID of the chain but that's normally uh something that you have to do with truffle anyway but just as easily take that format drop in the URL you have robsten in your environment your rank B you have gorley you have coven and again just as simple as dash dash Network and your network of choice and you're running live with us you can deploy you can test you can run queries everything that you would do from the console right to the live Network remix say you've never really built with us before you want to just drop it in and start using us in a more IDE environment all you have to do is navigate to that deploy and Run tab select web pre web 3 Provider from the drop down and then put your endpoint in right there and you're good to start deploying with us and testing with us in remix live as well so now let's say you're using pocket but in a JavaScript front end in ethers it's as simple as specifying your URL and initializing it in their Json RPC Constructor and you're good to start making queries directly to the chain remote web3.js just as easy take that URL just start using it right on the chain what about in Python if you're building something that lives in the back end take that URL and drop it into web3 Pi's Constructor and you're good to start querying that chain what about if you're not a d app developer but you're still interested in the space you can use us in your meta mask all you have to do is Select add a network from the drop down enter in the public RPC information that we offer a variety of and then you can repeat that for any of the chains that you interact with metamask with including we have Avalanche Public rpcs gnosis public rpcs fuse polygon a whole variety of public rpcs that you as a user not even as a developer can take access of these are available on our docs under our resources we have a public RPC endpoints for you um additionally let's say you're a developer who's not just building on ethereum I'm sure there's a lot of you here today here's an example of how you can quickly leverage us to not just build on ethereum but throw in optimism and polygon as well it's as simple as taking those endpoints and dropping them in where you need to that could again be in the solidity development environments that could again be in any of your libraries as long as they work in a Json RPC provider or in any of those environments you're good to get rolling on those networks too currently right now we have a full list of it's honestly now pushing close to 40 blockchains uh some of the big ones that come to mind that we recently integrated starknet optimism Avalanche we have a whole variety and it keeps growing and so what we're going to encourage you today is that if you are building anything with us or if you're building anything this weekend and you need to deploy a smart contract you need to build an interface to it we're offering a 2500 prize pool split between any developer who deploys something and utilizes us and we encourage you to this link will take you to essentially what we ran down today and even more about how to integrate yourself in various um uncovered programming libraries in case you're not a JavaScript or python Dev as well as some other um smart contract development environments like Brownie and um Brownie and ape works so I'm excited to see what you all build open it up anyone just questions on the RPC URL like what's to stop if there's like a DNS like outage on that it's like a global DNS outage we're talking yeah I mean that's a good question but then we're now talking the whole internet's down but I'm talking about let's say the ddns for that that URL that uh were provided through I guess through the app like is that like are we hosting that or like in the portal it provides the URL right yeah so that what the portal is is I can go back there um so the portal is an application that's built on top of pocket directly what that means is the portal under the hood is leveraging pocket Network to um to kind of give that ux development layer to Developers okay yeah yeah the the portal is not pocket Network it is built on top of pocket Network okay but for for a lot of smart contract developers the or people building interfaces to Smart contracts uh to actually kind of rotate through um every hour the list of providers that you can receive service to changes so every hour each application gets a list of 24 providers that they can receive service from and so for someone who's used to taking a URL and putting it into their D app it's a lot harder than maintaining that that rolling infrastructure but under the hood it's not fundamentally tied to that um okay to that layer yep okay awesome thanks everyone looking forward to see where you guys build again [Applause]

Automatic transcript — names and jargon may be misspelled.