{"id":20093937,"url":"https://github.com/api3dao/beacon-reader-example","last_synced_at":"2025-05-06T04:32:24.644Z","repository":{"id":44549207,"uuid":"438289733","full_name":"api3dao/beacon-reader-example","owner":"api3dao","description":null,"archived":true,"fork":false,"pushed_at":"2023-03-07T07:37:45.000Z","size":1386,"stargazers_count":0,"open_issues_count":3,"forks_count":1,"subscribers_count":7,"default_branch":"main","last_synced_at":"2025-03-02T16:16:07.475Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/api3dao.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2021-12-14T14:45:48.000Z","updated_at":"2023-08-08T14:10:16.000Z","dependencies_parsed_at":"2024-11-13T16:49:00.282Z","dependency_job_id":"02c02921-a598-43e4-abe4-4fb645d4028d","html_url":"https://github.com/api3dao/beacon-reader-example","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/api3dao%2Fbeacon-reader-example","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/api3dao%2Fbeacon-reader-example/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/api3dao%2Fbeacon-reader-example/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/api3dao%2Fbeacon-reader-example/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/api3dao","download_url":"https://codeload.github.com/api3dao/beacon-reader-example/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252622459,"owners_count":21777993,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":[],"created_at":"2024-11-13T16:48:53.498Z","updated_at":"2025-05-06T04:32:24.368Z","avatar_url":"https://github.com/api3dao.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Beacon Reader Example\n\n\u003e An example project for reading beacon values from a smart contract\n\n1. Tests that use a `MockRrpBeaconServer` contract to simulate reading a\n   beacon.\n2. A script to deploy the `BeaconReaderExample` contract to one of the supported\n   networks. This script will use the address of the `RrpBeaconServer` contract\n   deployed on the selected network. You can see the `deployments/` directory for\n   the address of the deployed contract.\n3. A script to whitelist `BeaconReaderExample` for it to be able to read a specific beacon.\n4. A script to have `BeaconReaderExample` read the beacon.\n\n## Instructions\n\n_You are recommended to follow our [docs](https://docs.api3.org/beacon/v0.1/introduction/hackathon.html) instead._\n\nInstall the dependencies:\n\n```sh\nnpm install\n```\n\n### Tests\n\nRun the unit tests defined in the `test/` directory:\n\n```sh\nnpm run test\n```\n\n### Network: `localhost`\n\nStart a local Ethereum node on a separate terminal:\n\n```sh\nnpm run eth-node\n```\n\nDeploy `MockRrpBeaconServer`, `BeaconReaderExample`, and mock-set a beacon value:\n\n```sh\nnpm run deploy:localhost\n```\n\nYou can skip the whitelisting step on `localhost`. \n\nHave `BeaconReaderExample` read the mocked beacon value and print it on the terminal:\n\n```sh\nnpm run read-beacon:localhost\n```\n\n### Networks: `ropsten`, `rinkeby`, `goerli`, `polygon-mumbai`\n\nCreate a `credentials.json` file at the root of the repo, similar to `credentials.example.json`.\nFill in the blockchain provider URL (e.g., `https://rpc-mumbai.matic.today` for `polygon-mumbai`).\nFill in the mnemonic with one that belongs to a wallet that you have funded using a faucet.\n\nDeploy `BeaconReaderExample` that is pointed to the pre-deployed `RrpBeaconServer`:\n\n```sh\nnpm run deploy:polygon-mumbai\n```\n\nWhitelist the `BeaconReaderExample` you have deployed for the `ETH/USD` beacon powered by Amberdata:\n\n```sh\nnpm run whitelist-reader:polygon-mumbai\n```\n\nHave `BeaconReaderExample` read the beacon value and print it on the terminal:\n\n```sh\nnpm run read-beacon:polygon-mumbai\n```\n\nYou can replace `polygon-mumbai` with `ropsten`, `rinkeby` or `goerli` to work on one of these networks.\n\nYou can read beacons other than `ETH/USD` by modifying `scripts/whitelist-reader.js` and `scripts/read-beacon.js`.\nRefer to the [docs](https://docs.api3.org/beacon/v0.1/reference/beacon-ids.html) for a complete list.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fapi3dao%2Fbeacon-reader-example","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fapi3dao%2Fbeacon-reader-example","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fapi3dao%2Fbeacon-reader-example/lists"}