{"id":19291836,"url":"https://github.com/hirosystems/subnet-demo-app","last_synced_at":"2026-01-04T07:53:57.461Z","repository":{"id":164528559,"uuid":"639946585","full_name":"hirosystems/subnet-demo-app","owner":"hirosystems","description":"The project demonstrates some of the capabilities of subnets through a simple NFT marketplace where minting, listing and offers happen on L2.","archived":false,"fork":false,"pushed_at":"2024-07-22T11:42:59.000Z","size":3231,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":17,"default_branch":"main","last_synced_at":"2025-03-19T14:51:33.538Z","etag":null,"topics":["stacks","subnet"],"latest_commit_sha":null,"homepage":"https://subnet-demo-app.vercel.app","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/hirosystems.png","metadata":{"files":{"readme":"README.md","changelog":"history.txt","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-05-12T15:35:06.000Z","updated_at":"2024-07-22T11:43:02.000Z","dependencies_parsed_at":null,"dependency_job_id":"003bdd3a-3a05-4ce6-b824-37eb122030d8","html_url":"https://github.com/hirosystems/subnet-demo-app","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/hirosystems%2Fsubnet-demo-app","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hirosystems%2Fsubnet-demo-app/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hirosystems%2Fsubnet-demo-app/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hirosystems%2Fsubnet-demo-app/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hirosystems","download_url":"https://codeload.github.com/hirosystems/subnet-demo-app/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244767794,"owners_count":20507110,"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":["stacks","subnet"],"created_at":"2024-11-09T22:28:05.609Z","updated_at":"2026-01-04T07:53:57.436Z","avatar_url":"https://github.com/hirosystems.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Subnet Demo App\n\n[See the Youtube Presentation](https://www.youtube.com/watch?v=FHKf-9C0LoI)\n\n[Subnets](https://github.com/hirosystems/stacks-subnets#readme) are a layer-2 scaling solution in the Stacks blockchain. The Subnet demo app demonstrates subnets' capabilities through a simple hypothetical NFT marketplace where minting, listing, and offers happen on L2.\nThis demo application showcases how to mint NFTs, list, transfer, and withdraw them from the subnet back to the main chain. This demo application illustrates how wallets, exchanges, and developer teams can leverage subnets in their applications.\n\n## Prerequisite\n\nClarinet version 1.7. You can follow the steps [here](https://docs.hiro.so/clarinet/getting-started#install-clarinet) to download the latest version of Clarinet.\n\n## Features\n\n- NFTs exchanges can happen on a subnet (L2)\n  - Users can deposit their NFTs on the subnet\n  - Then, they can receive offers or list their NFTs\n- At any time, users can deposit or withdraw STX and NFTs on or from the subnet\n\n\n## Project structure\n\n- `./src` webapp\n- `./clarity-l1` NFT contract to be deployed on stacks L1\n- `./clarity-l2` NFT and marketplace contracts to be deployed on L2\n\n**Note:**\n\nClarinet's full support for subnets is in the roadmap. However, the `clarity-l2` contract can be deployed manually, then checked and tested with `clarinet`.\n\n\n## Start project locally\n\n### Run `clarinet integrate`\n\nIn the `./clarity-l1` folder, run the following command:\n\n```sh\nclarinet integrate\n```\n\nIf you find any errors, please refer to our [troubleshooting guide](https://docs.hiro.so/clarinet/troubleshooting).\n\nWait a few minutes, as the subnet node reaches Stacks block 9.\n\n![Stacks block 9](images/microblock_9.png)\n\nGo to `clarity-l2/scripts/`.\n\nFirst, install the script dependencies:\n\n```sh\nnpm ci\n```\n\nDeposit some STX on the subnet by using the following command:\n\n```sh\nnode ./fund.js\n```\nThe output of the above command is a `txid`. You can explore more about the transaction by following the links in the services section of the clarinet integrate. The instructions for the same are documented [here](https://docs.hiro.so/subnets/getting-started#interacting-with-the-subnet).\n\nWait a couple of minutes for the funds to transfer. Then, publish the l2 contracts.\n\n```sh\nnode ./publish.js subnet-demo-marketplace ../contracts/subnet-demo-marketplace.clar 0\nnode ./publish.js parfait-nft ../contracts/parfait-nft-l2.clar 1\n```\n\n\nRegister the nft contract on the subnet:\n\n```sh\nnode ./register.js\n```\n\n## Run the front app\n\nIn the repo root `./` run\n\n```sh\nnpm ci # install dependencies\nnpm run dev\n```\n\nThe `npm run dev` command outputs a local link.\n\n## Add the local subnet to your Hiro Wallet\n\nAdd a network to your Hiro wallet. Make sure the *network* and the *key* match. For example, \"subnet\". \nThe URL is `http://localhost:13999`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhirosystems%2Fsubnet-demo-app","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhirosystems%2Fsubnet-demo-app","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhirosystems%2Fsubnet-demo-app/lists"}