{"id":20060599,"url":"https://github.com/oasisprotocol/demo-starter","last_synced_at":"2025-05-05T15:33:13.224Z","repository":{"id":196951986,"uuid":"696199224","full_name":"oasisprotocol/demo-starter","owner":"oasisprotocol","description":null,"archived":false,"fork":false,"pushed_at":"2024-11-12T06:25:56.000Z","size":334,"stargazers_count":3,"open_issues_count":5,"forks_count":5,"subscribers_count":15,"default_branch":"master","last_synced_at":"2024-11-12T07:23:37.079Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/oasisprotocol.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":"2023-09-25T09:36:13.000Z","updated_at":"2024-07-04T12:58:41.000Z","dependencies_parsed_at":"2024-03-06T17:05:36.100Z","dependency_job_id":"88c154c1-db60-469e-9026-4fe44cefcf8c","html_url":"https://github.com/oasisprotocol/demo-starter","commit_stats":null,"previous_names":["oasisprotocol/demo-starter"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oasisprotocol%2Fdemo-starter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oasisprotocol%2Fdemo-starter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oasisprotocol%2Fdemo-starter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oasisprotocol%2Fdemo-starter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/oasisprotocol","download_url":"https://codeload.github.com/oasisprotocol/demo-starter/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224452754,"owners_count":17313668,"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-13T13:15:51.909Z","updated_at":"2025-05-05T15:33:13.211Z","avatar_url":"https://github.com/oasisprotocol.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Oasis Starter dApp\n\nThis is a skeleton for confidential Oasis dApps:\n\n- `backend` contains the example MessageBox Solidity contract and Hardhat utils\n  for deploying the contract and managing it via command line.\n- `frontend` contains a React-based web application which communicates with your\n  smart contract.\n\nThis monorepo is set up for `pnpm`. Install dependencies by running:\n\n```sh\npnpm install\n```\n\n## Backend\n\nMove to the `backend` folder and build smart contracts:\n\n```sh\npnpm build\n```\n\n### Localnet deployment and Testing\n\nSpin up the [Sapphire Localnet] image:\n\n```shell\ndocker run -it -p8544-8548:8544-8548 ghcr.io/oasisprotocol/sapphire-localnet\n```\n\nOnce Localnet is ready, deploy the contract using the first test account by\ninvoking:\n\n```shell\nexport PRIVATE_KEY=0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80\nnpx hardhat deploy localhost --network sapphire-localnet\n```\n\nSimilarly, you can run tests on Localnet:\n\n```shell\nnpx hardhat test --network sapphire-localnet\n```\n\n### Production deployment\n\nPrepare your hex-encoded private key for paying the deployment gas fee and store\nit as an environment variable:\n\n```shell\nexport PRIVATE_KEY=0x...\n```\n\nAlternative CMD command for Windows:\n\n```powershell\nset PRIVATE_KEY=0x...\n```\n\nTo deploy the contract on Testnet or Mainnet for your dApp that will be\naccessible on `yourdomain.com`:\n\n```shell\nnpx hardhat deploy yourdomain.com --network sapphire-testnet\nnpx hardhat deploy yourdomain.com --network sapphire\n```\n\n[Sapphire Localnet]: https://github.com/oasisprotocol/oasis-web3-gateway/pkgs/container/sapphire-localnet\n\n## Frontend\n\nOnce the contract is deployed, the MessageBox address will be reported. Store it\ninside the `frontend` folder's `.env.development` (for Localnet) or\n`.env.production` (for Testnet or Mainnet - uncomment the appropriate network),\nfor example:\n\n```\nVITE_MESSAGE_BOX_ADDR=0x5FbDB2315678afecb367f032d93F642f64180aa3\n```\n\n### Run locally\n\nRun the hot-reload version of the frontend configured in `.env.development` by\nrunning:\n\n```sh\npnpm dev\n```\n\nNavigate to http://localhost:5173 with your browser to view your dApp. Some\nbrowsers (e.g. Brave) may require https connection and a CA-signed certificate\nto access the wallet. In this case, read the section below on how to properly\ndeploy your dApp.\n\nNote: If you use the same MetaMask accounts in your browser and restart the\nsapphire-localnet docker image, don't forget to _clear your MetaMask activity_\neach time to fetch correct account nonce.\n\n### Production deployment\n\nBuild assets for deployment by running:\n\n```sh\npnpm build\n```\n\n`dist` folder will contain the generated HTML files that can be hosted.\n\n#### Different Website Base\n\nIf run dApp on a non-root base dir, add\n\n```\nBASE_DIR=/my/public/path\n```\n\nto `.env.production` and bundle the app with\n\n```\npnpm build-only --base=/my/public/path/\n```\n\nThen copy the `dist` folder to a place of your `/my/public/path` location.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foasisprotocol%2Fdemo-starter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Foasisprotocol%2Fdemo-starter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foasisprotocol%2Fdemo-starter/lists"}