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

Loading player…

Pocket Network 🛠 Decentralizing RPC Access with Pocket Network

ETHGlobalSun, Oct 9, 2022, 12:00 AM

Join Joe Habel of Pocket Network for a workshop titled, "Decentralizing RPC Access with Pocket Network." This workshop is part of ETHNewYork 2022, a three-day in person hackathon that will feature hackers, mentors, enthusiasts, sponsors and speakers who are all gathering in New York June 24-26, 2022 to talk about the future of money, finance, the web, ownership, the way software works and the way power is distributed. We're excited about a new frontier. ---------------------------------------------------- Follow us: https://twitter.com/ETHGlobal​ Check us out: https://ethglobal.co​m Email us at: hello@ethglobal.com

Transcript

[Applause] [Music] what we're going to be doing is just kind of going over the basics of what pocket network is and how you will very likely want to use it in your application so um i think we can just get right into it so let's start off with uh the basic kind of what is pocket network so in short pocket network is a decentralized rpc provider and um yeah i think we're good that's kind of all we have to say now so what exactly does that mean um in the ethereum network there's there's kind of two ways to get your transaction out there you can run a client and then broadcast the transaction in the network through the client or you can send a request to a node that offers some form of rpc service and so when we ask like what a client is some examples of those are mining nodes in eth1 validator nodes in eth2 uh things that are called full nodes which is the the blockchain in the most what most 128 recent blocks archival nodes which is all the blocks in the history of ethereum and so what exactly does it take to run a node what this means is you need a machine that can be on 24 7. is that an old computer is that something like a raspberry pi is it a rack server is it in the cloud and on top of making sure it's on can you get to it securely can you figure out how to scale it if you need more than one there's a lot of work that goes into this process that's completely unrelated to smart contracted development and if you're not coming in as someone with a solid devops experience this is a really tough barrier to get over if you want to start using your application in production uh but wait isn't this what like clients are supposed to do for us and it would be great if they were here but unfortunately you can't really run a light client in a web browser today and so it's because that that client still needs to actually talk to the chain and there's a lot of complex behavior that just can't be done yet um and so in comes our pc service and this is what metamask uses and ledger smart contracts use this and so does trust wallet and guard a wallet and myetherwallet and basically every web-based df that you've ever used but what exactly is that and rpc itself stands for remote procedure call what that is is the messages go between the network through json nodes expose it over http https and so you can talk with it as you would any other standard web application and it provides the lowest technical barrier of entry for people building apps that work with the blockchain almost everything can go through json https so if you can write a traditional web 2 app that uses json http you can start building smart contract interfaces and who handles this uh is it the miners um which will be validators eventually um is this what gas pays for and the reality of that's no miners and validators can choose to serve rpc service but there's nothing that's obligating them to do so and so what this means is there's no on-chain incentive for nodes to actually serve our pc service to the network so while there's incentives to keep the um blockchain data valid there's no way to incentivize that the blockchain actually provides service in the way that every application uses it today some of the solutions for this private entities have really stepped up to fill this space some examples of these are infuria alchemy anchor and these are great products they make blockchain development super accessible but they're centralized and they all require monthly fiat payments to keep that d app open typically the only solution for contract developers who don't want to do this is to stand up their own servers until pocket network comes along pocket network is an independent blockchain that runs on the pocket token node runners earn that pocket for serving those rpc relays and apps can stake up pocket to get that rpc access it provides a utilitarian market for this infrastructure and it makes rpc permissionless and decentralized this all sounds neat and all but how does pocket actually help you as a developer and so a big thing is you have less risk from outages pocket nodes run in a variety of con configurations there's people who self-host physical machines that they actually own there's people who cloud host aws digitalocean all of those standard providers there's people who rent direct hardware through ovh ibm cloud bare metal basically if any of these big services goes down there's an entire other swarth of nodes out there ready to pick up that service another big advantage of pocket is it allows you to own your access what do we mean by that it means once an app is staked that rate is locked in and as long as that app remains staked there will be some guarantee of service this means for app developers that you don't have to worry about monthly billing you can't accidentally run up a giant cloud bill and you could actually recoup some of that initial infrastructure investment by unstaking and selling that when you're done in short with pocket network web 3 infrastructure becomes an investment and not a cost so let's actually get started getting free access here so the portal is an application that we built on top of the network um we have uh a link through today's event that gets anyone wanting to build on us a free service up to a million daily requests it gives developers the same kind of user experience that they have if they were using a previously centralized option it gives them that dedicated url that they expect it gives them the security configuration options to keep that contract endpoint safe as well as dashboards about actually watching and understanding what's going on and who's using your infrastructure and it keeps you alerted in case you are approaching your limit and again that free tier that we're offering gives you a million daily relays and so this is the this is where you go this is the the url will take you to here you sign up get registered and then creating an app is as simple as heading over to apps typing in the name launching the application and then urls are available and you're ready to roll there's the option of setting up security that allows it so that you can protect who actually can access that endpoint if you don't want to make it public and there's ways to set up the notifications that way you'll be sure that you're not going over your service limits so how do you use it we'll get started with just your basic solidity development environments so in hard hat if you're in your hard hat config js um it's as simple as using the pocket network urls from the portal in place of where you are so for example the mainnet is the mainnet url that you would get from the portal we have roxton and rinkby and gourley and coven and truffle looks very similar what you're doing is plopping the url in where you would previously plop something else in and you're good to start deploying in your build environments across test nets and mainnet with pocket network instead of any centralized option on top of this you can also use this in remix if truffle and hard hat are a little too in the weeds so if you go to the deploy and run tab of remix you have an option here of select web3 provider and then after you select that it's as simple as putting the url into that box and clicking ok and you're running in remix with us as well what about now if you're using it in javascript so in ethers ethers it's as simple as using the json rpc provider with that url and you're ready to roll web3.js very similar you can instantiate the web3 provider just with that pocket network url and you're ready to start getting service using us in python again it's going to start to look really similar just drop that url in and you're ready to roll on top of that you can use this in ways if you're not just a d app developer metamask gives people the option to use their own rpc and pocket network provides a variety of public rpcs for people to use so if you go to meta mask in your networks you can choose to add a network give it a name and then you're free to use the the pocket public rpc and now your meta mask is also decentralized so if inferior goes down you still have access to your to the service that you expect through metamask and you can repeat that for any of the chains we use right now we have uh just a subset of chains that we have public rpc for the full list is available on our docs for anyone interested on top of that what's so great is pocket can be used for cross chain and multi-chain uses so the same application that you register in the portal not only gets you access to the ethereum main net and test nets but as of now up to 50 other chains so for example let's say you wanted to use polygon and eth in the same application it's as simple as taking the urls throwing them into providers and you can get the youth block number and the polygon block number just as easily and the full list of supported chains we have available at the docs and for anyone interested this qr code here will take you to a link if you register and use us you're set up to start getting going with one million daily relays [Applause] any questions yeah yes so this whole focus has been about how pocket fits into your um from the perspective of an app developer but the network itself what it is is the app developers actually have the ability to get service from a network of independent providers and so those providers when they successfully provide service to an application who requests it are rewarded with that pocket token so they would all be pocket still yeah so how it works is that pocket itself is its own blockchain and that that blockchain is used to validate that nodes or servicing applications correctly and then the the native token of that blockchain pocket is what's used to distribute the rewards uh no not currently it's uh it's based off of tendermint based off of like the cosmos tendermint system the the underlying chain so when people run pocket blockchain nodes themselves what they do is they configure that pocket node 2.2 instances of nodes that are running on other chains those other chains nodes don't have to be validators they just have to be able to provide essentially the data and write service the read write from that layer so it would be like running a node but not validating on it yeah so the the pocket network sits on top of those rpc nodes to provide some incentive mechanism to do so yeah anything else yeah yeah go ahead um yeah so uh there's there's options to do so uh the underlying mechanism is that that native token is staked not necessarily paid so um there's features coming out to help us with uh bringing that out in ways that make the experience easier for those who don't have liquidity in the native token but um yeah the it's not actually spent is the is the core difference there well everyone holds that stake um and then the everyone who is servicing continues to earn rewards while the apps that are staked the apps that are staked don't earn anything that it's essentially locked is probably a better term so it's locked up in a way that they can't access it they can't build on it while those who have locked up tokens to service continue to earn rewards for doing so awesome thanks everyone [Applause]

Automatic transcript — names and jargon may be misspelled.