Closed adamsoffer closed 5 years ago
I am very excited about this! I think we can add a ton of user value by exposing indexed data to our delegators. My one suggestion would be to try to keep the UI resillient in the case of failures from The Graph node, since the project is so early in its development, and is not yet a reliable decentralized network. I'd expect the node to occasionally crash, or be unresponsive, or be slow, and I'd hate for the UI to be completely unusable in those scenarios.
Happy to hear you're excited about this! Agreed, data availability is super important and would have to be paid close attention to. I'll make sure to configure a server for high availability along with a monitoring agent. I've had the node running over the last 24 hours and so far so good. In the likely event of one of those scenarios playing out as The Graph matures, to ensure the UI is never in an unusable state we can probably check network conditions and fall back to querying the blockchain directly if a connection is lost.
Following up with where things are at with the Graph Protocol + Livepeer Explorer integration:
apollo
package to include GraphQL schema generated by the subgraph using schema stitching.Two points about the blocker with unreliable infura ws endpoints...
1) I assume that this not a client-specific connection in the browser, but instead a connection from the graph indexing node to infura? If so, is there a configuration option to point it at a locally running geth (light) node for example?
2) I got a note from The Graph team that they were aware of the issue and has a fix coming out very shortly.
Ah there is indeed a configuration option to point it at a locally running geth node. I'll give that shot. Thanks.
@adamsoffer I am not able to access Livepeer Subgraph GraphQL endpoint. I wanted to run some tests on this.
Oops, looks like the instance ran out of space and crashed. I'll add more storage space and rerun.
@adamsoffer a concern with this you might be able to address for me is the memory utilization that causes it to crash.
I ask because I would not want to see this happening in production under similar loads.
@Randy1Burrell Yeah uptime is super important. It's been running for a few weeks. Must of crashed this morning. I've been using the smallest possible instance size on Google Cloud while testing.
TBH I haven't paid much attention to the devops side of things yet - just trying to get everything working first. I can ask the Graph team what type of server environment they recommend for running a Graph Node reliably. Also, if you have have some devops experience, I'd love some help.
I'm traveling right now, but I'll let you know when I get chance to get the endpoint back up and running. Would love some feedback.
Update: Confirmed it simply ran out of space. Only had 10gb of storage on this instance.
@adamsoffer Safe travels.
I would love to hear what the Graph team recommends for this. Availability and reliability will make or break any platform.
Let me know what you need in regards to devops and I will see what I can do. I would be happy to give you my feedback and full support in getting this ready for deployment.
@dob Update: pointing at a locally running ethereum node in fast mode does seem to fix that Websocket issue. However, in order to access smart contract state in subgraph mappings we would need to run an archive node which takes weeks to sync. If all the indexed data needed for the explorer was on events / transactions we could get away with a regular full node, but there is some transcoder contract state we need access to such as isActive
that is not available without calling a contract method (correct me if I'm wrong here).
Good news is the Graph has a pull request in for a fix and I see it's pending review, so like you said it shouldn't be much longer before it's out.
Yah, good news about the open PR, because running an archive node would be a non-starter. Even if you can get it synced, it "breaks", and then is useless, without proper operational overhead and redundancies
Update:
Below is a screen recording that shows how the explorer responds if the graph node goes down. Notice when the graph node is running the transcoder view loads near instantly since it's fetching data from an indexed PostgreSQL db. When the graph node is manually shut down the explorer is still accessible, falling back to fetching data directly from the blockchain as it currently does with a ~15 second delay.
Update:
The Graph team released a fix for the unreliable infura endpoints. I noticed there were still a couple issues causing the node to error out, but they were resolved over the weekend at ETHSF with the help of the Graph team. That, along with some updates made to the Livepeer subgraph, means we can now index all relevant events from genesis to the most recent block and accurately recreate the current state of the transcoder set which I'm pretty excited about.
A couple things left to do:
cc: @dob @ericxtang @Randy1Burrell
Excellent, count me in for the Goog hangout walkthrough. Agree that at this point it seems to be more about dev ops of adding this piece of infrastructure than maintaining the actual functionality, but the fact that we have graceful fallbacks to blockchain looks is great!
@adamsoffer sounds great.
What's the problem?
In addition to providing a friendly user interface for token holders to delegate, the explorer plays an important role in helping token holders make informed decisions on which transcoders to delegate towards by exposing relevant transcoder data. Currently, the explorer gets this data directly and exclusively off the blockchain resulting in a less than desirable user experience for a couple reasons:
Describe a possible solution you've considered
An indexer would provide the explorer with both faster lookups and valuable aggregate data. I’ve been experimenting with The Graph, a query protocol for getting data off blockchains and storage networks through a peer-to-peer network of indexing nodes using GraphQL.
How The Graph works:
At a high level The Graph data flow is as follows:
Creating a Livepeer Subgraph
In The Graph, a project's GraphQL endpoint is referred as a subgraph, because once deployed to the decentralized network, it becomes just one subset of a global GraphQL endpoint. The subgraph is defined as a YAML file called a subgraph manifest. It comprises a schema, source data and mappings which are used to deploy an endpoint.
I propose creating a Livepeer subgraph for the transcoder view to speed up the initial time to render and using it to add the following information to the transcoder card:
I started working on a Livepeer subgraph which you can check out here. It's currently deployed to a Google Cloud instance if you’d like to play around with the GraphiQL interface. Right now it simply indexes transcoder data (stored in a PostgreSQL database).
Additional context