{"id":20974334,"url":"https://github.com/thirdweb-example/hardhat-local-node","last_synced_at":"2025-05-14T12:31:46.413Z","repository":{"id":107808271,"uuid":"599538465","full_name":"thirdweb-example/hardhat-local-node","owner":"thirdweb-example","description":"Deploy your smart contracts to a local node and use the thirdweb SDK to interact with them","archived":true,"fork":false,"pushed_at":"2023-02-16T04:59:30.000Z","size":1098,"stargazers_count":2,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-13T08:45:11.886Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://hardhat-local-node.thirdweb-preview.com","language":"TypeScript","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/thirdweb-example.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":"2023-02-09T10:58:41.000Z","updated_at":"2024-04-26T18:06:27.000Z","dependencies_parsed_at":null,"dependency_job_id":"0d9ab816-9137-44dc-b42d-40cbd99393bb","html_url":"https://github.com/thirdweb-example/hardhat-local-node","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/thirdweb-example%2Fhardhat-local-node","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thirdweb-example%2Fhardhat-local-node/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thirdweb-example%2Fhardhat-local-node/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thirdweb-example%2Fhardhat-local-node/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/thirdweb-example","download_url":"https://codeload.github.com/thirdweb-example/hardhat-local-node/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254142354,"owners_count":22021509,"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-19T04:28:16.094Z","updated_at":"2025-05-14T12:31:46.407Z","avatar_url":"https://github.com/thirdweb-example.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Hardhat Local Node with thirdweb\r\n\r\nUse the [React SDK](https://portal.thirdweb.com/react) to interact with smart contracts deployed to a\r\n[local Hardhat node](https://hardhat.org/hardhat-runner/docs/guides/deploying).\r\n\r\nThe code is split into two directories:\r\n\r\n1. `contracts`: Contains the smart contracts and the scripts to deploy to a local node.\r\n2. `application`: Contains the React application that interacts with the smart contracts.\r\n\r\n## Setup\r\n\r\nClone this repository using the [CLI](https://portal.thirdweb.com/cli).\r\n\r\n```bash\r\nnpx thirdweb create --template hardhat-local-node\r\n```\r\n\r\nInstall the dependencies for the project, in both the `contracts` and `application` directories.\r\n\r\n```bash\r\ncd application\r\nnpm install\r\n\r\ncd ../contracts\r\nnpm install\r\n```\r\n\r\n### Running a local node\r\n\r\nUse the `hardhat` CLI to [run a local node](https://hardhat.org/hardhat-runner/docs/getting-started#connecting-a-wallet-or-dapp-to-hardhat-network).\r\n\r\n```bash\r\n# From within the /contracts directory\r\nnpx hardhat node\r\n```\r\n\r\n### Deploy the smart contracts\r\n\r\nUse the [CLI](https://portal.thirdweb.com/cli) to deploy the smart contracts to the local node via the [dashboard](https://portal.thirdweb.com/dashboard).\r\n\r\n```bash\r\n# From within the /contracts directory\r\nnpx thirdweb deploy\r\n```\r\n\r\nThis command compiles your contract and produces a link to the [dashboard](https://portal.thirdweb.com/dashboard) where you can deploy the contract to a local node.\r\n\r\nUse the `Request testnet funds` button to load your wallet with some funds to deploy the contract.\r\n\r\n![request-funds.png](./application/public/readme_assets/request-funds.png)\r\n\r\nEnsure to select the `Localhost (ETH)` network and click on the `Deploy` button!\r\n\r\n![deploy.png](./application/public/readme_assets/deploy.png)\r\n\r\nOnce deployed, copy your contract address from the dashboard:\r\n\r\n![copy-address.png](./application/public/readme_assets/copy-address.png)\r\n\r\nPaste it in the `application/pages/index.tsx` file, within the `useContract` hook.\r\n\r\n```jsx\r\nconst Home: NextPage = () =\u003e {\r\n  const { contract, isLoading, error } = useContract(\r\n    // Your contract address here!\r\n    \"0x...\"\r\n  );\r\n};\r\n\r\nexport default Home;\r\n```\r\n\r\n## Join our Discord!\r\n\r\nFor any questions, suggestions, join our discord at [https://discord.gg/thirdweb](https://discord.gg/thirdweb).\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthirdweb-example%2Fhardhat-local-node","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthirdweb-example%2Fhardhat-local-node","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthirdweb-example%2Fhardhat-local-node/lists"}