Bringing GraphQL to Pantheon: Ethereal Hackathon Recap
DISCLAIMER: As of September 2019, Pantheon has been renamed to Hyperledger Besu. In posts prior to September 2019, we refer to the Ethereum client as Pantheon.
This was quite the challenge! To implement the interface according to its EIP specification, the teams had to implement GraphQL bindings within Pantheon from scratch and then provide a well-tested implementation for each of the 24 API calls listed in the specification.
Two teams took on the challenge and both provided functioning implementations. Their combined submissions totaled more than 15,000 lines of code! While both attempts were laudable, the simpler architecture and conciseness of the implementation led by @zyfrank made it the best fit for Pantheon and hence the winning implementation. His accomplishment was acknowledged onstage at this year’s Ethereal Summit.
But, why does Pantheon need a GraphQL interface in the first place? In short, to make a whole set of common queries run against Pantheon easier to execute. For example, GraphQL can reduce the overhead of querying for all the receipts in a block from one query per receipt to a single query for the entire block, or from O(n2) to O(n) in computer science terms.
This post was authored by Tim Beiko, Product Manager at PegaSys.