{"id":24054670,"url":"https://github.com/cardinal-cryptography/bulletin-board-example","last_synced_at":"2025-04-22T20:45:56.908Z","repository":{"id":63570913,"uuid":"558882925","full_name":"Cardinal-Cryptography/bulletin-board-example","owner":"Cardinal-Cryptography","description":"Repository with example smart contracts and corresponding frontend","archived":false,"fork":false,"pushed_at":"2023-06-27T12:23:04.000Z","size":525,"stargazers_count":12,"open_issues_count":1,"forks_count":4,"subscribers_count":6,"default_branch":"main","last_synced_at":"2025-03-29T18:41:36.895Z","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":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Cardinal-Cryptography.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}},"created_at":"2022-10-28T14:11:26.000Z","updated_at":"2024-09-03T21:47:41.000Z","dependencies_parsed_at":"2023-02-13T21:31:06.581Z","dependency_job_id":null,"html_url":"https://github.com/Cardinal-Cryptography/bulletin-board-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/Cardinal-Cryptography%2Fbulletin-board-example","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Cardinal-Cryptography%2Fbulletin-board-example/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Cardinal-Cryptography%2Fbulletin-board-example/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Cardinal-Cryptography%2Fbulletin-board-example/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Cardinal-Cryptography","download_url":"https://codeload.github.com/Cardinal-Cryptography/bulletin-board-example/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250322044,"owners_count":21411694,"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":"2025-01-09T03:49:19.784Z","updated_at":"2025-04-22T20:45:56.870Z","avatar_url":"https://github.com/Cardinal-Cryptography.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"This repository will serve dApp developers, interested in developing for Aleph Zero network, to boostrap their work. It will include:\n* an example set of smart contracts, showcasing all basic building blocks required to build a dApp\n* accompanying frontend, together with Aleph Zero branding, for interacting with the contracts\n* integration with the PolkadotJS signer extension\n\n\n## How to run locally\n\n### Prerequisities\n\n1. Rust in version 1.69.0 with the `nightly-2023-02-07` toolchain.\n2. `substrate-contracts-node` version [`v0.26.0`](https://github.com/paritytech/substrate-contracts-node/releases/tag/v0.26.0).\n3. `cargo-contract` version [`3.0.1`](https://github.com/paritytech/cargo-contract/releases/tag/v3.0.1).\n\n**To install Rust**, run:\n\n```bash\ncurl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh\n```\n\nThis will install `rustup`, the Rust version and toolchain management tool. Next, use it to install Rust and the appropriate toolchain:\n\n```bash\nrustup install 1.69.0\nrustup install nightly-2023-02-07-x86_64-unknown-linux-gnu\n```\n\n**To install the `substrate-contracts-node`**, simply download it from [the release page](https://github.com/paritytech/substrate-contracts-node/releases/tag/v0.26.0), unpack the archive and put the binary on your path (remember to reload the shell for this to take effect).\n\n**To install cargo contract**, run:\n```bash\ncargo install --force --locked cargo-contract --version 3.0.1\n```\n\nYou can verify your versions using:\n```bash\nrustup show\nsubstrate-contracts-node --version\ncargo contract --version\n```\n\n### Running chain\n\nIn the root directory of the project, run `make chain-start`. To stop the chain, just exit the process in your terminal.\n\nTo clean the chain's run `make chain-clean`. This will remove chain's database files (like blocks and contracts).\n\nTo restart the chain (and purge the state) run `make chain-restart`.\n\nBy default, node will bind its websocket endpoint to port **9944**. Make sure that the chain is running WS on port 9944. In the logs, look for:\n```sh\n2023-01-10 19:23:40.475  INFO main sc_rpc_server: Running JSON-RPC HTTP server: addr=127.0.0.1:9933, allowed origins=None\n2023-01-10 19:23:40.475  INFO main sc_rpc_server: Running JSON-RPC WS server: addr=127.0.0.1:9944, allowed origins=None\n```\nIf it bound to a different port your frontend instance will not connect properly - it tries to connect to the 9944 port. In that case, either make sure there are no other `substrate-contracts-node` running (by killing them with `make chain-stop`) or change the port in the frontend app.\n\n### Building contracts\n\nIn the `/contracts` directory run `make build-all` to build both contracts.\n\n### Deploying contracts\n\nIn the root directory, run `make setup`. This will:\n* deploy both contracts to the local chain\n* instantiate them\n* record their addresses\n* update the addresses and contracts' metadata files in the frontend directory\n\nIf you need to upload the contracts many times, you have two options:\n* run the `make chain-restart` command, which will remove the old contracts,\n* set the `BULLETIN_BOARD_VERSION` variable to different two-digit numbers with each run, which will allow you to upload different instances of the same contract.\n\nOption 1 is the recommended one for most use cases.\n\n### Running the frontend\n\nIn the `/frontend` directory, run `export REACT_APP_PROVIDER_URL=ws://localhost:9944 \u0026\u0026 npm start`. This should open a new tab in your default browser that connects to your local chain.\n\n### Working with the polkadot.js wallet extension\n\nTo sign transactions, we will be using the [polkadot extension](https://polkadot.js.org/extension/). Follow the instructions about how to install it in the official documentation.\n\n`substrate-contracts-node` ships with bunch of pre-funded accounts - we need to import them into the extension:\n1. Open the browser extension modal.\n2. Click on the **+** icon.\n3. Then **Import account from pre-existing seed**.\n4. In the **EXISTING 12 OR 24-WORD MNEOMNIC SEED** form add `bottom drive obey lake curtain smoke basket hold race lonely fit walk` -- this it the seed for the default accounts. You can find it on https://docs.substrate.io/reference/command-line-tools/subkey/#subkey-generate-node-key .\n5. Click **ADVANCED** and use one of the derivation paths:\n* `//Bob//stash`\n* `//Charlie//stash`\n* `//Dave//stash`\n* `//Eve//stash`\n* `//Ferdie//stash`\n6. Finish the account setup.\n\nNow, you can use the newly-added account with the example frontend.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcardinal-cryptography%2Fbulletin-board-example","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcardinal-cryptography%2Fbulletin-board-example","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcardinal-cryptography%2Fbulletin-board-example/lists"}