{"id":18487483,"url":"https://github.com/loomnetwork/truffle-dappchain-example","last_synced_at":"2026-02-02T13:53:35.183Z","repository":{"id":39515946,"uuid":"136104966","full_name":"loomnetwork/truffle-dappchain-example","owner":"loomnetwork","description":"Example of Truffle configured with Loom Truffle Provider","archived":false,"fork":false,"pushed_at":"2022-12-10T00:55:24.000Z","size":2956,"stargazers_count":92,"open_issues_count":16,"forks_count":45,"subscribers_count":20,"default_branch":"master","last_synced_at":"2024-11-06T13:00:00.374Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/loomnetwork.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}},"created_at":"2018-06-05T01:54:59.000Z","updated_at":"2024-06-07T13:01:56.000Z","dependencies_parsed_at":"2023-01-26T01:16:36.089Z","dependency_job_id":null,"html_url":"https://github.com/loomnetwork/truffle-dappchain-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/loomnetwork%2Ftruffle-dappchain-example","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/loomnetwork%2Ftruffle-dappchain-example/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/loomnetwork%2Ftruffle-dappchain-example/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/loomnetwork%2Ftruffle-dappchain-example/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/loomnetwork","download_url":"https://codeload.github.com/loomnetwork/truffle-dappchain-example/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247922870,"owners_count":21018875,"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-06T12:50:30.493Z","updated_at":"2026-02-02T13:53:35.088Z","avatar_url":"https://github.com/loomnetwork.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"\n# Truffle DappChain Example\n\nThis simple example shows how you can use `Truffle` and the [Loom Truffle Provider](https://github.com/loomnetwork/loom-truffle-provider) to build a simple Web UI that interacts with the Loom PlasmaChain.\n\n![](https://dzwonsemrish7.cloudfront.net/items/0a1N05043p1Y1G3K1Y2L/Screen%20Recording%202018-07-17%20at%2011.26%20AM.gif?v=df873ac3)\n\n\n## Requirements\n\nMake sure the following requirements are met and then follow the steps in the next section:\n\n```text\nRecommended Node version v10.15.3\nyarn or npm\n```\n\n## Install\n\nFirst, let's clone this repository. Open a terminal, `cd` into the directory where you store your projects, and run the following command:\n\n```bash\ngit clone https://github.com/loomnetwork/truffle-dappchain-example\n```\n\nNext, `cd` into `truffle-dappchain-example`:\n\n```bash\ncd truffle-dappchain-example\n```\n\nand run:\n\n```bash\nyarn install\n```\n\n## Run against Loom Testnet\n\n### Generate the Loom private key\n\nThe following command will download the `loom` binary and generate the private key for you:\n\n```bash\nyarn gen:extdev-key\n```\n\nThis will download the loom binary and generate a private key. The private key will be saved into a file called `extdev_private_key`.\n\n\n### Deploy to extdev_plasma_us1\n\nAs an example, we will deploy and run our application against `extdev_plasma_us1`.\n\nRun the following command:\n\n```bash\nyarn deploy:extdev\n```\n\n\u003eThe above command will **compile and then deploy** our smart contract to `extdev_plasma_us1`\n\n\n### Test\n\nRun this command below to send transactions to the smart contract deployed to `extdev_plasma_us1`:\n\n\n```test\nyarn test:extdev\n```\n\nIf everything looks good, let's spin up a web server and interact with our smart contract.\n\n### Start the web interface\n\nThe web interface is built with React and Webpack. Open a new terminal and run the following command:\n\n```bash\nyarn serve:extdev\n```\n\n\u003e The web interface is available on http://localhost:8080.\n\n\n\n## Run against local Loom chain\n\nFirst, you have to generate a private key using:\n\n```bash\nyarn gen:loom-key\n```\n\nThis will download the loom binary and write a private key to a file called  `loom_private_key`\n\n### Spin up Loom Chain\n\nIn a new terminal, run:\n\n```bash\nyarn loom:init\n```\n\nand then:\n\n```bash\nyarn loom:run\n```\n\n### Deploy the smart contract\n\nTo deploy, run the following command:\n\n```bash\nyarn deploy\n```\n\n### Test\n\n\n```bash\nyarn test\n```\n\n## Web interface\n\nWe're ready to start the web server. In a new terminal, run:\n\n```bash\nyarn serve\n```\n\n## Useful information\n\n1. In order to correctly redeploy the contracts, there's a command `yarn deploy:reset`.\n\n2. Also is possible to call truffle command directly with `yarn truffle`.\n\n2. We're not versioning the build directory for this particular example, although is recommended to versioning, the limitation can be removed by editing the `.gitignore` file.\n\n\n## Current limitations\n\n* Events declared on smart contracts should have an named parameter like `NewValueSet(uint _value)` in the contract `SimpleStore.sol`. Also, it helps in dealing with events.\n\nLoom Network\n----\n[https://loomx.io](https://loomx.io)\n\n\nLicense\n----\n\nBSD 3-Clause License\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Floomnetwork%2Ftruffle-dappchain-example","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Floomnetwork%2Ftruffle-dappchain-example","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Floomnetwork%2Ftruffle-dappchain-example/lists"}