Rivet: The (Open Source, Private) Next-Gen RPC Service for Developers by Austin Roberts of Rivet
ETHGlobal·Fri, Oct 9, 2020, 12:00 AM
Austin Roberts, CEO and lead developer of Rivet gives a talk at ETHBoston about Rivet, a Web3 RPC endpoint. ETHBoston was an ethereum focused hackathon that took place Sep. 6-8, 2019 at Northwest Building, Harvard Campus. ETHBoston was a hackathon organized by ETHGlobal and a team of hackers, developers and enthusiasts interested in building and creating in the ethereum ecosystem. The ethereum focused hackathon took place for 3 days at Northwest Building, Harvard Campus in Cambridge, MA. For more information visit eth.boston and ethglobal.co
Transcript
welcome to the thief busted first workshop on a Saturday morning my name is Austin Roberts I'm here to talk to you about rivet so is Ribit Ribit is a win three or PC in point we have a strong open-source ethos our service that were rivet cons our service it's based on an open-source project that we've had going for quite a while called the ether panel initiative which will talk about both in a minute but rivet has a strong privacy policy will not sell nor data we will not sell your users data we sell with RPC services and we don't even track the information we get from our users of stuff obvious of the transactions that they tell us to send off to the network and rivet is designed for operational maintainability and horizontal scalability which lets us hit a fairly low price point so we're gonna walk through the signup process real quick if you got a rivet duck cloud slash sign up and enter the promo code Boston will looking for promo code recommend so okay so again we're talking over the rivet club slash sign up we have two plans we have the building plan which is a free plan don't all we need is your organization name and an email address then we have our scale planner where you'll have to put in a credit card the build plan gives you five hundred thousand free RPC requests a month the scale plan also gives you that five hundred thousand three every month but then you have essentially unlimited RPC requests at one dollar per hundred thousand requests so for now we're going to go through the process of setting up a build planet so we're just going to call this demo [Music] so that's going to send me a confirmation email which a minute I'm gonna have to jump over here my confirmation and while he's doing that one of the key important points here is that the Andorran rate plans right now do rate limiting for some of the lower level accounts and we don't join you that so again you put in the promo code Boston and you will get free RP see requests all weekend and now we're logged in at the dashboard and we have an API key that is working on the rythem network so we can copy the input URL just by clicking this button it's now in our clipboard and you can drop that into your application or real quick we're going to go through the process of setting up meta mask to use rivet instead of this defaults so we're just going to call this main net rivet drop in the URL chain ID is one simple is easy and now we're using rivet instead of the defaults and if we go to adapt like fling as a DAP that open really wrote a while back you can see here populates quickly with my teeth balance if I go down to begin you can see my big imbalance can set an allowance so you know now we're going to rivet instead of mathematics default so back over to back over the presentation again from Luca Boston gets you free RPC request for the weekend so how many how does this work behind the scenes with traditionally theory of nodes you have you have a peer-to-peer network with a bunch of people running the etherium clients on their network or on their local system and it's a peer-to-peer network so all the peers share information each other but all of that information has to be verified it's not like Facebook where you go contact a server and they send you information you trust it because it's their server all of these peers are sending you information that you have no reason how the game to assume is correct so you have to verify that information through some computationally intensive processes that can eat up a lot of cpu for a server that's running one of those knows so when you want to run apps you connect your daps whether they're mobile apps or something running on a server or something running on a desktop those connects to your note using the RPC protocol each note has fairly loaded capacity you know on a typical computer with say two cores and eight gigs around you can figure on getting somewhere between 150 and 250 requests per second off of a single server and that single server is also a single point of failure so if that server goes down none of those gaps can connect to the blockchain so real quick what our RPC query is RPC queries allowed apps to get e 30 imbalances read contract code get token balances find out what color your crypto Kitty's eyes are transfer tokens monitor asset transfers decks trades basically any information that is there on the blockchain if you want it you're gonna run our PC queries to get it so you know we talked about some of the challenges of that you know you just have that one server with limited capacity and it's a single point of failure so if you want to solve those two problems you can load balanced across multiple order PC nodes but this still has some problems so each node must verify data from its peers so you know hit here now we're running two nodes in each of those nodes is spending a decent CPU verifying information that comes from all these other peers you can possibly get inconsistencies because you know this node might get a block of full second or two before this dough gets that same block and so if you're sitting here running queries against those two nodes you might ask this node you know a question and it might resolve block number in and then a second later you ask this node a question and it resolves that block in minus one so you're getting inconsistent information just by looking down lensing across a pool of nodes the other problem is that if you have a sudden surge in capacity new instances can take hours to sink even if you have a snapshot it's like you take it in the last 24 hours it can take a few hours to find enough peers and grab information off the blockchain and write it out to the local disk so you know this is not a great way to scale up and if you're an infrastructure project so rivet solution and then this is part of our open source EtherCAT initiative is we introduces in introduced replication so the basic idea is that you have one master node that connects two peers and verifies data from the peer so we can actually support more than one master you need one for this to work that you can have more than one for the redundancy so that if you can again you don't have that single point of failure at your master and then the data is streamed through a system called Kafka two servers that we call replicas now the replicas they're not verifying the information they trust the master because they're operated by the same people and you know they just pull down the write operations that were sent to them from the master that gets right right into their local disk and then they're able serve the RPC requests off of their local desk the benefits of this are that replicas don't have to do the verification program so they can dedicate 100% of their resources - or 98% because they got a full stomach off camera right - disk but they they can dedicate the vast majority of their resources to serving RPC request so where we could get a hundred and fifty requests per second before we started seeing an increase in response time on a conventional node we can get about 850 requests per second on a replica node with the same hardware it also means that we have minimal inconsistency across schools and replicas in US and a pool since they're pulling from the same kafka server that kafka server is going to notify them as soon as informations ready they write it out to their local disk the inconsistencies between two servers might be about 20 milliseconds as opposed to you know upwards of two seconds that we would see with two individual servers pulling block information and and the other great benefit of this is that replicas start in minutes so it rivet we take snapshots every 24 hours and then that means that we're pulling up to 24 hours worth of snapshot data from Kafka all we have to do is pull that data and write it to disk it's a sequential disk read from Kafka it's a fairly simple write to a replica servers so we can be up and running with within about five minutes if we need to add capacity you can add 850 requests per second in about five minutes and you we can have more than one replicas in that five minute period so we can give it scale up as quickly as we need to just about as far as test nets we support Gourley and Roxton and Rigby unfortunately we don't support Kovan covin is only supported by the parity client and rivet is based on GAF our streaming replication system works with a light touch fork together we keep it up to two up to date with that the mainstream branch but we can made similar changes to parity too which would be required to support code man we don't have any immediate plans to do so but if we get a whole lot of feedback that the co event support is actually absolutely critical that could be in our future we have just in the last 24 hours gotten WebSocket support up and running you won't find that on the dash board yet and you're not confident enough in our solution say it's a production-ready future but for hackers that youth denver if you want to give it a whirl you can plug in eath WS dot rivet cloud as your endpoint and put your api key after that and you can connect to WebSockets and give it give it a whirl so the benefits of WebSockets are that you can get immediate notification of new blocks notifications of things like token transfers or really any other on chain events you can be notified of that instead of having to pull periodically to see if something new has happened so here we are at youth Boston sponsors we are sponsoring a prize for the best project built with rivet really just about any hackathon project out there could use ribbon as it's our PC provider and be eligible for this prize we are offering a hundred million RPC requests for as long as it takes you to use those we are going to consider prizes take into consideration our values when evaluating the projects so you know we're looking for something that it hits the values of open source and also you know we're very privacy centric so something is is privacy century you know it is gonna give bonus points so again sign up with rivet cloud slash line up the promo code boston youtube free RPC request for all weekend and we have deaf resources page here where we have documentation on how to use browser plugins depending on what language you're using we've got documentation for different libraries on different in different languages we have one thing that no real quick here is this documentation includes to our API keys so you can copy and paste these snippets and it will just look for you then we've also got some documentation of the various test nets we talked about proof report versus proof of authority we give a link to a faucet so you can get started with some test net you throw on each of these test nuts as well as some other parameters of these test nets and nettle recommendations so yeah these developer resources are out there for anybody that packing today trying to figure out how they use this stuff so any questions yeah so you say privacy like to see I wonder is there a way you guys are trying to investigate that client side I have obscured from what you guys are seeing like calls for you could not buy her ticket so so you know that there's been a fair bit of conversation at Boston about don't be evil versus can't be evil right now you know that this is a service that people need so we're taking the don't be people for a we're exploring the number of options for the can't be evil approach so right now we're not recording any you know we are reporting how many requests we got from a given API key but that's it we're not keeping track of IP addresses we're not keeping track of what the request was for FME right now you kind of gotta take our word for that we've gotten our privacy policy you could solicit if it wasn't true I know these are parts of the conventional ecosystem again we are exploring options for how we could make those things technically impossible for us to do this opposed to us just asking you to trust us that we're not but if you know we didn't want to wait until we can answer that question about the service oh yeah and to be clear no one else in the space right now pregnancy you know according to their policies it's not important of them right you know and so that's that's really what's critical for us is that you know we're taking that stand right because you know right right so yeah we started this out rivet is a product of ovary and so we run an open-source t-rex order book and you know that goes back to over two years ago that we started working on that over burger and one of the big challenges that we found and running this whole system you know we built up of a micro services architecture any piece was disposable we you know it was all redundant we if a server is misbehaving we just kill that server if they auto steal it replaces it everything comes back up and it's happy except for our node infrastructure and so we wanted to get there with their node infrastructure - and by the time we implemented all the stuff I just talked about you know in order to have that you gotta have a cough good cluster which is redundant you gotta have you know multiple masters you gotta have multiple replicas and by the time you're there you could handle you know 80 million hundred million requests a day and we're using you know a few hundred thousand requests a day so we've got all this extra capacity so yes absolutely we have an open source project if you want to run it on AWS we have CloudFormation template you can deploy it with a few clicks but the cost of that is several hundred bucks a month and then you have capacity it's way more than you need so that led us to think as extra capacity we might as well set up a business around that and you know there's the competition right now is you know alchemy that you can't just go sign up for you've got to talk to somebody talk to them about your use case and that you know then there's in furor which when we started working on this was free but we knew they weren't going to be free forever and we also knew from some of the other projects that we worked with that even when they were free and worked free for everybody and when they became not free for you you you didn't know when you were going to hit that limit or how hard it was going to hit you and of course they are that they've announced a pricing plan the first three months are free but you know next month they're they're charging starts and our one dollar per hundred thousand requests price point is going to be better for about eighty percent of users if you're in the top of a tier and you can make sure that you don't go over and need to go to the next tier their price point will probably be better for you but if you're anywhere near the bottom 75 to 80 percent of the tier our price points gonna come up yes yeah we again being able to take crypto for this as a high priority yeah but we didn't want to wait to put this out there until until we had that I've been really excited to see yeah and then that is an idea we've kind of been exploring you know I think initially we will probably take you know larger chunk payments and but but yeah you know one of the challenges is that the RPC request protocol doesn't include any mechanism for thinking of doing a micro transaction with that RPC request but you know we're also exploring some other potential protocols where you know maybe there's no web 3 provider that you could drop into your JavaScript application that could do that but it's not just using the straight you get an RPC protocol yeah any other questions yes Sobek another private privacy thing kind of reminds me of some email provider stories so you do have any sort of strategy in mind for how you're going to protect yourself if a government comes after you for instance where they would be far more comfortable with you working in a conventional manner where you you know you take more of that data so they can turn around and tell you to hand it over do you have a plan Greg do you must speak to that yeah Greg's our legal mind okay I used to practice law and one of my will old hats so and business litigation at that I can promise that we will and we will die on our sort of we have to I'd rather show them business down then have somebody to take advantage of have anybody be taken advantage of by a nation-state and one idea that we have tossed around but not yet implemented is putting out some kind of you know like Deadman switch canary where you know you know well and this is something I've always thought would be a great use of is watching or we could go out and you can make another VC call once of it you know maybe make a transaction once a week to say in a week we haven't been served with any warrant sir you give us something along those lines if you just don't see that and then you know maybe we can't tell you about it but but it's there down the line when we can engage in some similar Phil profit exercises that we will be financing things like right to privacy campaigning is I mean I think that so one thing I really want to see in this space I know a lot of it will be hungry for has effectively private completely discrete block explore like for instance if I'm a whale and I want to check my balances and not let anybody know that I have any access to these accounts or care about them at all right that'd be something I'd really like to see what like like a tour based walk Explorer yes so I think hosting is a secret service but then also obscuring from the secret service itself those calls and I'm making so you don't even know who I am or what I'm looking for so so what what idea that works boring for a number of reasons you know okay I mentioned that we've got this Cocteau stream if you can't work where our master writes if our replicas read it write it out to their local system one thing we've been exploring is exposing that to customers so you could just walk around one little replica repin it to be a small light server pull down from our Kafka stream write it out to your local system we have no idea what you get it I mean you're targeting everything we have no idea what you know music right you know of course just to you know do a quick balance check that's pretty extreme overkill but you know if you're running an application and maybe not in the position to post the full infrastructure yourself who you don't want to get that connect level of privacy by taking our Kafka streams that you can get that level of redundancy that you need but you know all we know is you're taking the same information as everybody else is taking their conference rooms pretty heavy data load for you guys so it might be a reasonable monetary incentive yeah
Automatic transcript — names and jargon may be misspelled.