{"id":21660205,"url":"https://github.com/loomnetwork/loom-truffle-provider","last_synced_at":"2026-02-02T13:53:35.297Z","repository":{"id":46996567,"uuid":"136012181","full_name":"loomnetwork/loom-truffle-provider","owner":"loomnetwork","description":"Adapter that allows Truffle Suite to communicate with Loom DappChain","archived":false,"fork":false,"pushed_at":"2022-12-08T19:40:04.000Z","size":806,"stargazers_count":28,"open_issues_count":11,"forks_count":9,"subscribers_count":6,"default_branch":"master","last_synced_at":"2023-02-28T07:02:59.878Z","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":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/loomnetwork.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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-04T10:58:06.000Z","updated_at":"2022-10-26T23:36:16.000Z","dependencies_parsed_at":"2023-01-25T18:30:09.546Z","dependency_job_id":null,"html_url":"https://github.com/loomnetwork/loom-truffle-provider","commit_stats":null,"previous_names":[],"tags_count":null,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/loomnetwork%2Floom-truffle-provider","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/loomnetwork%2Floom-truffle-provider/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/loomnetwork%2Floom-truffle-provider/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/loomnetwork%2Floom-truffle-provider/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/loomnetwork","download_url":"https://codeload.github.com/loomnetwork/loom-truffle-provider/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":226306123,"owners_count":17603935,"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-25T09:32:29.642Z","updated_at":"2026-02-02T13:53:35.268Z","avatar_url":"https://github.com/loomnetwork.png","language":"TypeScript","funding_links":[],"categories":["TypeScript"],"sub_categories":[],"readme":"# Loom Truffle Provider\n\nAdapter that allows `Truffle Suite` to communicate with a `Loom DappChain`.\n\n## Install\n\n```bash\nyarn add loom-truffle-provider\n# or\nnpm install loom-truffle-provider\n```\n\n## Requirements\n\n```\nNode \u003e= 8\n```\n\n## Truffle\n\n```\nnpm install -g truffle\n```\n\n## Description\n\nLoom Truffle Provider makes it possible to deploy smart contracts written in Solidity and using Truffle Suite on a Loom\nDappChain. Here's an example Truffle configuration that uses the Loom Truffle Provider...\n\n```javascript\n// truffle.js\nconst { readFileSync } = require('fs')\nconst LoomTruffleProvider = require('loom-truffle-provider')\n\nconst chainId    = 'default'\nconst writeUrl   = 'http://127.0.0.1:46658/rpc'\nconst readUrl    = 'http://127.0.0.1:46658/eth'\n\n// ./privateKey file contains a base64 encoded key generated by the command:\n// loom genkey -a publicKey -k privateKey\nconst privateKey = readFileSync('./privateKey', 'utf-8')\n\nconst loomTruffleProvider = new LoomTruffleProvider(chainId, writeUrl, readUrl, privateKey)\n\n// Create 10 extra accounts, useful for tests\nloomTruffleProvider.createExtraAccounts(10)\n\nmodule.exports = {\n  networks: {\n    loom_dapp_chain: {\n      provider: loomTruffleProvider,\n      network_id: '*'\n    }\n  }\n};\n```\n\n### Accounts managed by LoomTruffleProvider\n\nIn order to access accounts on `LoomTruffleProvider` you should use the function `getProviderEngine`\nwhich will return the `LoomProvider` giving access to properties `accounts`.\n\n```Javascript\nconst loomTruffleProvider = new LoomTruffleProvider(chainId, writeUrl, readUrl, privateKey)\nconst loomProvider = loomTruffleProvider.getProviderEngine()\n\nconsole.log(\"Accounts and Private Keys\", loomProvider.accounts)\n```\n\nAnother way to create extra accounts is to use a `BIP-39 mnemonic`, which will create extra accounts\nfrom a set of words.\n\n```Javascript\n// Using the mnemonic code to create 10 accounts\nloomTruffleProvider.createExtraAccountsFromMnemonic(\"gravity top burden ship student car spell purchase hundred improve check genre\", 10)\n```\n\nNote that the account at index `0` is created from the key passed to the `LoomTruffleProvider` constructor,\nwhile the other accounts are created from the `mnemonic`.\n\n## Notes\n\n* Make sure that the `Loom DappChain` node is running before executing any `Truffle` command.\n* The `Truffle` `network` option must be set to `loom_dapp_chain` when using the example configuration\n  above, e.g. `truffle deploy --network loom_dapp_chain`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Floomnetwork%2Floom-truffle-provider","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Floomnetwork%2Floom-truffle-provider","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Floomnetwork%2Floom-truffle-provider/lists"}