{"id":20433103,"url":"https://github.com/anataliocs/archive-data-playground","last_synced_at":"2026-04-10T11:01:48.941Z","repository":{"id":82966472,"uuid":"498180467","full_name":"anataliocs/Archive-Data-Playground","owner":"anataliocs","description":"This application demonstrates various use cases for Infura Ethereum Archive Data Nodes!","archived":false,"fork":false,"pushed_at":"2022-06-03T00:42:48.000Z","size":1236,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-03-05T06:20:35.170Z","etag":null,"topics":["ethereum","infura","java","spring","typescript"],"latest_commit_sha":null,"homepage":"https://infura.io/register","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/anataliocs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-05-31T04:03:47.000Z","updated_at":"2022-06-14T08:41:59.000Z","dependencies_parsed_at":null,"dependency_job_id":"c8d4511f-b3a4-42a9-a866-30995b6ec0eb","html_url":"https://github.com/anataliocs/Archive-Data-Playground","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/anataliocs/Archive-Data-Playground","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anataliocs%2FArchive-Data-Playground","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anataliocs%2FArchive-Data-Playground/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anataliocs%2FArchive-Data-Playground/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anataliocs%2FArchive-Data-Playground/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/anataliocs","download_url":"https://codeload.github.com/anataliocs/Archive-Data-Playground/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anataliocs%2FArchive-Data-Playground/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31639524,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-10T07:40:12.752Z","status":"ssl_error","status_checked_at":"2026-04-10T07:40:11.664Z","response_time":98,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ethereum","infura","java","spring","typescript"],"created_at":"2024-11-15T08:17:43.230Z","updated_at":"2026-04-10T11:01:48.924Z","avatar_url":"https://github.com/anataliocs.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Archive Data Playground\n\nThis application demonstrates various use cases for Infura Ethereum Archive Data Nodes!\n\nSign up for Infura here: [https://infura.io/register](https://infura.io/register)\n\nUse cases:\n- Block Explorer\n- Museum of Famous Blocks\n\n## Project Structure\n\nNode is required. `package.json` is always generated.\n\n`/src/*` structure follows default Java structure.\n\n- `.yo-rc.json` - Yeoman configuration file\n  JHipster config is stored in `generator-jhipster` key\n- `.yo-resolve` (optional) - Yeoman conflict resolver\n- `.jhipster/*.json` - JHipster entity config files\n\n- `npmw` - wrapper to use locally installed npm\n  JHipster installs Node/npm locally using the build tool by default.\n- `/src/main/docker` - Docker configurations\n\n## Development\n\nDependencies:\n\n1. [Node.js][]: Used for dev web server and the build stage.\n\n```\nnpm install\n```\n\nWe use npm scripts and [Webpack][] as our build system.\n\nLive Reload:\n\n```\n./gradlew -x webapp\nnpm start\n```\n\n### JHipster Control Center\n\nJHipster Control Center can help you manage and control your application(s). You can start a local control center server (accessible on http://localhost:7419) with:\n\n```\ndocker-compose -f src/main/docker/jhipster-control-center.yml up\n```\n\n## Testing\n\nTo launch your application's tests, run:\n\n```\n./gradlew test integrationTest jacocoTestReport\n```\n\n### Client tests\n\nUnit tests are run by [Jest][]. They're located in [src/test/javascript/](src/test/javascript/) and can be run with:\n\n```\nnpm test\n```\n\n\n----\n\n\n## Tutorial\n\nThis is a full-stack application that provides a reference implementation and proof-of-concept for \nvarious use cases that are enabled by access to Ethereum archive data.\n\nCheck out the repo here:  https://github.com/anataliocs/Archive-Data-Playground\n\nTechnologies Used:\n\n- Java 11\n- Spring Boot\n- Gradle\n- Typescript\n- React/Redux\n- node/npm\n\n\n### Setup and Configuration\n\nThe project is built with a Java/Spring Boot backend and a React front-end.  \nYou will need to install the following dependencies locally to run this project:\n\n- [An Infura account](https://infura.io/register)\n- Git\n- Node / npm\n- Java 11\n- An IDE\n\n\n**Get your API endpoint URL and Project ID**\n\n\nHead to https://infura.io/ and go to your project settings page:\n\n![Infura Dashboard](https://raw.githubusercontent.com/anataliocs/Archive-Data-Playground/main/static/Infura-ui.jpeg)\n\n\nNow let’s set up our externalized configuration so that we can use our project ID without exposing those details on Github.  \nThe Spring Boot app uses Spring Dev Tools when running locally so we can use a `.spring-boot-devtools.properties` file for \nconfiguration properties.\n\n**Configuration for MacOS users:**\n\nCreate the properties file:\n\n`touch ~/.spring-boot-devtools.properties`\n\nOpen the properties file:\n\n`vi ~/.spring-boot-devtools.properties`\n\nAdd the following line to properties file:\n\n`infura.projectid=[YOUR_PROJECT_ID]`\n\n**Running the application:**\n\nPull down the source code:\n\n`git clone git@github.com:anataliocs/Archive-Data-Playground.git`\n\nImport the project into your IDE and it should build automatically.  \nOur project uses gradle to build the back-end and npm/webpack for the front-end UI.\n\nChange directory into the project folder:\n\n`cd archivedataplayground/`\n\nThen to run the full stack, invoke the Gradle wrapper:\n\n`./gradlew`\n\nThis command will start up the Spring Boot backend in dev mode and also the React front-end all in one command!\n\nAfter the application starts up you should see the following:\n\n```\n2022-05-31 11:21:45.262  INFO 83493 --- [  restartedMain] i.i.a.ArchiveDataPlaygroundApp           : Started ArchiveDataPlaygroundApp in 3.709 seconds (JVM running for 3.924)\n2022-05-31 11:21:45.264  INFO 83493 --- [  restartedMain] i.i.a.ArchiveDataPlaygroundApp           :\n----------------------------------------------------------\n        Application 'archivedataplayground' is running! Access URLs:\n        Local:          http://localhost:8080/\n        External:       http://192.168.0.37:8080/\n        Profile(s):     [dev, api-docs]\n----------------------------------------------------------\n\u003c============-\u003e 92% EXECUTING [2m 15s]\n```\n\nNavigate to the local server in a browser at http://localhost:8080/\n![App UI](https://raw.githubusercontent.com/anataliocs/Archive-Data-Playground/main/static/app-UI-1.png)\n\nOn the right-hand corner click account -\u003e Sign-in and use the canned login and password “admin/admin”\n![App UI](https://raw.githubusercontent.com/anataliocs/Archive-Data-Playground/main/static/app-ui-2.png)\n\nYou will then have access to the application.  The login flow comes from the base Jhipster project scaffolding tool that \nwas used to create the basic project skeleton.\n\nYou can directly query Infura JSON-RPC endpoints if you navigate to \nhttp://localhost:8080/admin/docs or click Administration -\u003e API\n\nThis will bring you to the Swagger UI interface where you can call JSON-RPC endpoints such as getting blocks older than \n128 blocks which are available via Archive nodes with hydrated transactions.  These calls can then be used in Block Explorer style \napplications or other use cases.\n\n![Swagger UI](https://raw.githubusercontent.com/anataliocs/Archive-Data-Playground/main/static/swagger-ui-1.png)\n\n\nSome specific blocks of code that help enable this functionality include:\n\nhttps://github.com/anataliocs/Archive-Data-Playground/blob/main/src/main/java/io/infura/archivedataplayground/config/InfuraConfig.java\n\n**InfuraConfig.java**\n```\n@Configuration\npublic class InfuraConfig {\n\n   @Bean\n   public RestTemplate restTemplate() {\n      return new RestTemplate();\n   }\n}\n```\n\nThis code provides a “RestTemplate” singleton which can be injected in classes where it’s needed and helps abstract away the complexity of making JSON-RPC calls to Infura.\n\nThe `dto.infura` package contains POJO objects representing request and response JSONs used in Infura RPC calls.\n\nhttps://github.com/anataliocs/Archive-Data-Playground/tree/main/src/main/java/io/infura/archivedataplayground/service/dto/infura\n\nFor instance, the following 3 DTO objects contain the block and hydrated transactions response from \nan `eth_getBlockByNumber` JSON-RPC call which can be used to get archive blocks from Ethereum’s history.\n\n**GetBlockByNumberResponse.java**\n```\npublic class GetBlockByNumberResponse {\n   private String jsonrpc;\n   private String id;\n   private GetBlockByNumberResult result;\n   \n   // Getters and setters\n}\n```\nInfura POJO response to de-serialize JSON\n\n**GetBlockByNumberResult.java**\n```\npublic class GetBlockByNumberResult {\n   private String difficulty;\n   private String extraData;\n   private String gasLimit;\n   private String gasUsed;\n   private String hash;\n   private String logsBloom;\n   private String miner;\n   private String mixHash;\n   private String nonce;\n   private String number;\n   private String parentHash;\n   private String receiptsRoot;\n   private String sha3Uncles;\n   private String size;\n   private String stateRoot;\n   private String timestamp;\n   private String totalDifficulty;\n   private Transaction[] transactions; //Hydrated Transactions\n   \n   // Getters and setters\n}\n```\n\nInfura POJO response to de-serialize JSON\n\n**Transaction.java**\n```\npublic class Transaction {\n\n   private String blockHash;\n   private String blockNumber;\n   private String from;\n   private String gas;\n   private String gasPrice;\n   private String hash;\n   private String input;\n   private String nonce;\n   private String r;\n   private String s;\n   private String to;\n   private String transactionIndex;\n   private String type;\n   private String v;\n   private String value;\n}\n```\n\nThe included “RestTemplate” will automatically marshal/unmarshal responses into these Object types.\n\nYou could also consider using https://github.com/web3j/web3j to help facilitate Infura JSON–RPC calls made using the Spring Boot \nbackend but this is a more heavyweight solution that contains a lot of stuff you might not need.\n\n#### The Front-end\n\nOne feature that archive data enables is Block Exploration.\n\n![Swagger UI](https://raw.githubusercontent.com/anataliocs/Archive-Data-Playground/main/static/app-ui-3.png)\n\nThis block explorer displays information about about famous blocks in Ethereum history such as:\n\nFrontier\n- Block height: 0\n- Genesis block\n- Jul 30 2015 \n\nFrontier Thawing\n- Block height: 200000\n- Ethereum price: $1.24 USD\n- Sep 07 2015\n\nHomestead\n- Block height: 1,150,000\n- Ethereum price: $12.50 USD\n- Mar 14 2016\n\nThe front-end is implemented using React and Typescript.  This form allows you to submit a block number and look up that block’s data \nand hydrated transactions.\n\n**infura.tsx**\n```\n…\n\n\u003cp className=\"lead\"\u003eExplore historical Ethereum Data\u003c/p\u003e\n\u003cForm onSubmit={handleBlockByNumberSubmit}\u003e\n\n   \u003cValidatedField\n   name=\"blockNumber\"\n   label=\"Block Number\"\n   placeholder=\"Block Number in hex\"\n   required\n   autoFocus\n   data-cy=\"blockNumber\"\n   validate={{required: 'Block Number cannot be empty!'}}\n   error={errors.blockNumber}\n   isTouched={touchedFields.blockNumber}\n   /\u003e\n\n   \u003cButton color=\"primary\" type=\"submit\" data-cy=\"submit\"\u003e\n     Search\n   \u003c/Button\u003e\u003cbr/\u003e\n\u003c/Form\u003e\n\n…\n```\nSubmitting the form dispatches a request to the Spring Boot API and uses a reducer to parse the JSON returned from the backend and stores\nthat state in Redux.\n\n**infura.reducer.tsx**\n\n```\n…\n\nexport const getInfura = createAsyncThunk('infura/get_json', async (blocknumber: string) =\u003e axios.get\u003cany\u003e(`api/infura/${blocknumber}`), {\nserializeError: serializeAxiosError,\n});\n\n…\n```\n\nThis is only a simple example of functionality that access to archive data enables.  Using this basic framework, you could create \nEthereum block analytics, more detailed Block Explorers, back testing for trading algorithms and Blockchain forensics applications!\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanataliocs%2Farchive-data-playground","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fanataliocs%2Farchive-data-playground","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanataliocs%2Farchive-data-playground/lists"}