diff --git a/db.json b/db.json index 59b3013b..85e542ef 100644 --- a/db.json +++ b/db.json @@ -1 +1 @@ -{"meta":{"version":1,"warehouse":"3.0.2"},"models":{"Asset":[{"_id":"source/CNAME","path":"CNAME","modified":0,"renderable":0},{"_id":"source/browserconfig.xml","path":"browserconfig.xml","modified":0,"renderable":0},{"_id":"source/embark-logo.svg","path":"embark-logo.svg","modified":0,"renderable":0},{"_id":"source/favicon.ico","path":"favicon.ico","modified":0,"renderable":0},{"_id":"source/robots.txt","path":"robots.txt","modified":0,"renderable":0},{"_id":"source/coverage-files.png","path":"coverage-files.png","modified":0,"renderable":0},{"_id":"source/coverage-report.png","path":"coverage-report.png","modified":0,"renderable":0},{"_id":"source/plugins/thumbnails/bamboo.png","path":"plugins/thumbnails/bamboo.png","modified":0,"renderable":0},{"_id":"source/plugins/thumbnails/fortune.jpg","path":"plugins/thumbnails/fortune.jpg","modified":0,"renderable":0},{"_id":"source/plugins/thumbnails/haml.png","path":"plugins/thumbnails/haml.png","modified":0,"renderable":0},{"_id":"source/plugins/thumbnails/pug.png","path":"plugins/thumbnails/pug.png","modified":0,"renderable":0},{"_id":"source/plugins/thumbnails/remix copy.png","path":"plugins/thumbnails/remix copy.png","modified":0,"renderable":0},{"_id":"source/plugins/thumbnails/remix.png","path":"plugins/thumbnails/remix.png","modified":0,"renderable":0},{"_id":"source/plugins/thumbnails/solidity.png","path":"plugins/thumbnails/solidity.png","modified":0,"renderable":0},{"_id":"source/plugins/thumbnails/solium.png","path":"plugins/thumbnails/solium.png","modified":0,"renderable":0},{"_id":"source/plugins/thumbnails/status.png","path":"plugins/thumbnails/status.png","modified":0,"renderable":0},{"_id":"source/templates/thumbnails/angular.png","path":"templates/thumbnails/angular.png","modified":0,"renderable":0},{"_id":"source/templates/thumbnails/bamboo.png","path":"templates/thumbnails/bamboo.png","modified":0,"renderable":0},{"_id":"source/templates/thumbnails/react.png","path":"templates/thumbnails/react.png","modified":0,"renderable":0},{"_id":"source/templates/thumbnails/sggc.png","path":"templates/thumbnails/sggc.png","modified":0,"renderable":0},{"_id":"source/templates/thumbnails/typescript.png","path":"templates/thumbnails/typescript.png","modified":0,"renderable":0},{"_id":"source/templates/thumbnails/vortex.png","path":"templates/thumbnails/vortex.png","modified":0,"renderable":0},{"_id":"source/templates/thumbnails/vuejs.png","path":"templates/thumbnails/vuejs.png","modified":0,"renderable":0},{"_id":"source/templates/thumbnails/vyper.png","path":"templates/thumbnails/vyper.png","modified":0,"renderable":0},{"_id":"source/tutorials/infura_guide/api-keys.png","path":"tutorials/infura_guide/api-keys.png","modified":0,"renderable":0},{"_id":"source/tutorials/infura_guide/lift-off.jpg","path":"tutorials/infura_guide/lift-off.jpg","modified":0,"renderable":0},{"_id":"themes/embark/source/css/embark.scss","path":"css/embark.scss","modified":0,"renderable":1},{"_id":"themes/embark/source/js/index.js","path":"js/index.js","modified":0,"renderable":1},{"_id":"source/assets/images/cockpit_debugger_controls.png","path":"assets/images/cockpit_debugger_controls.png","modified":0,"renderable":0},{"_id":"source/assets/images/crystal-thread-test.png","path":"assets/images/crystal-thread-test.png","modified":0,"renderable":0},{"_id":"source/plugins/thumbnails/mythx.png","path":"plugins/thumbnails/mythx.png","modified":0,"renderable":0},{"_id":"source/assets/images/token_factory_1/page_1.png","path":"assets/images/token_factory_1/page_1.png","modified":0,"renderable":0},{"_id":"source/assets/images/token_factory_1/page_2.png","path":"assets/images/token_factory_1/page_2.png","modified":0,"renderable":0},{"_id":"source/assets/images/token_factory_1/page_3.png","path":"assets/images/token_factory_1/page_3.png","modified":0,"renderable":0},{"_id":"source/assets/images/token_factory_1/page_4.png","path":"assets/images/token_factory_1/page_4.png","modified":0,"renderable":0},{"_id":"source/assets/images/token_factory_1/page_5.png","path":"assets/images/token_factory_1/page_5.png","modified":0,"renderable":0},{"_id":"source/assets/images/token_factory_2/page_1.png","path":"assets/images/token_factory_2/page_1.png","modified":0,"renderable":0},{"_id":"source/assets/images/token_factory_2/page_2.png","path":"assets/images/token_factory_2/page_2.png","modified":0,"renderable":0},{"_id":"source/assets/images/token_factory_2/page_3.png","path":"assets/images/token_factory_2/page_3.png","modified":0,"renderable":0},{"_id":"source/assets/images/token_factory_2/page_4.png","path":"assets/images/token_factory_2/page_4.png","modified":0,"renderable":0},{"_id":"source/assets/images/token_factory_2/page_5.png","path":"assets/images/token_factory_2/page_5.png","modified":0,"renderable":0},{"_id":"source/assets/images/token_factory_2/page_6.png","path":"assets/images/token_factory_2/page_6.png","modified":0,"renderable":0},{"_id":"source/assets/images/token_factory_2/page_7.png","path":"assets/images/token_factory_2/page_7.png","modified":0,"renderable":0},{"_id":"themes/embark/source/assets/icons/app-window-search-text.svg","path":"assets/icons/app-window-search-text.svg","modified":0,"renderable":1},{"_id":"themes/embark/source/assets/icons/arrow-down-1.svg","path":"assets/icons/arrow-down-1.svg","modified":0,"renderable":1},{"_id":"themes/embark/source/assets/icons/arrow-left-1.svg","path":"assets/icons/arrow-left-1.svg","modified":0,"renderable":1},{"_id":"themes/embark/source/assets/icons/arrow-right-1.svg","path":"assets/icons/arrow-right-1.svg","modified":0,"renderable":1},{"_id":"themes/embark/source/assets/icons/arrow-up-1.svg","path":"assets/icons/arrow-up-1.svg","modified":0,"renderable":1},{"_id":"themes/embark/source/assets/icons/browser-gauge.svg","path":"assets/icons/browser-gauge.svg","modified":0,"renderable":1},{"_id":"themes/embark/source/assets/icons/check.svg","path":"assets/icons/check.svg","modified":0,"renderable":1},{"_id":"themes/embark/source/assets/icons/close.svg","path":"assets/icons/close.svg","modified":0,"renderable":1},{"_id":"themes/embark/source/assets/icons/computer-bug-search.svg","path":"assets/icons/computer-bug-search.svg","modified":0,"renderable":1},{"_id":"themes/embark/source/assets/icons/copy-paste.svg","path":"assets/icons/copy-paste.svg","modified":0,"renderable":1},{"_id":"themes/embark/source/assets/icons/crypto-currency-bitcoin-circle.svg","path":"assets/icons/crypto-currency-bitcoin-circle.svg","modified":0,"renderable":1},{"_id":"themes/embark/source/assets/icons/github.svg","path":"assets/icons/github.svg","modified":0,"renderable":1},{"_id":"themes/embark/source/assets/icons/list-to-do.svg","path":"assets/icons/list-to-do.svg","modified":0,"renderable":1},{"_id":"themes/embark/source/assets/icons/module.svg","path":"assets/icons/module.svg","modified":0,"renderable":1},{"_id":"themes/embark/source/assets/icons/navigation-menu.svg","path":"assets/icons/navigation-menu.svg","modified":0,"renderable":1},{"_id":"themes/embark/source/assets/icons/notes-paper-text.svg","path":"assets/icons/notes-paper-text.svg","modified":0,"renderable":1},{"_id":"themes/embark/source/assets/icons/paginate-filter-video-alternate.svg","path":"assets/icons/paginate-filter-video-alternate.svg","modified":0,"renderable":1},{"_id":"themes/embark/source/assets/icons/pen-write-paper.svg","path":"assets/icons/pen-write-paper.svg","modified":0,"renderable":1},{"_id":"themes/embark/source/assets/icons/pie-line-graph.svg","path":"assets/icons/pie-line-graph.svg","modified":0,"renderable":1},{"_id":"themes/embark/source/assets/icons/rating-star.svg","path":"assets/icons/rating-star.svg","modified":0,"renderable":1},{"_id":"themes/embark/source/assets/icons/search-bar.svg","path":"assets/icons/search-bar.svg","modified":0,"renderable":1},{"_id":"themes/embark/source/assets/icons/symbols.html","path":"assets/icons/symbols.html","modified":0,"renderable":1},{"_id":"themes/embark/source/assets/icons/symbols.svg","path":"assets/icons/symbols.svg","modified":0,"renderable":1},{"_id":"themes/embark/source/assets/icons/tag-new-circle.svg","path":"assets/icons/tag-new-circle.svg","modified":0,"renderable":1},{"_id":"themes/embark/source/assets/icons/twitter.svg","path":"assets/icons/twitter.svg","modified":0,"renderable":1},{"_id":"themes/embark/source/assets/images/Nimbus.svg","path":"assets/images/Nimbus.svg","modified":0,"renderable":1},{"_id":"themes/embark/source/assets/images/apple-touch-icon-120x120-precomposed.png","path":"assets/images/apple-touch-icon-120x120-precomposed.png","modified":0,"renderable":1},{"_id":"themes/embark/source/assets/images/apple-touch-icon-152x152-precomposed.png","path":"assets/images/apple-touch-icon-152x152-precomposed.png","modified":0,"renderable":1},{"_id":"themes/embark/source/assets/images/apple-touch-icon-180x180-precomposed.png","path":"assets/images/apple-touch-icon-180x180-precomposed.png","modified":0,"renderable":1},{"_id":"themes/embark/source/assets/images/apple-touch-icon-60x60-precomposed.png","path":"assets/images/apple-touch-icon-60x60-precomposed.png","modified":0,"renderable":1},{"_id":"themes/embark/source/assets/images/apple-touch-icon-76x76-precomposed.png","path":"assets/images/apple-touch-icon-76x76-precomposed.png","modified":0,"renderable":1},{"_id":"themes/embark/source/assets/images/apple-touch-icon-precomposed.png","path":"assets/images/apple-touch-icon-precomposed.png","modified":0,"renderable":1},{"_id":"themes/embark/source/assets/images/company-flexdapps.svg","path":"assets/images/company-flexdapps.svg","modified":0,"renderable":1},{"_id":"themes/embark/source/assets/images/company-giveth.svg","path":"assets/images/company-giveth.svg","modified":0,"renderable":1},{"_id":"themes/embark/source/assets/images/company-status.svg","path":"assets/images/company-status.svg","modified":0,"renderable":1},{"_id":"themes/embark/source/assets/images/dots.png","path":"assets/images/dots.png","modified":0,"renderable":1},{"_id":"themes/embark/source/assets/images/favicon-16.png","path":"assets/images/favicon-16.png","modified":0,"renderable":1},{"_id":"themes/embark/source/assets/images/favicon-32.png","path":"assets/images/favicon-32.png","modified":0,"renderable":1},{"_id":"themes/embark/source/assets/images/keycard-logo-negative.svg","path":"assets/images/keycard-logo-negative.svg","modified":0,"renderable":1},{"_id":"themes/embark/source/assets/images/logo-negative.svg","path":"assets/images/logo-negative.svg","modified":0,"renderable":1},{"_id":"themes/embark/source/assets/images/logo.svg","path":"assets/images/logo.svg","modified":0,"renderable":1},{"_id":"themes/embark/source/assets/images/rocket-start.svg","path":"assets/images/rocket-start.svg","modified":0,"renderable":1},{"_id":"themes/embark/source/assets/images/status-logo.svg","path":"assets/images/status-logo.svg","modified":0,"renderable":1},{"_id":"themes/embark/source/js/linkjuice/README.md","path":"js/linkjuice/README.md","modified":0,"renderable":1},{"_id":"themes/embark/source/js/linkjuice/gulpfile.js","path":"js/linkjuice/gulpfile.js","modified":0,"renderable":1},{"_id":"themes/embark/source/js/linkjuice/package.json","path":"js/linkjuice/package.json","modified":0,"renderable":1},{"_id":"source/assets/images/cockpit_dashboard_release.png","path":"assets/images/cockpit_dashboard_release.png","modified":0,"renderable":0},{"_id":"source/assets/images/cockpit_editor_release.png","path":"assets/images/cockpit_editor_release.png","modified":0,"renderable":0},{"_id":"source/assets/images/nimble-creating-app.png","path":"assets/images/nimble-creating-app.png","modified":0,"renderable":0},{"_id":"themes/embark/source/assets/images/bg-hexagons.png","path":"assets/images/bg-hexagons.png","modified":0,"renderable":1},{"_id":"source/assets/images/cockpit_contracts_view.gif","path":"assets/images/cockpit_contracts_view.gif","modified":0,"renderable":0},{"_id":"source/assets/images/cockpit_selective_deployment.gif","path":"assets/images/cockpit_selective_deployment.gif","modified":0,"renderable":0},{"_id":"source/assets/images/token_factory_1/console_2.png","path":"assets/images/token_factory_1/console_2.png","modified":0,"renderable":0},{"_id":"themes/embark/source/assets/images/tool-screenshot.png","path":"assets/images/tool-screenshot.png","modified":0,"renderable":1},{"_id":"themes/embark/source/js/linkjuice/src/linkjuice.js","path":"js/linkjuice/src/linkjuice.js","modified":0,"renderable":1},{"_id":"source/assets/images/nim-crystal-header-img_NEW.jpg","path":"assets/images/nim-crystal-header-img_NEW.jpg","modified":0,"renderable":0},{"_id":"source/assets/images/token_factory_2/console_2.png","path":"assets/images/token_factory_2/console_2.png","modified":0,"renderable":0},{"_id":"source/assets/images/cockpit_dashboard.png","path":"assets/images/cockpit_dashboard.png","modified":0,"renderable":0},{"_id":"source/assets/images/cockpit_dashboard_dark.png","path":"assets/images/cockpit_dashboard_dark.png","modified":0,"renderable":0},{"_id":"source/assets/images/token_factory_1/console_1.png","path":"assets/images/token_factory_1/console_1.png","modified":0,"renderable":0},{"_id":"source/assets/images/cockpit_explorer_block.png","path":"assets/images/cockpit_explorer_block.png","modified":0,"renderable":0},{"_id":"source/assets/images/token_factory_2/console_1.png","path":"assets/images/token_factory_2/console_1.png","modified":0,"renderable":0},{"_id":"themes/embark/source/assets/images/EMBARK_HEADER_ALT_OPTIMIZED.jpg","path":"assets/images/EMBARK_HEADER_ALT_OPTIMIZED.jpg","modified":0,"renderable":1},{"_id":"themes/embark/source/assets/images/cli-tool.png","path":"assets/images/cli-tool.png","modified":0,"renderable":1},{"_id":"source/assets/images/cockpit_explorer_overview.png","path":"assets/images/cockpit_explorer_overview.png","modified":0,"renderable":0},{"_id":"themes/embark/source/assets/images/EMBARK_MODULAR.png","path":"assets/images/EMBARK_MODULAR.png","modified":0,"renderable":1},{"_id":"source/assets/images/cockpit_explorer_contracts_detail.gif","path":"assets/images/cockpit_explorer_contracts_detail.gif","modified":0,"renderable":0},{"_id":"themes/embark/source/assets/images/EMBARK_FRAMEWORK.png","path":"assets/images/EMBARK_FRAMEWORK.png","modified":0,"renderable":1},{"_id":"source/assets/images/embark-dashboard.png","path":"assets/images/embark-dashboard.png","modified":0,"renderable":0},{"_id":"source/assets/images/website_release.png","path":"assets/images/website_release.png","modified":0,"renderable":0},{"_id":"source/assets/images/cockpit_explorer_transactions.gif","path":"assets/images/cockpit_explorer_transactions.gif","modified":0,"renderable":0},{"_id":"source/assets/images/cockpit_suggestions.gif","path":"assets/images/cockpit_suggestions.gif","modified":0,"renderable":0},{"_id":"source/assets/images/cockpit_using_debugger.gif","path":"assets/images/cockpit_using_debugger.gif","modified":0,"renderable":0},{"_id":"source/assets/images/cockpit_search.gif","path":"assets/images/cockpit_search.gif","modified":0,"renderable":0},{"_id":"source/assets/images/cockpit_explorer_account.gif","path":"assets/images/cockpit_explorer_account.gif","modified":0,"renderable":0},{"_id":"source/assets/images/cockpit_editor.gif","path":"assets/images/cockpit_editor.gif","modified":0,"renderable":0},{"_id":"source/assets/images/cockpit_enter_debugger.gif","path":"assets/images/cockpit_enter_debugger.gif","modified":0,"renderable":0},{"_id":"source/assets/images/cockpit_navigation.gif","path":"assets/images/cockpit_navigation.gif","modified":0,"renderable":0},{"_id":"source/assets/images/cockpit_change_theme.gif","path":"assets/images/cockpit_change_theme.gif","modified":0,"renderable":0},{"_id":"source/assets/images/cockpit_dashboard_contracts.gif","path":"assets/images/cockpit_dashboard_contracts.gif","modified":0,"renderable":0},{"_id":"source/assets/images/token_factory_1/dashboard.png","path":"assets/images/token_factory_1/dashboard.png","modified":0,"renderable":0},{"_id":"source/assets/images/web3-js-diagram.png","path":"assets/images/web3-js-diagram.png","modified":0,"renderable":0},{"_id":"source/assets/images/embark-header_blank.jpg","path":"assets/images/embark-header_blank.jpg","modified":0,"renderable":0},{"_id":"source/assets/images/web3-article-header.png","path":"assets/images/web3-article-header.png","modified":0,"renderable":0}],"Cache":[{"_id":"source/CNAME","hash":"fbac6d19ee04b9b7f4b3085544d024ec900c633c","modified":1579288027510},{"_id":"source/browserconfig.xml","hash":"f54412705ab9eb69b544f438c9a1e15ae57f27c0","modified":1579287603896},{"_id":"source/embark-logo.svg","hash":"af5b81d96dd4f7e4e65851e53866da7883daf52e","modified":1579287603900},{"_id":"source/favicon.ico","hash":"96b9a549337c2bec483c2879eeafa4d1f8748fed","modified":1579287603900},{"_id":"source/index.md","hash":"0a8e37f1549e24d127e9b65773ae00826d0b53c6","modified":1579287603900},{"_id":"source/robots.txt","hash":"7e49dfd97319f5dd7cdaea8518cf43e0e8d01e5a","modified":1579287603900},{"_id":"themes/embark/package.json","hash":"162acd2d930b76e2aca9114110e08110892db77e","modified":1579467413031},{"_id":"source/coverage-files.png","hash":"e9b0f9b1f09dc16409266dfbc1223f274dd63cbc","modified":1579287603896},{"_id":"source/_data/authors.yml","hash":"3250f13e4e2b6659b36e0932fe5b247fb8f4a4de","modified":1579287603592},{"_id":"source/_data/categories.yml","hash":"3c7131ed69c491243da443abca694a5c33d281b6","modified":1579287603592},{"_id":"source/_data/languages.yml","hash":"74e55635eb66bb12833e42f0d1057b03beb65bcf","modified":1579287603592},{"_id":"source/_data/menu.yml","hash":"bf3d8f131b64deb519c503acad1d98c260c7bef8","modified":1579288101159},{"_id":"source/_data/plugins.yml","hash":"250b7281973f7c96b773150c5215edffcabc8297","modified":1579287603592},{"_id":"source/_data/sidebar.yml","hash":"0ea60cee0c8cfd15952164e2c4f0f7ac5baff74b","modified":1579287603592},{"_id":"source/_data/templates.yml","hash":"bb1ad150c7145d71cb0c8cc79bf11313e5336044","modified":1579467412647},{"_id":"source/_data/tutorials.yml","hash":"6546e52f28f25f5eed82a13390ff7dc1e40d8f9b","modified":1579287603592},{"_id":"source/_data/versions.yml","hash":"e67950c3480c00a3da7728648542cfef802a656f","modified":1579467412647},{"_id":"source/_posts/2017-06-28-embark-2-5-released.md","hash":"5d149e9a2abea4c7ab621dfc846e8e15e67d0e54","modified":1579287936382},{"_id":"source/_posts/2017-10-25-embark-2-6-released.md","hash":"960e06e89708a2c7efb4e2833f3330e50df4ca5c","modified":1579287936382},{"_id":"source/_posts/2018-05-04-embark-3-0-released.md","hash":"96d9c51b2958bb133fabb45fb8adf82643352efb","modified":1579467412648},{"_id":"source/_posts/2018-06-20-embark-3-1-released.md","hash":"cbfe0ade135b7adcfe7d8ccb44b9651f5ac9571d","modified":1579287936386},{"_id":"source/_posts/2018-09-27-how-to-create-a-token-factory-with-embark-part-1.md","hash":"b92b23dcd959f9ad706a08d6a669000d0e8c73f9","modified":1579467412649},{"_id":"source/_posts/2018-10-27-how-to-create-a-token-factory-with-embark-part-2.md","hash":"2801c0fd796b136fff5d275de5581d3950eb8bb1","modified":1579467412649},{"_id":"source/_posts/2019-01-23-building-smart-contract-only-dapps.md","hash":"07ee6e18303761d241359b84d5ca49a895ae3f54","modified":1579287936386},{"_id":"source/_posts/2019-01-28-running-embark-tests-on-a-continuous-integration-server.md","hash":"b9b5affc2764a4b92fee15c6bd12201ee4d6c7c4","modified":1579287936386},{"_id":"source/_posts/2019-02-04-building-a-decentralized-reddit-with-embark-part-1.md","hash":"57de8cfef3e845f2bd86d01c01efc1fcc8bf23fe","modified":1579287936386},{"_id":"source/_posts/2019-02-11-building-a-decentralized-reddit-with-embark-part-2.md","hash":"3aa3e6ef8fbb7c57f07ee3b0738ccf3791e792c5","modified":1579287936386},{"_id":"source/_posts/2019-02-18-building-a-decentralized-reddit-with-embark-part-3.md","hash":"f985d4e255f1b4794ae75dbf6cecc6375b2b8a52","modified":1579287936394},{"_id":"source/_posts/2019-03-18-upgrading-to-embark-4.md","hash":"273625d93b803e0b9d447dfb669c94d7c54744e7","modified":1579467412651},{"_id":"source/_posts/2019-03-19-introducing-embark-4.md","hash":"50072eac21af7cd032c33cd410fbb743010caa34","modified":1579287936394},{"_id":"source/_posts/2019-07-23-whats-new-in-embark-4.1.md","hash":"314ccfcf29600a751720d27f397e3ea1cbfa5d3c","modified":1579467412652},{"_id":"source/_posts/2019-11-18-nim-vs-crystal-part-1-performance-interoperability.md","hash":"22c1e00430cf3e46211ee0b77dd9217ffcea6dff","modified":1579287936394},{"_id":"source/_posts/2019-11-21-nim-vs-crystal-part-2-threading-tooling.md","hash":"307509171f13c6fa9e47627d1f79bd8dde494e4d","modified":1579287936402},{"_id":"source/_posts/2019-11-28-nim-vs-crystal-part-3-cryto-dapps-p2p.md","hash":"3aded116db278f1fd187152731ef786b5ca3b216","modified":1579287936402},{"_id":"source/_posts/2019-12-09-web3-what-are-your-options.md","hash":"52309d265c0c7f970bf33e6c54ca683be9bda152","modified":1580395967138},{"_id":"source/_posts/2020-01-09-take-back-the-web-hackathon.md","hash":"b40dfd06e176be35860fe7679b059773f94c8e63","modified":1579287936418},{"_id":"source/_posts/2020-01-13-announcing-embark-5.md","hash":"86e13a2296e1363a47f19e0dfc356194f7f1bd1b","modified":1579467412653},{"_id":"source/chat/index.md","hash":"f4e76f80e3bcf796e5c06080b745129f389de4b6","modified":1579287603896},{"_id":"source/community/index.md","hash":"abc586bb9afa334aefcc6da5f995be6fced6fced","modified":1579287603896},{"_id":"source/coverage-report.png","hash":"4f2e52ad838258e4e7ee03f2cfd4bdd9be2c4046","modified":1579287603896},{"_id":"source/docs/bamboo.md","hash":"d6dda7ef34b47d759f4cbce3f993ae16d8e9cbd0","modified":1579467413006},{"_id":"source/docs/blockchain_accounts_configuration.md","hash":"2418ac7cdbb8e02d7f3dcbba489de45ad54b4824","modified":1579287603896},{"_id":"source/docs/blockchain_configuration.md","hash":"f6623133b83ee1ab652773b8f2a58e437f5b953a","modified":1579467413007},{"_id":"source/docs/cockpit_dashboard.md","hash":"53e5bc1ffdf3e247d4cc7e97e9f56af96f6e8d56","modified":1579287603896},{"_id":"source/docs/cockpit_deployment.md","hash":"b9c0a1e9bdb4ae6e3ee192d3b8ab90d42a302264","modified":1579287603896},{"_id":"source/docs/cockpit_editor.md","hash":"099d331e041671790bbc212d752d37b832868504","modified":1579287603896},{"_id":"source/docs/cockpit_explorer.md","hash":"b887c079e3442c4e48ea518de30c282186983c45","modified":1579287603896},{"_id":"source/docs/cockpit_introduction.md","hash":"e6c36e3bb3fae88eed1d17860a85ba0366b50009","modified":1579287603896},{"_id":"source/docs/cockpit_utils.md","hash":"9ed2f52f1a0b15fed6fc61e685558e1ed242cd1e","modified":1579287603896},{"_id":"source/docs/configuration.md","hash":"906896808f07737b17f5d8afd3aa713c22952349","modified":1579287603896},{"_id":"source/docs/console_commands.md","hash":"2855fb1b8ee0429e402450ed4d9f38dd2e145cb5","modified":1579287603896},{"_id":"source/docs/contracts_configuration.md","hash":"574ac3d6d2ac48282a8c60ea86d5f2a445426fb1","modified":1579287603896},{"_id":"source/docs/contracts_deployment.md","hash":"87cba365f821abd91399fd773048a02a0c897607","modified":1579287603896},{"_id":"source/docs/contracts_imports.md","hash":"a4d6267182dff8c7dc2a096bbda08bc9c45cbd96","modified":1579287603896},{"_id":"source/docs/contracts_javascript.md","hash":"336454607755a5580e0c36f3d9c60ddcf20318d4","modified":1579287603896},{"_id":"source/docs/contracts_testing.md","hash":"ccaa64628ab2ce6b42013a461a65c07668f4bb5f","modified":1579287603896},{"_id":"source/docs/contributing.md","hash":"5559d38ec006e0e67ee4a56dc657b0d44a08edb0","modified":1579467413009},{"_id":"source/docs/create_project.md","hash":"9650c8422979e82d7c91cb5f308dcd1895c27099","modified":1579467413009},{"_id":"source/docs/creating_plugins.md","hash":"2be705b9646c4041eb7d50a6b1641131f79bd497","modified":1579287603900},{"_id":"source/docs/dashboard.md","hash":"d24645009374a2a4dff4ddbb72bb85ff885d80a2","modified":1579287603900},{"_id":"source/docs/embark_commands.md","hash":"39cd9d4622035b3f2b82dc8fee5eab25cabe82a2","modified":1579287603900},{"_id":"source/docs/environments.md","hash":"c71903c0fd3349b905c8d6c659211fde5c6732e8","modified":1579287603900},{"_id":"source/docs/faq.md","hash":"8154c0047d7de4d63f6337769e7ead2542ffd9aa","modified":1579287603900},{"_id":"source/docs/index.md","hash":"f1870f73da1edb4a5b7a8aacb508e183ea88f7e5","modified":1579287603900},{"_id":"source/docs/installation.md","hash":"df32deb65494ea88439b710c0398d5074a5d2456","modified":1579467413010},{"_id":"source/docs/installing_embarkjs.md","hash":"cf7a19d5f0262f9da14ca33a45a32303c8874694","modified":1579287603900},{"_id":"source/docs/installing_plugins.md","hash":"4575e3c53d3a55d184d10ffb4900b59cf718390e","modified":1579287603900},{"_id":"source/docs/javascript_usage.md","hash":"70a188d16a66e2a1e2b524f04b140bbc3b397367","modified":1579287603900},{"_id":"source/docs/messages_configuration.md","hash":"bb298e851d786cbcb8431bb12bc24f81f9cb3de5","modified":1579287603900},{"_id":"source/docs/messages_javascript.md","hash":"57884a9cc96813469d1c097f08e95e56e62af2aa","modified":1579287603900},{"_id":"source/docs/migrating_from_3.x.md","hash":"707aa9b83492393615b16eb9bde367a0f99f1bf2","modified":1579287603900},{"_id":"source/docs/naming_configuration.md","hash":"a80f6e0dd9f3bb25ead13dc2cb2ab79799f38766","modified":1579287603900},{"_id":"source/docs/naming_javascript.md","hash":"5118e7571f0721579981f68c9ea9c8d127126a08","modified":1579287603900},{"_id":"source/docs/overview.md","hash":"3d4555bb0449f36d7283a9a1b8fdb10c5e1d8d5a","modified":1579467413012},{"_id":"source/docs/pipeline_and_webpack.md","hash":"2d4168eb25766e4558546043538283e87ec916ce","modified":1579287603900},{"_id":"source/docs/plugin_reference.md","hash":"ffc8755b9fee5db7123b120ca0430edb0129bb22","modified":1579287603900},{"_id":"source/docs/quick_start.md","hash":"c7944c6c0344696dc9a47f11a83f98b892ae2f87","modified":1579287603900},{"_id":"source/docs/running_apps.md","hash":"0519272706734c5f9e2184a9680e192e56a2ca47","modified":1579287603900},{"_id":"source/docs/sending_and_receiving_messages.md","hash":"3fe8e66233492f4fb312dcb90cc7ba74ba689ce4","modified":1579287603900},{"_id":"source/docs/smart_contract_objects.md","hash":"7e72a5d62e915d680ad7ed0adbd7c758eafa5a6b","modified":1579287603900},{"_id":"source/docs/solidity.md","hash":"2a8c16ac8c2d049b9d7d91f530b0dddd0f9d73b2","modified":1579287603900},{"_id":"source/docs/storage_configuration.md","hash":"bd275b61fe3b7cc3577f9d30e25d3e7ad7a76795","modified":1579287603900},{"_id":"source/docs/storage_deployment.md","hash":"2f31438f49648a497ffbae160e509bde0c9609ec","modified":1579287603900},{"_id":"source/docs/storage_javascript.md","hash":"f3996b2415cf4a277681f1708b06fe186a54ab2f","modified":1579287603900},{"_id":"source/docs/structure.md","hash":"507a4a506daa32ec5a49fd19f15b6100cf673c13","modified":1579287603900},{"_id":"source/docs/cockpit_debugger.md","hash":"f38a1789e23c0bfad66c116c38aaf6448365adb1","modified":1579287603896},{"_id":"source/docs/troubleshooting.md","hash":"ee789578225703a04e94e6eca209a694e39b02f3","modified":1579467413015},{"_id":"source/docs/using_storages.md","hash":"fcaa4c3846c063bc7f46afdf9f8c780f96125ede","modified":1579287603900},{"_id":"source/docs/using_the_console.md","hash":"1281c1d98732e0f173a865428b06a30da4dc9d76","modified":1579287603900},{"_id":"source/docs/vyper.md","hash":"987e6ad8e86fe7470c4db19a633179aa5b0a2acb","modified":1579287603900},{"_id":"source/docs/web3js.md","hash":"9ad98e255c60ba532b992fae75e903cdff981d60","modified":1579287603900},{"_id":"source/docs/webpack.md","hash":"012cdad1030fb7c45f47d0433ae56c963f635717","modified":1579287603900},{"_id":"source/docs/what_dapp.md","hash":"79502dafd6e70b81e69c6b0aee073f0dac5b1623","modified":1579287603900},{"_id":"source/docs/working_with_name_systems.md","hash":"c972b4ce78f98bb46bf7a245fb811be06d31e4c4","modified":1579287603900},{"_id":"source/news/index.md","hash":"0a8e37f1549e24d127e9b65773ae00826d0b53c6","modified":1579287603900},{"_id":"source/plugins/index.md","hash":"c500bda064f243bfb33b4dffbdf1cb4349bf0bd4","modified":1579287603900},{"_id":"source/templates/index.md","hash":"180f034b05fe0a621c3ccb05f87bf9ab6fde2978","modified":1579287603900},{"_id":"source/tutorials/infura_guide.md","hash":"4e9497c9737522860adc286e126e0f3d1d92cdf0","modified":1579287603904},{"_id":"themes/embark/languages/en.yml","hash":"aa8783506c3f4a09fd4d33bca0bc923fe09f4538","modified":1579287603904},{"_id":"themes/embark/layout/archive.swig","hash":"bbfbbbd37bd047ba20c9b68b036bdbeacbd47482","modified":1579287603904},{"_id":"themes/embark/layout/blog-post.swig","hash":"90595b22104a46c2fc32c25ff484855131df321e","modified":1579287603904},{"_id":"themes/embark/layout/blog.swig","hash":"96bfe880cf8e35c83f66281322ee1d0075161121","modified":1579287603904},{"_id":"themes/embark/layout/community.swig","hash":"feabc52f006a70402a4949c1782a7901a78c4cf3","modified":1579467413027},{"_id":"themes/embark/layout/docs-landing.swig","hash":"9b3cc62579713f7b4211010d66ad17f8f0c99d79","modified":1579287603904},{"_id":"themes/embark/layout/docs.swig","hash":"ca3eeb67eed027298adb8b979be6fda92a18a90c","modified":1579467413027},{"_id":"themes/embark/layout/index.swig","hash":"41aef7f9bffbc8ffe1b3419e596d69169c45692d","modified":1579287603904},{"_id":"themes/embark/layout/layout.swig","hash":"df1f72a8acb309f689760ba9a1ab293c4b1e86b0","modified":1580395967408},{"_id":"themes/embark/layout/page.swig","hash":"21801a7f37e340e45a30bfa5ccf122182d2adc5d","modified":1579287603904},{"_id":"themes/embark/layout/plugins.swig","hash":"b848b10690be2a83276026797e1c333a00596f0b","modified":1579287603904},{"_id":"themes/embark/scripts/checklist.js","hash":"9bb1f40b63fc1673655dac1b3205d5e597833536","modified":1579287603904},{"_id":"themes/embark/scripts/code.js","hash":"1ab08ac667d6ba3442305d6f117a5faa3032055d","modified":1579287603904},{"_id":"themes/embark/scripts/docs_paginator.js","hash":"38632311c2623fee67afc0cee307a17125871743","modified":1579287603904},{"_id":"themes/embark/scripts/is_quickstart.js","hash":"24bdbf644884697d7182c558d45b3fa18113176c","modified":1579287603904},{"_id":"themes/embark/scripts/notification.js","hash":"6dbbccb55c1940dac32140001b1afb19e59af819","modified":1579287603904},{"_id":"themes/embark/scripts/toc.js","hash":"0150d62da68310989db7c9cb74711f1031a7e62c","modified":1579287603904},{"_id":"source/plugins/thumbnails/bamboo.png","hash":"b7c9f4d84aa7d6642e4a822a7b66042ab2d33710","modified":1579287603900},{"_id":"source/plugins/thumbnails/fortune.jpg","hash":"f041a2bc22e374dd833e4b56066e7d3bf20d49f6","modified":1579287603900},{"_id":"source/plugins/thumbnails/haml.png","hash":"19c468e7d07eed1ddadc38818b8f9c350ebf8511","modified":1579287603900},{"_id":"source/plugins/thumbnails/pug.png","hash":"774bb436243175c41b9e4c51558a02e2262a7e47","modified":1579287603900},{"_id":"source/plugins/thumbnails/remix copy.png","hash":"0654c1ca096d7336391d50ffc27c64aa30a37b85","modified":1579287603900},{"_id":"source/plugins/thumbnails/remix.png","hash":"c288a89299382837bde8ce248b2d1265dff49083","modified":1579287603900},{"_id":"source/plugins/thumbnails/solidity.png","hash":"860e6c14fe1fc7799de218b11dbdda5cb73123d3","modified":1579287603900},{"_id":"source/plugins/thumbnails/solium.png","hash":"a8e525113fb9dff400e71b9762f537f82cfdb7ac","modified":1579287603900},{"_id":"source/plugins/thumbnails/status.png","hash":"452ce074cb13ffa9be473c7001c675b6b35f3780","modified":1579287603900},{"_id":"source/templates/thumbnails/angular.png","hash":"e50350df2526f0abf0a8d2e808085c24f2273662","modified":1579287603900},{"_id":"source/templates/thumbnails/bamboo.png","hash":"b7c9f4d84aa7d6642e4a822a7b66042ab2d33710","modified":1579287603900},{"_id":"source/templates/thumbnails/react.png","hash":"a6d33dab3a85a4d7004246e39a704869a6319306","modified":1579287603904},{"_id":"source/templates/thumbnails/sggc.png","hash":"f2742e7865280a840ccb8de8a466e7571947ec9a","modified":1579287603904},{"_id":"source/templates/thumbnails/typescript.png","hash":"bc3c71f25fc966f00c23df3222cde74c6e70c06d","modified":1579287603904},{"_id":"source/templates/thumbnails/vortex.png","hash":"ca5675313297535b416158e7a6b775bbe59f3a56","modified":1579287603904},{"_id":"source/templates/thumbnails/vuejs.png","hash":"85cb9bd3cf15f02dc2b44fbc9dffc2737c6a985b","modified":1579287603904},{"_id":"source/templates/thumbnails/vyper.png","hash":"ecbc1f9ce334685b0a1d9ec6da3ad98a69758f6e","modified":1579287603904},{"_id":"source/tutorials/infura_guide/api-keys.png","hash":"9ef67096142c2cd4dff7e391f2664e335d347517","modified":1579287603904},{"_id":"source/tutorials/infura_guide/lift-off.jpg","hash":"90d8d7604930e30d01aff8c1513412a75e8f4a58","modified":1579287603904},{"_id":"themes/embark/layout/partial/checklist.swig","hash":"a038b0b62e56710637ab3c67d180a27c08e5d18b","modified":1579287603904},{"_id":"themes/embark/layout/partial/checklist_item.swig","hash":"215f6e6f1d7e280990e86abdd56a98cc3c68a95a","modified":1579287603904},{"_id":"themes/embark/layout/partial/code.swig","hash":"7e2fba9a0ef75f26e19c5542ab61d5a951eeb2f5","modified":1579287603904},{"_id":"themes/embark/layout/partial/contributor-box.swig","hash":"5efb1e4b5584b26d37281c11282580ca46e9d879","modified":1579287603904},{"_id":"themes/embark/layout/partial/coverbox.swig","hash":"4346c1cec4aa2ac3455553266b9fc79a1f892c8f","modified":1579287603904},{"_id":"themes/embark/layout/partial/event-box.swig","hash":"b9cf7362d527eba61484ab709c01e4a612237e73","modified":1579287603904},{"_id":"themes/embark/layout/partial/footer.swig","hash":"0b0078e1db5f15f98ccc929121f32eb383f3f821","modified":1579467413030},{"_id":"themes/embark/layout/partial/head.swig","hash":"18fa0064c87fa85d6f12289204a76dbb2e12fa50","modified":1579287603904},{"_id":"themes/embark/layout/partial/header-blog.swig","hash":"2bb97428887b5a9f4d72c0393063ab9550d47a96","modified":1580234110678},{"_id":"themes/embark/layout/partial/header.swig","hash":"c007d93180cde8587c0d1412ea8c31545cabaa9d","modified":1580234110679},{"_id":"themes/embark/layout/partial/heading.swig","hash":"3a3a0760c31be524ba0208ed24cb0894481a2597","modified":1579287603904},{"_id":"themes/embark/layout/partial/notification.swig","hash":"bb1fdae3eb87feb344571a3d8636ea7daf166cd6","modified":1579287603904},{"_id":"themes/embark/layout/partial/paginator.swig","hash":"6f862b18625d7c824fbc32a6228e34686acf4fc7","modified":1579287603904},{"_id":"themes/embark/layout/partial/spotbox.swig","hash":"6f321dab798da2ca02623fa6dcc54cce7a30d13d","modified":1579287603904},{"_id":"themes/embark/layout/partial/universebox.swig","hash":"66bb32ae4f6821b449ddff58a790fc918cb21b29","modified":1579287603904},{"_id":"themes/embark/layout/partial/whisperbox-alternative.swig","hash":"7cb78c69cb4b058de3de13ef5485258f0e1f63fd","modified":1579287603904},{"_id":"themes/embark/layout/partial/whisperbox.swig","hash":"3c6e94cc8774d72cfb30218003f4a266772d238d","modified":1579287603904},{"_id":"themes/embark/source/css/_shame.scss","hash":"3558db6b81dd7b76e71c49d3260edddd57fa8dc7","modified":1579287603916},{"_id":"themes/embark/source/css/embark.scss","hash":"7ffcd12e49bffde3b86a34e8c4f6dff463741717","modified":1579287603916},{"_id":"themes/embark/source/js/index.js","hash":"cb46b90689c0ac59988a81d4d231ae2d4b9d3806","modified":1579287603916},{"_id":"source/assets/images/cockpit_debugger_controls.png","hash":"ba68f8b39e0d745e39a26d0bd8c9c3bfea5ad8c5","modified":1579287603664},{"_id":"source/assets/images/crystal-thread-test.png","hash":"4e8aa7ac613a332960de0117141ed1e33b14d9f1","modified":1579287603792},{"_id":"source/plugins/thumbnails/mythx.png","hash":"7d1972d98ddd2bc13afbb0049d45f157d8cdf675","modified":1579287603900},{"_id":"source/assets/images/token_factory_1/page_1.png","hash":"6babcba0bca8fc8a48a0eed7045396f9c3fb55af","modified":1579287603876},{"_id":"source/assets/images/token_factory_1/page_2.png","hash":"4fa5a22eb63587f424a2742e7f14f39e6e6e4c9d","modified":1579287603880},{"_id":"source/assets/images/token_factory_1/page_3.png","hash":"08a8a87009da0594ac5c763e269082ed489c9b31","modified":1579287603880},{"_id":"source/assets/images/token_factory_1/page_4.png","hash":"78a3cbea0a3a686847fa7024a634bc28b38e7c08","modified":1579287603880},{"_id":"source/assets/images/token_factory_1/page_5.png","hash":"1938ae333249ead32842d39f36dc7d7742e97a95","modified":1579287603880},{"_id":"source/assets/images/token_factory_2/page_1.png","hash":"d0c1bdc7478dcc4878239b2924107df50608d97a","modified":1579287603880},{"_id":"source/assets/images/token_factory_2/page_2.png","hash":"238f769f8834d36a088f6352d5e8b056d339fa7d","modified":1579287603880},{"_id":"source/assets/images/token_factory_2/page_3.png","hash":"8eca458e6e78457f268142f45542c2a919ab07af","modified":1579287603880},{"_id":"source/assets/images/token_factory_2/page_4.png","hash":"92dd82374e8ccd6f258481fc69ebdc2aa16c0532","modified":1579287603880},{"_id":"source/assets/images/token_factory_2/page_5.png","hash":"ea35b940330be24051ac278a8ad6d239a93c3fd5","modified":1579287603884},{"_id":"source/assets/images/token_factory_2/page_6.png","hash":"b672160f850fcd590050dfbc268ec03c1027072f","modified":1579287603884},{"_id":"source/assets/images/token_factory_2/page_7.png","hash":"da58b3365e3b6841ffdcfbf6c5b8a6152daa9a49","modified":1579287603884},{"_id":"themes/embark/source/assets/icons/app-window-search-text.svg","hash":"a7658278c51714beb9a4aa378074b0f1a2a3811a","modified":1579287603904},{"_id":"themes/embark/source/assets/icons/arrow-down-1.svg","hash":"cf919e204adc66907e541c5a32a6cdb8bd86e9d7","modified":1579287603904},{"_id":"themes/embark/source/assets/icons/arrow-left-1.svg","hash":"6a5b3fe7927e03320be668170011aba2d461d1af","modified":1579287603904},{"_id":"themes/embark/source/assets/icons/arrow-right-1.svg","hash":"5948e9eda884b948d0c668ae51f99509d2cfa631","modified":1579287603904},{"_id":"themes/embark/source/assets/icons/arrow-up-1.svg","hash":"e4e31a2af62c2838e1871dfd72203b9a94ae8ae9","modified":1579287603904},{"_id":"themes/embark/source/assets/icons/browser-gauge.svg","hash":"4ab8c84f8c5cc2ece1a2847ef8d9f2c9b842609f","modified":1579287603904},{"_id":"themes/embark/source/assets/icons/check.svg","hash":"94cb2741b66a54d22bbacdf65c5bbf1f4de59c4a","modified":1579287603904},{"_id":"themes/embark/source/assets/icons/close.svg","hash":"07c332a892c2b2a107bf53a055425064006b7161","modified":1579287603904},{"_id":"themes/embark/source/assets/icons/computer-bug-search.svg","hash":"720717cc34ce43565de8ab4a360603c2c55092a7","modified":1579287603904},{"_id":"themes/embark/source/assets/icons/copy-paste.svg","hash":"6a11ff19bd04cf7774d7155a535eb68be3dbb592","modified":1579287603904},{"_id":"themes/embark/source/assets/icons/crypto-currency-bitcoin-circle.svg","hash":"6feceaadc9ee12a3e457d94a3d548a3d82213b92","modified":1579287603904},{"_id":"themes/embark/source/assets/icons/github.svg","hash":"6b9fba84ce16f0f8278ca4eb00ced1c5b13109f4","modified":1579287603904},{"_id":"themes/embark/source/assets/icons/list-to-do.svg","hash":"6954c1ea40469c5548ff8c3daba91ea3e883dab4","modified":1579287603904},{"_id":"themes/embark/source/assets/icons/module.svg","hash":"cf1284f20a532fc451ba6cd443ff1534e63b6779","modified":1579287603904},{"_id":"themes/embark/source/assets/icons/navigation-menu.svg","hash":"d6b4d9e2da8849ac362bcb8d634725b921ebf46c","modified":1579287603904},{"_id":"themes/embark/source/assets/icons/notes-paper-text.svg","hash":"fc8a3304cfc24437597a565290c6b1095fa365f7","modified":1579287603904},{"_id":"themes/embark/source/assets/icons/paginate-filter-video-alternate.svg","hash":"a2953dbbdcd49ce07a7aa90be9803d5e44a77688","modified":1579287603904},{"_id":"themes/embark/source/assets/icons/pen-write-paper.svg","hash":"a2828e87d8ea6f6d965a1aae8ab450c3bba19564","modified":1579287603904},{"_id":"themes/embark/source/assets/icons/pie-line-graph.svg","hash":"d8a9dad5f7377b12b3130d964f7fe3d03de80d1a","modified":1579287603904},{"_id":"themes/embark/source/assets/icons/rating-star.svg","hash":"961c6f9cf48e662267cdfb609e89f3234e1c84c0","modified":1579287603904},{"_id":"themes/embark/source/assets/icons/search-bar.svg","hash":"6e3dfc910fda432935eaf7a6170bf1f6be8c7a21","modified":1579287603904},{"_id":"themes/embark/source/assets/icons/symbols.html","hash":"d13ca80e28788a3fffb404dd5dff6225139b38a9","modified":1579287603904},{"_id":"themes/embark/source/assets/icons/symbols.svg","hash":"d34c6846fa16190a9e264d9f1cbf40e12ae8f410","modified":1579287603904},{"_id":"themes/embark/source/assets/icons/tag-new-circle.svg","hash":"3a155bcde805c6101d431c08a093a5ffed37dfeb","modified":1579287603904},{"_id":"themes/embark/source/assets/icons/twitter.svg","hash":"90e4959062ea5bc14eb10f182c1c9859dcc0b168","modified":1579287603904},{"_id":"themes/embark/source/assets/images/Nimbus.svg","hash":"f0ea3f6a1804fc951901bdf3c3ec84ebcbcfb1b3","modified":1579287603912},{"_id":"themes/embark/source/assets/images/apple-touch-icon-120x120-precomposed.png","hash":"2b599bbb36131a537d0a2db417eefd8cb2a348f7","modified":1579287603912},{"_id":"themes/embark/source/assets/images/apple-touch-icon-152x152-precomposed.png","hash":"8f2800d891c5e1374cef4f3fcd26575f46748e5c","modified":1579287603912},{"_id":"themes/embark/source/assets/images/apple-touch-icon-180x180-precomposed.png","hash":"451e3cfad6ebe9dad9eb35af1d7c113b2f76f143","modified":1579287603912},{"_id":"themes/embark/source/assets/images/apple-touch-icon-60x60-precomposed.png","hash":"aa89e00d7671bfa8add7afc2ee25e84cf93319b3","modified":1579287603912},{"_id":"themes/embark/source/assets/images/apple-touch-icon-76x76-precomposed.png","hash":"99cd68afb86ecab681c217b0eeffed8163f228e6","modified":1579287603912},{"_id":"themes/embark/source/assets/images/apple-touch-icon-precomposed.png","hash":"451e3cfad6ebe9dad9eb35af1d7c113b2f76f143","modified":1579287603912},{"_id":"themes/embark/source/assets/images/company-flexdapps.svg","hash":"ae7686cb0c918a69b497774fba8829cb3df89858","modified":1579287603916},{"_id":"themes/embark/source/assets/images/company-giveth.svg","hash":"8d611a8a4c94e2bb13da7661195cb44d3ee163f4","modified":1579287603916},{"_id":"themes/embark/source/assets/images/company-status.svg","hash":"5729e8db16b262cb6c3ca91113500b1895f24768","modified":1579287603916},{"_id":"themes/embark/source/assets/images/dots.png","hash":"2f22dcbbe2b643819e263bc292732d0875e9f24e","modified":1579287603916},{"_id":"themes/embark/source/assets/images/favicon-16.png","hash":"db9d7be08c2096635e4acd9f00fb56c04aafa7a5","modified":1579287603916},{"_id":"themes/embark/source/assets/images/favicon-32.png","hash":"b841b7f468325cab45486b1a25343e0f0654ef0d","modified":1579287603916},{"_id":"themes/embark/source/assets/images/keycard-logo-negative.svg","hash":"b93278634ae78c759a0439a7d8c275889ae90e8f","modified":1579287603916},{"_id":"themes/embark/source/assets/images/logo-negative.svg","hash":"2eb5bdd4eb9aac594e7fcbb7ff0fb7456d6c1fd1","modified":1579287603916},{"_id":"themes/embark/source/assets/images/logo.svg","hash":"0bc239291c9f4732df92ed67b5f80d7392d9920a","modified":1579287603916},{"_id":"themes/embark/source/assets/images/rocket-start.svg","hash":"1c2121ac58f2ea3916de10a4667518b653ce83a7","modified":1579287603916},{"_id":"themes/embark/source/assets/images/status-logo.svg","hash":"80e9ac5ea6f37880927c680f66d41f2acd751873","modified":1579287603916},{"_id":"themes/embark/source/css/00-functions/_functions.get-color-brand.scss","hash":"1fb90cf4cd3da1241355f85a5185e0aa31dc5263","modified":1579287603916},{"_id":"themes/embark/source/css/00-functions/_functions.get-color-layout.scss","hash":"4ec42cab6f2b425240cb7254bdb7c81d13dc7198","modified":1579287603916},{"_id":"themes/embark/source/css/00-functions/_functions.get-color-semantic.scss","hash":"434b52490937e1471d95a143b70381a2f4bb619c","modified":1579287603916},{"_id":"themes/embark/source/css/00-functions/_functions.get-color.scss","hash":"c9ff601899d050f74893a8eb7d5d2df42cb5a217","modified":1579287603916},{"_id":"themes/embark/source/css/00-functions/_functions.get-spacing-inset.scss","hash":"6fe46f2345b2420307f4d67eff32036055795272","modified":1579287603916},{"_id":"themes/embark/source/css/00-functions/_functions.get-spacing-squish.scss","hash":"940d65a07b14673ffd3da63a75937c3125981e91","modified":1579287603916},{"_id":"themes/embark/source/css/00-functions/_functions.get-spacing-stack.scss","hash":"a8a2c86786d30bfd8bd2c8d3ac180ea7003cc725","modified":1579287603916},{"_id":"themes/embark/source/css/00-functions/_functions.get-spacing-stretch-inset.scss","hash":"eecce95964b8897de6054fb5fc5eab3a676094b6","modified":1579287603916},{"_id":"themes/embark/source/css/00-settings/_settings.border.scss","hash":"b15fd59a3abba1a570659792270550c6f3cbeb88","modified":1579287603916},{"_id":"themes/embark/source/css/00-settings/_settings.color-brand.scss","hash":"bf20393b0cce0cf2847cc897fa559fce66d42d2b","modified":1579287603916},{"_id":"themes/embark/source/css/00-settings/_settings.color-layout.scss","hash":"a8b5170ae33e09a75f6f845a4873ca63f408adb0","modified":1579287603916},{"_id":"themes/embark/source/css/00-settings/_settings.color-palette.scss","hash":"903b152e109e80753a4051b1d19ba0726d19da8b","modified":1579287603916},{"_id":"themes/embark/source/css/00-settings/_settings.forms.scss","hash":"b1dde72a9cdba6355472369155b38dea4f1bef77","modified":1579287603916},{"_id":"themes/embark/source/css/00-settings/_settings.indecies.scss","hash":"3c394d06e65163811e8d884286235d202d0f3403","modified":1579287603916},{"_id":"themes/embark/source/css/00-settings/_settings.color-semantic.scss","hash":"262bcab015c3f323b375e6dee538a212a60426ad","modified":1579287603916},{"_id":"themes/embark/source/css/00-settings/_settings.layout.scss","hash":"3e67200fb9444187aab60a1282549b0075437877","modified":1579287603916},{"_id":"themes/embark/source/css/00-settings/_settings.links.scss","hash":"65637c528bfd48c7b023fc94e28358fc58c0a8f6","modified":1579287603916},{"_id":"themes/embark/source/css/00-settings/_settings.misc.scss","hash":"e7bf80f32564301cc1e41ccfdba1ee1749ae525c","modified":1579287603916},{"_id":"themes/embark/source/css/00-settings/_settings.spacing.scss","hash":"8cf54f8146fad87f59d45ec053df7f1ff8345cbe","modified":1579287603916},{"_id":"themes/embark/source/css/00-settings/_settings.typography.scss","hash":"3e3b83e8fe1d28c9ad156fa33555ae8674c746cc","modified":1579287603916},{"_id":"themes/embark/source/css/01-tools/_tools.border.scss","hash":"a9b21ea9d1cf2bf5877c1c9c50c4fe4996b69ff0","modified":1579287603916},{"_id":"themes/embark/source/css/01-tools/_tools.box-shadow.scss","hash":"ec0081d8b10eeb945eebf744742ea6417c384b8c","modified":1579287603916},{"_id":"themes/embark/source/css/01-tools/_tools.breakpoint.scss","hash":"7b261864e28b0ec16781bc24065450caf2b70abe","modified":1579287603916},{"_id":"themes/embark/source/css/01-tools/_tools.clearfix.scss","hash":"266582ce0ffe5eb0622868370dc9ac8e6acea737","modified":1579287603916},{"_id":"themes/embark/source/css/01-tools/_tools.column.scss","hash":"c588b90cb648c979a391658ed337e00daecdb271","modified":1579287603916},{"_id":"themes/embark/source/css/01-tools/_tools.list-reset.scss","hash":"406d4d60d370decc9d7f3d5a8eb3308bb8fae6c8","modified":1579287603916},{"_id":"themes/embark/source/css/01-tools/_tools.overlay.scss","hash":"b1cf5a920ba83db93aa649f2ddf98ef858bb1bce","modified":1579287603916},{"_id":"themes/embark/source/css/01-tools/_tools.placeholder.scss","hash":"baf73d8af13039931a6f0b8b22279c3f1bfdf267","modified":1579287603916},{"_id":"themes/embark/source/css/02-generic/_generic.box-sizing.scss","hash":"26b7b6efad6435f49a808080ca987f123bf2ab8e","modified":1579287603916},{"_id":"themes/embark/source/css/02-generic/_generic.reset.scss","hash":"8a50750b05184887d7290f2360ce72a94e84ca64","modified":1579287603916},{"_id":"themes/embark/source/css/03-elements/_elements.buttons.scss","hash":"4842d392957b128f686eea568d896efb45f9f834","modified":1579287603916},{"_id":"themes/embark/source/css/03-elements/_elements.forms.scss","hash":"f45be318ebb22533e8e266b2eebe43ddb0937bf4","modified":1579287603916},{"_id":"themes/embark/source/css/03-elements/_elements.headings.scss","hash":"de758429ddb890d33564356af3ca61debc2ef155","modified":1579287603916},{"_id":"themes/embark/source/css/03-elements/_elements.images.scss","hash":"0a52090c19650caf47b7f848b28786e8eddb89d5","modified":1579287603916},{"_id":"themes/embark/source/css/03-elements/_elements.links.scss","hash":"f2e98137d2d3ca5092c73f70cc4e28ad393b039f","modified":1579287603916},{"_id":"themes/embark/source/css/03-elements/_elements.lists.scss","hash":"a388a10af8a7ca3f0b6ec74fe0efdb9e2296aacb","modified":1579287603916},{"_id":"themes/embark/source/css/03-elements/_elements.tables.scss","hash":"81d33b10eecfb74e8ddbeb150c8f497dbfcff11f","modified":1579287603916},{"_id":"themes/embark/source/css/03-elements/_elements.typography.scss","hash":"44d0622de4f290e6d2c8ed34cfd750e056bf6711","modified":1579287603916},{"_id":"themes/embark/source/css/04-objects/_objects.buttonbar.scss","hash":"8f6bc88ec9125075b147f1477b439e6e9413b42b","modified":1579287603916},{"_id":"themes/embark/source/css/04-objects/_objects.distances.scss","hash":"c21f0844a596e8410fb594c0d97eb2e12b22f8f4","modified":1579287603916},{"_id":"themes/embark/source/css/04-objects/_objects.footer.scss","hash":"366eafaf766cd95a5b195b914cee0c4d227b104d","modified":1579287603916},{"_id":"themes/embark/source/css/04-objects/_objects.grid.scss","hash":"da7c0ebf630f220f858044f4edceadea9abbfd12","modified":1579287603916},{"_id":"themes/embark/source/css/04-objects/_objects.guided-content.scss","hash":"3a6d8159ce5c47e2a72d00184aa28719285303e3","modified":1579287603916},{"_id":"themes/embark/source/css/04-objects/_objects.head-up.scss","hash":"b50eaa3fab38d2e9f1230a12f8542917cdc172e5","modified":1579287603916},{"_id":"themes/embark/source/css/04-objects/_objects.header.scss","hash":"471289d74d223952cb5eab924854aa79df0622e6","modified":1579287603916},{"_id":"themes/embark/source/css/04-objects/_objects.heading.scss","hash":"7579f117e65d258c46aaa437f07f9f092b2db596","modified":1579287603916},{"_id":"themes/embark/source/css/04-objects/_objects.list-bare.scss","hash":"767f64a9bd40b16cf72efefe731fecebc2565fa8","modified":1579287603916},{"_id":"themes/embark/source/css/04-objects/_objects.list-inline.scss","hash":"1b36ae3bb253a87edb4db15f9b875e10ba146906","modified":1579287603916},{"_id":"themes/embark/source/css/04-objects/_objects.media.scss","hash":"332888a05a775f5b7f550f2d58c9ff329cfaaef1","modified":1579287603916},{"_id":"themes/embark/source/css/04-objects/_objects.overlap.scss","hash":"4a0ae3a2032bc450d3d4693d92b49965ecbc6620","modified":1579287603916},{"_id":"themes/embark/source/css/04-objects/_objects.standard-page.scss","hash":"ab662003b9c21f5da3fdde6f66d70e8aa82dd8d8","modified":1579287603916},{"_id":"themes/embark/source/css/05-components/_components.avatars.scss","hash":"c2dbff38e210486f01e9fcd8703329f773129545","modified":1579287603916},{"_id":"themes/embark/source/css/05-components/_components.boxes.scss","hash":"5d3fcd7009b24671f56fbb3c6c1884157b056a3e","modified":1579287603916},{"_id":"themes/embark/source/css/05-components/_components.button.scss","hash":"c43f5627dd9a80e64f024b9f484d9a7a833febc8","modified":1579287603916},{"_id":"themes/embark/source/css/05-components/_components.checklist.scss","hash":"29f16754036ca4fcec731597a416c98787a744d2","modified":1579287603916},{"_id":"themes/embark/source/css/05-components/_components.guide.scss","hash":"cdafd26c3ee6c739f9bbfce0125645a0b7b3bd0a","modified":1579287603916},{"_id":"themes/embark/source/css/05-components/_components.headings.scss","hash":"5f583822f762f99d00187935d933770972294413","modified":1579287603916},{"_id":"themes/embark/source/css/05-components/_components.highlight.scss","hash":"69476a68de00e2e290fa84fffdec9b99f7459acf","modified":1579287603916},{"_id":"themes/embark/source/css/05-components/_components.icons.scss","hash":"4ddbc047a971df8f6878e173bdbc79db8d67f8d4","modified":1579287603916},{"_id":"themes/embark/source/css/05-components/_components.links.scss","hash":"59ad321a05677c8716fbace182288551ea04530b","modified":1579287603916},{"_id":"themes/embark/source/css/05-components/_components.logos.scss","hash":"afa93ec0d91281c5bb3e4b0f3685b65217a07514","modified":1579287603916},{"_id":"themes/embark/source/css/05-components/_components.meta.scss","hash":"e0edb9b8a27121f70302608a4ae3ef51d7a809c1","modified":1579287603916},{"_id":"themes/embark/source/css/05-components/_components.navigations.scss","hash":"2a03188aac7dc518f519139ec44566bcebf6c51e","modified":1579287603916},{"_id":"themes/embark/source/css/05-components/_components.notifications.scss","hash":"c43dcef42e77778a863ebf39835814b363703ba7","modified":1579287603916},{"_id":"themes/embark/source/css/05-components/_components.tags.scss","hash":"0296364650db159da3659e9c8659d1ba46d3f455","modified":1579287603916},{"_id":"themes/embark/source/css/06-utilities/_utilities.links.scss","hash":"0876483cf965935ddf3264de0cc947a9b5240093","modified":1579287603916},{"_id":"themes/embark/source/css/06-utilities/_utilities.list-reset.scss","hash":"621869acabfcf504dad7983ef7770919d9aa39e4","modified":1579287603916},{"_id":"themes/embark/source/css/06-utilities/_utilities.text.scss","hash":"451861b375641c6efbfa22e1e0b398feed1aa7b8","modified":1579287603916},{"_id":"themes/embark/source/css/06-utilities/_utilities.visibility.scss","hash":"83eff52a70c64c2c2c6da20765ad9f2c94bca71f","modified":1579287603916},{"_id":"themes/embark/source/js/linkjuice/.babelrc","hash":"7224f35c4916aa40abdd0f9597b7997015d83533","modified":1579287603916},{"_id":"themes/embark/source/js/linkjuice/.editorconfig","hash":"62e8da92cc4bedb619b57f573fe8b931cce190a6","modified":1579287603920},{"_id":"themes/embark/source/js/linkjuice/.gitignore","hash":"3f33fc2aefbc0b8c9650ad620d14aa5e3c8e4604","modified":1579287603920},{"_id":"themes/embark/source/js/linkjuice/.jshintrc","hash":"1725359358cfcb1a42b09c8441cea8322803a2a2","modified":1579287603920},{"_id":"themes/embark/source/js/linkjuice/README.md","hash":"f15e54a42ccce6a7830526e4c70504c0d604daaa","modified":1579287603920},{"_id":"themes/embark/source/js/linkjuice/gulpfile.js","hash":"c160dfead280a588086115a45a895549b99ed458","modified":1579287603920},{"_id":"themes/embark/source/js/linkjuice/package.json","hash":"28edd71a4c5ef266af83c60d68a85883755c1a3e","modified":1579287603920},{"_id":"source/assets/images/cockpit_dashboard_release.png","hash":"096b0b893f3d467919edd968ce827985e1f233f0","modified":1579287603664},{"_id":"source/assets/images/cockpit_editor_release.png","hash":"c912dcedf5db89e08e491d1b49f7b07795bdcf21","modified":1579287603680},{"_id":"source/assets/images/nimble-creating-app.png","hash":"30bdcea82d2a7e7b063dfeca277438ae9a9a44f4","modified":1579287603808},{"_id":"themes/embark/source/assets/images/bg-hexagons.png","hash":"d2a3d73d939c8d6a34f04741231739d25d81c1a8","modified":1579287603912},{"_id":"themes/embark/source/css/00-functions/_functions.get-spacing-inline.scss","hash":"fc62e3c3e377d2db64a809986900e99e79fd10ba","modified":1579287603916},{"_id":"themes/embark/source/css/00-functions/_functions.get-index.scss","hash":"2f2f39faafa8d4b216be83c6fd4b25a030e39fc8","modified":1579287603916},{"_id":"themes/embark/source/css/00-functions/_functions.get-font-size.scss","hash":"006929f9ec36f9253467851dce1b3de5479c6b9e","modified":1579287603916},{"_id":"source/assets/images/cockpit_contracts_view.gif","hash":"999f406795198c3d8651e61d7e0b251f7320d98c","modified":1579287603632},{"_id":"source/assets/images/cockpit_selective_deployment.gif","hash":"1d9e6e6a5d1c98da71e316c7cfb4ac7aff6c5708","modified":1579287603768},{"_id":"source/assets/images/nim-crystal-header_blank.jpg","hash":"9da5d1642a4ad2ba3af71504589a5ced42a4ab8f","modified":1579287603808},{"_id":"source/assets/images/token_factory_1/console_2.png","hash":"82a4f8163e92edc66a14726a97e6f3d586fc5ec9","modified":1579287603808},{"_id":"themes/embark/source/assets/images/tool-screenshot.png","hash":"9cfaabed43e1453cdf1edb60238f2aeaa3b7ad07","modified":1579287603916},{"_id":"themes/embark/source/js/linkjuice/src/linkjuice.js","hash":"c9145e827c4a9c35575911407b9a7e65c48ae858","modified":1579287603920},{"_id":"source/assets/images/nim-crystal-header-img_NEW.jpg","hash":"f0716491dd88db1d137c915879e66694844ea334","modified":1579287603804},{"_id":"source/assets/images/token_factory_2/console_2.png","hash":"4efdab7b54dacafc83854b6dc7d73addf9fe8ade","modified":1579287603880},{"_id":"source/assets/images/cockpit_dashboard.png","hash":"aa995f3517e692402819dc004010c9f45960a7a5","modified":1579287603636},{"_id":"source/assets/images/cockpit_dashboard_dark.png","hash":"69148b6547065adcd5583118286f74aff9a29889","modified":1579287603660},{"_id":"source/assets/images/token_factory_1/console_1.png","hash":"fd0c379505c036ad151b01a5a28b610df190d3d6","modified":1579287603808},{"_id":"source/assets/images/cockpit_explorer_block.png","hash":"e9f398fc9eacf99b3e64997c3724ec541875e144","modified":1579287603724},{"_id":"source/assets/images/token_factory_2/console_1.png","hash":"9d35e99618f0ff90911672eaf7765a48ab84f94e","modified":1579287603880},{"_id":"themes/embark/source/assets/images/EMBARK_HEADER_ALT_OPTIMIZED.jpg","hash":"9d767c14d82980b184cb6d9a1746f986c21cec8e","modified":1579287603908},{"_id":"themes/embark/source/assets/images/cli-tool.png","hash":"21fa930acb0a5259f9f35b37d14bc4b11fd9120d","modified":1579287603916},{"_id":"source/assets/images/cockpit_explorer_overview.png","hash":"86a94110f1ae3fe956a5efb1b165902c63fa35d8","modified":1579287603736},{"_id":"themes/embark/source/assets/images/EMBARK_MODULAR.png","hash":"38677401713a7583c44d97e59eb5bcc3c8fb8386","modified":1579287603912},{"_id":"source/assets/images/cockpit_explorer_contracts_detail.gif","hash":"2464c474ba42193ca58df7288c2afc81608657c0","modified":1579287603732},{"_id":"themes/embark/source/assets/images/EMBARK_FRAMEWORK.png","hash":"6113f59cb45baf50f78c13684f366b3b2ba11239","modified":1579287603908},{"_id":"source/assets/images/embark-dashboard.png","hash":"fbfa1764086f3c436172bc8c812452a99c8d8f79","modified":1579287603800},{"_id":"source/assets/images/website_release.png","hash":"4625f3ee3f58fae5d2c2dc7b10fc8d2547c6a448","modified":1579287603896},{"_id":"source/assets/images/cockpit_explorer_transactions.gif","hash":"fd74abafca81d5a2986f57d72147b228b06f075d","modified":1579287603744},{"_id":"source/assets/images/cockpit_suggestions.gif","hash":"2e004a561dda70e22effa1af96315bb9d2314758","modified":1579287603784},{"_id":"source/assets/images/cockpit_using_debugger.gif","hash":"72acc4d2ab4f9b342749519b69455e30fd4e24c0","modified":1579287603792},{"_id":"source/assets/images/cockpit_search.gif","hash":"c797eb599b822ca56f57cfa882967f23b27d62f9","modified":1579287603768},{"_id":"source/assets/images/cockpit_explorer_account.gif","hash":"a9c557a12ff36090c6a41c265bbd8eb9285de657","modified":1579287603716},{"_id":"source/assets/images/cockpit_editor.gif","hash":"3ce64fcf60098d6954d4a021ef4d2f2c20e1dc46","modified":1579287603676},{"_id":"source/assets/images/cockpit_enter_debugger.gif","hash":"f3374c1898aba97acb7d53779d4e8fc9643d2dff","modified":1579287603696},{"_id":"source/assets/images/cockpit_navigation.gif","hash":"7ed00581b8752de847a7e7e2d2c6e47bc961614a","modified":1579287603756},{"_id":"source/assets/images/cockpit_change_theme.gif","hash":"fe6c1c931e3db5c069a158bf7da7fd732d0f39bc","modified":1579287603632},{"_id":"source/assets/images/cockpit_dashboard_contracts.gif","hash":"1792d363902a2ec8f26f7596bffc4431461f2fee","modified":1579287603660},{"_id":"source/assets/images/token_factory_1/dashboard.png","hash":"bfb37f6fe22c28ac3cfa10b100e2db47acf5f6ca","modified":1579287603876},{"_id":"source/.DS_Store","hash":"388ff7bec88d20496fcfb7869ca9aefb6d504b1b","modified":1580238088484},{"_id":"source/_posts/2020-01-27-web-app-security-frontend-to-backend.md","hash":"d69fe3a5216e37c06390e3f1b0ee141cb288047b","modified":1580237771508},{"_id":"source/_posts/2020-01-28-embark-5-1.md","hash":"d4aad91d8ffac95ef4637f7965107469888f6e04","modified":1580234109597},{"_id":"source/assets/.DS_Store","hash":"663ccef78538c09fc70cf73b359272828aef3132","modified":1580237849355},{"_id":"source/assets/images/web3-js-diagram.png","hash":"5cc26458f47462ce25a80abca52a4cc2e90de9e4","modified":1578640785567},{"_id":"source/assets/images/embark-header_blank.jpg","hash":"9da5d1642a4ad2ba3af71504589a5ced42a4ab8f","modified":1580234110379},{"_id":"source/assets/images/web3-article-header.png","hash":"48e3fc72598773913bbfbde2f13c3feca8008578","modified":1578640785563},{"_id":"source/_posts/2020-01-30-dapp-frontend-security.md","hash":"79159d525961c5fc9601e47e11fcccfcc7fb7314","modified":1580395967141},{"_id":"source/_posts/2020-01-29-subspace-1-2.md","hash":"755e9286ca8c69e06ffca1f21b18aaf874fe4cea","modified":1580395967140}],"Category":[{"name":"announcements","_id":"ck5ijm3qp00057heg5kpz32j7"},{"name":"tutorials","_id":"ck5ijm3r7000n7heg18or2163"},{"name":"releases","parent":"ck5ijm3qp00057heg5kpz32j7","_id":"ck5y92ljz0001zf0ebip59hx1"}],"Data":[{"_id":"authors","data":{"iuri_matias":{"name":"Iuri Matias","twitter":"iurimatias","image":"https://pbs.twimg.com/profile_images/928272512181563392/iDJdvy2k_400x400.jpg"},"pascal_precht":{"name":"Pascal Precht","twitter":"pascalprecht","image":"https://pbs.twimg.com/profile_images/993785060733194241/p3oAIMDP_400x400.jpg"},"anthony_laibe":{"name":"Anthony Laibe","twitter":"a_laibe","image":"https://pbs.twimg.com/profile_images/257742900/13168239_400x400.jpg"},"jonathan_rainville":{"name":"Jonathan Rainville","twitter":"ShyolGhul","image":"https://pbs.twimg.com/profile_images/993873866878570496/-aE4byjj_400x400.jpg"},"andre_medeiros":{"name":"Andre Medeiros","twitter":"superdealloc","image":"https://pbs.twimg.com/profile_images/965722487735701504/m58KNgWN_400x400.jpg"},"eric_mastro":{"name":"Eric Mastro","twitter":"ericmastro","image":"https://avatars1.githubusercontent.com/u/5089238?s=460&v=4"},"michael_bradley":{"name":"Michael Bradley","image":"https://avatars3.githubusercontent.com/u/194260?s=460&v=4"},"richard_ramos":{"name":"Richard Ramos","twitter":"richardramos_me","image":"https://pbs.twimg.com/profile_images/1063160577973866496/aM313uHG_400x400.jpg"},"jonny_zerah":{"name":"Jonny Zerah","twitter":"jonnyzerah","image":"https://pbs.twimg.com/profile_images/1043774340490248192/gI9aGy17_400x400.jpg"},"robin_percy":{"name":"Robin Percy","twitter":"rbin","image":"https://avatars1.githubusercontent.com/u/29288325?s=400&v=4"}}},{"_id":"categories","data":{"tutorials":"Tutorials","announcements":"Announcements"}},{"_id":"languages","data":{"en":"English"}},{"_id":"plugins","data":[{"name":"embark-bamboo","description":"plugins_page.plugins.bamboo.desc","link":"https://www.npmjs.com/package/embark-bamboo","thumbnail":"bamboo.png","tags":["language","smart-contracts"]},{"name":"embark-solc","description":"plugins_page.plugins.solc.desc","link":"https://www.npmjs.com/package/embark-solc","thumbnail":"solidity.png","tags":["solidity","language","smart-contracts"]},{"name":"embark-solium","description":"plugins_page.plugins.solium.desc","link":"https://www.npmjs.com/package/embark-solium","thumbnail":"solium.png","tags":["linter","solidity","solium"]},{"name":"embark-etherscan-verifier","description":"plugins_page.plugins.verifier.desc","link":"https://www.npmjs.com/package/embark-etherscan-verifier","tags":["solidity","etherscan","smart-contracts"]},{"name":"embark-status","description":"plugins_page.plugins.status.desc","link":"https://www.npmjs.com/package/embark-status-plugin","thumbnail":"status.png","tags":["status","mobile"]},{"name":"embark-remix","description":"plugins_page.plugins.remix.desc","link":"https://www.npmjs.com/package/embark-remix","thumbnail":"remix.png","tags":["remix","debugger"]},{"name":"embark-slither","description":"plugins_page.plugins.slither.desc","link":"https://www.npmjs.com/package/embark-slither","tags":["solidity"]},{"name":"embark-snark","description":"plugins_page.plugins.snark.desc","link":"https://www.npmjs.com/package/embark-snark","tags":["snark"]},{"name":"embark-fortune","description":"plugins_page.plugins.fortune.desc","link":"https://www.npmjs.com/package/embark-fortune","thumbnail":"fortune.jpg","tags":["fun"]},{"name":"embark-pug","description":"plugins_page.plugins.pug.desc","link":"https://www.npmjs.com/package/embark-pug","legacy":true,"thumbnail":"pug.png","tags":["pug","jade","templates"]},{"name":"embark-haml","description":"plugins_page.plugins.haml.desc","link":"https://www.npmjs.com/package/embark-haml","legacy":true,"thumbnail":"haml.png","tags":["haml","templates"]},{"name":"embark-mythx","description":"plugins_page.plugins.mythx.desc","link":"https://www.npmjs.com/package/embark-mythx","thumbnail":"mythx.png","tags":["mythx","smart-contracts"]}]},{"_id":"menu","data":{"docs":"/docs/","plugins":"/plugins/","chat":"/chat/","blog":"/news/"}},{"_id":"sidebar","data":{"docs":{"getting_started":{"overview":"overview.html","installation":"installation.html","faq":"faq.html"},"general_usage":{"creating_project":"create_project.html","structure":"structure.html","running_apps":"running_apps.html","dashboard":"dashboard.html","using_the_console":"using_the_console.html","environments":"environments.html","configuration":"configuration.html","pipeline_and_webpack":"pipeline_and_webpack.html","javascript_usage":"javascript_usage.html"},"smart_contracts":{"contracts_configuration":"contracts_configuration.html","contracts_deployment":"contracts_deployment.html","contracts_imports":"contracts_imports.html","contracts_testing":"contracts_testing.html","contracts_javascript":"contracts_javascript.html"},"blockchain_node":{"blockchain_configuration":"blockchain_configuration.html","blockchain_accounts_configuration":"blockchain_accounts_configuration.html"},"storage":{"storage_configuration":"storage_configuration.html","storage_deployment":"storage_deployment.html","storage_javascript":"storage_javascript.html"},"messages":{"messages_configuration":"messages_configuration.html","messages_javascript":"messages_javascript.html"},"naming":{"naming_configuration":"naming_configuration.html","naming_javascript":"naming_javascript.html"},"plugins":{"installing_a_plugin":"installing_plugins.html","creating_a_plugin":"creating_plugins.html","plugin_reference":"plugin_reference.html"},"cockpit":{"cockpit_introduction":"cockpit_introduction.html","cockpit_dashboard":"cockpit_dashboard.html","cockpit_deployment":"cockpit_deployment.html","cockpit_explorer":"cockpit_explorer.html","cockpit_editor":"cockpit_editor.html","cockpit_debugger":"cockpit_debugger.html"},"reference":{"embark_commands":"embark_commands.html"},"miscellaneous":{"migrating_from_3":"migrating_from_3.x.html","troubleshooting":"troubleshooting.html","contributing":"contributing.html"}}}},{"_id":"templates","data":[{"name":"Vyper Template","description":"Template to demonstrate the use of the Vyper contracts","install":"embark new AppName --template vyper","thumbnail":"vyper.png","link":"https://github.com/embarklabs/embark-vyper-template","tags":["vyper","contracts"]},{"name":"Embark Demo React Template","description":"A React Application showcasing Embark's functionality","install":"embark demo","thumbnail":"react.png","link":"https://embark.embarklabs.io/docs/create_project.html#Creating-a-Demo-Project","tags":["react","contracts","whisper","ipfs"]},{"name":"Typescript Template","description":"Template with Typescript support pre-configured","thumbnail":"typescript.png","install":"embark new AppName --template typescript","link":"https://github.com/embarklabs/embark-typescript-template","tags":["typescript","frontend"]},{"name":"Vue.js Template","description":"Ready to use Template for using Embark with vue.js","thumbnail":"vuejs.png","install":"embark new AppName --template vue","link":"https://github.com/embarklabs/embark-vue-template","tags":["vue.js","frontend"]},{"name":"ethvtx Template","description":"Demo app for ethvtx, an Ethereum-Ready & Framework-Agnostic Redux configuration","thumbnail":"vortex.png","install":"embark new AppName --template Horyus/ethvtx_embark","link":"https://github.com/Horyus/ethvtx_embark","tags":["react"]},{"name":"Bamboo Template","description":"Template to demonstrate use of the Bamboo contracts","install":"embark new AppName --template bamboo","thumbnail":"bamboo.png","link":"https://github.com/embarklabs/embark-bamboo-template","tags":["bamboo","contracts"]},{"name":"Solidity Gas Golfing","description":"Boilerplate and tests for the first Solidity Gas Golfing Contest","thumbnail":"sggc.png","install":"embark new AppName --template embarklabs/sggc","link":"https://github.com/embarklabs/sggc","tags":["solidity","tests","fun"]}]},{"_id":"tutorials","data":[{"name":"How to create a Token Factory with Ethereum — Part 1","description":"Create and Deploy a Token with Ethereum","link":"/tutorials/token_factory_1.html","tags":["token","ethereum"]},{"name":"How to create a Token Factory with Ethereum — Part 2","description":"Create a DApp that can deploy Tokens on the fly","link":"/tutorials/token_factory_2.html","tags":["token","ethereum","client-side-deployment"]},{"name":"How to deploy to a testnet with Infura","description":"Deploy and interact with your Dapp on a testnet with the use of Infura","link":"/tutorials/infura_guide.html","tags":["ethereum","deployment","testnet"]}]},{"_id":"versions","data":{"latest":{"label":"stable (v4)","url":"https://embark.embarklabs.io/docs"},"3.2":{"label":"v3.2","url":"https://5ca4e0fdb29712000adde37f--embark-site-versions.netlify.com/docs/"}}}],"Page":[{"title":"blog.header.title","tagline":"blog.header.tagline","layout":"blog","_content":"","source":"index.md","raw":"title: blog.header.title\ntagline: blog.header.tagline\nlayout: blog\n---\n","date":"2020-01-17T19:00:03.900Z","updated":"2020-01-17T19:00:03.900Z","path":"index.html","comments":1,"_id":"ck5ijm3ml00007heg4oeo64fj","content":"","site":{"data":{"authors":{"iuri_matias":{"name":"Iuri Matias","twitter":"iurimatias","image":"https://pbs.twimg.com/profile_images/928272512181563392/iDJdvy2k_400x400.jpg"},"pascal_precht":{"name":"Pascal Precht","twitter":"pascalprecht","image":"https://pbs.twimg.com/profile_images/993785060733194241/p3oAIMDP_400x400.jpg"},"anthony_laibe":{"name":"Anthony Laibe","twitter":"a_laibe","image":"https://pbs.twimg.com/profile_images/257742900/13168239_400x400.jpg"},"jonathan_rainville":{"name":"Jonathan Rainville","twitter":"ShyolGhul","image":"https://pbs.twimg.com/profile_images/993873866878570496/-aE4byjj_400x400.jpg"},"andre_medeiros":{"name":"Andre Medeiros","twitter":"superdealloc","image":"https://pbs.twimg.com/profile_images/965722487735701504/m58KNgWN_400x400.jpg"},"eric_mastro":{"name":"Eric Mastro","twitter":"ericmastro","image":"https://avatars1.githubusercontent.com/u/5089238?s=460&v=4"},"michael_bradley":{"name":"Michael Bradley","image":"https://avatars3.githubusercontent.com/u/194260?s=460&v=4"},"richard_ramos":{"name":"Richard Ramos","twitter":"richardramos_me","image":"https://pbs.twimg.com/profile_images/1063160577973866496/aM313uHG_400x400.jpg"},"jonny_zerah":{"name":"Jonny Zerah","twitter":"jonnyzerah","image":"https://pbs.twimg.com/profile_images/1043774340490248192/gI9aGy17_400x400.jpg"},"robin_percy":{"name":"Robin Percy","twitter":"rbin","image":"https://avatars1.githubusercontent.com/u/29288325?s=400&v=4"}},"categories":{"tutorials":"Tutorials","announcements":"Announcements"},"languages":{"en":"English"},"plugins":[{"name":"embark-bamboo","description":"plugins_page.plugins.bamboo.desc","link":"https://www.npmjs.com/package/embark-bamboo","thumbnail":"bamboo.png","tags":["language","smart-contracts"]},{"name":"embark-solc","description":"plugins_page.plugins.solc.desc","link":"https://www.npmjs.com/package/embark-solc","thumbnail":"solidity.png","tags":["solidity","language","smart-contracts"]},{"name":"embark-solium","description":"plugins_page.plugins.solium.desc","link":"https://www.npmjs.com/package/embark-solium","thumbnail":"solium.png","tags":["linter","solidity","solium"]},{"name":"embark-etherscan-verifier","description":"plugins_page.plugins.verifier.desc","link":"https://www.npmjs.com/package/embark-etherscan-verifier","tags":["solidity","etherscan","smart-contracts"]},{"name":"embark-status","description":"plugins_page.plugins.status.desc","link":"https://www.npmjs.com/package/embark-status-plugin","thumbnail":"status.png","tags":["status","mobile"]},{"name":"embark-remix","description":"plugins_page.plugins.remix.desc","link":"https://www.npmjs.com/package/embark-remix","thumbnail":"remix.png","tags":["remix","debugger"]},{"name":"embark-slither","description":"plugins_page.plugins.slither.desc","link":"https://www.npmjs.com/package/embark-slither","tags":["solidity"]},{"name":"embark-snark","description":"plugins_page.plugins.snark.desc","link":"https://www.npmjs.com/package/embark-snark","tags":["snark"]},{"name":"embark-fortune","description":"plugins_page.plugins.fortune.desc","link":"https://www.npmjs.com/package/embark-fortune","thumbnail":"fortune.jpg","tags":["fun"]},{"name":"embark-pug","description":"plugins_page.plugins.pug.desc","link":"https://www.npmjs.com/package/embark-pug","legacy":true,"thumbnail":"pug.png","tags":["pug","jade","templates"]},{"name":"embark-haml","description":"plugins_page.plugins.haml.desc","link":"https://www.npmjs.com/package/embark-haml","legacy":true,"thumbnail":"haml.png","tags":["haml","templates"]},{"name":"embark-mythx","description":"plugins_page.plugins.mythx.desc","link":"https://www.npmjs.com/package/embark-mythx","thumbnail":"mythx.png","tags":["mythx","smart-contracts"]}],"menu":{"docs":"/docs/","plugins":"/plugins/","chat":"/chat/","blog":"/news/"},"sidebar":{"docs":{"getting_started":{"overview":"overview.html","installation":"installation.html","faq":"faq.html"},"general_usage":{"creating_project":"create_project.html","structure":"structure.html","running_apps":"running_apps.html","dashboard":"dashboard.html","using_the_console":"using_the_console.html","environments":"environments.html","configuration":"configuration.html","pipeline_and_webpack":"pipeline_and_webpack.html","javascript_usage":"javascript_usage.html"},"smart_contracts":{"contracts_configuration":"contracts_configuration.html","contracts_deployment":"contracts_deployment.html","contracts_imports":"contracts_imports.html","contracts_testing":"contracts_testing.html","contracts_javascript":"contracts_javascript.html"},"blockchain_node":{"blockchain_configuration":"blockchain_configuration.html","blockchain_accounts_configuration":"blockchain_accounts_configuration.html"},"storage":{"storage_configuration":"storage_configuration.html","storage_deployment":"storage_deployment.html","storage_javascript":"storage_javascript.html"},"messages":{"messages_configuration":"messages_configuration.html","messages_javascript":"messages_javascript.html"},"naming":{"naming_configuration":"naming_configuration.html","naming_javascript":"naming_javascript.html"},"plugins":{"installing_a_plugin":"installing_plugins.html","creating_a_plugin":"creating_plugins.html","plugin_reference":"plugin_reference.html"},"cockpit":{"cockpit_introduction":"cockpit_introduction.html","cockpit_dashboard":"cockpit_dashboard.html","cockpit_deployment":"cockpit_deployment.html","cockpit_explorer":"cockpit_explorer.html","cockpit_editor":"cockpit_editor.html","cockpit_debugger":"cockpit_debugger.html"},"reference":{"embark_commands":"embark_commands.html"},"miscellaneous":{"migrating_from_3":"migrating_from_3.x.html","troubleshooting":"troubleshooting.html","contributing":"contributing.html"}}},"templates":[{"name":"Vyper Template","description":"Template to demonstrate the use of the Vyper contracts","install":"embark new AppName --template vyper","thumbnail":"vyper.png","link":"https://github.com/embarklabs/embark-vyper-template","tags":["vyper","contracts"]},{"name":"Embark Demo React Template","description":"A React Application showcasing Embark's functionality","install":"embark demo","thumbnail":"react.png","link":"https://embark.embarklabs.io/docs/create_project.html#Creating-a-Demo-Project","tags":["react","contracts","whisper","ipfs"]},{"name":"Typescript Template","description":"Template with Typescript support pre-configured","thumbnail":"typescript.png","install":"embark new AppName --template typescript","link":"https://github.com/embarklabs/embark-typescript-template","tags":["typescript","frontend"]},{"name":"Vue.js Template","description":"Ready to use Template for using Embark with vue.js","thumbnail":"vuejs.png","install":"embark new AppName --template vue","link":"https://github.com/embarklabs/embark-vue-template","tags":["vue.js","frontend"]},{"name":"ethvtx Template","description":"Demo app for ethvtx, an Ethereum-Ready & Framework-Agnostic Redux configuration","thumbnail":"vortex.png","install":"embark new AppName --template Horyus/ethvtx_embark","link":"https://github.com/Horyus/ethvtx_embark","tags":["react"]},{"name":"Bamboo Template","description":"Template to demonstrate use of the Bamboo contracts","install":"embark new AppName --template bamboo","thumbnail":"bamboo.png","link":"https://github.com/embarklabs/embark-bamboo-template","tags":["bamboo","contracts"]},{"name":"Solidity Gas Golfing","description":"Boilerplate and tests for the first Solidity Gas Golfing Contest","thumbnail":"sggc.png","install":"embark new AppName --template embarklabs/sggc","link":"https://github.com/embarklabs/sggc","tags":["solidity","tests","fun"]}],"tutorials":[{"name":"How to create a Token Factory with Ethereum — Part 1","description":"Create and Deploy a Token with Ethereum","link":"/tutorials/token_factory_1.html","tags":["token","ethereum"]},{"name":"How to create a Token Factory with Ethereum — Part 2","description":"Create a DApp that can deploy Tokens on the fly","link":"/tutorials/token_factory_2.html","tags":["token","ethereum","client-side-deployment"]},{"name":"How to deploy to a testnet with Infura","description":"Deploy and interact with your Dapp on a testnet with the use of Infura","link":"/tutorials/infura_guide.html","tags":["ethereum","deployment","testnet"]}],"versions":{"latest":{"label":"stable (v4)","url":"https://embark.embarklabs.io/docs"},"3.2":{"label":"v3.2","url":"https://5ca4e0fdb29712000adde37f--embark-site-versions.netlify.com/docs/"}}}},"excerpt":"","more":""},{"title":"Chat","layout":"chat","_content":"\n

\n Join us at gitter.im/embark-framework/Lobby\n

\n\n\n","source":"chat/index.md","raw":"title: Chat\nlayout: chat\n---\n\n

\n Join us at gitter.im/embark-framework/Lobby\n

\n\n\n","date":"2020-01-17T19:00:03.896Z","updated":"2020-01-17T19:00:03.896Z","path":"chat/index.html","comments":1,"_id":"ck5ijm3qm00027hegfm15h31m","content":"

\n Join us at gitter.im/embark-framework/Lobby\n

\n\n\n","site":{"data":{"authors":{"iuri_matias":{"name":"Iuri Matias","twitter":"iurimatias","image":"https://pbs.twimg.com/profile_images/928272512181563392/iDJdvy2k_400x400.jpg"},"pascal_precht":{"name":"Pascal Precht","twitter":"pascalprecht","image":"https://pbs.twimg.com/profile_images/993785060733194241/p3oAIMDP_400x400.jpg"},"anthony_laibe":{"name":"Anthony Laibe","twitter":"a_laibe","image":"https://pbs.twimg.com/profile_images/257742900/13168239_400x400.jpg"},"jonathan_rainville":{"name":"Jonathan Rainville","twitter":"ShyolGhul","image":"https://pbs.twimg.com/profile_images/993873866878570496/-aE4byjj_400x400.jpg"},"andre_medeiros":{"name":"Andre Medeiros","twitter":"superdealloc","image":"https://pbs.twimg.com/profile_images/965722487735701504/m58KNgWN_400x400.jpg"},"eric_mastro":{"name":"Eric Mastro","twitter":"ericmastro","image":"https://avatars1.githubusercontent.com/u/5089238?s=460&v=4"},"michael_bradley":{"name":"Michael Bradley","image":"https://avatars3.githubusercontent.com/u/194260?s=460&v=4"},"richard_ramos":{"name":"Richard Ramos","twitter":"richardramos_me","image":"https://pbs.twimg.com/profile_images/1063160577973866496/aM313uHG_400x400.jpg"},"jonny_zerah":{"name":"Jonny Zerah","twitter":"jonnyzerah","image":"https://pbs.twimg.com/profile_images/1043774340490248192/gI9aGy17_400x400.jpg"},"robin_percy":{"name":"Robin Percy","twitter":"rbin","image":"https://avatars1.githubusercontent.com/u/29288325?s=400&v=4"}},"categories":{"tutorials":"Tutorials","announcements":"Announcements"},"languages":{"en":"English"},"plugins":[{"name":"embark-bamboo","description":"plugins_page.plugins.bamboo.desc","link":"https://www.npmjs.com/package/embark-bamboo","thumbnail":"bamboo.png","tags":["language","smart-contracts"]},{"name":"embark-solc","description":"plugins_page.plugins.solc.desc","link":"https://www.npmjs.com/package/embark-solc","thumbnail":"solidity.png","tags":["solidity","language","smart-contracts"]},{"name":"embark-solium","description":"plugins_page.plugins.solium.desc","link":"https://www.npmjs.com/package/embark-solium","thumbnail":"solium.png","tags":["linter","solidity","solium"]},{"name":"embark-etherscan-verifier","description":"plugins_page.plugins.verifier.desc","link":"https://www.npmjs.com/package/embark-etherscan-verifier","tags":["solidity","etherscan","smart-contracts"]},{"name":"embark-status","description":"plugins_page.plugins.status.desc","link":"https://www.npmjs.com/package/embark-status-plugin","thumbnail":"status.png","tags":["status","mobile"]},{"name":"embark-remix","description":"plugins_page.plugins.remix.desc","link":"https://www.npmjs.com/package/embark-remix","thumbnail":"remix.png","tags":["remix","debugger"]},{"name":"embark-slither","description":"plugins_page.plugins.slither.desc","link":"https://www.npmjs.com/package/embark-slither","tags":["solidity"]},{"name":"embark-snark","description":"plugins_page.plugins.snark.desc","link":"https://www.npmjs.com/package/embark-snark","tags":["snark"]},{"name":"embark-fortune","description":"plugins_page.plugins.fortune.desc","link":"https://www.npmjs.com/package/embark-fortune","thumbnail":"fortune.jpg","tags":["fun"]},{"name":"embark-pug","description":"plugins_page.plugins.pug.desc","link":"https://www.npmjs.com/package/embark-pug","legacy":true,"thumbnail":"pug.png","tags":["pug","jade","templates"]},{"name":"embark-haml","description":"plugins_page.plugins.haml.desc","link":"https://www.npmjs.com/package/embark-haml","legacy":true,"thumbnail":"haml.png","tags":["haml","templates"]},{"name":"embark-mythx","description":"plugins_page.plugins.mythx.desc","link":"https://www.npmjs.com/package/embark-mythx","thumbnail":"mythx.png","tags":["mythx","smart-contracts"]}],"menu":{"docs":"/docs/","plugins":"/plugins/","chat":"/chat/","blog":"/news/"},"sidebar":{"docs":{"getting_started":{"overview":"overview.html","installation":"installation.html","faq":"faq.html"},"general_usage":{"creating_project":"create_project.html","structure":"structure.html","running_apps":"running_apps.html","dashboard":"dashboard.html","using_the_console":"using_the_console.html","environments":"environments.html","configuration":"configuration.html","pipeline_and_webpack":"pipeline_and_webpack.html","javascript_usage":"javascript_usage.html"},"smart_contracts":{"contracts_configuration":"contracts_configuration.html","contracts_deployment":"contracts_deployment.html","contracts_imports":"contracts_imports.html","contracts_testing":"contracts_testing.html","contracts_javascript":"contracts_javascript.html"},"blockchain_node":{"blockchain_configuration":"blockchain_configuration.html","blockchain_accounts_configuration":"blockchain_accounts_configuration.html"},"storage":{"storage_configuration":"storage_configuration.html","storage_deployment":"storage_deployment.html","storage_javascript":"storage_javascript.html"},"messages":{"messages_configuration":"messages_configuration.html","messages_javascript":"messages_javascript.html"},"naming":{"naming_configuration":"naming_configuration.html","naming_javascript":"naming_javascript.html"},"plugins":{"installing_a_plugin":"installing_plugins.html","creating_a_plugin":"creating_plugins.html","plugin_reference":"plugin_reference.html"},"cockpit":{"cockpit_introduction":"cockpit_introduction.html","cockpit_dashboard":"cockpit_dashboard.html","cockpit_deployment":"cockpit_deployment.html","cockpit_explorer":"cockpit_explorer.html","cockpit_editor":"cockpit_editor.html","cockpit_debugger":"cockpit_debugger.html"},"reference":{"embark_commands":"embark_commands.html"},"miscellaneous":{"migrating_from_3":"migrating_from_3.x.html","troubleshooting":"troubleshooting.html","contributing":"contributing.html"}}},"templates":[{"name":"Vyper Template","description":"Template to demonstrate the use of the Vyper contracts","install":"embark new AppName --template vyper","thumbnail":"vyper.png","link":"https://github.com/embarklabs/embark-vyper-template","tags":["vyper","contracts"]},{"name":"Embark Demo React Template","description":"A React Application showcasing Embark's functionality","install":"embark demo","thumbnail":"react.png","link":"https://embark.embarklabs.io/docs/create_project.html#Creating-a-Demo-Project","tags":["react","contracts","whisper","ipfs"]},{"name":"Typescript Template","description":"Template with Typescript support pre-configured","thumbnail":"typescript.png","install":"embark new AppName --template typescript","link":"https://github.com/embarklabs/embark-typescript-template","tags":["typescript","frontend"]},{"name":"Vue.js Template","description":"Ready to use Template for using Embark with vue.js","thumbnail":"vuejs.png","install":"embark new AppName --template vue","link":"https://github.com/embarklabs/embark-vue-template","tags":["vue.js","frontend"]},{"name":"ethvtx Template","description":"Demo app for ethvtx, an Ethereum-Ready & Framework-Agnostic Redux configuration","thumbnail":"vortex.png","install":"embark new AppName --template Horyus/ethvtx_embark","link":"https://github.com/Horyus/ethvtx_embark","tags":["react"]},{"name":"Bamboo Template","description":"Template to demonstrate use of the Bamboo contracts","install":"embark new AppName --template bamboo","thumbnail":"bamboo.png","link":"https://github.com/embarklabs/embark-bamboo-template","tags":["bamboo","contracts"]},{"name":"Solidity Gas Golfing","description":"Boilerplate and tests for the first Solidity Gas Golfing Contest","thumbnail":"sggc.png","install":"embark new AppName --template embarklabs/sggc","link":"https://github.com/embarklabs/sggc","tags":["solidity","tests","fun"]}],"tutorials":[{"name":"How to create a Token Factory with Ethereum — Part 1","description":"Create and Deploy a Token with Ethereum","link":"/tutorials/token_factory_1.html","tags":["token","ethereum"]},{"name":"How to create a Token Factory with Ethereum — Part 2","description":"Create a DApp that can deploy Tokens on the fly","link":"/tutorials/token_factory_2.html","tags":["token","ethereum","client-side-deployment"]},{"name":"How to deploy to a testnet with Infura","description":"Deploy and interact with your Dapp on a testnet with the use of Infura","link":"/tutorials/infura_guide.html","tags":["ethereum","deployment","testnet"]}],"versions":{"latest":{"label":"stable (v4)","url":"https://embark.embarklabs.io/docs"},"3.2":{"label":"v3.2","url":"https://5ca4e0fdb29712000adde37f--embark-site-versions.netlify.com/docs/"}}}},"excerpt":"","more":"

\n Join us at gitter.im/embark-framework/Lobby\n

\n\n\n"},{"title":"community_page.header.title","tagline":"community_page.header.tagline","link":{"text":"community_page.header.link","href":"https://gitter.im/embark-framework/Lobby"},"layout":"community","_content":"","source":"community/index.md","raw":"title: community_page.header.title\ntagline: community_page.header.tagline\nlink:\n text: community_page.header.link\n href: https://gitter.im/embark-framework/Lobby\nlayout: community\n---\n","date":"2020-01-17T19:00:03.896Z","updated":"2020-01-17T19:00:03.896Z","path":"community/index.html","comments":1,"_id":"ck5ijm3qo00047heg1ev79kfc","content":"","site":{"data":{"authors":{"iuri_matias":{"name":"Iuri Matias","twitter":"iurimatias","image":"https://pbs.twimg.com/profile_images/928272512181563392/iDJdvy2k_400x400.jpg"},"pascal_precht":{"name":"Pascal Precht","twitter":"pascalprecht","image":"https://pbs.twimg.com/profile_images/993785060733194241/p3oAIMDP_400x400.jpg"},"anthony_laibe":{"name":"Anthony Laibe","twitter":"a_laibe","image":"https://pbs.twimg.com/profile_images/257742900/13168239_400x400.jpg"},"jonathan_rainville":{"name":"Jonathan Rainville","twitter":"ShyolGhul","image":"https://pbs.twimg.com/profile_images/993873866878570496/-aE4byjj_400x400.jpg"},"andre_medeiros":{"name":"Andre Medeiros","twitter":"superdealloc","image":"https://pbs.twimg.com/profile_images/965722487735701504/m58KNgWN_400x400.jpg"},"eric_mastro":{"name":"Eric Mastro","twitter":"ericmastro","image":"https://avatars1.githubusercontent.com/u/5089238?s=460&v=4"},"michael_bradley":{"name":"Michael Bradley","image":"https://avatars3.githubusercontent.com/u/194260?s=460&v=4"},"richard_ramos":{"name":"Richard Ramos","twitter":"richardramos_me","image":"https://pbs.twimg.com/profile_images/1063160577973866496/aM313uHG_400x400.jpg"},"jonny_zerah":{"name":"Jonny Zerah","twitter":"jonnyzerah","image":"https://pbs.twimg.com/profile_images/1043774340490248192/gI9aGy17_400x400.jpg"},"robin_percy":{"name":"Robin Percy","twitter":"rbin","image":"https://avatars1.githubusercontent.com/u/29288325?s=400&v=4"}},"categories":{"tutorials":"Tutorials","announcements":"Announcements"},"languages":{"en":"English"},"plugins":[{"name":"embark-bamboo","description":"plugins_page.plugins.bamboo.desc","link":"https://www.npmjs.com/package/embark-bamboo","thumbnail":"bamboo.png","tags":["language","smart-contracts"]},{"name":"embark-solc","description":"plugins_page.plugins.solc.desc","link":"https://www.npmjs.com/package/embark-solc","thumbnail":"solidity.png","tags":["solidity","language","smart-contracts"]},{"name":"embark-solium","description":"plugins_page.plugins.solium.desc","link":"https://www.npmjs.com/package/embark-solium","thumbnail":"solium.png","tags":["linter","solidity","solium"]},{"name":"embark-etherscan-verifier","description":"plugins_page.plugins.verifier.desc","link":"https://www.npmjs.com/package/embark-etherscan-verifier","tags":["solidity","etherscan","smart-contracts"]},{"name":"embark-status","description":"plugins_page.plugins.status.desc","link":"https://www.npmjs.com/package/embark-status-plugin","thumbnail":"status.png","tags":["status","mobile"]},{"name":"embark-remix","description":"plugins_page.plugins.remix.desc","link":"https://www.npmjs.com/package/embark-remix","thumbnail":"remix.png","tags":["remix","debugger"]},{"name":"embark-slither","description":"plugins_page.plugins.slither.desc","link":"https://www.npmjs.com/package/embark-slither","tags":["solidity"]},{"name":"embark-snark","description":"plugins_page.plugins.snark.desc","link":"https://www.npmjs.com/package/embark-snark","tags":["snark"]},{"name":"embark-fortune","description":"plugins_page.plugins.fortune.desc","link":"https://www.npmjs.com/package/embark-fortune","thumbnail":"fortune.jpg","tags":["fun"]},{"name":"embark-pug","description":"plugins_page.plugins.pug.desc","link":"https://www.npmjs.com/package/embark-pug","legacy":true,"thumbnail":"pug.png","tags":["pug","jade","templates"]},{"name":"embark-haml","description":"plugins_page.plugins.haml.desc","link":"https://www.npmjs.com/package/embark-haml","legacy":true,"thumbnail":"haml.png","tags":["haml","templates"]},{"name":"embark-mythx","description":"plugins_page.plugins.mythx.desc","link":"https://www.npmjs.com/package/embark-mythx","thumbnail":"mythx.png","tags":["mythx","smart-contracts"]}],"menu":{"docs":"/docs/","plugins":"/plugins/","chat":"/chat/","blog":"/news/"},"sidebar":{"docs":{"getting_started":{"overview":"overview.html","installation":"installation.html","faq":"faq.html"},"general_usage":{"creating_project":"create_project.html","structure":"structure.html","running_apps":"running_apps.html","dashboard":"dashboard.html","using_the_console":"using_the_console.html","environments":"environments.html","configuration":"configuration.html","pipeline_and_webpack":"pipeline_and_webpack.html","javascript_usage":"javascript_usage.html"},"smart_contracts":{"contracts_configuration":"contracts_configuration.html","contracts_deployment":"contracts_deployment.html","contracts_imports":"contracts_imports.html","contracts_testing":"contracts_testing.html","contracts_javascript":"contracts_javascript.html"},"blockchain_node":{"blockchain_configuration":"blockchain_configuration.html","blockchain_accounts_configuration":"blockchain_accounts_configuration.html"},"storage":{"storage_configuration":"storage_configuration.html","storage_deployment":"storage_deployment.html","storage_javascript":"storage_javascript.html"},"messages":{"messages_configuration":"messages_configuration.html","messages_javascript":"messages_javascript.html"},"naming":{"naming_configuration":"naming_configuration.html","naming_javascript":"naming_javascript.html"},"plugins":{"installing_a_plugin":"installing_plugins.html","creating_a_plugin":"creating_plugins.html","plugin_reference":"plugin_reference.html"},"cockpit":{"cockpit_introduction":"cockpit_introduction.html","cockpit_dashboard":"cockpit_dashboard.html","cockpit_deployment":"cockpit_deployment.html","cockpit_explorer":"cockpit_explorer.html","cockpit_editor":"cockpit_editor.html","cockpit_debugger":"cockpit_debugger.html"},"reference":{"embark_commands":"embark_commands.html"},"miscellaneous":{"migrating_from_3":"migrating_from_3.x.html","troubleshooting":"troubleshooting.html","contributing":"contributing.html"}}},"templates":[{"name":"Vyper Template","description":"Template to demonstrate the use of the Vyper contracts","install":"embark new AppName --template vyper","thumbnail":"vyper.png","link":"https://github.com/embarklabs/embark-vyper-template","tags":["vyper","contracts"]},{"name":"Embark Demo React Template","description":"A React Application showcasing Embark's functionality","install":"embark demo","thumbnail":"react.png","link":"https://embark.embarklabs.io/docs/create_project.html#Creating-a-Demo-Project","tags":["react","contracts","whisper","ipfs"]},{"name":"Typescript Template","description":"Template with Typescript support pre-configured","thumbnail":"typescript.png","install":"embark new AppName --template typescript","link":"https://github.com/embarklabs/embark-typescript-template","tags":["typescript","frontend"]},{"name":"Vue.js Template","description":"Ready to use Template for using Embark with vue.js","thumbnail":"vuejs.png","install":"embark new AppName --template vue","link":"https://github.com/embarklabs/embark-vue-template","tags":["vue.js","frontend"]},{"name":"ethvtx Template","description":"Demo app for ethvtx, an Ethereum-Ready & Framework-Agnostic Redux configuration","thumbnail":"vortex.png","install":"embark new AppName --template Horyus/ethvtx_embark","link":"https://github.com/Horyus/ethvtx_embark","tags":["react"]},{"name":"Bamboo Template","description":"Template to demonstrate use of the Bamboo contracts","install":"embark new AppName --template bamboo","thumbnail":"bamboo.png","link":"https://github.com/embarklabs/embark-bamboo-template","tags":["bamboo","contracts"]},{"name":"Solidity Gas Golfing","description":"Boilerplate and tests for the first Solidity Gas Golfing Contest","thumbnail":"sggc.png","install":"embark new AppName --template embarklabs/sggc","link":"https://github.com/embarklabs/sggc","tags":["solidity","tests","fun"]}],"tutorials":[{"name":"How to create a Token Factory with Ethereum — Part 1","description":"Create and Deploy a Token with Ethereum","link":"/tutorials/token_factory_1.html","tags":["token","ethereum"]},{"name":"How to create a Token Factory with Ethereum — Part 2","description":"Create a DApp that can deploy Tokens on the fly","link":"/tutorials/token_factory_2.html","tags":["token","ethereum","client-side-deployment"]},{"name":"How to deploy to a testnet with Infura","description":"Deploy and interact with your Dapp on a testnet with the use of Infura","link":"/tutorials/infura_guide.html","tags":["ethereum","deployment","testnet"]}],"versions":{"latest":{"label":"stable (v4)","url":"https://embark.embarklabs.io/docs"},"3.2":{"label":"v3.2","url":"https://5ca4e0fdb29712000adde37f--embark-site-versions.netlify.com/docs/"}}}},"excerpt":"","more":""},{"title":"Bamboo Documentation","_content":"\nThe documentation for Bamboo can be found [here](https://github.com/pirapira/bamboo)\n\nTo use Bamboo with Embark you will need to first install the [embark-bamboo](https://github.com/embarklabs/embark-bamboo) plugin\n\n","source":"docs/bamboo.md","raw":"title: Bamboo Documentation\n---\n\nThe documentation for Bamboo can be found [here](https://github.com/pirapira/bamboo)\n\nTo use Bamboo with Embark you will need to first install the [embark-bamboo](https://github.com/embarklabs/embark-bamboo) plugin\n\n","date":"2020-01-19T20:56:53.006Z","updated":"2020-01-19T20:56:53.006Z","path":"docs/bamboo.html","_id":"ck5ijm3qs00077heg6vu1ep31","comments":1,"layout":"page","content":"

The documentation for Bamboo can be found here

\n

To use Bamboo with Embark you will need to first install the embark-bamboo plugin

\n","site":{"data":{"authors":{"iuri_matias":{"name":"Iuri Matias","twitter":"iurimatias","image":"https://pbs.twimg.com/profile_images/928272512181563392/iDJdvy2k_400x400.jpg"},"pascal_precht":{"name":"Pascal Precht","twitter":"pascalprecht","image":"https://pbs.twimg.com/profile_images/993785060733194241/p3oAIMDP_400x400.jpg"},"anthony_laibe":{"name":"Anthony Laibe","twitter":"a_laibe","image":"https://pbs.twimg.com/profile_images/257742900/13168239_400x400.jpg"},"jonathan_rainville":{"name":"Jonathan Rainville","twitter":"ShyolGhul","image":"https://pbs.twimg.com/profile_images/993873866878570496/-aE4byjj_400x400.jpg"},"andre_medeiros":{"name":"Andre Medeiros","twitter":"superdealloc","image":"https://pbs.twimg.com/profile_images/965722487735701504/m58KNgWN_400x400.jpg"},"eric_mastro":{"name":"Eric Mastro","twitter":"ericmastro","image":"https://avatars1.githubusercontent.com/u/5089238?s=460&v=4"},"michael_bradley":{"name":"Michael Bradley","image":"https://avatars3.githubusercontent.com/u/194260?s=460&v=4"},"richard_ramos":{"name":"Richard Ramos","twitter":"richardramos_me","image":"https://pbs.twimg.com/profile_images/1063160577973866496/aM313uHG_400x400.jpg"},"jonny_zerah":{"name":"Jonny Zerah","twitter":"jonnyzerah","image":"https://pbs.twimg.com/profile_images/1043774340490248192/gI9aGy17_400x400.jpg"},"robin_percy":{"name":"Robin Percy","twitter":"rbin","image":"https://avatars1.githubusercontent.com/u/29288325?s=400&v=4"}},"categories":{"tutorials":"Tutorials","announcements":"Announcements"},"languages":{"en":"English"},"plugins":[{"name":"embark-bamboo","description":"plugins_page.plugins.bamboo.desc","link":"https://www.npmjs.com/package/embark-bamboo","thumbnail":"bamboo.png","tags":["language","smart-contracts"]},{"name":"embark-solc","description":"plugins_page.plugins.solc.desc","link":"https://www.npmjs.com/package/embark-solc","thumbnail":"solidity.png","tags":["solidity","language","smart-contracts"]},{"name":"embark-solium","description":"plugins_page.plugins.solium.desc","link":"https://www.npmjs.com/package/embark-solium","thumbnail":"solium.png","tags":["linter","solidity","solium"]},{"name":"embark-etherscan-verifier","description":"plugins_page.plugins.verifier.desc","link":"https://www.npmjs.com/package/embark-etherscan-verifier","tags":["solidity","etherscan","smart-contracts"]},{"name":"embark-status","description":"plugins_page.plugins.status.desc","link":"https://www.npmjs.com/package/embark-status-plugin","thumbnail":"status.png","tags":["status","mobile"]},{"name":"embark-remix","description":"plugins_page.plugins.remix.desc","link":"https://www.npmjs.com/package/embark-remix","thumbnail":"remix.png","tags":["remix","debugger"]},{"name":"embark-slither","description":"plugins_page.plugins.slither.desc","link":"https://www.npmjs.com/package/embark-slither","tags":["solidity"]},{"name":"embark-snark","description":"plugins_page.plugins.snark.desc","link":"https://www.npmjs.com/package/embark-snark","tags":["snark"]},{"name":"embark-fortune","description":"plugins_page.plugins.fortune.desc","link":"https://www.npmjs.com/package/embark-fortune","thumbnail":"fortune.jpg","tags":["fun"]},{"name":"embark-pug","description":"plugins_page.plugins.pug.desc","link":"https://www.npmjs.com/package/embark-pug","legacy":true,"thumbnail":"pug.png","tags":["pug","jade","templates"]},{"name":"embark-haml","description":"plugins_page.plugins.haml.desc","link":"https://www.npmjs.com/package/embark-haml","legacy":true,"thumbnail":"haml.png","tags":["haml","templates"]},{"name":"embark-mythx","description":"plugins_page.plugins.mythx.desc","link":"https://www.npmjs.com/package/embark-mythx","thumbnail":"mythx.png","tags":["mythx","smart-contracts"]}],"menu":{"docs":"/docs/","plugins":"/plugins/","chat":"/chat/","blog":"/news/"},"sidebar":{"docs":{"getting_started":{"overview":"overview.html","installation":"installation.html","faq":"faq.html"},"general_usage":{"creating_project":"create_project.html","structure":"structure.html","running_apps":"running_apps.html","dashboard":"dashboard.html","using_the_console":"using_the_console.html","environments":"environments.html","configuration":"configuration.html","pipeline_and_webpack":"pipeline_and_webpack.html","javascript_usage":"javascript_usage.html"},"smart_contracts":{"contracts_configuration":"contracts_configuration.html","contracts_deployment":"contracts_deployment.html","contracts_imports":"contracts_imports.html","contracts_testing":"contracts_testing.html","contracts_javascript":"contracts_javascript.html"},"blockchain_node":{"blockchain_configuration":"blockchain_configuration.html","blockchain_accounts_configuration":"blockchain_accounts_configuration.html"},"storage":{"storage_configuration":"storage_configuration.html","storage_deployment":"storage_deployment.html","storage_javascript":"storage_javascript.html"},"messages":{"messages_configuration":"messages_configuration.html","messages_javascript":"messages_javascript.html"},"naming":{"naming_configuration":"naming_configuration.html","naming_javascript":"naming_javascript.html"},"plugins":{"installing_a_plugin":"installing_plugins.html","creating_a_plugin":"creating_plugins.html","plugin_reference":"plugin_reference.html"},"cockpit":{"cockpit_introduction":"cockpit_introduction.html","cockpit_dashboard":"cockpit_dashboard.html","cockpit_deployment":"cockpit_deployment.html","cockpit_explorer":"cockpit_explorer.html","cockpit_editor":"cockpit_editor.html","cockpit_debugger":"cockpit_debugger.html"},"reference":{"embark_commands":"embark_commands.html"},"miscellaneous":{"migrating_from_3":"migrating_from_3.x.html","troubleshooting":"troubleshooting.html","contributing":"contributing.html"}}},"templates":[{"name":"Vyper Template","description":"Template to demonstrate the use of the Vyper contracts","install":"embark new AppName --template vyper","thumbnail":"vyper.png","link":"https://github.com/embarklabs/embark-vyper-template","tags":["vyper","contracts"]},{"name":"Embark Demo React Template","description":"A React Application showcasing Embark's functionality","install":"embark demo","thumbnail":"react.png","link":"https://embark.embarklabs.io/docs/create_project.html#Creating-a-Demo-Project","tags":["react","contracts","whisper","ipfs"]},{"name":"Typescript Template","description":"Template with Typescript support pre-configured","thumbnail":"typescript.png","install":"embark new AppName --template typescript","link":"https://github.com/embarklabs/embark-typescript-template","tags":["typescript","frontend"]},{"name":"Vue.js Template","description":"Ready to use Template for using Embark with vue.js","thumbnail":"vuejs.png","install":"embark new AppName --template vue","link":"https://github.com/embarklabs/embark-vue-template","tags":["vue.js","frontend"]},{"name":"ethvtx Template","description":"Demo app for ethvtx, an Ethereum-Ready & Framework-Agnostic Redux configuration","thumbnail":"vortex.png","install":"embark new AppName --template Horyus/ethvtx_embark","link":"https://github.com/Horyus/ethvtx_embark","tags":["react"]},{"name":"Bamboo Template","description":"Template to demonstrate use of the Bamboo contracts","install":"embark new AppName --template bamboo","thumbnail":"bamboo.png","link":"https://github.com/embarklabs/embark-bamboo-template","tags":["bamboo","contracts"]},{"name":"Solidity Gas Golfing","description":"Boilerplate and tests for the first Solidity Gas Golfing Contest","thumbnail":"sggc.png","install":"embark new AppName --template embarklabs/sggc","link":"https://github.com/embarklabs/sggc","tags":["solidity","tests","fun"]}],"tutorials":[{"name":"How to create a Token Factory with Ethereum — Part 1","description":"Create and Deploy a Token with Ethereum","link":"/tutorials/token_factory_1.html","tags":["token","ethereum"]},{"name":"How to create a Token Factory with Ethereum — Part 2","description":"Create a DApp that can deploy Tokens on the fly","link":"/tutorials/token_factory_2.html","tags":["token","ethereum","client-side-deployment"]},{"name":"How to deploy to a testnet with Infura","description":"Deploy and interact with your Dapp on a testnet with the use of Infura","link":"/tutorials/infura_guide.html","tags":["ethereum","deployment","testnet"]}],"versions":{"latest":{"label":"stable (v4)","url":"https://embark.embarklabs.io/docs"},"3.2":{"label":"v3.2","url":"https://5ca4e0fdb29712000adde37f--embark-site-versions.netlify.com/docs/"}}}},"excerpt":"","more":"

The documentation for Bamboo can be found here

\n

To use Bamboo with Embark you will need to first install the embark-bamboo plugin

\n"},{"title":"Accounts Blockchain configuration","layout":"docs","_content":"\nIn our [guide on configuring a blockchain client](/docs/blockchain_configuration.html), we've configured accounts in several places.\n\nThis parameter let's us customize what the `accounts` will be for our deployment, as well as the accounts that will be created and unlocked by our blockchain client.\n\n## Accounts parameters\n\n```\naccounts: [\n {\n nodeAccounts: true,\n numAddresses: \"1\",\n password: \"config/development/devpassword\"\n },\n {\n privateKey: process.env.MyPrivateKey\n },\n {\n privateKeyFile: \"path/to/file\",\n password: process.env.MyKeyStorePassword\n },\n {\n mnemonic: process.env.My12WordsMnemonic,\n addressIndex: \"0\",\n numAddresses: \"1\",\n hdpath: \"m/44'/60'/0'/0/\"\n }\n]\n```\n\nThe `accounts` configuration is an array of objects, where each object represents one or more account.\n\nEmbark offers you multiple ways to include your account. You can use the one you prefer and ignore the others or mix and match.\n\n{% notification danger 'Using production keys' %}\nBe careful when using production keys and mnemonics (ie the account where you have real money).\n\nWe recommend using [environment variables](https://www.schrodinger.com/kb/1842) for plain text values like `privateKey` and `mnemonic` and to put the files for `privateKeyFile` and key stores either out of your working directory or ignored by versioning (eg: add the file in gitignore)\n{% endnotification %}\n\n### Parameter descriptions\n\n- **nodeAccounts**: The actual node accounts, that get created and unlocked by the client\n - Can be enabled by setting it to `true`\n - **numAddresses**: Number of addresses you want from the node. Defaults to `1`\n - **password**: Password file where the password to create and unlock the accounts is. This is required\n- **privateKey**: Private key string\n- **privateKeyFile**: Either a file containing comma separated private keys or a keystore (password needed for the latter). This can also be set to `random` to generate a random account (useful when testing)\n - **password**: Password string for the keystore\n- **mnemonic**: 12 word mnemonic\n - **addressIndex**: Index where to start getting the addresses. Defaults to `0`\n - **numAddresses**: Number of addresses to get. Defaults to `1`\n - **hdpath**: HD derivation path. Defaults to `\"m/44'/60'/0'/0/\"`\n\n{% notification info 'Accounts order' %}\nThe order in the accounts array is important. This means that using `nodeAccounts` first, as above, will set the node's account as the `defaultAccount` for deployment.\n{% endnotification %}\n\n### Configuring account balance for development\n\nWhen in development, we can specify the balance of each account using the `balance` option:\n\n```\nmodule.exports = {\n development: {\n deployment: {\n accounts: [\n {\n mnemonic: \"12 word mnemonic\",\n balance: \"5 ether\"\n }\n ]\n }\n }\n}\n```\n\nBalances can be specified using [human readable units](/docs/contracts_configuration.html#Human-readable-Ether-units) such as \"5 ether\" or \"200 finney\". If no unit is specified the value will be in Wei.\n","source":"docs/blockchain_accounts_configuration.md","raw":"title: Accounts Blockchain configuration\nlayout: docs\n---\n\nIn our [guide on configuring a blockchain client](/docs/blockchain_configuration.html), we've configured accounts in several places.\n\nThis parameter let's us customize what the `accounts` will be for our deployment, as well as the accounts that will be created and unlocked by our blockchain client.\n\n## Accounts parameters\n\n```\naccounts: [\n {\n nodeAccounts: true,\n numAddresses: \"1\",\n password: \"config/development/devpassword\"\n },\n {\n privateKey: process.env.MyPrivateKey\n },\n {\n privateKeyFile: \"path/to/file\",\n password: process.env.MyKeyStorePassword\n },\n {\n mnemonic: process.env.My12WordsMnemonic,\n addressIndex: \"0\",\n numAddresses: \"1\",\n hdpath: \"m/44'/60'/0'/0/\"\n }\n]\n```\n\nThe `accounts` configuration is an array of objects, where each object represents one or more account.\n\nEmbark offers you multiple ways to include your account. You can use the one you prefer and ignore the others or mix and match.\n\n{% notification danger 'Using production keys' %}\nBe careful when using production keys and mnemonics (ie the account where you have real money).\n\nWe recommend using [environment variables](https://www.schrodinger.com/kb/1842) for plain text values like `privateKey` and `mnemonic` and to put the files for `privateKeyFile` and key stores either out of your working directory or ignored by versioning (eg: add the file in gitignore)\n{% endnotification %}\n\n### Parameter descriptions\n\n- **nodeAccounts**: The actual node accounts, that get created and unlocked by the client\n - Can be enabled by setting it to `true`\n - **numAddresses**: Number of addresses you want from the node. Defaults to `1`\n - **password**: Password file where the password to create and unlock the accounts is. This is required\n- **privateKey**: Private key string\n- **privateKeyFile**: Either a file containing comma separated private keys or a keystore (password needed for the latter). This can also be set to `random` to generate a random account (useful when testing)\n - **password**: Password string for the keystore\n- **mnemonic**: 12 word mnemonic\n - **addressIndex**: Index where to start getting the addresses. Defaults to `0`\n - **numAddresses**: Number of addresses to get. Defaults to `1`\n - **hdpath**: HD derivation path. Defaults to `\"m/44'/60'/0'/0/\"`\n\n{% notification info 'Accounts order' %}\nThe order in the accounts array is important. This means that using `nodeAccounts` first, as above, will set the node's account as the `defaultAccount` for deployment.\n{% endnotification %}\n\n### Configuring account balance for development\n\nWhen in development, we can specify the balance of each account using the `balance` option:\n\n```\nmodule.exports = {\n development: {\n deployment: {\n accounts: [\n {\n mnemonic: \"12 word mnemonic\",\n balance: \"5 ether\"\n }\n ]\n }\n }\n}\n```\n\nBalances can be specified using [human readable units](/docs/contracts_configuration.html#Human-readable-Ether-units) such as \"5 ether\" or \"200 finney\". If no unit is specified the value will be in Wei.\n","date":"2020-01-17T19:00:03.896Z","updated":"2020-01-17T19:00:03.896Z","path":"docs/blockchain_accounts_configuration.html","comments":1,"_id":"ck5ijm3qu00097hegey92ab6f","content":"

In our guide on configuring a blockchain client, we’ve configured accounts in several places.

\n

This parameter let’s us customize what the accounts will be for our deployment, as well as the accounts that will be created and unlocked by our blockchain client.

\n

Accounts parameters

accounts: [
{
nodeAccounts: true,
numAddresses: "1",
password: "config/development/devpassword"
},
{
privateKey: process.env.MyPrivateKey
},
{
privateKeyFile: "path/to/file",
password: process.env.MyKeyStorePassword
},
{
mnemonic: process.env.My12WordsMnemonic,
addressIndex: "0",
numAddresses: "1",
hdpath: "m/44'/60'/0'/0/"
}
]
\n\n

The accounts configuration is an array of objects, where each object represents one or more account.

\n

Embark offers you multiple ways to include your account. You can use the one you prefer and ignore the others or mix and match.

\n
\n

Using production keys

\n

Be careful when using production keys and mnemonics (ie the account where you have real money).

\n

We recommend using environment variables for plain text values like privateKey and mnemonic and to put the files for privateKeyFile and key stores either out of your working directory or ignored by versioning (eg: add the file in gitignore)

\n

\n
\n\n\n\n

Parameter descriptions

\n
\n

Accounts order

\n

The order in the accounts array is important. This means that using nodeAccounts first, as above, will set the node’s account as the defaultAccount for deployment.

\n

\n
\n\n\n\n

Configuring account balance for development

When in development, we can specify the balance of each account using the balance option:

\n
module.exports = {
development: {
deployment: {
accounts: [
{
mnemonic: "12 word mnemonic",
balance: "5 ether"
}
]
}
}
}
\n\n

Balances can be specified using human readable units such as “5 ether” or “200 finney”. If no unit is specified the value will be in Wei.

\n","site":{"data":{"authors":{"iuri_matias":{"name":"Iuri Matias","twitter":"iurimatias","image":"https://pbs.twimg.com/profile_images/928272512181563392/iDJdvy2k_400x400.jpg"},"pascal_precht":{"name":"Pascal Precht","twitter":"pascalprecht","image":"https://pbs.twimg.com/profile_images/993785060733194241/p3oAIMDP_400x400.jpg"},"anthony_laibe":{"name":"Anthony Laibe","twitter":"a_laibe","image":"https://pbs.twimg.com/profile_images/257742900/13168239_400x400.jpg"},"jonathan_rainville":{"name":"Jonathan Rainville","twitter":"ShyolGhul","image":"https://pbs.twimg.com/profile_images/993873866878570496/-aE4byjj_400x400.jpg"},"andre_medeiros":{"name":"Andre Medeiros","twitter":"superdealloc","image":"https://pbs.twimg.com/profile_images/965722487735701504/m58KNgWN_400x400.jpg"},"eric_mastro":{"name":"Eric Mastro","twitter":"ericmastro","image":"https://avatars1.githubusercontent.com/u/5089238?s=460&v=4"},"michael_bradley":{"name":"Michael Bradley","image":"https://avatars3.githubusercontent.com/u/194260?s=460&v=4"},"richard_ramos":{"name":"Richard Ramos","twitter":"richardramos_me","image":"https://pbs.twimg.com/profile_images/1063160577973866496/aM313uHG_400x400.jpg"},"jonny_zerah":{"name":"Jonny Zerah","twitter":"jonnyzerah","image":"https://pbs.twimg.com/profile_images/1043774340490248192/gI9aGy17_400x400.jpg"},"robin_percy":{"name":"Robin Percy","twitter":"rbin","image":"https://avatars1.githubusercontent.com/u/29288325?s=400&v=4"}},"categories":{"tutorials":"Tutorials","announcements":"Announcements"},"languages":{"en":"English"},"plugins":[{"name":"embark-bamboo","description":"plugins_page.plugins.bamboo.desc","link":"https://www.npmjs.com/package/embark-bamboo","thumbnail":"bamboo.png","tags":["language","smart-contracts"]},{"name":"embark-solc","description":"plugins_page.plugins.solc.desc","link":"https://www.npmjs.com/package/embark-solc","thumbnail":"solidity.png","tags":["solidity","language","smart-contracts"]},{"name":"embark-solium","description":"plugins_page.plugins.solium.desc","link":"https://www.npmjs.com/package/embark-solium","thumbnail":"solium.png","tags":["linter","solidity","solium"]},{"name":"embark-etherscan-verifier","description":"plugins_page.plugins.verifier.desc","link":"https://www.npmjs.com/package/embark-etherscan-verifier","tags":["solidity","etherscan","smart-contracts"]},{"name":"embark-status","description":"plugins_page.plugins.status.desc","link":"https://www.npmjs.com/package/embark-status-plugin","thumbnail":"status.png","tags":["status","mobile"]},{"name":"embark-remix","description":"plugins_page.plugins.remix.desc","link":"https://www.npmjs.com/package/embark-remix","thumbnail":"remix.png","tags":["remix","debugger"]},{"name":"embark-slither","description":"plugins_page.plugins.slither.desc","link":"https://www.npmjs.com/package/embark-slither","tags":["solidity"]},{"name":"embark-snark","description":"plugins_page.plugins.snark.desc","link":"https://www.npmjs.com/package/embark-snark","tags":["snark"]},{"name":"embark-fortune","description":"plugins_page.plugins.fortune.desc","link":"https://www.npmjs.com/package/embark-fortune","thumbnail":"fortune.jpg","tags":["fun"]},{"name":"embark-pug","description":"plugins_page.plugins.pug.desc","link":"https://www.npmjs.com/package/embark-pug","legacy":true,"thumbnail":"pug.png","tags":["pug","jade","templates"]},{"name":"embark-haml","description":"plugins_page.plugins.haml.desc","link":"https://www.npmjs.com/package/embark-haml","legacy":true,"thumbnail":"haml.png","tags":["haml","templates"]},{"name":"embark-mythx","description":"plugins_page.plugins.mythx.desc","link":"https://www.npmjs.com/package/embark-mythx","thumbnail":"mythx.png","tags":["mythx","smart-contracts"]}],"menu":{"docs":"/docs/","plugins":"/plugins/","chat":"/chat/","blog":"/news/"},"sidebar":{"docs":{"getting_started":{"overview":"overview.html","installation":"installation.html","faq":"faq.html"},"general_usage":{"creating_project":"create_project.html","structure":"structure.html","running_apps":"running_apps.html","dashboard":"dashboard.html","using_the_console":"using_the_console.html","environments":"environments.html","configuration":"configuration.html","pipeline_and_webpack":"pipeline_and_webpack.html","javascript_usage":"javascript_usage.html"},"smart_contracts":{"contracts_configuration":"contracts_configuration.html","contracts_deployment":"contracts_deployment.html","contracts_imports":"contracts_imports.html","contracts_testing":"contracts_testing.html","contracts_javascript":"contracts_javascript.html"},"blockchain_node":{"blockchain_configuration":"blockchain_configuration.html","blockchain_accounts_configuration":"blockchain_accounts_configuration.html"},"storage":{"storage_configuration":"storage_configuration.html","storage_deployment":"storage_deployment.html","storage_javascript":"storage_javascript.html"},"messages":{"messages_configuration":"messages_configuration.html","messages_javascript":"messages_javascript.html"},"naming":{"naming_configuration":"naming_configuration.html","naming_javascript":"naming_javascript.html"},"plugins":{"installing_a_plugin":"installing_plugins.html","creating_a_plugin":"creating_plugins.html","plugin_reference":"plugin_reference.html"},"cockpit":{"cockpit_introduction":"cockpit_introduction.html","cockpit_dashboard":"cockpit_dashboard.html","cockpit_deployment":"cockpit_deployment.html","cockpit_explorer":"cockpit_explorer.html","cockpit_editor":"cockpit_editor.html","cockpit_debugger":"cockpit_debugger.html"},"reference":{"embark_commands":"embark_commands.html"},"miscellaneous":{"migrating_from_3":"migrating_from_3.x.html","troubleshooting":"troubleshooting.html","contributing":"contributing.html"}}},"templates":[{"name":"Vyper Template","description":"Template to demonstrate the use of the Vyper contracts","install":"embark new AppName --template vyper","thumbnail":"vyper.png","link":"https://github.com/embarklabs/embark-vyper-template","tags":["vyper","contracts"]},{"name":"Embark Demo React Template","description":"A React Application showcasing Embark's functionality","install":"embark demo","thumbnail":"react.png","link":"https://embark.embarklabs.io/docs/create_project.html#Creating-a-Demo-Project","tags":["react","contracts","whisper","ipfs"]},{"name":"Typescript Template","description":"Template with Typescript support pre-configured","thumbnail":"typescript.png","install":"embark new AppName --template typescript","link":"https://github.com/embarklabs/embark-typescript-template","tags":["typescript","frontend"]},{"name":"Vue.js Template","description":"Ready to use Template for using Embark with vue.js","thumbnail":"vuejs.png","install":"embark new AppName --template vue","link":"https://github.com/embarklabs/embark-vue-template","tags":["vue.js","frontend"]},{"name":"ethvtx Template","description":"Demo app for ethvtx, an Ethereum-Ready & Framework-Agnostic Redux configuration","thumbnail":"vortex.png","install":"embark new AppName --template Horyus/ethvtx_embark","link":"https://github.com/Horyus/ethvtx_embark","tags":["react"]},{"name":"Bamboo Template","description":"Template to demonstrate use of the Bamboo contracts","install":"embark new AppName --template bamboo","thumbnail":"bamboo.png","link":"https://github.com/embarklabs/embark-bamboo-template","tags":["bamboo","contracts"]},{"name":"Solidity Gas Golfing","description":"Boilerplate and tests for the first Solidity Gas Golfing Contest","thumbnail":"sggc.png","install":"embark new AppName --template embarklabs/sggc","link":"https://github.com/embarklabs/sggc","tags":["solidity","tests","fun"]}],"tutorials":[{"name":"How to create a Token Factory with Ethereum — Part 1","description":"Create and Deploy a Token with Ethereum","link":"/tutorials/token_factory_1.html","tags":["token","ethereum"]},{"name":"How to create a Token Factory with Ethereum — Part 2","description":"Create a DApp that can deploy Tokens on the fly","link":"/tutorials/token_factory_2.html","tags":["token","ethereum","client-side-deployment"]},{"name":"How to deploy to a testnet with Infura","description":"Deploy and interact with your Dapp on a testnet with the use of Infura","link":"/tutorials/infura_guide.html","tags":["ethereum","deployment","testnet"]}],"versions":{"latest":{"label":"stable (v4)","url":"https://embark.embarklabs.io/docs"},"3.2":{"label":"v3.2","url":"https://5ca4e0fdb29712000adde37f--embark-site-versions.netlify.com/docs/"}}}},"excerpt":"","more":"

In our guide on configuring a blockchain client, we’ve configured accounts in several places.

\n

This parameter let’s us customize what the accounts will be for our deployment, as well as the accounts that will be created and unlocked by our blockchain client.

\n

Accounts parameters

accounts: [
{
nodeAccounts: true,
numAddresses: "1",
password: "config/development/devpassword"
},
{
privateKey: process.env.MyPrivateKey
},
{
privateKeyFile: "path/to/file",
password: process.env.MyKeyStorePassword
},
{
mnemonic: process.env.My12WordsMnemonic,
addressIndex: "0",
numAddresses: "1",
hdpath: "m/44'/60'/0'/0/"
}
]
\n\n

The accounts configuration is an array of objects, where each object represents one or more account.

\n

Embark offers you multiple ways to include your account. You can use the one you prefer and ignore the others or mix and match.

\n
\n

Using production keys

\n

Be careful when using production keys and mnemonics (ie the account where you have real money).

\n

We recommend using environment variables for plain text values like privateKey and mnemonic and to put the files for privateKeyFile and key stores either out of your working directory or ignored by versioning (eg: add the file in gitignore)

\n

\n
\n\n\n\n

Parameter descriptions

\n
\n

Accounts order

\n

The order in the accounts array is important. This means that using nodeAccounts first, as above, will set the node’s account as the defaultAccount for deployment.

\n

\n
\n\n\n\n

Configuring account balance for development

When in development, we can specify the balance of each account using the balance option:

\n
module.exports = {
development: {
deployment: {
accounts: [
{
mnemonic: "12 word mnemonic",
balance: "5 ether"
}
]
}
}
}
\n\n

Balances can be specified using human readable units such as “5 ether” or “200 finney”. If no unit is specified the value will be in Wei.

\n"},{"title":"Cockpit Dashboard","layout":"docs","_content":"\nThe first view we're getting when entering Cockpit is its Dashboard view. Consider this your central station when developing, deploying and debugging your application. It has a lot of things to offer, so let's get right to it and take a look!\n\n## Overview\n\n![Cockpit Dashboard](/assets/images/cockpit_dashboard.png)\n\nThe dashboard is separated into different sections, which each of them having a certain responsibility. Here's a brief overview of what these are.\n\n- **Navigation & Search** - At the very top we have the navigation and search. Those are self explanatory, but we'll talk a bit more about search features in a few moments.\n- **Available Services** - Right below we see boxes for services monitoring. These boxes tell us what services are up and running and will respond accordingly when turned off.\n- **Interactive Console** - This is the Cockpit equivalent of Embark's [Interactive Console](/docs/using_the_console.html).\n- **Deployed Smart Contracts** - The current status of deployed Smart Contracts. Again, very similar to Embark's [Dashboard](/docs/dashboard.html).\n\n## Navigation & Search\n\nWe can navigate through different sections and parts of Cockpit by using the links in the navigation bar as shown below. Notice that the active view is also visually reflected in the navigation as well.\n\n![Cockpit Navigation](/assets/images/cockpit_navigation.gif)\n\nCockpit's search is very powerful and lets us easily search for transactions, Smart Contracts, blocks etc. from a single search bar. All we have to do is entering a valid hash, or, in case we're searching for a deployed Smart Contract, entering the name of the Smart Contract works too:\n\n![Cockpit Search](/assets/images/cockpit_search.gif)\n\n## Available Services\n\nAs mentioned above, the available services tell us which processes and services are running and available within our current Embark session. This is simply for monitoring purposes but can be very useful in case any of the processes is crashing or will be turned off. \n\nThe components will reflect their active state in the UI. We can test this easily disabling any of the services using their dedicated configuration files.\n\n## Interactive Console\n\nThis is an equivalent to Embark's [Interactive Console](/docs/using_the_console.html) just in a more rich and interactive fashion. We can use the same commands, however in addition we also get something called **Smart Suggestions**. \n\nWhen typing a command, Embark will provide decent suggestions, making it very easy to explore what command options are available!\n\n![Cockpit Smart Suggestions](/assets/images/cockpit_suggestions.gif)\n\n## Deployed Smart Contracts\n\nAs the name suggests, this sections lists all of our application's deployed Smart Contracts. Not only that, we can click on any of them and get a nice detail view of the Smart Contract within Cockpit's [Explorer](/docs/cockpit_explorer.html).\n\n![Cockpit Dashboard Contracts](/assets/images/cockpit_dashboard_contracts.gif)\n\n## Changing Dark and Light theme\n\nAnother thing that web-based user interfaces enable easily as opposed to others, is changing the appearance of an application. Cockpit implements two different themes to choose from - light and dark. The light theme is the default.\n\nToggling between light and dark theme is as easy as clicking on the cog wheel in the navigation bar and selecting the theme respectively:\n\n![Cockpit change theme](/assets/images/cockpit_change_theme.gif)\n\n","source":"docs/cockpit_dashboard.md","raw":"title: Cockpit Dashboard\nlayout: docs\n---\n\nThe first view we're getting when entering Cockpit is its Dashboard view. Consider this your central station when developing, deploying and debugging your application. It has a lot of things to offer, so let's get right to it and take a look!\n\n## Overview\n\n![Cockpit Dashboard](/assets/images/cockpit_dashboard.png)\n\nThe dashboard is separated into different sections, which each of them having a certain responsibility. Here's a brief overview of what these are.\n\n- **Navigation & Search** - At the very top we have the navigation and search. Those are self explanatory, but we'll talk a bit more about search features in a few moments.\n- **Available Services** - Right below we see boxes for services monitoring. These boxes tell us what services are up and running and will respond accordingly when turned off.\n- **Interactive Console** - This is the Cockpit equivalent of Embark's [Interactive Console](/docs/using_the_console.html).\n- **Deployed Smart Contracts** - The current status of deployed Smart Contracts. Again, very similar to Embark's [Dashboard](/docs/dashboard.html).\n\n## Navigation & Search\n\nWe can navigate through different sections and parts of Cockpit by using the links in the navigation bar as shown below. Notice that the active view is also visually reflected in the navigation as well.\n\n![Cockpit Navigation](/assets/images/cockpit_navigation.gif)\n\nCockpit's search is very powerful and lets us easily search for transactions, Smart Contracts, blocks etc. from a single search bar. All we have to do is entering a valid hash, or, in case we're searching for a deployed Smart Contract, entering the name of the Smart Contract works too:\n\n![Cockpit Search](/assets/images/cockpit_search.gif)\n\n## Available Services\n\nAs mentioned above, the available services tell us which processes and services are running and available within our current Embark session. This is simply for monitoring purposes but can be very useful in case any of the processes is crashing or will be turned off. \n\nThe components will reflect their active state in the UI. We can test this easily disabling any of the services using their dedicated configuration files.\n\n## Interactive Console\n\nThis is an equivalent to Embark's [Interactive Console](/docs/using_the_console.html) just in a more rich and interactive fashion. We can use the same commands, however in addition we also get something called **Smart Suggestions**. \n\nWhen typing a command, Embark will provide decent suggestions, making it very easy to explore what command options are available!\n\n![Cockpit Smart Suggestions](/assets/images/cockpit_suggestions.gif)\n\n## Deployed Smart Contracts\n\nAs the name suggests, this sections lists all of our application's deployed Smart Contracts. Not only that, we can click on any of them and get a nice detail view of the Smart Contract within Cockpit's [Explorer](/docs/cockpit_explorer.html).\n\n![Cockpit Dashboard Contracts](/assets/images/cockpit_dashboard_contracts.gif)\n\n## Changing Dark and Light theme\n\nAnother thing that web-based user interfaces enable easily as opposed to others, is changing the appearance of an application. Cockpit implements two different themes to choose from - light and dark. The light theme is the default.\n\nToggling between light and dark theme is as easy as clicking on the cog wheel in the navigation bar and selecting the theme respectively:\n\n![Cockpit change theme](/assets/images/cockpit_change_theme.gif)\n\n","date":"2020-01-17T19:00:03.896Z","updated":"2020-01-17T19:00:03.896Z","path":"docs/cockpit_dashboard.html","comments":1,"_id":"ck5ijm3qw000c7hegdljfdyw4","content":"

The first view we’re getting when entering Cockpit is its Dashboard view. Consider this your central station when developing, deploying and debugging your application. It has a lot of things to offer, so let’s get right to it and take a look!

\n

Overview

\"Cockpit

\n

The dashboard is separated into different sections, which each of them having a certain responsibility. Here’s a brief overview of what these are.

\n\n

Navigation & Search

We can navigate through different sections and parts of Cockpit by using the links in the navigation bar as shown below. Notice that the active view is also visually reflected in the navigation as well.

\n

\"Cockpit

\n

Cockpit’s search is very powerful and lets us easily search for transactions, Smart Contracts, blocks etc. from a single search bar. All we have to do is entering a valid hash, or, in case we’re searching for a deployed Smart Contract, entering the name of the Smart Contract works too:

\n

\"Cockpit

\n

Available Services

As mentioned above, the available services tell us which processes and services are running and available within our current Embark session. This is simply for monitoring purposes but can be very useful in case any of the processes is crashing or will be turned off.

\n

The components will reflect their active state in the UI. We can test this easily disabling any of the services using their dedicated configuration files.

\n

Interactive Console

This is an equivalent to Embark’s Interactive Console just in a more rich and interactive fashion. We can use the same commands, however in addition we also get something called Smart Suggestions.

\n

When typing a command, Embark will provide decent suggestions, making it very easy to explore what command options are available!

\n

\"Cockpit

\n

Deployed Smart Contracts

As the name suggests, this sections lists all of our application’s deployed Smart Contracts. Not only that, we can click on any of them and get a nice detail view of the Smart Contract within Cockpit’s Explorer.

\n

\"Cockpit

\n

Changing Dark and Light theme

Another thing that web-based user interfaces enable easily as opposed to others, is changing the appearance of an application. Cockpit implements two different themes to choose from - light and dark. The light theme is the default.

\n

Toggling between light and dark theme is as easy as clicking on the cog wheel in the navigation bar and selecting the theme respectively:

\n

\"Cockpit

\n","site":{"data":{"authors":{"iuri_matias":{"name":"Iuri Matias","twitter":"iurimatias","image":"https://pbs.twimg.com/profile_images/928272512181563392/iDJdvy2k_400x400.jpg"},"pascal_precht":{"name":"Pascal Precht","twitter":"pascalprecht","image":"https://pbs.twimg.com/profile_images/993785060733194241/p3oAIMDP_400x400.jpg"},"anthony_laibe":{"name":"Anthony Laibe","twitter":"a_laibe","image":"https://pbs.twimg.com/profile_images/257742900/13168239_400x400.jpg"},"jonathan_rainville":{"name":"Jonathan Rainville","twitter":"ShyolGhul","image":"https://pbs.twimg.com/profile_images/993873866878570496/-aE4byjj_400x400.jpg"},"andre_medeiros":{"name":"Andre Medeiros","twitter":"superdealloc","image":"https://pbs.twimg.com/profile_images/965722487735701504/m58KNgWN_400x400.jpg"},"eric_mastro":{"name":"Eric Mastro","twitter":"ericmastro","image":"https://avatars1.githubusercontent.com/u/5089238?s=460&v=4"},"michael_bradley":{"name":"Michael Bradley","image":"https://avatars3.githubusercontent.com/u/194260?s=460&v=4"},"richard_ramos":{"name":"Richard Ramos","twitter":"richardramos_me","image":"https://pbs.twimg.com/profile_images/1063160577973866496/aM313uHG_400x400.jpg"},"jonny_zerah":{"name":"Jonny Zerah","twitter":"jonnyzerah","image":"https://pbs.twimg.com/profile_images/1043774340490248192/gI9aGy17_400x400.jpg"},"robin_percy":{"name":"Robin Percy","twitter":"rbin","image":"https://avatars1.githubusercontent.com/u/29288325?s=400&v=4"}},"categories":{"tutorials":"Tutorials","announcements":"Announcements"},"languages":{"en":"English"},"plugins":[{"name":"embark-bamboo","description":"plugins_page.plugins.bamboo.desc","link":"https://www.npmjs.com/package/embark-bamboo","thumbnail":"bamboo.png","tags":["language","smart-contracts"]},{"name":"embark-solc","description":"plugins_page.plugins.solc.desc","link":"https://www.npmjs.com/package/embark-solc","thumbnail":"solidity.png","tags":["solidity","language","smart-contracts"]},{"name":"embark-solium","description":"plugins_page.plugins.solium.desc","link":"https://www.npmjs.com/package/embark-solium","thumbnail":"solium.png","tags":["linter","solidity","solium"]},{"name":"embark-etherscan-verifier","description":"plugins_page.plugins.verifier.desc","link":"https://www.npmjs.com/package/embark-etherscan-verifier","tags":["solidity","etherscan","smart-contracts"]},{"name":"embark-status","description":"plugins_page.plugins.status.desc","link":"https://www.npmjs.com/package/embark-status-plugin","thumbnail":"status.png","tags":["status","mobile"]},{"name":"embark-remix","description":"plugins_page.plugins.remix.desc","link":"https://www.npmjs.com/package/embark-remix","thumbnail":"remix.png","tags":["remix","debugger"]},{"name":"embark-slither","description":"plugins_page.plugins.slither.desc","link":"https://www.npmjs.com/package/embark-slither","tags":["solidity"]},{"name":"embark-snark","description":"plugins_page.plugins.snark.desc","link":"https://www.npmjs.com/package/embark-snark","tags":["snark"]},{"name":"embark-fortune","description":"plugins_page.plugins.fortune.desc","link":"https://www.npmjs.com/package/embark-fortune","thumbnail":"fortune.jpg","tags":["fun"]},{"name":"embark-pug","description":"plugins_page.plugins.pug.desc","link":"https://www.npmjs.com/package/embark-pug","legacy":true,"thumbnail":"pug.png","tags":["pug","jade","templates"]},{"name":"embark-haml","description":"plugins_page.plugins.haml.desc","link":"https://www.npmjs.com/package/embark-haml","legacy":true,"thumbnail":"haml.png","tags":["haml","templates"]},{"name":"embark-mythx","description":"plugins_page.plugins.mythx.desc","link":"https://www.npmjs.com/package/embark-mythx","thumbnail":"mythx.png","tags":["mythx","smart-contracts"]}],"menu":{"docs":"/docs/","plugins":"/plugins/","chat":"/chat/","blog":"/news/"},"sidebar":{"docs":{"getting_started":{"overview":"overview.html","installation":"installation.html","faq":"faq.html"},"general_usage":{"creating_project":"create_project.html","structure":"structure.html","running_apps":"running_apps.html","dashboard":"dashboard.html","using_the_console":"using_the_console.html","environments":"environments.html","configuration":"configuration.html","pipeline_and_webpack":"pipeline_and_webpack.html","javascript_usage":"javascript_usage.html"},"smart_contracts":{"contracts_configuration":"contracts_configuration.html","contracts_deployment":"contracts_deployment.html","contracts_imports":"contracts_imports.html","contracts_testing":"contracts_testing.html","contracts_javascript":"contracts_javascript.html"},"blockchain_node":{"blockchain_configuration":"blockchain_configuration.html","blockchain_accounts_configuration":"blockchain_accounts_configuration.html"},"storage":{"storage_configuration":"storage_configuration.html","storage_deployment":"storage_deployment.html","storage_javascript":"storage_javascript.html"},"messages":{"messages_configuration":"messages_configuration.html","messages_javascript":"messages_javascript.html"},"naming":{"naming_configuration":"naming_configuration.html","naming_javascript":"naming_javascript.html"},"plugins":{"installing_a_plugin":"installing_plugins.html","creating_a_plugin":"creating_plugins.html","plugin_reference":"plugin_reference.html"},"cockpit":{"cockpit_introduction":"cockpit_introduction.html","cockpit_dashboard":"cockpit_dashboard.html","cockpit_deployment":"cockpit_deployment.html","cockpit_explorer":"cockpit_explorer.html","cockpit_editor":"cockpit_editor.html","cockpit_debugger":"cockpit_debugger.html"},"reference":{"embark_commands":"embark_commands.html"},"miscellaneous":{"migrating_from_3":"migrating_from_3.x.html","troubleshooting":"troubleshooting.html","contributing":"contributing.html"}}},"templates":[{"name":"Vyper Template","description":"Template to demonstrate the use of the Vyper contracts","install":"embark new AppName --template vyper","thumbnail":"vyper.png","link":"https://github.com/embarklabs/embark-vyper-template","tags":["vyper","contracts"]},{"name":"Embark Demo React Template","description":"A React Application showcasing Embark's functionality","install":"embark demo","thumbnail":"react.png","link":"https://embark.embarklabs.io/docs/create_project.html#Creating-a-Demo-Project","tags":["react","contracts","whisper","ipfs"]},{"name":"Typescript Template","description":"Template with Typescript support pre-configured","thumbnail":"typescript.png","install":"embark new AppName --template typescript","link":"https://github.com/embarklabs/embark-typescript-template","tags":["typescript","frontend"]},{"name":"Vue.js Template","description":"Ready to use Template for using Embark with vue.js","thumbnail":"vuejs.png","install":"embark new AppName --template vue","link":"https://github.com/embarklabs/embark-vue-template","tags":["vue.js","frontend"]},{"name":"ethvtx Template","description":"Demo app for ethvtx, an Ethereum-Ready & Framework-Agnostic Redux configuration","thumbnail":"vortex.png","install":"embark new AppName --template Horyus/ethvtx_embark","link":"https://github.com/Horyus/ethvtx_embark","tags":["react"]},{"name":"Bamboo Template","description":"Template to demonstrate use of the Bamboo contracts","install":"embark new AppName --template bamboo","thumbnail":"bamboo.png","link":"https://github.com/embarklabs/embark-bamboo-template","tags":["bamboo","contracts"]},{"name":"Solidity Gas Golfing","description":"Boilerplate and tests for the first Solidity Gas Golfing Contest","thumbnail":"sggc.png","install":"embark new AppName --template embarklabs/sggc","link":"https://github.com/embarklabs/sggc","tags":["solidity","tests","fun"]}],"tutorials":[{"name":"How to create a Token Factory with Ethereum — Part 1","description":"Create and Deploy a Token with Ethereum","link":"/tutorials/token_factory_1.html","tags":["token","ethereum"]},{"name":"How to create a Token Factory with Ethereum — Part 2","description":"Create a DApp that can deploy Tokens on the fly","link":"/tutorials/token_factory_2.html","tags":["token","ethereum","client-side-deployment"]},{"name":"How to deploy to a testnet with Infura","description":"Deploy and interact with your Dapp on a testnet with the use of Infura","link":"/tutorials/infura_guide.html","tags":["ethereum","deployment","testnet"]}],"versions":{"latest":{"label":"stable (v4)","url":"https://embark.embarklabs.io/docs"},"3.2":{"label":"v3.2","url":"https://5ca4e0fdb29712000adde37f--embark-site-versions.netlify.com/docs/"}}}},"excerpt":"","more":"

The first view we’re getting when entering Cockpit is its Dashboard view. Consider this your central station when developing, deploying and debugging your application. It has a lot of things to offer, so let’s get right to it and take a look!

\n

Overview

\"Cockpit

\n

The dashboard is separated into different sections, which each of them having a certain responsibility. Here’s a brief overview of what these are.

\n\n

Navigation & Search

We can navigate through different sections and parts of Cockpit by using the links in the navigation bar as shown below. Notice that the active view is also visually reflected in the navigation as well.

\n

\"Cockpit

\n

Cockpit’s search is very powerful and lets us easily search for transactions, Smart Contracts, blocks etc. from a single search bar. All we have to do is entering a valid hash, or, in case we’re searching for a deployed Smart Contract, entering the name of the Smart Contract works too:

\n

\"Cockpit

\n

Available Services

As mentioned above, the available services tell us which processes and services are running and available within our current Embark session. This is simply for monitoring purposes but can be very useful in case any of the processes is crashing or will be turned off.

\n

The components will reflect their active state in the UI. We can test this easily disabling any of the services using their dedicated configuration files.

\n

Interactive Console

This is an equivalent to Embark’s Interactive Console just in a more rich and interactive fashion. We can use the same commands, however in addition we also get something called Smart Suggestions.

\n

When typing a command, Embark will provide decent suggestions, making it very easy to explore what command options are available!

\n

\"Cockpit

\n

Deployed Smart Contracts

As the name suggests, this sections lists all of our application’s deployed Smart Contracts. Not only that, we can click on any of them and get a nice detail view of the Smart Contract within Cockpit’s Explorer.

\n

\"Cockpit

\n

Changing Dark and Light theme

Another thing that web-based user interfaces enable easily as opposed to others, is changing the appearance of an application. Cockpit implements two different themes to choose from - light and dark. The light theme is the default.

\n

Toggling between light and dark theme is as easy as clicking on the cog wheel in the navigation bar and selecting the theme respectively:

\n

\"Cockpit

\n"},{"title":"Deploying with Cockpit","layout":"docs","_content":"\nCockpit offers an additional deployment experience that enables developers to deploy their application's Smart Contracts in an **iterative** and **selective** fashion. In this guide we'll take a closer look at how this works.\n\n## Viewing Smart Contracts\n\nWhen entering the deployment view, the first thing we see is the status of all our application's deployed contracts, similar to [Embark's dashboard](/docs/dashboard.html).\n\nNext to their addresses, we see the arguments that have been used to initialized each and every Smart Contract. \n\nClicking on any of the Smart Contracts opens up a detail view through which we even can call methods associated to that Smart Contract.\n\n![Cockpit Contract View](/assets/images/cockpit_contracts_view.gif)\n\n## Selective deployment\n\nWith the deployment view, it's possible to selectively deploy any of our application's Smart Contracts. By default, Embark will take care of deploying our Smart Contracts based on configurations discussed in our guide on [managing accounts](/docs/blockchain_accounts_configuration.html).\n\nHowever, we can use an injected Web3 instance, for example provided by extensions like Metamask, and select individual Smart Contracts for deployment.\n\nTo make this work, we need to have Metamask setup, and activate the \"Injected Web3\" switch as shown below. Once activated, we can specify values used for initializing our Smart Contracts, as well as performing a gas estimation: \n\n![Cockpit Selective Deployment](/assets/images/cockpit_selective_deployment.gif)\n","source":"docs/cockpit_deployment.md","raw":"title: Deploying with Cockpit\nlayout: docs\n---\n\nCockpit offers an additional deployment experience that enables developers to deploy their application's Smart Contracts in an **iterative** and **selective** fashion. In this guide we'll take a closer look at how this works.\n\n## Viewing Smart Contracts\n\nWhen entering the deployment view, the first thing we see is the status of all our application's deployed contracts, similar to [Embark's dashboard](/docs/dashboard.html).\n\nNext to their addresses, we see the arguments that have been used to initialized each and every Smart Contract. \n\nClicking on any of the Smart Contracts opens up a detail view through which we even can call methods associated to that Smart Contract.\n\n![Cockpit Contract View](/assets/images/cockpit_contracts_view.gif)\n\n## Selective deployment\n\nWith the deployment view, it's possible to selectively deploy any of our application's Smart Contracts. By default, Embark will take care of deploying our Smart Contracts based on configurations discussed in our guide on [managing accounts](/docs/blockchain_accounts_configuration.html).\n\nHowever, we can use an injected Web3 instance, for example provided by extensions like Metamask, and select individual Smart Contracts for deployment.\n\nTo make this work, we need to have Metamask setup, and activate the \"Injected Web3\" switch as shown below. Once activated, we can specify values used for initializing our Smart Contracts, as well as performing a gas estimation: \n\n![Cockpit Selective Deployment](/assets/images/cockpit_selective_deployment.gif)\n","date":"2020-01-17T19:00:03.896Z","updated":"2020-01-17T19:00:03.896Z","path":"docs/cockpit_deployment.html","comments":1,"_id":"ck5ijm3qz000e7heg6asods5b","content":"

Cockpit offers an additional deployment experience that enables developers to deploy their application’s Smart Contracts in an iterative and selective fashion. In this guide we’ll take a closer look at how this works.

\n

Viewing Smart Contracts

When entering the deployment view, the first thing we see is the status of all our application’s deployed contracts, similar to Embark’s dashboard.

\n

Next to their addresses, we see the arguments that have been used to initialized each and every Smart Contract.

\n

Clicking on any of the Smart Contracts opens up a detail view through which we even can call methods associated to that Smart Contract.

\n

\"Cockpit

\n

Selective deployment

With the deployment view, it’s possible to selectively deploy any of our application’s Smart Contracts. By default, Embark will take care of deploying our Smart Contracts based on configurations discussed in our guide on managing accounts.

\n

However, we can use an injected Web3 instance, for example provided by extensions like Metamask, and select individual Smart Contracts for deployment.

\n

To make this work, we need to have Metamask setup, and activate the “Injected Web3” switch as shown below. Once activated, we can specify values used for initializing our Smart Contracts, as well as performing a gas estimation:

\n

\"Cockpit

\n","site":{"data":{"authors":{"iuri_matias":{"name":"Iuri Matias","twitter":"iurimatias","image":"https://pbs.twimg.com/profile_images/928272512181563392/iDJdvy2k_400x400.jpg"},"pascal_precht":{"name":"Pascal Precht","twitter":"pascalprecht","image":"https://pbs.twimg.com/profile_images/993785060733194241/p3oAIMDP_400x400.jpg"},"anthony_laibe":{"name":"Anthony Laibe","twitter":"a_laibe","image":"https://pbs.twimg.com/profile_images/257742900/13168239_400x400.jpg"},"jonathan_rainville":{"name":"Jonathan Rainville","twitter":"ShyolGhul","image":"https://pbs.twimg.com/profile_images/993873866878570496/-aE4byjj_400x400.jpg"},"andre_medeiros":{"name":"Andre Medeiros","twitter":"superdealloc","image":"https://pbs.twimg.com/profile_images/965722487735701504/m58KNgWN_400x400.jpg"},"eric_mastro":{"name":"Eric Mastro","twitter":"ericmastro","image":"https://avatars1.githubusercontent.com/u/5089238?s=460&v=4"},"michael_bradley":{"name":"Michael Bradley","image":"https://avatars3.githubusercontent.com/u/194260?s=460&v=4"},"richard_ramos":{"name":"Richard Ramos","twitter":"richardramos_me","image":"https://pbs.twimg.com/profile_images/1063160577973866496/aM313uHG_400x400.jpg"},"jonny_zerah":{"name":"Jonny Zerah","twitter":"jonnyzerah","image":"https://pbs.twimg.com/profile_images/1043774340490248192/gI9aGy17_400x400.jpg"},"robin_percy":{"name":"Robin Percy","twitter":"rbin","image":"https://avatars1.githubusercontent.com/u/29288325?s=400&v=4"}},"categories":{"tutorials":"Tutorials","announcements":"Announcements"},"languages":{"en":"English"},"plugins":[{"name":"embark-bamboo","description":"plugins_page.plugins.bamboo.desc","link":"https://www.npmjs.com/package/embark-bamboo","thumbnail":"bamboo.png","tags":["language","smart-contracts"]},{"name":"embark-solc","description":"plugins_page.plugins.solc.desc","link":"https://www.npmjs.com/package/embark-solc","thumbnail":"solidity.png","tags":["solidity","language","smart-contracts"]},{"name":"embark-solium","description":"plugins_page.plugins.solium.desc","link":"https://www.npmjs.com/package/embark-solium","thumbnail":"solium.png","tags":["linter","solidity","solium"]},{"name":"embark-etherscan-verifier","description":"plugins_page.plugins.verifier.desc","link":"https://www.npmjs.com/package/embark-etherscan-verifier","tags":["solidity","etherscan","smart-contracts"]},{"name":"embark-status","description":"plugins_page.plugins.status.desc","link":"https://www.npmjs.com/package/embark-status-plugin","thumbnail":"status.png","tags":["status","mobile"]},{"name":"embark-remix","description":"plugins_page.plugins.remix.desc","link":"https://www.npmjs.com/package/embark-remix","thumbnail":"remix.png","tags":["remix","debugger"]},{"name":"embark-slither","description":"plugins_page.plugins.slither.desc","link":"https://www.npmjs.com/package/embark-slither","tags":["solidity"]},{"name":"embark-snark","description":"plugins_page.plugins.snark.desc","link":"https://www.npmjs.com/package/embark-snark","tags":["snark"]},{"name":"embark-fortune","description":"plugins_page.plugins.fortune.desc","link":"https://www.npmjs.com/package/embark-fortune","thumbnail":"fortune.jpg","tags":["fun"]},{"name":"embark-pug","description":"plugins_page.plugins.pug.desc","link":"https://www.npmjs.com/package/embark-pug","legacy":true,"thumbnail":"pug.png","tags":["pug","jade","templates"]},{"name":"embark-haml","description":"plugins_page.plugins.haml.desc","link":"https://www.npmjs.com/package/embark-haml","legacy":true,"thumbnail":"haml.png","tags":["haml","templates"]},{"name":"embark-mythx","description":"plugins_page.plugins.mythx.desc","link":"https://www.npmjs.com/package/embark-mythx","thumbnail":"mythx.png","tags":["mythx","smart-contracts"]}],"menu":{"docs":"/docs/","plugins":"/plugins/","chat":"/chat/","blog":"/news/"},"sidebar":{"docs":{"getting_started":{"overview":"overview.html","installation":"installation.html","faq":"faq.html"},"general_usage":{"creating_project":"create_project.html","structure":"structure.html","running_apps":"running_apps.html","dashboard":"dashboard.html","using_the_console":"using_the_console.html","environments":"environments.html","configuration":"configuration.html","pipeline_and_webpack":"pipeline_and_webpack.html","javascript_usage":"javascript_usage.html"},"smart_contracts":{"contracts_configuration":"contracts_configuration.html","contracts_deployment":"contracts_deployment.html","contracts_imports":"contracts_imports.html","contracts_testing":"contracts_testing.html","contracts_javascript":"contracts_javascript.html"},"blockchain_node":{"blockchain_configuration":"blockchain_configuration.html","blockchain_accounts_configuration":"blockchain_accounts_configuration.html"},"storage":{"storage_configuration":"storage_configuration.html","storage_deployment":"storage_deployment.html","storage_javascript":"storage_javascript.html"},"messages":{"messages_configuration":"messages_configuration.html","messages_javascript":"messages_javascript.html"},"naming":{"naming_configuration":"naming_configuration.html","naming_javascript":"naming_javascript.html"},"plugins":{"installing_a_plugin":"installing_plugins.html","creating_a_plugin":"creating_plugins.html","plugin_reference":"plugin_reference.html"},"cockpit":{"cockpit_introduction":"cockpit_introduction.html","cockpit_dashboard":"cockpit_dashboard.html","cockpit_deployment":"cockpit_deployment.html","cockpit_explorer":"cockpit_explorer.html","cockpit_editor":"cockpit_editor.html","cockpit_debugger":"cockpit_debugger.html"},"reference":{"embark_commands":"embark_commands.html"},"miscellaneous":{"migrating_from_3":"migrating_from_3.x.html","troubleshooting":"troubleshooting.html","contributing":"contributing.html"}}},"templates":[{"name":"Vyper Template","description":"Template to demonstrate the use of the Vyper contracts","install":"embark new AppName --template vyper","thumbnail":"vyper.png","link":"https://github.com/embarklabs/embark-vyper-template","tags":["vyper","contracts"]},{"name":"Embark Demo React Template","description":"A React Application showcasing Embark's functionality","install":"embark demo","thumbnail":"react.png","link":"https://embark.embarklabs.io/docs/create_project.html#Creating-a-Demo-Project","tags":["react","contracts","whisper","ipfs"]},{"name":"Typescript Template","description":"Template with Typescript support pre-configured","thumbnail":"typescript.png","install":"embark new AppName --template typescript","link":"https://github.com/embarklabs/embark-typescript-template","tags":["typescript","frontend"]},{"name":"Vue.js Template","description":"Ready to use Template for using Embark with vue.js","thumbnail":"vuejs.png","install":"embark new AppName --template vue","link":"https://github.com/embarklabs/embark-vue-template","tags":["vue.js","frontend"]},{"name":"ethvtx Template","description":"Demo app for ethvtx, an Ethereum-Ready & Framework-Agnostic Redux configuration","thumbnail":"vortex.png","install":"embark new AppName --template Horyus/ethvtx_embark","link":"https://github.com/Horyus/ethvtx_embark","tags":["react"]},{"name":"Bamboo Template","description":"Template to demonstrate use of the Bamboo contracts","install":"embark new AppName --template bamboo","thumbnail":"bamboo.png","link":"https://github.com/embarklabs/embark-bamboo-template","tags":["bamboo","contracts"]},{"name":"Solidity Gas Golfing","description":"Boilerplate and tests for the first Solidity Gas Golfing Contest","thumbnail":"sggc.png","install":"embark new AppName --template embarklabs/sggc","link":"https://github.com/embarklabs/sggc","tags":["solidity","tests","fun"]}],"tutorials":[{"name":"How to create a Token Factory with Ethereum — Part 1","description":"Create and Deploy a Token with Ethereum","link":"/tutorials/token_factory_1.html","tags":["token","ethereum"]},{"name":"How to create a Token Factory with Ethereum — Part 2","description":"Create a DApp that can deploy Tokens on the fly","link":"/tutorials/token_factory_2.html","tags":["token","ethereum","client-side-deployment"]},{"name":"How to deploy to a testnet with Infura","description":"Deploy and interact with your Dapp on a testnet with the use of Infura","link":"/tutorials/infura_guide.html","tags":["ethereum","deployment","testnet"]}],"versions":{"latest":{"label":"stable (v4)","url":"https://embark.embarklabs.io/docs"},"3.2":{"label":"v3.2","url":"https://5ca4e0fdb29712000adde37f--embark-site-versions.netlify.com/docs/"}}}},"excerpt":"","more":"

Cockpit offers an additional deployment experience that enables developers to deploy their application’s Smart Contracts in an iterative and selective fashion. In this guide we’ll take a closer look at how this works.

\n

Viewing Smart Contracts

When entering the deployment view, the first thing we see is the status of all our application’s deployed contracts, similar to Embark’s dashboard.

\n

Next to their addresses, we see the arguments that have been used to initialized each and every Smart Contract.

\n

Clicking on any of the Smart Contracts opens up a detail view through which we even can call methods associated to that Smart Contract.

\n

\"Cockpit

\n

Selective deployment

With the deployment view, it’s possible to selectively deploy any of our application’s Smart Contracts. By default, Embark will take care of deploying our Smart Contracts based on configurations discussed in our guide on managing accounts.

\n

However, we can use an injected Web3 instance, for example provided by extensions like Metamask, and select individual Smart Contracts for deployment.

\n

To make this work, we need to have Metamask setup, and activate the “Injected Web3” switch as shown below. Once activated, we can specify values used for initializing our Smart Contracts, as well as performing a gas estimation:

\n

\"Cockpit

\n"},{"title":"Cockpit Editor","layout":"docs","_content":"\nCockpit comes with a web-based code editor that enables us to change our application's source code on the fly. Just like any other typical editor, it has a file tree, can open multiple source files and lets us add and delete files.\n\n## Additional features for Smart Contract files\n\nWhen opening a Smart Contract source file in Cockpit's editor, we'll get additional features and options to work with. These features are **Interact**, **Details** and **Transactions**, very similar to the ones we've discussed in [Exploring Smart Contracts](/docs/cockpit_explorer.html#Exploring-Smart-Contracts).\n\nCockpit will open up dedicated view for each of these in another in-pane window as shown below:\n\n\n![Cockpit Navigation](/assets/images/cockpit_editor.gif)\n\n","source":"docs/cockpit_editor.md","raw":"title: Cockpit Editor\nlayout: docs\n---\n\nCockpit comes with a web-based code editor that enables us to change our application's source code on the fly. Just like any other typical editor, it has a file tree, can open multiple source files and lets us add and delete files.\n\n## Additional features for Smart Contract files\n\nWhen opening a Smart Contract source file in Cockpit's editor, we'll get additional features and options to work with. These features are **Interact**, **Details** and **Transactions**, very similar to the ones we've discussed in [Exploring Smart Contracts](/docs/cockpit_explorer.html#Exploring-Smart-Contracts).\n\nCockpit will open up dedicated view for each of these in another in-pane window as shown below:\n\n\n![Cockpit Navigation](/assets/images/cockpit_editor.gif)\n\n","date":"2020-01-17T19:00:03.896Z","updated":"2020-01-17T19:00:03.896Z","path":"docs/cockpit_editor.html","comments":1,"_id":"ck5ijm3r2000i7heg6nkq7sik","content":"

Cockpit comes with a web-based code editor that enables us to change our application’s source code on the fly. Just like any other typical editor, it has a file tree, can open multiple source files and lets us add and delete files.

\n

Additional features for Smart Contract files

When opening a Smart Contract source file in Cockpit’s editor, we’ll get additional features and options to work with. These features are Interact, Details and Transactions, very similar to the ones we’ve discussed in Exploring Smart Contracts.

\n

Cockpit will open up dedicated view for each of these in another in-pane window as shown below:

\n

\"Cockpit

\n","site":{"data":{"authors":{"iuri_matias":{"name":"Iuri Matias","twitter":"iurimatias","image":"https://pbs.twimg.com/profile_images/928272512181563392/iDJdvy2k_400x400.jpg"},"pascal_precht":{"name":"Pascal Precht","twitter":"pascalprecht","image":"https://pbs.twimg.com/profile_images/993785060733194241/p3oAIMDP_400x400.jpg"},"anthony_laibe":{"name":"Anthony Laibe","twitter":"a_laibe","image":"https://pbs.twimg.com/profile_images/257742900/13168239_400x400.jpg"},"jonathan_rainville":{"name":"Jonathan Rainville","twitter":"ShyolGhul","image":"https://pbs.twimg.com/profile_images/993873866878570496/-aE4byjj_400x400.jpg"},"andre_medeiros":{"name":"Andre Medeiros","twitter":"superdealloc","image":"https://pbs.twimg.com/profile_images/965722487735701504/m58KNgWN_400x400.jpg"},"eric_mastro":{"name":"Eric Mastro","twitter":"ericmastro","image":"https://avatars1.githubusercontent.com/u/5089238?s=460&v=4"},"michael_bradley":{"name":"Michael Bradley","image":"https://avatars3.githubusercontent.com/u/194260?s=460&v=4"},"richard_ramos":{"name":"Richard Ramos","twitter":"richardramos_me","image":"https://pbs.twimg.com/profile_images/1063160577973866496/aM313uHG_400x400.jpg"},"jonny_zerah":{"name":"Jonny Zerah","twitter":"jonnyzerah","image":"https://pbs.twimg.com/profile_images/1043774340490248192/gI9aGy17_400x400.jpg"},"robin_percy":{"name":"Robin Percy","twitter":"rbin","image":"https://avatars1.githubusercontent.com/u/29288325?s=400&v=4"}},"categories":{"tutorials":"Tutorials","announcements":"Announcements"},"languages":{"en":"English"},"plugins":[{"name":"embark-bamboo","description":"plugins_page.plugins.bamboo.desc","link":"https://www.npmjs.com/package/embark-bamboo","thumbnail":"bamboo.png","tags":["language","smart-contracts"]},{"name":"embark-solc","description":"plugins_page.plugins.solc.desc","link":"https://www.npmjs.com/package/embark-solc","thumbnail":"solidity.png","tags":["solidity","language","smart-contracts"]},{"name":"embark-solium","description":"plugins_page.plugins.solium.desc","link":"https://www.npmjs.com/package/embark-solium","thumbnail":"solium.png","tags":["linter","solidity","solium"]},{"name":"embark-etherscan-verifier","description":"plugins_page.plugins.verifier.desc","link":"https://www.npmjs.com/package/embark-etherscan-verifier","tags":["solidity","etherscan","smart-contracts"]},{"name":"embark-status","description":"plugins_page.plugins.status.desc","link":"https://www.npmjs.com/package/embark-status-plugin","thumbnail":"status.png","tags":["status","mobile"]},{"name":"embark-remix","description":"plugins_page.plugins.remix.desc","link":"https://www.npmjs.com/package/embark-remix","thumbnail":"remix.png","tags":["remix","debugger"]},{"name":"embark-slither","description":"plugins_page.plugins.slither.desc","link":"https://www.npmjs.com/package/embark-slither","tags":["solidity"]},{"name":"embark-snark","description":"plugins_page.plugins.snark.desc","link":"https://www.npmjs.com/package/embark-snark","tags":["snark"]},{"name":"embark-fortune","description":"plugins_page.plugins.fortune.desc","link":"https://www.npmjs.com/package/embark-fortune","thumbnail":"fortune.jpg","tags":["fun"]},{"name":"embark-pug","description":"plugins_page.plugins.pug.desc","link":"https://www.npmjs.com/package/embark-pug","legacy":true,"thumbnail":"pug.png","tags":["pug","jade","templates"]},{"name":"embark-haml","description":"plugins_page.plugins.haml.desc","link":"https://www.npmjs.com/package/embark-haml","legacy":true,"thumbnail":"haml.png","tags":["haml","templates"]},{"name":"embark-mythx","description":"plugins_page.plugins.mythx.desc","link":"https://www.npmjs.com/package/embark-mythx","thumbnail":"mythx.png","tags":["mythx","smart-contracts"]}],"menu":{"docs":"/docs/","plugins":"/plugins/","chat":"/chat/","blog":"/news/"},"sidebar":{"docs":{"getting_started":{"overview":"overview.html","installation":"installation.html","faq":"faq.html"},"general_usage":{"creating_project":"create_project.html","structure":"structure.html","running_apps":"running_apps.html","dashboard":"dashboard.html","using_the_console":"using_the_console.html","environments":"environments.html","configuration":"configuration.html","pipeline_and_webpack":"pipeline_and_webpack.html","javascript_usage":"javascript_usage.html"},"smart_contracts":{"contracts_configuration":"contracts_configuration.html","contracts_deployment":"contracts_deployment.html","contracts_imports":"contracts_imports.html","contracts_testing":"contracts_testing.html","contracts_javascript":"contracts_javascript.html"},"blockchain_node":{"blockchain_configuration":"blockchain_configuration.html","blockchain_accounts_configuration":"blockchain_accounts_configuration.html"},"storage":{"storage_configuration":"storage_configuration.html","storage_deployment":"storage_deployment.html","storage_javascript":"storage_javascript.html"},"messages":{"messages_configuration":"messages_configuration.html","messages_javascript":"messages_javascript.html"},"naming":{"naming_configuration":"naming_configuration.html","naming_javascript":"naming_javascript.html"},"plugins":{"installing_a_plugin":"installing_plugins.html","creating_a_plugin":"creating_plugins.html","plugin_reference":"plugin_reference.html"},"cockpit":{"cockpit_introduction":"cockpit_introduction.html","cockpit_dashboard":"cockpit_dashboard.html","cockpit_deployment":"cockpit_deployment.html","cockpit_explorer":"cockpit_explorer.html","cockpit_editor":"cockpit_editor.html","cockpit_debugger":"cockpit_debugger.html"},"reference":{"embark_commands":"embark_commands.html"},"miscellaneous":{"migrating_from_3":"migrating_from_3.x.html","troubleshooting":"troubleshooting.html","contributing":"contributing.html"}}},"templates":[{"name":"Vyper Template","description":"Template to demonstrate the use of the Vyper contracts","install":"embark new AppName --template vyper","thumbnail":"vyper.png","link":"https://github.com/embarklabs/embark-vyper-template","tags":["vyper","contracts"]},{"name":"Embark Demo React Template","description":"A React Application showcasing Embark's functionality","install":"embark demo","thumbnail":"react.png","link":"https://embark.embarklabs.io/docs/create_project.html#Creating-a-Demo-Project","tags":["react","contracts","whisper","ipfs"]},{"name":"Typescript Template","description":"Template with Typescript support pre-configured","thumbnail":"typescript.png","install":"embark new AppName --template typescript","link":"https://github.com/embarklabs/embark-typescript-template","tags":["typescript","frontend"]},{"name":"Vue.js Template","description":"Ready to use Template for using Embark with vue.js","thumbnail":"vuejs.png","install":"embark new AppName --template vue","link":"https://github.com/embarklabs/embark-vue-template","tags":["vue.js","frontend"]},{"name":"ethvtx Template","description":"Demo app for ethvtx, an Ethereum-Ready & Framework-Agnostic Redux configuration","thumbnail":"vortex.png","install":"embark new AppName --template Horyus/ethvtx_embark","link":"https://github.com/Horyus/ethvtx_embark","tags":["react"]},{"name":"Bamboo Template","description":"Template to demonstrate use of the Bamboo contracts","install":"embark new AppName --template bamboo","thumbnail":"bamboo.png","link":"https://github.com/embarklabs/embark-bamboo-template","tags":["bamboo","contracts"]},{"name":"Solidity Gas Golfing","description":"Boilerplate and tests for the first Solidity Gas Golfing Contest","thumbnail":"sggc.png","install":"embark new AppName --template embarklabs/sggc","link":"https://github.com/embarklabs/sggc","tags":["solidity","tests","fun"]}],"tutorials":[{"name":"How to create a Token Factory with Ethereum — Part 1","description":"Create and Deploy a Token with Ethereum","link":"/tutorials/token_factory_1.html","tags":["token","ethereum"]},{"name":"How to create a Token Factory with Ethereum — Part 2","description":"Create a DApp that can deploy Tokens on the fly","link":"/tutorials/token_factory_2.html","tags":["token","ethereum","client-side-deployment"]},{"name":"How to deploy to a testnet with Infura","description":"Deploy and interact with your Dapp on a testnet with the use of Infura","link":"/tutorials/infura_guide.html","tags":["ethereum","deployment","testnet"]}],"versions":{"latest":{"label":"stable (v4)","url":"https://embark.embarklabs.io/docs"},"3.2":{"label":"v3.2","url":"https://5ca4e0fdb29712000adde37f--embark-site-versions.netlify.com/docs/"}}}},"excerpt":"","more":"

Cockpit comes with a web-based code editor that enables us to change our application’s source code on the fly. Just like any other typical editor, it has a file tree, can open multiple source files and lets us add and delete files.

\n

Additional features for Smart Contract files

When opening a Smart Contract source file in Cockpit’s editor, we’ll get additional features and options to work with. These features are Interact, Details and Transactions, very similar to the ones we’ve discussed in Exploring Smart Contracts.

\n

Cockpit will open up dedicated view for each of these in another in-pane window as shown below:

\n

\"Cockpit

\n"},{"title":"Cockpit Explorer","layout":"docs","_content":"\nThe Explorer view in Cockpit provides an easy and accessible way to browse your way through Smart Contracts, accounts, blocks and transactions. \n\n## Overview\n\nIn the overview of the Explorer we see a aggregation of available accounts, mind blocks and performed transactions. Each of these are paginated, making it easy to navigate through them:\n\n![Cockpit Explorer Overview](/assets/images/cockpit_explorer_overview.png)\n\n## Viewing Accounts\n\nAccount detail view can be accessed by clicking on an account address or hash. The account detail view then not only displays data about the account, but also all transactions associated with the account.\n\nThis makes it very convenient to find transactions, if we're aiming to find any that belong to a certain account.\n![Cockpit Contract View](/assets/images/cockpit_explorer_account.gif)\n\n## Viewing Blocks\n\nBlocks can be inspected as well, just by clicking on their hash. This will open up a block detail view that contains all the data attached to the block in question, including transactions that ended up in there.\n\n![Cockpit Explorer Block](/assets/images/cockpit_explorer_block.png)\n\n## Viewing Transactions\n\nIt's no surprise that Cockpit's Explorer offers a view for inspecting transactions as well. Clicking on a transaction hash takes us to the detail view, rendering all relevant transaction data.\n\n![Cockpit Contract View](/assets/images/cockpit_explorer_transactions.gif)\n\n## Exploring Smart Contracts\n\nWe can extract a lot of information about our deploy Smart Contract instances in the Explorer. When entering a Smart Contract view, we can choose to open any of the available tabs:\n\n- **Interact** - Call methods on your Smart Contract instance\n- **Details** - View the ABI and byte code of your Smart Contract\n- **Transactions** - List and explore all transactions and events associated with that Smart Contract instnace\n\n\n![Cockpit Contract View](/assets/images/cockpit_explorer_contracts_detail.gif)\n\n","source":"docs/cockpit_explorer.md","raw":"title: Cockpit Explorer\nlayout: docs\n---\n\nThe Explorer view in Cockpit provides an easy and accessible way to browse your way through Smart Contracts, accounts, blocks and transactions. \n\n## Overview\n\nIn the overview of the Explorer we see a aggregation of available accounts, mind blocks and performed transactions. Each of these are paginated, making it easy to navigate through them:\n\n![Cockpit Explorer Overview](/assets/images/cockpit_explorer_overview.png)\n\n## Viewing Accounts\n\nAccount detail view can be accessed by clicking on an account address or hash. The account detail view then not only displays data about the account, but also all transactions associated with the account.\n\nThis makes it very convenient to find transactions, if we're aiming to find any that belong to a certain account.\n![Cockpit Contract View](/assets/images/cockpit_explorer_account.gif)\n\n## Viewing Blocks\n\nBlocks can be inspected as well, just by clicking on their hash. This will open up a block detail view that contains all the data attached to the block in question, including transactions that ended up in there.\n\n![Cockpit Explorer Block](/assets/images/cockpit_explorer_block.png)\n\n## Viewing Transactions\n\nIt's no surprise that Cockpit's Explorer offers a view for inspecting transactions as well. Clicking on a transaction hash takes us to the detail view, rendering all relevant transaction data.\n\n![Cockpit Contract View](/assets/images/cockpit_explorer_transactions.gif)\n\n## Exploring Smart Contracts\n\nWe can extract a lot of information about our deploy Smart Contract instances in the Explorer. When entering a Smart Contract view, we can choose to open any of the available tabs:\n\n- **Interact** - Call methods on your Smart Contract instance\n- **Details** - View the ABI and byte code of your Smart Contract\n- **Transactions** - List and explore all transactions and events associated with that Smart Contract instnace\n\n\n![Cockpit Contract View](/assets/images/cockpit_explorer_contracts_detail.gif)\n\n","date":"2020-01-17T19:00:03.896Z","updated":"2020-01-17T19:00:03.896Z","path":"docs/cockpit_explorer.html","comments":1,"_id":"ck5ijm3r5000l7hegcvmc7q55","content":"

The Explorer view in Cockpit provides an easy and accessible way to browse your way through Smart Contracts, accounts, blocks and transactions.

\n

Overview

In the overview of the Explorer we see a aggregation of available accounts, mind blocks and performed transactions. Each of these are paginated, making it easy to navigate through them:

\n

\"Cockpit

\n

Viewing Accounts

Account detail view can be accessed by clicking on an account address or hash. The account detail view then not only displays data about the account, but also all transactions associated with the account.

\n

This makes it very convenient to find transactions, if we’re aiming to find any that belong to a certain account.
\"Cockpit

\n

Viewing Blocks

Blocks can be inspected as well, just by clicking on their hash. This will open up a block detail view that contains all the data attached to the block in question, including transactions that ended up in there.

\n

\"Cockpit

\n

Viewing Transactions

It’s no surprise that Cockpit’s Explorer offers a view for inspecting transactions as well. Clicking on a transaction hash takes us to the detail view, rendering all relevant transaction data.

\n

\"Cockpit

\n

Exploring Smart Contracts

We can extract a lot of information about our deploy Smart Contract instances in the Explorer. When entering a Smart Contract view, we can choose to open any of the available tabs:

\n\n

\"Cockpit

\n","site":{"data":{"authors":{"iuri_matias":{"name":"Iuri Matias","twitter":"iurimatias","image":"https://pbs.twimg.com/profile_images/928272512181563392/iDJdvy2k_400x400.jpg"},"pascal_precht":{"name":"Pascal Precht","twitter":"pascalprecht","image":"https://pbs.twimg.com/profile_images/993785060733194241/p3oAIMDP_400x400.jpg"},"anthony_laibe":{"name":"Anthony Laibe","twitter":"a_laibe","image":"https://pbs.twimg.com/profile_images/257742900/13168239_400x400.jpg"},"jonathan_rainville":{"name":"Jonathan Rainville","twitter":"ShyolGhul","image":"https://pbs.twimg.com/profile_images/993873866878570496/-aE4byjj_400x400.jpg"},"andre_medeiros":{"name":"Andre Medeiros","twitter":"superdealloc","image":"https://pbs.twimg.com/profile_images/965722487735701504/m58KNgWN_400x400.jpg"},"eric_mastro":{"name":"Eric Mastro","twitter":"ericmastro","image":"https://avatars1.githubusercontent.com/u/5089238?s=460&v=4"},"michael_bradley":{"name":"Michael Bradley","image":"https://avatars3.githubusercontent.com/u/194260?s=460&v=4"},"richard_ramos":{"name":"Richard Ramos","twitter":"richardramos_me","image":"https://pbs.twimg.com/profile_images/1063160577973866496/aM313uHG_400x400.jpg"},"jonny_zerah":{"name":"Jonny Zerah","twitter":"jonnyzerah","image":"https://pbs.twimg.com/profile_images/1043774340490248192/gI9aGy17_400x400.jpg"},"robin_percy":{"name":"Robin Percy","twitter":"rbin","image":"https://avatars1.githubusercontent.com/u/29288325?s=400&v=4"}},"categories":{"tutorials":"Tutorials","announcements":"Announcements"},"languages":{"en":"English"},"plugins":[{"name":"embark-bamboo","description":"plugins_page.plugins.bamboo.desc","link":"https://www.npmjs.com/package/embark-bamboo","thumbnail":"bamboo.png","tags":["language","smart-contracts"]},{"name":"embark-solc","description":"plugins_page.plugins.solc.desc","link":"https://www.npmjs.com/package/embark-solc","thumbnail":"solidity.png","tags":["solidity","language","smart-contracts"]},{"name":"embark-solium","description":"plugins_page.plugins.solium.desc","link":"https://www.npmjs.com/package/embark-solium","thumbnail":"solium.png","tags":["linter","solidity","solium"]},{"name":"embark-etherscan-verifier","description":"plugins_page.plugins.verifier.desc","link":"https://www.npmjs.com/package/embark-etherscan-verifier","tags":["solidity","etherscan","smart-contracts"]},{"name":"embark-status","description":"plugins_page.plugins.status.desc","link":"https://www.npmjs.com/package/embark-status-plugin","thumbnail":"status.png","tags":["status","mobile"]},{"name":"embark-remix","description":"plugins_page.plugins.remix.desc","link":"https://www.npmjs.com/package/embark-remix","thumbnail":"remix.png","tags":["remix","debugger"]},{"name":"embark-slither","description":"plugins_page.plugins.slither.desc","link":"https://www.npmjs.com/package/embark-slither","tags":["solidity"]},{"name":"embark-snark","description":"plugins_page.plugins.snark.desc","link":"https://www.npmjs.com/package/embark-snark","tags":["snark"]},{"name":"embark-fortune","description":"plugins_page.plugins.fortune.desc","link":"https://www.npmjs.com/package/embark-fortune","thumbnail":"fortune.jpg","tags":["fun"]},{"name":"embark-pug","description":"plugins_page.plugins.pug.desc","link":"https://www.npmjs.com/package/embark-pug","legacy":true,"thumbnail":"pug.png","tags":["pug","jade","templates"]},{"name":"embark-haml","description":"plugins_page.plugins.haml.desc","link":"https://www.npmjs.com/package/embark-haml","legacy":true,"thumbnail":"haml.png","tags":["haml","templates"]},{"name":"embark-mythx","description":"plugins_page.plugins.mythx.desc","link":"https://www.npmjs.com/package/embark-mythx","thumbnail":"mythx.png","tags":["mythx","smart-contracts"]}],"menu":{"docs":"/docs/","plugins":"/plugins/","chat":"/chat/","blog":"/news/"},"sidebar":{"docs":{"getting_started":{"overview":"overview.html","installation":"installation.html","faq":"faq.html"},"general_usage":{"creating_project":"create_project.html","structure":"structure.html","running_apps":"running_apps.html","dashboard":"dashboard.html","using_the_console":"using_the_console.html","environments":"environments.html","configuration":"configuration.html","pipeline_and_webpack":"pipeline_and_webpack.html","javascript_usage":"javascript_usage.html"},"smart_contracts":{"contracts_configuration":"contracts_configuration.html","contracts_deployment":"contracts_deployment.html","contracts_imports":"contracts_imports.html","contracts_testing":"contracts_testing.html","contracts_javascript":"contracts_javascript.html"},"blockchain_node":{"blockchain_configuration":"blockchain_configuration.html","blockchain_accounts_configuration":"blockchain_accounts_configuration.html"},"storage":{"storage_configuration":"storage_configuration.html","storage_deployment":"storage_deployment.html","storage_javascript":"storage_javascript.html"},"messages":{"messages_configuration":"messages_configuration.html","messages_javascript":"messages_javascript.html"},"naming":{"naming_configuration":"naming_configuration.html","naming_javascript":"naming_javascript.html"},"plugins":{"installing_a_plugin":"installing_plugins.html","creating_a_plugin":"creating_plugins.html","plugin_reference":"plugin_reference.html"},"cockpit":{"cockpit_introduction":"cockpit_introduction.html","cockpit_dashboard":"cockpit_dashboard.html","cockpit_deployment":"cockpit_deployment.html","cockpit_explorer":"cockpit_explorer.html","cockpit_editor":"cockpit_editor.html","cockpit_debugger":"cockpit_debugger.html"},"reference":{"embark_commands":"embark_commands.html"},"miscellaneous":{"migrating_from_3":"migrating_from_3.x.html","troubleshooting":"troubleshooting.html","contributing":"contributing.html"}}},"templates":[{"name":"Vyper Template","description":"Template to demonstrate the use of the Vyper contracts","install":"embark new AppName --template vyper","thumbnail":"vyper.png","link":"https://github.com/embarklabs/embark-vyper-template","tags":["vyper","contracts"]},{"name":"Embark Demo React Template","description":"A React Application showcasing Embark's functionality","install":"embark demo","thumbnail":"react.png","link":"https://embark.embarklabs.io/docs/create_project.html#Creating-a-Demo-Project","tags":["react","contracts","whisper","ipfs"]},{"name":"Typescript Template","description":"Template with Typescript support pre-configured","thumbnail":"typescript.png","install":"embark new AppName --template typescript","link":"https://github.com/embarklabs/embark-typescript-template","tags":["typescript","frontend"]},{"name":"Vue.js Template","description":"Ready to use Template for using Embark with vue.js","thumbnail":"vuejs.png","install":"embark new AppName --template vue","link":"https://github.com/embarklabs/embark-vue-template","tags":["vue.js","frontend"]},{"name":"ethvtx Template","description":"Demo app for ethvtx, an Ethereum-Ready & Framework-Agnostic Redux configuration","thumbnail":"vortex.png","install":"embark new AppName --template Horyus/ethvtx_embark","link":"https://github.com/Horyus/ethvtx_embark","tags":["react"]},{"name":"Bamboo Template","description":"Template to demonstrate use of the Bamboo contracts","install":"embark new AppName --template bamboo","thumbnail":"bamboo.png","link":"https://github.com/embarklabs/embark-bamboo-template","tags":["bamboo","contracts"]},{"name":"Solidity Gas Golfing","description":"Boilerplate and tests for the first Solidity Gas Golfing Contest","thumbnail":"sggc.png","install":"embark new AppName --template embarklabs/sggc","link":"https://github.com/embarklabs/sggc","tags":["solidity","tests","fun"]}],"tutorials":[{"name":"How to create a Token Factory with Ethereum — Part 1","description":"Create and Deploy a Token with Ethereum","link":"/tutorials/token_factory_1.html","tags":["token","ethereum"]},{"name":"How to create a Token Factory with Ethereum — Part 2","description":"Create a DApp that can deploy Tokens on the fly","link":"/tutorials/token_factory_2.html","tags":["token","ethereum","client-side-deployment"]},{"name":"How to deploy to a testnet with Infura","description":"Deploy and interact with your Dapp on a testnet with the use of Infura","link":"/tutorials/infura_guide.html","tags":["ethereum","deployment","testnet"]}],"versions":{"latest":{"label":"stable (v4)","url":"https://embark.embarklabs.io/docs"},"3.2":{"label":"v3.2","url":"https://5ca4e0fdb29712000adde37f--embark-site-versions.netlify.com/docs/"}}}},"excerpt":"","more":"

The Explorer view in Cockpit provides an easy and accessible way to browse your way through Smart Contracts, accounts, blocks and transactions.

\n

Overview

In the overview of the Explorer we see a aggregation of available accounts, mind blocks and performed transactions. Each of these are paginated, making it easy to navigate through them:

\n

\"Cockpit

\n

Viewing Accounts

Account detail view can be accessed by clicking on an account address or hash. The account detail view then not only displays data about the account, but also all transactions associated with the account.

\n

This makes it very convenient to find transactions, if we’re aiming to find any that belong to a certain account.
\"Cockpit

\n

Viewing Blocks

Blocks can be inspected as well, just by clicking on their hash. This will open up a block detail view that contains all the data attached to the block in question, including transactions that ended up in there.

\n

\"Cockpit

\n

Viewing Transactions

It’s no surprise that Cockpit’s Explorer offers a view for inspecting transactions as well. Clicking on a transaction hash takes us to the detail view, rendering all relevant transaction data.

\n

\"Cockpit

\n

Exploring Smart Contracts

We can extract a lot of information about our deploy Smart Contract instances in the Explorer. When entering a Smart Contract view, we can choose to open any of the available tabs:

\n\n

\"Cockpit

\n"},{"title":"Introduction to Cockpit","layout":"docs","_content":"\nProbably one of Embark's most exciting features is its companion web interface Cockpit. With Cockpit, we're aiming for offering an alternative and more powerful interface to make developing and debugging decentralized applications even easier.\n\nThroughout the following sections we'll take a closer look at Cockpit's features and how we can use it to improve our developer experience when working with Embark!\n\n{% notification info 'A note on Cockpit availability' %}\nPlease note that Cockpit is a feature that ships since Embark version 4.0 and is not available in or for previous versions of Embark.\n{% endnotification %}\n\n## What is Cockpit?\n\nCockpit is a web application that ships with Embark since version 4.0. It's an alternative and sometimes more powerful interface in comparison to [Embark's dashboard](/docs/dashboard.html), that connects to any existing Embark process. Since it's web-based, Cockpit offers a much richer and more interactive user interface, with additional tools and features that can't be found in Embark otherwise.\n\nSome of Cockpit's features are:\n\n- **Dashboard** - A highly interactive real-time dashboard with service monitoring and deployment status\n- **Selective Deployment** - A deployment interface that gives you fine-grain control over when and how your Smart Contracts are deployed\n- **Explorer** - A built-in blockchain explorer making it easy to explore blocks, transactions and accounts\n- **Code Editor** - A web-based code editor, enabling changing your application's source on the fly\n- **Utilities** - Powerful utility tools, including ENS, a transaction decoder and more\n\nCockpit is actively developed and implements new features on a regular basis.\n\n## Starting Cockpit\n\nCockpit can be used as soon as Embark has been spinned up in any of our applications. As mentioned in our guide on [running apps](/docs/running_apps.html), Embark will start Cockpit as part of the run process. In fact, Embark even outputs a message, telling us how to open Cockpit:\n\n```\nAccess the web backend with the following url: http://localhost:55555?token=xxxxx-xxxxx-xxxxx-xxxxx\n```\n\nNotice that `token` is a security measurement so nobody else can access your Embark processes through Cockpit (unless they have the token). To make it a little more secure, tokens are one-time use only. If we're trying to access the same session through different browser instances, one instance won't be able to connect.\n\nWe can always generate a new token inside [Embark's interactive console](/docs/using_the_console.html) using the [`token` command](/docs/using_the_console.html#Retrieving-authentication-tokens-for-Cockpit).\n\n## Entering the Cockpit\n\nOnce Embark is running, entering the Cockpit is really just a matter of opening the URL shown by Embark. Let's explore what Cockpit has to offer in the following guides.\n\nBon Voyage! \n","source":"docs/cockpit_introduction.md","raw":"title: Introduction to Cockpit\nlayout: docs\n---\n\nProbably one of Embark's most exciting features is its companion web interface Cockpit. With Cockpit, we're aiming for offering an alternative and more powerful interface to make developing and debugging decentralized applications even easier.\n\nThroughout the following sections we'll take a closer look at Cockpit's features and how we can use it to improve our developer experience when working with Embark!\n\n{% notification info 'A note on Cockpit availability' %}\nPlease note that Cockpit is a feature that ships since Embark version 4.0 and is not available in or for previous versions of Embark.\n{% endnotification %}\n\n## What is Cockpit?\n\nCockpit is a web application that ships with Embark since version 4.0. It's an alternative and sometimes more powerful interface in comparison to [Embark's dashboard](/docs/dashboard.html), that connects to any existing Embark process. Since it's web-based, Cockpit offers a much richer and more interactive user interface, with additional tools and features that can't be found in Embark otherwise.\n\nSome of Cockpit's features are:\n\n- **Dashboard** - A highly interactive real-time dashboard with service monitoring and deployment status\n- **Selective Deployment** - A deployment interface that gives you fine-grain control over when and how your Smart Contracts are deployed\n- **Explorer** - A built-in blockchain explorer making it easy to explore blocks, transactions and accounts\n- **Code Editor** - A web-based code editor, enabling changing your application's source on the fly\n- **Utilities** - Powerful utility tools, including ENS, a transaction decoder and more\n\nCockpit is actively developed and implements new features on a regular basis.\n\n## Starting Cockpit\n\nCockpit can be used as soon as Embark has been spinned up in any of our applications. As mentioned in our guide on [running apps](/docs/running_apps.html), Embark will start Cockpit as part of the run process. In fact, Embark even outputs a message, telling us how to open Cockpit:\n\n```\nAccess the web backend with the following url: http://localhost:55555?token=xxxxx-xxxxx-xxxxx-xxxxx\n```\n\nNotice that `token` is a security measurement so nobody else can access your Embark processes through Cockpit (unless they have the token). To make it a little more secure, tokens are one-time use only. If we're trying to access the same session through different browser instances, one instance won't be able to connect.\n\nWe can always generate a new token inside [Embark's interactive console](/docs/using_the_console.html) using the [`token` command](/docs/using_the_console.html#Retrieving-authentication-tokens-for-Cockpit).\n\n## Entering the Cockpit\n\nOnce Embark is running, entering the Cockpit is really just a matter of opening the URL shown by Embark. Let's explore what Cockpit has to offer in the following guides.\n\nBon Voyage! \n","date":"2020-01-17T19:00:03.896Z","updated":"2020-01-17T19:00:03.896Z","path":"docs/cockpit_introduction.html","comments":1,"_id":"ck5ijm3r7000o7heg5npzevk2","content":"

Probably one of Embark’s most exciting features is its companion web interface Cockpit. With Cockpit, we’re aiming for offering an alternative and more powerful interface to make developing and debugging decentralized applications even easier.

\n

Throughout the following sections we’ll take a closer look at Cockpit’s features and how we can use it to improve our developer experience when working with Embark!

\n
\n

A note on Cockpit availability

\n

Please note that Cockpit is a feature that ships since Embark version 4.0 and is not available in or for previous versions of Embark.

\n

\n
\n\n\n\n

What is Cockpit?

Cockpit is a web application that ships with Embark since version 4.0. It’s an alternative and sometimes more powerful interface in comparison to Embark’s dashboard, that connects to any existing Embark process. Since it’s web-based, Cockpit offers a much richer and more interactive user interface, with additional tools and features that can’t be found in Embark otherwise.

\n

Some of Cockpit’s features are:

\n\n

Cockpit is actively developed and implements new features on a regular basis.

\n

Starting Cockpit

Cockpit can be used as soon as Embark has been spinned up in any of our applications. As mentioned in our guide on running apps, Embark will start Cockpit as part of the run process. In fact, Embark even outputs a message, telling us how to open Cockpit:

\n
Access the web backend with the following url: http://localhost:55555?token=xxxxx-xxxxx-xxxxx-xxxxx
\n\n

Notice that token is a security measurement so nobody else can access your Embark processes through Cockpit (unless they have the token). To make it a little more secure, tokens are one-time use only. If we’re trying to access the same session through different browser instances, one instance won’t be able to connect.

\n

We can always generate a new token inside Embark’s interactive console using the token command.

\n

Entering the Cockpit

Once Embark is running, entering the Cockpit is really just a matter of opening the URL shown by Embark. Let’s explore what Cockpit has to offer in the following guides.

\n

Bon Voyage!

\n","site":{"data":{"authors":{"iuri_matias":{"name":"Iuri Matias","twitter":"iurimatias","image":"https://pbs.twimg.com/profile_images/928272512181563392/iDJdvy2k_400x400.jpg"},"pascal_precht":{"name":"Pascal Precht","twitter":"pascalprecht","image":"https://pbs.twimg.com/profile_images/993785060733194241/p3oAIMDP_400x400.jpg"},"anthony_laibe":{"name":"Anthony Laibe","twitter":"a_laibe","image":"https://pbs.twimg.com/profile_images/257742900/13168239_400x400.jpg"},"jonathan_rainville":{"name":"Jonathan Rainville","twitter":"ShyolGhul","image":"https://pbs.twimg.com/profile_images/993873866878570496/-aE4byjj_400x400.jpg"},"andre_medeiros":{"name":"Andre Medeiros","twitter":"superdealloc","image":"https://pbs.twimg.com/profile_images/965722487735701504/m58KNgWN_400x400.jpg"},"eric_mastro":{"name":"Eric Mastro","twitter":"ericmastro","image":"https://avatars1.githubusercontent.com/u/5089238?s=460&v=4"},"michael_bradley":{"name":"Michael Bradley","image":"https://avatars3.githubusercontent.com/u/194260?s=460&v=4"},"richard_ramos":{"name":"Richard Ramos","twitter":"richardramos_me","image":"https://pbs.twimg.com/profile_images/1063160577973866496/aM313uHG_400x400.jpg"},"jonny_zerah":{"name":"Jonny Zerah","twitter":"jonnyzerah","image":"https://pbs.twimg.com/profile_images/1043774340490248192/gI9aGy17_400x400.jpg"},"robin_percy":{"name":"Robin Percy","twitter":"rbin","image":"https://avatars1.githubusercontent.com/u/29288325?s=400&v=4"}},"categories":{"tutorials":"Tutorials","announcements":"Announcements"},"languages":{"en":"English"},"plugins":[{"name":"embark-bamboo","description":"plugins_page.plugins.bamboo.desc","link":"https://www.npmjs.com/package/embark-bamboo","thumbnail":"bamboo.png","tags":["language","smart-contracts"]},{"name":"embark-solc","description":"plugins_page.plugins.solc.desc","link":"https://www.npmjs.com/package/embark-solc","thumbnail":"solidity.png","tags":["solidity","language","smart-contracts"]},{"name":"embark-solium","description":"plugins_page.plugins.solium.desc","link":"https://www.npmjs.com/package/embark-solium","thumbnail":"solium.png","tags":["linter","solidity","solium"]},{"name":"embark-etherscan-verifier","description":"plugins_page.plugins.verifier.desc","link":"https://www.npmjs.com/package/embark-etherscan-verifier","tags":["solidity","etherscan","smart-contracts"]},{"name":"embark-status","description":"plugins_page.plugins.status.desc","link":"https://www.npmjs.com/package/embark-status-plugin","thumbnail":"status.png","tags":["status","mobile"]},{"name":"embark-remix","description":"plugins_page.plugins.remix.desc","link":"https://www.npmjs.com/package/embark-remix","thumbnail":"remix.png","tags":["remix","debugger"]},{"name":"embark-slither","description":"plugins_page.plugins.slither.desc","link":"https://www.npmjs.com/package/embark-slither","tags":["solidity"]},{"name":"embark-snark","description":"plugins_page.plugins.snark.desc","link":"https://www.npmjs.com/package/embark-snark","tags":["snark"]},{"name":"embark-fortune","description":"plugins_page.plugins.fortune.desc","link":"https://www.npmjs.com/package/embark-fortune","thumbnail":"fortune.jpg","tags":["fun"]},{"name":"embark-pug","description":"plugins_page.plugins.pug.desc","link":"https://www.npmjs.com/package/embark-pug","legacy":true,"thumbnail":"pug.png","tags":["pug","jade","templates"]},{"name":"embark-haml","description":"plugins_page.plugins.haml.desc","link":"https://www.npmjs.com/package/embark-haml","legacy":true,"thumbnail":"haml.png","tags":["haml","templates"]},{"name":"embark-mythx","description":"plugins_page.plugins.mythx.desc","link":"https://www.npmjs.com/package/embark-mythx","thumbnail":"mythx.png","tags":["mythx","smart-contracts"]}],"menu":{"docs":"/docs/","plugins":"/plugins/","chat":"/chat/","blog":"/news/"},"sidebar":{"docs":{"getting_started":{"overview":"overview.html","installation":"installation.html","faq":"faq.html"},"general_usage":{"creating_project":"create_project.html","structure":"structure.html","running_apps":"running_apps.html","dashboard":"dashboard.html","using_the_console":"using_the_console.html","environments":"environments.html","configuration":"configuration.html","pipeline_and_webpack":"pipeline_and_webpack.html","javascript_usage":"javascript_usage.html"},"smart_contracts":{"contracts_configuration":"contracts_configuration.html","contracts_deployment":"contracts_deployment.html","contracts_imports":"contracts_imports.html","contracts_testing":"contracts_testing.html","contracts_javascript":"contracts_javascript.html"},"blockchain_node":{"blockchain_configuration":"blockchain_configuration.html","blockchain_accounts_configuration":"blockchain_accounts_configuration.html"},"storage":{"storage_configuration":"storage_configuration.html","storage_deployment":"storage_deployment.html","storage_javascript":"storage_javascript.html"},"messages":{"messages_configuration":"messages_configuration.html","messages_javascript":"messages_javascript.html"},"naming":{"naming_configuration":"naming_configuration.html","naming_javascript":"naming_javascript.html"},"plugins":{"installing_a_plugin":"installing_plugins.html","creating_a_plugin":"creating_plugins.html","plugin_reference":"plugin_reference.html"},"cockpit":{"cockpit_introduction":"cockpit_introduction.html","cockpit_dashboard":"cockpit_dashboard.html","cockpit_deployment":"cockpit_deployment.html","cockpit_explorer":"cockpit_explorer.html","cockpit_editor":"cockpit_editor.html","cockpit_debugger":"cockpit_debugger.html"},"reference":{"embark_commands":"embark_commands.html"},"miscellaneous":{"migrating_from_3":"migrating_from_3.x.html","troubleshooting":"troubleshooting.html","contributing":"contributing.html"}}},"templates":[{"name":"Vyper Template","description":"Template to demonstrate the use of the Vyper contracts","install":"embark new AppName --template vyper","thumbnail":"vyper.png","link":"https://github.com/embarklabs/embark-vyper-template","tags":["vyper","contracts"]},{"name":"Embark Demo React Template","description":"A React Application showcasing Embark's functionality","install":"embark demo","thumbnail":"react.png","link":"https://embark.embarklabs.io/docs/create_project.html#Creating-a-Demo-Project","tags":["react","contracts","whisper","ipfs"]},{"name":"Typescript Template","description":"Template with Typescript support pre-configured","thumbnail":"typescript.png","install":"embark new AppName --template typescript","link":"https://github.com/embarklabs/embark-typescript-template","tags":["typescript","frontend"]},{"name":"Vue.js Template","description":"Ready to use Template for using Embark with vue.js","thumbnail":"vuejs.png","install":"embark new AppName --template vue","link":"https://github.com/embarklabs/embark-vue-template","tags":["vue.js","frontend"]},{"name":"ethvtx Template","description":"Demo app for ethvtx, an Ethereum-Ready & Framework-Agnostic Redux configuration","thumbnail":"vortex.png","install":"embark new AppName --template Horyus/ethvtx_embark","link":"https://github.com/Horyus/ethvtx_embark","tags":["react"]},{"name":"Bamboo Template","description":"Template to demonstrate use of the Bamboo contracts","install":"embark new AppName --template bamboo","thumbnail":"bamboo.png","link":"https://github.com/embarklabs/embark-bamboo-template","tags":["bamboo","contracts"]},{"name":"Solidity Gas Golfing","description":"Boilerplate and tests for the first Solidity Gas Golfing Contest","thumbnail":"sggc.png","install":"embark new AppName --template embarklabs/sggc","link":"https://github.com/embarklabs/sggc","tags":["solidity","tests","fun"]}],"tutorials":[{"name":"How to create a Token Factory with Ethereum — Part 1","description":"Create and Deploy a Token with Ethereum","link":"/tutorials/token_factory_1.html","tags":["token","ethereum"]},{"name":"How to create a Token Factory with Ethereum — Part 2","description":"Create a DApp that can deploy Tokens on the fly","link":"/tutorials/token_factory_2.html","tags":["token","ethereum","client-side-deployment"]},{"name":"How to deploy to a testnet with Infura","description":"Deploy and interact with your Dapp on a testnet with the use of Infura","link":"/tutorials/infura_guide.html","tags":["ethereum","deployment","testnet"]}],"versions":{"latest":{"label":"stable (v4)","url":"https://embark.embarklabs.io/docs"},"3.2":{"label":"v3.2","url":"https://5ca4e0fdb29712000adde37f--embark-site-versions.netlify.com/docs/"}}}},"excerpt":"","more":"

Probably one of Embark’s most exciting features is its companion web interface Cockpit. With Cockpit, we’re aiming for offering an alternative and more powerful interface to make developing and debugging decentralized applications even easier.

\n

Throughout the following sections we’ll take a closer look at Cockpit’s features and how we can use it to improve our developer experience when working with Embark!

\n
\n

A note on Cockpit availability

\n

Please note that Cockpit is a feature that ships since Embark version 4.0 and is not available in or for previous versions of Embark.

\n

\n
\n\n\n\n

What is Cockpit?

Cockpit is a web application that ships with Embark since version 4.0. It’s an alternative and sometimes more powerful interface in comparison to Embark’s dashboard, that connects to any existing Embark process. Since it’s web-based, Cockpit offers a much richer and more interactive user interface, with additional tools and features that can’t be found in Embark otherwise.

\n

Some of Cockpit’s features are:

\n\n

Cockpit is actively developed and implements new features on a regular basis.

\n

Starting Cockpit

Cockpit can be used as soon as Embark has been spinned up in any of our applications. As mentioned in our guide on running apps, Embark will start Cockpit as part of the run process. In fact, Embark even outputs a message, telling us how to open Cockpit:

\n
Access the web backend with the following url: http://localhost:55555?token=xxxxx-xxxxx-xxxxx-xxxxx
\n\n

Notice that token is a security measurement so nobody else can access your Embark processes through Cockpit (unless they have the token). To make it a little more secure, tokens are one-time use only. If we’re trying to access the same session through different browser instances, one instance won’t be able to connect.

\n

We can always generate a new token inside Embark’s interactive console using the token command.

\n

Entering the Cockpit

Once Embark is running, entering the Cockpit is really just a matter of opening the URL shown by Embark. Let’s explore what Cockpit has to offer in the following guides.

\n

Bon Voyage!

\n"},{"title":"Cockpit Utilities","layout":"docs","_content":"\n","source":"docs/cockpit_utils.md","raw":"title: Cockpit Utilities\nlayout: docs\n---\n\n","date":"2020-01-17T19:00:03.896Z","updated":"2020-01-17T19:00:03.896Z","path":"docs/cockpit_utils.html","comments":1,"_id":"ck5ijm3r9000q7heghpi5a61h","content":"","site":{"data":{"authors":{"iuri_matias":{"name":"Iuri Matias","twitter":"iurimatias","image":"https://pbs.twimg.com/profile_images/928272512181563392/iDJdvy2k_400x400.jpg"},"pascal_precht":{"name":"Pascal Precht","twitter":"pascalprecht","image":"https://pbs.twimg.com/profile_images/993785060733194241/p3oAIMDP_400x400.jpg"},"anthony_laibe":{"name":"Anthony Laibe","twitter":"a_laibe","image":"https://pbs.twimg.com/profile_images/257742900/13168239_400x400.jpg"},"jonathan_rainville":{"name":"Jonathan Rainville","twitter":"ShyolGhul","image":"https://pbs.twimg.com/profile_images/993873866878570496/-aE4byjj_400x400.jpg"},"andre_medeiros":{"name":"Andre Medeiros","twitter":"superdealloc","image":"https://pbs.twimg.com/profile_images/965722487735701504/m58KNgWN_400x400.jpg"},"eric_mastro":{"name":"Eric Mastro","twitter":"ericmastro","image":"https://avatars1.githubusercontent.com/u/5089238?s=460&v=4"},"michael_bradley":{"name":"Michael Bradley","image":"https://avatars3.githubusercontent.com/u/194260?s=460&v=4"},"richard_ramos":{"name":"Richard Ramos","twitter":"richardramos_me","image":"https://pbs.twimg.com/profile_images/1063160577973866496/aM313uHG_400x400.jpg"},"jonny_zerah":{"name":"Jonny Zerah","twitter":"jonnyzerah","image":"https://pbs.twimg.com/profile_images/1043774340490248192/gI9aGy17_400x400.jpg"},"robin_percy":{"name":"Robin Percy","twitter":"rbin","image":"https://avatars1.githubusercontent.com/u/29288325?s=400&v=4"}},"categories":{"tutorials":"Tutorials","announcements":"Announcements"},"languages":{"en":"English"},"plugins":[{"name":"embark-bamboo","description":"plugins_page.plugins.bamboo.desc","link":"https://www.npmjs.com/package/embark-bamboo","thumbnail":"bamboo.png","tags":["language","smart-contracts"]},{"name":"embark-solc","description":"plugins_page.plugins.solc.desc","link":"https://www.npmjs.com/package/embark-solc","thumbnail":"solidity.png","tags":["solidity","language","smart-contracts"]},{"name":"embark-solium","description":"plugins_page.plugins.solium.desc","link":"https://www.npmjs.com/package/embark-solium","thumbnail":"solium.png","tags":["linter","solidity","solium"]},{"name":"embark-etherscan-verifier","description":"plugins_page.plugins.verifier.desc","link":"https://www.npmjs.com/package/embark-etherscan-verifier","tags":["solidity","etherscan","smart-contracts"]},{"name":"embark-status","description":"plugins_page.plugins.status.desc","link":"https://www.npmjs.com/package/embark-status-plugin","thumbnail":"status.png","tags":["status","mobile"]},{"name":"embark-remix","description":"plugins_page.plugins.remix.desc","link":"https://www.npmjs.com/package/embark-remix","thumbnail":"remix.png","tags":["remix","debugger"]},{"name":"embark-slither","description":"plugins_page.plugins.slither.desc","link":"https://www.npmjs.com/package/embark-slither","tags":["solidity"]},{"name":"embark-snark","description":"plugins_page.plugins.snark.desc","link":"https://www.npmjs.com/package/embark-snark","tags":["snark"]},{"name":"embark-fortune","description":"plugins_page.plugins.fortune.desc","link":"https://www.npmjs.com/package/embark-fortune","thumbnail":"fortune.jpg","tags":["fun"]},{"name":"embark-pug","description":"plugins_page.plugins.pug.desc","link":"https://www.npmjs.com/package/embark-pug","legacy":true,"thumbnail":"pug.png","tags":["pug","jade","templates"]},{"name":"embark-haml","description":"plugins_page.plugins.haml.desc","link":"https://www.npmjs.com/package/embark-haml","legacy":true,"thumbnail":"haml.png","tags":["haml","templates"]},{"name":"embark-mythx","description":"plugins_page.plugins.mythx.desc","link":"https://www.npmjs.com/package/embark-mythx","thumbnail":"mythx.png","tags":["mythx","smart-contracts"]}],"menu":{"docs":"/docs/","plugins":"/plugins/","chat":"/chat/","blog":"/news/"},"sidebar":{"docs":{"getting_started":{"overview":"overview.html","installation":"installation.html","faq":"faq.html"},"general_usage":{"creating_project":"create_project.html","structure":"structure.html","running_apps":"running_apps.html","dashboard":"dashboard.html","using_the_console":"using_the_console.html","environments":"environments.html","configuration":"configuration.html","pipeline_and_webpack":"pipeline_and_webpack.html","javascript_usage":"javascript_usage.html"},"smart_contracts":{"contracts_configuration":"contracts_configuration.html","contracts_deployment":"contracts_deployment.html","contracts_imports":"contracts_imports.html","contracts_testing":"contracts_testing.html","contracts_javascript":"contracts_javascript.html"},"blockchain_node":{"blockchain_configuration":"blockchain_configuration.html","blockchain_accounts_configuration":"blockchain_accounts_configuration.html"},"storage":{"storage_configuration":"storage_configuration.html","storage_deployment":"storage_deployment.html","storage_javascript":"storage_javascript.html"},"messages":{"messages_configuration":"messages_configuration.html","messages_javascript":"messages_javascript.html"},"naming":{"naming_configuration":"naming_configuration.html","naming_javascript":"naming_javascript.html"},"plugins":{"installing_a_plugin":"installing_plugins.html","creating_a_plugin":"creating_plugins.html","plugin_reference":"plugin_reference.html"},"cockpit":{"cockpit_introduction":"cockpit_introduction.html","cockpit_dashboard":"cockpit_dashboard.html","cockpit_deployment":"cockpit_deployment.html","cockpit_explorer":"cockpit_explorer.html","cockpit_editor":"cockpit_editor.html","cockpit_debugger":"cockpit_debugger.html"},"reference":{"embark_commands":"embark_commands.html"},"miscellaneous":{"migrating_from_3":"migrating_from_3.x.html","troubleshooting":"troubleshooting.html","contributing":"contributing.html"}}},"templates":[{"name":"Vyper Template","description":"Template to demonstrate the use of the Vyper contracts","install":"embark new AppName --template vyper","thumbnail":"vyper.png","link":"https://github.com/embarklabs/embark-vyper-template","tags":["vyper","contracts"]},{"name":"Embark Demo React Template","description":"A React Application showcasing Embark's functionality","install":"embark demo","thumbnail":"react.png","link":"https://embark.embarklabs.io/docs/create_project.html#Creating-a-Demo-Project","tags":["react","contracts","whisper","ipfs"]},{"name":"Typescript Template","description":"Template with Typescript support pre-configured","thumbnail":"typescript.png","install":"embark new AppName --template typescript","link":"https://github.com/embarklabs/embark-typescript-template","tags":["typescript","frontend"]},{"name":"Vue.js Template","description":"Ready to use Template for using Embark with vue.js","thumbnail":"vuejs.png","install":"embark new AppName --template vue","link":"https://github.com/embarklabs/embark-vue-template","tags":["vue.js","frontend"]},{"name":"ethvtx Template","description":"Demo app for ethvtx, an Ethereum-Ready & Framework-Agnostic Redux configuration","thumbnail":"vortex.png","install":"embark new AppName --template Horyus/ethvtx_embark","link":"https://github.com/Horyus/ethvtx_embark","tags":["react"]},{"name":"Bamboo Template","description":"Template to demonstrate use of the Bamboo contracts","install":"embark new AppName --template bamboo","thumbnail":"bamboo.png","link":"https://github.com/embarklabs/embark-bamboo-template","tags":["bamboo","contracts"]},{"name":"Solidity Gas Golfing","description":"Boilerplate and tests for the first Solidity Gas Golfing Contest","thumbnail":"sggc.png","install":"embark new AppName --template embarklabs/sggc","link":"https://github.com/embarklabs/sggc","tags":["solidity","tests","fun"]}],"tutorials":[{"name":"How to create a Token Factory with Ethereum — Part 1","description":"Create and Deploy a Token with Ethereum","link":"/tutorials/token_factory_1.html","tags":["token","ethereum"]},{"name":"How to create a Token Factory with Ethereum — Part 2","description":"Create a DApp that can deploy Tokens on the fly","link":"/tutorials/token_factory_2.html","tags":["token","ethereum","client-side-deployment"]},{"name":"How to deploy to a testnet with Infura","description":"Deploy and interact with your Dapp on a testnet with the use of Infura","link":"/tutorials/infura_guide.html","tags":["ethereum","deployment","testnet"]}],"versions":{"latest":{"label":"stable (v4)","url":"https://embark.embarklabs.io/docs"},"3.2":{"label":"v3.2","url":"https://5ca4e0fdb29712000adde37f--embark-site-versions.netlify.com/docs/"}}}},"excerpt":"","more":""},{"title":"Configuring Embark","layout":"docs","_content":"\nEmbark offers a lot of fine control when it comes to configuring the different parts of our decentralized application. In this guide we'll take a closer look at the basic configuration options provided by our application's `embark.json` file, which are mainly relevant for, but not restricted to, our application structure.\n\nFor configuration options related to connecting to a blockchain client, [deploying your Smart Contracts](contracts_configuration.html), [decentralized storage](storage_configuration.html), [Whisper](messages_configuration) or [ENS](naming_configuration.html), please head over to the dedicated configuration guides respectively.\n\n## Overview\n\nEvery application [created with Embark](create_project.html) comes with an `embark.json` file. This file configures where Embark has to look for Smart Contract files and assets, as well as plugins options. Here's what a freshly scaffolded `embark.json` file could look like:\n\n```\n{\n \"contracts\": [\"contracts/**\"],\n \"app\": {\n \"js/dapp.js\": [\"app/dapp.js\"],\n \"index.html\": \"app/index.html\",\n \"images/\": [\"app/images/**\"]\n },\n \"buildDir\": \"dist/\",\n \"generationDir\": \"embarkArtifacts\",\n \"config\": \"config/\",\n \"versions\": {\n \"solc\": \"0.4.25\"\n },\n \"plugins\": {\n },\n \"options\": {\n \"solc\": {\n \"optimize\": true,\n \"optimize-runs\": 200\n }\n }\n}\n```\n\nLet's look at the different options and learn what they do and mean.\n\n### contracts\n\nThis is a list of directories in which Embark should look for Smart Contract files. These typically are globbing patterns (e.g `[\"contracts/**/*.sol\"]` will match all sol files inside any folders inside `contracts/`).\n\n### app\n\nEverything inside `app` configures the assets of our application, which could be anything from HTML, JavaScript to CSS and other assets. JavaScript source files are compiled using webpack to create a bundle, all other file types are simply copied to the specified destination.\n\nIn the key/value pairs of `app`, every key describes the destination, while the value describes a list of glob patterns for files to be transformed and copied.\n\n - **js/dapp.js** - This is the JavaScript bundle that contains our application. Specifically, all files that are defined in this option (`app/dapp.js`).\n - **index.html** - The entry point of our application (`app/index.html`)\n - **images** - All image assets of our application that we can find in `app/images/`.\n\nChange these configurations as you need.\n\n### buildDir\n\nThe directory to which the build artifacts are being moved to. Everything inside this configured folder can be considered a production ready build (default is `dist/`).\n\n{% notification info 'Important note:' %}\nWhen using Embark with any other complementary CLI tool for building a DApp, such as Create-React-App or Angular CLI, `buildDir` should point at the same location as the complementary tool writes its distribution files to.\n\nThis is important so that Embark picks up the right files when doing things like [deploying your app](/docs/storage_deployment.html) on IPFS or Swarm.\n{% endnotification %}\n\n### generationDir\n\nA directory in which Embark is going to generate artifacts that can be used for DApp development. This include Smart Contract ABIs as well Embark specific configuration data extracted from the project's configuration. The default name of this directory is `embarkArtifacts`. To learn more about Embark Artifacts, head over to our guide on [Using EmbarkJS](/docs/javascript_usage.html).\n\n### config\n\nThis is the location of the configuration files. There are different options to configure those:\n\n* **A string** (e.g `\"config/\"`) - Will assume the directory in which the configuration files are located (`blockchain.js`, `contracts.js`, etc).\n* **An object**:\n * Each property would configure the path of each configuration file\n * Configuration properties can be set to false to disable the component/service in question\n\n```\n...\n\"config\": {\n \"contracts\": \"contracts.js\",\n \"blockchain\": false,\n \"storage\": false,\n \"communication\": false,\n \"webserver\": false\n},\n...\n```\n\n### versions (3rd-party libraries)\n\nHere you can optionally specify the versions of the library to be used by Embark. Embark will automatically download the specific library version if necessary.\n\nCurrently, `solc` is the only library that can be specified in this way. It's possible to override the `solc` version in other configuration files such as `contracts.json` on a per environment basis.\n\n### plugins\n\nThis is a list of installed plugins. For more information on Plugins, head over to our [Plugins guide](/docs/installing_plugins.html).\n\n### options\n\nThe `options` property enable us to configure options for specific components and services of Embark and our application. Currently supported are options for the `solc` compiler, as well as options related to Embark's `reset` command:\n```\n...\n \"options\": {\n \"solc\": {\n \"optimize\": true,\n \"optimize-runs\": 200\n },\n }\n...\n```\n\n## Configuring Embark's reset command\n\nAs mentioned in the section above, it's possible to configure how Embark behaves when [resetting projects](/docs/running_apps.html#Resetting-apps). Most of the time, the default configuration should do the trick, however, if we need more control over what files should be removed as part of the reset, we can do that using the `reset` option.\n\nIt comes with two properties:\n\n- **defaults** - Tells Embark whether it should reset the default files it usually resets or not\n- **files** - A list of files Embark should remove as well when resetting the project\n\nWith these two options we have full control over what files `reset` will remove.\n\n```\n...\n \"options\": {\n \"reset\": {\n \"defaults\": true,\n \"files\": [\"some/other/file\"]\n }\n }\n...\n```\n","source":"docs/configuration.md","raw":"title: Configuring Embark\nlayout: docs\n---\n\nEmbark offers a lot of fine control when it comes to configuring the different parts of our decentralized application. In this guide we'll take a closer look at the basic configuration options provided by our application's `embark.json` file, which are mainly relevant for, but not restricted to, our application structure.\n\nFor configuration options related to connecting to a blockchain client, [deploying your Smart Contracts](contracts_configuration.html), [decentralized storage](storage_configuration.html), [Whisper](messages_configuration) or [ENS](naming_configuration.html), please head over to the dedicated configuration guides respectively.\n\n## Overview\n\nEvery application [created with Embark](create_project.html) comes with an `embark.json` file. This file configures where Embark has to look for Smart Contract files and assets, as well as plugins options. Here's what a freshly scaffolded `embark.json` file could look like:\n\n```\n{\n \"contracts\": [\"contracts/**\"],\n \"app\": {\n \"js/dapp.js\": [\"app/dapp.js\"],\n \"index.html\": \"app/index.html\",\n \"images/\": [\"app/images/**\"]\n },\n \"buildDir\": \"dist/\",\n \"generationDir\": \"embarkArtifacts\",\n \"config\": \"config/\",\n \"versions\": {\n \"solc\": \"0.4.25\"\n },\n \"plugins\": {\n },\n \"options\": {\n \"solc\": {\n \"optimize\": true,\n \"optimize-runs\": 200\n }\n }\n}\n```\n\nLet's look at the different options and learn what they do and mean.\n\n### contracts\n\nThis is a list of directories in which Embark should look for Smart Contract files. These typically are globbing patterns (e.g `[\"contracts/**/*.sol\"]` will match all sol files inside any folders inside `contracts/`).\n\n### app\n\nEverything inside `app` configures the assets of our application, which could be anything from HTML, JavaScript to CSS and other assets. JavaScript source files are compiled using webpack to create a bundle, all other file types are simply copied to the specified destination.\n\nIn the key/value pairs of `app`, every key describes the destination, while the value describes a list of glob patterns for files to be transformed and copied.\n\n - **js/dapp.js** - This is the JavaScript bundle that contains our application. Specifically, all files that are defined in this option (`app/dapp.js`).\n - **index.html** - The entry point of our application (`app/index.html`)\n - **images** - All image assets of our application that we can find in `app/images/`.\n\nChange these configurations as you need.\n\n### buildDir\n\nThe directory to which the build artifacts are being moved to. Everything inside this configured folder can be considered a production ready build (default is `dist/`).\n\n{% notification info 'Important note:' %}\nWhen using Embark with any other complementary CLI tool for building a DApp, such as Create-React-App or Angular CLI, `buildDir` should point at the same location as the complementary tool writes its distribution files to.\n\nThis is important so that Embark picks up the right files when doing things like [deploying your app](/docs/storage_deployment.html) on IPFS or Swarm.\n{% endnotification %}\n\n### generationDir\n\nA directory in which Embark is going to generate artifacts that can be used for DApp development. This include Smart Contract ABIs as well Embark specific configuration data extracted from the project's configuration. The default name of this directory is `embarkArtifacts`. To learn more about Embark Artifacts, head over to our guide on [Using EmbarkJS](/docs/javascript_usage.html).\n\n### config\n\nThis is the location of the configuration files. There are different options to configure those:\n\n* **A string** (e.g `\"config/\"`) - Will assume the directory in which the configuration files are located (`blockchain.js`, `contracts.js`, etc).\n* **An object**:\n * Each property would configure the path of each configuration file\n * Configuration properties can be set to false to disable the component/service in question\n\n```\n...\n\"config\": {\n \"contracts\": \"contracts.js\",\n \"blockchain\": false,\n \"storage\": false,\n \"communication\": false,\n \"webserver\": false\n},\n...\n```\n\n### versions (3rd-party libraries)\n\nHere you can optionally specify the versions of the library to be used by Embark. Embark will automatically download the specific library version if necessary.\n\nCurrently, `solc` is the only library that can be specified in this way. It's possible to override the `solc` version in other configuration files such as `contracts.json` on a per environment basis.\n\n### plugins\n\nThis is a list of installed plugins. For more information on Plugins, head over to our [Plugins guide](/docs/installing_plugins.html).\n\n### options\n\nThe `options` property enable us to configure options for specific components and services of Embark and our application. Currently supported are options for the `solc` compiler, as well as options related to Embark's `reset` command:\n```\n...\n \"options\": {\n \"solc\": {\n \"optimize\": true,\n \"optimize-runs\": 200\n },\n }\n...\n```\n\n## Configuring Embark's reset command\n\nAs mentioned in the section above, it's possible to configure how Embark behaves when [resetting projects](/docs/running_apps.html#Resetting-apps). Most of the time, the default configuration should do the trick, however, if we need more control over what files should be removed as part of the reset, we can do that using the `reset` option.\n\nIt comes with two properties:\n\n- **defaults** - Tells Embark whether it should reset the default files it usually resets or not\n- **files** - A list of files Embark should remove as well when resetting the project\n\nWith these two options we have full control over what files `reset` will remove.\n\n```\n...\n \"options\": {\n \"reset\": {\n \"defaults\": true,\n \"files\": [\"some/other/file\"]\n }\n }\n...\n```\n","date":"2020-01-17T19:00:03.896Z","updated":"2020-01-17T19:00:03.896Z","path":"docs/configuration.html","comments":1,"_id":"ck5ijm3ra000s7heg60xe14sp","content":"

Embark offers a lot of fine control when it comes to configuring the different parts of our decentralized application. In this guide we’ll take a closer look at the basic configuration options provided by our application’s embark.json file, which are mainly relevant for, but not restricted to, our application structure.

\n

For configuration options related to connecting to a blockchain client, deploying your Smart Contracts, decentralized storage, Whisper or ENS, please head over to the dedicated configuration guides respectively.

\n

Overview

Every application created with Embark comes with an embark.json file. This file configures where Embark has to look for Smart Contract files and assets, as well as plugins options. Here’s what a freshly scaffolded embark.json file could look like:

\n
{
"contracts": ["contracts/**"],
"app": {
"js/dapp.js": ["app/dapp.js"],
"index.html": "app/index.html",
"images/": ["app/images/**"]
},
"buildDir": "dist/",
"generationDir": "embarkArtifacts",
"config": "config/",
"versions": {
"solc": "0.4.25"
},
"plugins": {
},
"options": {
"solc": {
"optimize": true,
"optimize-runs": 200
}
}
}
\n\n

Let’s look at the different options and learn what they do and mean.

\n

contracts

This is a list of directories in which Embark should look for Smart Contract files. These typically are globbing patterns (e.g ["contracts/**/*.sol"] will match all sol files inside any folders inside contracts/).

\n

app

Everything inside app configures the assets of our application, which could be anything from HTML, JavaScript to CSS and other assets. JavaScript source files are compiled using webpack to create a bundle, all other file types are simply copied to the specified destination.

\n

In the key/value pairs of app, every key describes the destination, while the value describes a list of glob patterns for files to be transformed and copied.

\n\n

Change these configurations as you need.

\n

buildDir

The directory to which the build artifacts are being moved to. Everything inside this configured folder can be considered a production ready build (default is dist/).

\n
\n

Important note:

\n

When using Embark with any other complementary CLI tool for building a DApp, such as Create-React-App or Angular CLI, buildDir should point at the same location as the complementary tool writes its distribution files to.

\n

This is important so that Embark picks up the right files when doing things like deploying your app on IPFS or Swarm.

\n

\n
\n\n\n\n

generationDir

A directory in which Embark is going to generate artifacts that can be used for DApp development. This include Smart Contract ABIs as well Embark specific configuration data extracted from the project’s configuration. The default name of this directory is embarkArtifacts. To learn more about Embark Artifacts, head over to our guide on Using EmbarkJS.

\n

config

This is the location of the configuration files. There are different options to configure those:

\n\n
...
"config": {
"contracts": "contracts.js",
"blockchain": false,
"storage": false,
"communication": false,
"webserver": false
},
...
\n\n

versions (3rd-party libraries)

Here you can optionally specify the versions of the library to be used by Embark. Embark will automatically download the specific library version if necessary.

\n

Currently, solc is the only library that can be specified in this way. It’s possible to override the solc version in other configuration files such as contracts.json on a per environment basis.

\n

plugins

This is a list of installed plugins. For more information on Plugins, head over to our Plugins guide.

\n

options

The options property enable us to configure options for specific components and services of Embark and our application. Currently supported are options for the solc compiler, as well as options related to Embark’s reset command:

\n
...
"options": {
"solc": {
"optimize": true,
"optimize-runs": 200
},
}
...
\n\n

Configuring Embark’s reset command

As mentioned in the section above, it’s possible to configure how Embark behaves when resetting projects. Most of the time, the default configuration should do the trick, however, if we need more control over what files should be removed as part of the reset, we can do that using the reset option.

\n

It comes with two properties:

\n\n

With these two options we have full control over what files reset will remove.

\n
...
"options": {
"reset": {
"defaults": true,
"files": ["some/other/file"]
}
}
...
\n","site":{"data":{"authors":{"iuri_matias":{"name":"Iuri Matias","twitter":"iurimatias","image":"https://pbs.twimg.com/profile_images/928272512181563392/iDJdvy2k_400x400.jpg"},"pascal_precht":{"name":"Pascal Precht","twitter":"pascalprecht","image":"https://pbs.twimg.com/profile_images/993785060733194241/p3oAIMDP_400x400.jpg"},"anthony_laibe":{"name":"Anthony Laibe","twitter":"a_laibe","image":"https://pbs.twimg.com/profile_images/257742900/13168239_400x400.jpg"},"jonathan_rainville":{"name":"Jonathan Rainville","twitter":"ShyolGhul","image":"https://pbs.twimg.com/profile_images/993873866878570496/-aE4byjj_400x400.jpg"},"andre_medeiros":{"name":"Andre Medeiros","twitter":"superdealloc","image":"https://pbs.twimg.com/profile_images/965722487735701504/m58KNgWN_400x400.jpg"},"eric_mastro":{"name":"Eric Mastro","twitter":"ericmastro","image":"https://avatars1.githubusercontent.com/u/5089238?s=460&v=4"},"michael_bradley":{"name":"Michael Bradley","image":"https://avatars3.githubusercontent.com/u/194260?s=460&v=4"},"richard_ramos":{"name":"Richard Ramos","twitter":"richardramos_me","image":"https://pbs.twimg.com/profile_images/1063160577973866496/aM313uHG_400x400.jpg"},"jonny_zerah":{"name":"Jonny Zerah","twitter":"jonnyzerah","image":"https://pbs.twimg.com/profile_images/1043774340490248192/gI9aGy17_400x400.jpg"},"robin_percy":{"name":"Robin Percy","twitter":"rbin","image":"https://avatars1.githubusercontent.com/u/29288325?s=400&v=4"}},"categories":{"tutorials":"Tutorials","announcements":"Announcements"},"languages":{"en":"English"},"plugins":[{"name":"embark-bamboo","description":"plugins_page.plugins.bamboo.desc","link":"https://www.npmjs.com/package/embark-bamboo","thumbnail":"bamboo.png","tags":["language","smart-contracts"]},{"name":"embark-solc","description":"plugins_page.plugins.solc.desc","link":"https://www.npmjs.com/package/embark-solc","thumbnail":"solidity.png","tags":["solidity","language","smart-contracts"]},{"name":"embark-solium","description":"plugins_page.plugins.solium.desc","link":"https://www.npmjs.com/package/embark-solium","thumbnail":"solium.png","tags":["linter","solidity","solium"]},{"name":"embark-etherscan-verifier","description":"plugins_page.plugins.verifier.desc","link":"https://www.npmjs.com/package/embark-etherscan-verifier","tags":["solidity","etherscan","smart-contracts"]},{"name":"embark-status","description":"plugins_page.plugins.status.desc","link":"https://www.npmjs.com/package/embark-status-plugin","thumbnail":"status.png","tags":["status","mobile"]},{"name":"embark-remix","description":"plugins_page.plugins.remix.desc","link":"https://www.npmjs.com/package/embark-remix","thumbnail":"remix.png","tags":["remix","debugger"]},{"name":"embark-slither","description":"plugins_page.plugins.slither.desc","link":"https://www.npmjs.com/package/embark-slither","tags":["solidity"]},{"name":"embark-snark","description":"plugins_page.plugins.snark.desc","link":"https://www.npmjs.com/package/embark-snark","tags":["snark"]},{"name":"embark-fortune","description":"plugins_page.plugins.fortune.desc","link":"https://www.npmjs.com/package/embark-fortune","thumbnail":"fortune.jpg","tags":["fun"]},{"name":"embark-pug","description":"plugins_page.plugins.pug.desc","link":"https://www.npmjs.com/package/embark-pug","legacy":true,"thumbnail":"pug.png","tags":["pug","jade","templates"]},{"name":"embark-haml","description":"plugins_page.plugins.haml.desc","link":"https://www.npmjs.com/package/embark-haml","legacy":true,"thumbnail":"haml.png","tags":["haml","templates"]},{"name":"embark-mythx","description":"plugins_page.plugins.mythx.desc","link":"https://www.npmjs.com/package/embark-mythx","thumbnail":"mythx.png","tags":["mythx","smart-contracts"]}],"menu":{"docs":"/docs/","plugins":"/plugins/","chat":"/chat/","blog":"/news/"},"sidebar":{"docs":{"getting_started":{"overview":"overview.html","installation":"installation.html","faq":"faq.html"},"general_usage":{"creating_project":"create_project.html","structure":"structure.html","running_apps":"running_apps.html","dashboard":"dashboard.html","using_the_console":"using_the_console.html","environments":"environments.html","configuration":"configuration.html","pipeline_and_webpack":"pipeline_and_webpack.html","javascript_usage":"javascript_usage.html"},"smart_contracts":{"contracts_configuration":"contracts_configuration.html","contracts_deployment":"contracts_deployment.html","contracts_imports":"contracts_imports.html","contracts_testing":"contracts_testing.html","contracts_javascript":"contracts_javascript.html"},"blockchain_node":{"blockchain_configuration":"blockchain_configuration.html","blockchain_accounts_configuration":"blockchain_accounts_configuration.html"},"storage":{"storage_configuration":"storage_configuration.html","storage_deployment":"storage_deployment.html","storage_javascript":"storage_javascript.html"},"messages":{"messages_configuration":"messages_configuration.html","messages_javascript":"messages_javascript.html"},"naming":{"naming_configuration":"naming_configuration.html","naming_javascript":"naming_javascript.html"},"plugins":{"installing_a_plugin":"installing_plugins.html","creating_a_plugin":"creating_plugins.html","plugin_reference":"plugin_reference.html"},"cockpit":{"cockpit_introduction":"cockpit_introduction.html","cockpit_dashboard":"cockpit_dashboard.html","cockpit_deployment":"cockpit_deployment.html","cockpit_explorer":"cockpit_explorer.html","cockpit_editor":"cockpit_editor.html","cockpit_debugger":"cockpit_debugger.html"},"reference":{"embark_commands":"embark_commands.html"},"miscellaneous":{"migrating_from_3":"migrating_from_3.x.html","troubleshooting":"troubleshooting.html","contributing":"contributing.html"}}},"templates":[{"name":"Vyper Template","description":"Template to demonstrate the use of the Vyper contracts","install":"embark new AppName --template vyper","thumbnail":"vyper.png","link":"https://github.com/embarklabs/embark-vyper-template","tags":["vyper","contracts"]},{"name":"Embark Demo React Template","description":"A React Application showcasing Embark's functionality","install":"embark demo","thumbnail":"react.png","link":"https://embark.embarklabs.io/docs/create_project.html#Creating-a-Demo-Project","tags":["react","contracts","whisper","ipfs"]},{"name":"Typescript Template","description":"Template with Typescript support pre-configured","thumbnail":"typescript.png","install":"embark new AppName --template typescript","link":"https://github.com/embarklabs/embark-typescript-template","tags":["typescript","frontend"]},{"name":"Vue.js Template","description":"Ready to use Template for using Embark with vue.js","thumbnail":"vuejs.png","install":"embark new AppName --template vue","link":"https://github.com/embarklabs/embark-vue-template","tags":["vue.js","frontend"]},{"name":"ethvtx Template","description":"Demo app for ethvtx, an Ethereum-Ready & Framework-Agnostic Redux configuration","thumbnail":"vortex.png","install":"embark new AppName --template Horyus/ethvtx_embark","link":"https://github.com/Horyus/ethvtx_embark","tags":["react"]},{"name":"Bamboo Template","description":"Template to demonstrate use of the Bamboo contracts","install":"embark new AppName --template bamboo","thumbnail":"bamboo.png","link":"https://github.com/embarklabs/embark-bamboo-template","tags":["bamboo","contracts"]},{"name":"Solidity Gas Golfing","description":"Boilerplate and tests for the first Solidity Gas Golfing Contest","thumbnail":"sggc.png","install":"embark new AppName --template embarklabs/sggc","link":"https://github.com/embarklabs/sggc","tags":["solidity","tests","fun"]}],"tutorials":[{"name":"How to create a Token Factory with Ethereum — Part 1","description":"Create and Deploy a Token with Ethereum","link":"/tutorials/token_factory_1.html","tags":["token","ethereum"]},{"name":"How to create a Token Factory with Ethereum — Part 2","description":"Create a DApp that can deploy Tokens on the fly","link":"/tutorials/token_factory_2.html","tags":["token","ethereum","client-side-deployment"]},{"name":"How to deploy to a testnet with Infura","description":"Deploy and interact with your Dapp on a testnet with the use of Infura","link":"/tutorials/infura_guide.html","tags":["ethereum","deployment","testnet"]}],"versions":{"latest":{"label":"stable (v4)","url":"https://embark.embarklabs.io/docs"},"3.2":{"label":"v3.2","url":"https://5ca4e0fdb29712000adde37f--embark-site-versions.netlify.com/docs/"}}}},"excerpt":"","more":"

Embark offers a lot of fine control when it comes to configuring the different parts of our decentralized application. In this guide we’ll take a closer look at the basic configuration options provided by our application’s embark.json file, which are mainly relevant for, but not restricted to, our application structure.

\n

For configuration options related to connecting to a blockchain client, deploying your Smart Contracts, decentralized storage, Whisper or ENS, please head over to the dedicated configuration guides respectively.

\n

Overview

Every application created with Embark comes with an embark.json file. This file configures where Embark has to look for Smart Contract files and assets, as well as plugins options. Here’s what a freshly scaffolded embark.json file could look like:

\n
{
"contracts": ["contracts/**"],
"app": {
"js/dapp.js": ["app/dapp.js"],
"index.html": "app/index.html",
"images/": ["app/images/**"]
},
"buildDir": "dist/",
"generationDir": "embarkArtifacts",
"config": "config/",
"versions": {
"solc": "0.4.25"
},
"plugins": {
},
"options": {
"solc": {
"optimize": true,
"optimize-runs": 200
}
}
}
\n\n

Let’s look at the different options and learn what they do and mean.

\n

contracts

This is a list of directories in which Embark should look for Smart Contract files. These typically are globbing patterns (e.g ["contracts/**/*.sol"] will match all sol files inside any folders inside contracts/).

\n

app

Everything inside app configures the assets of our application, which could be anything from HTML, JavaScript to CSS and other assets. JavaScript source files are compiled using webpack to create a bundle, all other file types are simply copied to the specified destination.

\n

In the key/value pairs of app, every key describes the destination, while the value describes a list of glob patterns for files to be transformed and copied.

\n\n

Change these configurations as you need.

\n

buildDir

The directory to which the build artifacts are being moved to. Everything inside this configured folder can be considered a production ready build (default is dist/).

\n
\n

Important note:

\n

When using Embark with any other complementary CLI tool for building a DApp, such as Create-React-App or Angular CLI, buildDir should point at the same location as the complementary tool writes its distribution files to.

\n

This is important so that Embark picks up the right files when doing things like deploying your app on IPFS or Swarm.

\n

\n
\n\n\n\n

generationDir

A directory in which Embark is going to generate artifacts that can be used for DApp development. This include Smart Contract ABIs as well Embark specific configuration data extracted from the project’s configuration. The default name of this directory is embarkArtifacts. To learn more about Embark Artifacts, head over to our guide on Using EmbarkJS.

\n

config

This is the location of the configuration files. There are different options to configure those:

\n\n
...
"config": {
"contracts": "contracts.js",
"blockchain": false,
"storage": false,
"communication": false,
"webserver": false
},
...
\n\n

versions (3rd-party libraries)

Here you can optionally specify the versions of the library to be used by Embark. Embark will automatically download the specific library version if necessary.

\n

Currently, solc is the only library that can be specified in this way. It’s possible to override the solc version in other configuration files such as contracts.json on a per environment basis.

\n

plugins

This is a list of installed plugins. For more information on Plugins, head over to our Plugins guide.

\n

options

The options property enable us to configure options for specific components and services of Embark and our application. Currently supported are options for the solc compiler, as well as options related to Embark’s reset command:

\n
...
"options": {
"solc": {
"optimize": true,
"optimize-runs": 200
},
}
...
\n\n

Configuring Embark’s reset command

As mentioned in the section above, it’s possible to configure how Embark behaves when resetting projects. Most of the time, the default configuration should do the trick, however, if we need more control over what files should be removed as part of the reset, we can do that using the reset option.

\n

It comes with two properties:

\n\n

With these two options we have full control over what files reset will remove.

\n
...
"options": {
"reset": {
"defaults": true,
"files": ["some/other/file"]
}
}
...
\n"},{"title":"Console Commands","layout":"docs","_content":"\nWith ``embark run`` there is a console at the bottom which can be used to interact with contracts or with embark itself. type ``help`` to see a list of available commands, more commands will be added with each version of Embark.\n\n### Interacting with contracts\nAfter contract deployment, you should be able to interact with the web3 object and the deployed contracts.\n\n### Other Available Commands\nSome commands available include:\n\n* ``version`` - see list of software & libraries and their respective versions\n* ``quit`` or ``exit`` - to immediatly exit (you can also use ctrl + c)\n* ``webserver start`` - start the dev webserver\n* ``webserver stop`` - stop the dev webserver\n* ``browser open`` - open a web browser and load your DApp from the dev webserver\n\n### Custom Commands\n\nIt's possible to extend Embark to include custom commands. See [how to create\na plugin](creating_plugins.html)\n\n
module.exports = function(embark) {\n        embark.registerConsoleCommand(function(cmd, options) {\n          if (cmd === \"hello\") {\n            return \"hello there!\";\n          }\n          // continue to embark or next plugin;\n          return false;\n        });\n    }\n
\n","source":"docs/console_commands.md","raw":"title: Console Commands\nlayout: docs\n---\n\nWith ``embark run`` there is a console at the bottom which can be used to interact with contracts or with embark itself. type ``help`` to see a list of available commands, more commands will be added with each version of Embark.\n\n### Interacting with contracts\nAfter contract deployment, you should be able to interact with the web3 object and the deployed contracts.\n\n### Other Available Commands\nSome commands available include:\n\n* ``version`` - see list of software & libraries and their respective versions\n* ``quit`` or ``exit`` - to immediatly exit (you can also use ctrl + c)\n* ``webserver start`` - start the dev webserver\n* ``webserver stop`` - stop the dev webserver\n* ``browser open`` - open a web browser and load your DApp from the dev webserver\n\n### Custom Commands\n\nIt's possible to extend Embark to include custom commands. See [how to create\na plugin](creating_plugins.html)\n\n
module.exports = function(embark) {\n        embark.registerConsoleCommand(function(cmd, options) {\n          if (cmd === \"hello\") {\n            return \"hello there!\";\n          }\n          // continue to embark or next plugin;\n          return false;\n        });\n    }\n
\n","date":"2020-01-17T19:00:03.896Z","updated":"2020-01-17T19:00:03.896Z","path":"docs/console_commands.html","comments":1,"_id":"ck5ijm3ra000u7heg555m76d6","content":"

With embark run there is a console at the bottom which can be used to interact with contracts or with embark itself. type help to see a list of available commands, more commands will be added with each version of Embark.

\n

Interacting with contracts

After contract deployment, you should be able to interact with the web3 object and the deployed contracts.

\n

Other Available Commands

Some commands available include:

\n\n

Custom Commands

It’s possible to extend Embark to include custom commands. See how to create
a plugin

\n
module.exports = function(embark) {\n        embark.registerConsoleCommand(function(cmd, options) {\n          if (cmd === \"hello\") {\n            return \"hello there!\";\n          }\n          // continue to embark or next plugin;\n          return false;\n        });\n    }\n
\n","site":{"data":{"authors":{"iuri_matias":{"name":"Iuri Matias","twitter":"iurimatias","image":"https://pbs.twimg.com/profile_images/928272512181563392/iDJdvy2k_400x400.jpg"},"pascal_precht":{"name":"Pascal Precht","twitter":"pascalprecht","image":"https://pbs.twimg.com/profile_images/993785060733194241/p3oAIMDP_400x400.jpg"},"anthony_laibe":{"name":"Anthony Laibe","twitter":"a_laibe","image":"https://pbs.twimg.com/profile_images/257742900/13168239_400x400.jpg"},"jonathan_rainville":{"name":"Jonathan Rainville","twitter":"ShyolGhul","image":"https://pbs.twimg.com/profile_images/993873866878570496/-aE4byjj_400x400.jpg"},"andre_medeiros":{"name":"Andre Medeiros","twitter":"superdealloc","image":"https://pbs.twimg.com/profile_images/965722487735701504/m58KNgWN_400x400.jpg"},"eric_mastro":{"name":"Eric Mastro","twitter":"ericmastro","image":"https://avatars1.githubusercontent.com/u/5089238?s=460&v=4"},"michael_bradley":{"name":"Michael Bradley","image":"https://avatars3.githubusercontent.com/u/194260?s=460&v=4"},"richard_ramos":{"name":"Richard Ramos","twitter":"richardramos_me","image":"https://pbs.twimg.com/profile_images/1063160577973866496/aM313uHG_400x400.jpg"},"jonny_zerah":{"name":"Jonny Zerah","twitter":"jonnyzerah","image":"https://pbs.twimg.com/profile_images/1043774340490248192/gI9aGy17_400x400.jpg"},"robin_percy":{"name":"Robin Percy","twitter":"rbin","image":"https://avatars1.githubusercontent.com/u/29288325?s=400&v=4"}},"categories":{"tutorials":"Tutorials","announcements":"Announcements"},"languages":{"en":"English"},"plugins":[{"name":"embark-bamboo","description":"plugins_page.plugins.bamboo.desc","link":"https://www.npmjs.com/package/embark-bamboo","thumbnail":"bamboo.png","tags":["language","smart-contracts"]},{"name":"embark-solc","description":"plugins_page.plugins.solc.desc","link":"https://www.npmjs.com/package/embark-solc","thumbnail":"solidity.png","tags":["solidity","language","smart-contracts"]},{"name":"embark-solium","description":"plugins_page.plugins.solium.desc","link":"https://www.npmjs.com/package/embark-solium","thumbnail":"solium.png","tags":["linter","solidity","solium"]},{"name":"embark-etherscan-verifier","description":"plugins_page.plugins.verifier.desc","link":"https://www.npmjs.com/package/embark-etherscan-verifier","tags":["solidity","etherscan","smart-contracts"]},{"name":"embark-status","description":"plugins_page.plugins.status.desc","link":"https://www.npmjs.com/package/embark-status-plugin","thumbnail":"status.png","tags":["status","mobile"]},{"name":"embark-remix","description":"plugins_page.plugins.remix.desc","link":"https://www.npmjs.com/package/embark-remix","thumbnail":"remix.png","tags":["remix","debugger"]},{"name":"embark-slither","description":"plugins_page.plugins.slither.desc","link":"https://www.npmjs.com/package/embark-slither","tags":["solidity"]},{"name":"embark-snark","description":"plugins_page.plugins.snark.desc","link":"https://www.npmjs.com/package/embark-snark","tags":["snark"]},{"name":"embark-fortune","description":"plugins_page.plugins.fortune.desc","link":"https://www.npmjs.com/package/embark-fortune","thumbnail":"fortune.jpg","tags":["fun"]},{"name":"embark-pug","description":"plugins_page.plugins.pug.desc","link":"https://www.npmjs.com/package/embark-pug","legacy":true,"thumbnail":"pug.png","tags":["pug","jade","templates"]},{"name":"embark-haml","description":"plugins_page.plugins.haml.desc","link":"https://www.npmjs.com/package/embark-haml","legacy":true,"thumbnail":"haml.png","tags":["haml","templates"]},{"name":"embark-mythx","description":"plugins_page.plugins.mythx.desc","link":"https://www.npmjs.com/package/embark-mythx","thumbnail":"mythx.png","tags":["mythx","smart-contracts"]}],"menu":{"docs":"/docs/","plugins":"/plugins/","chat":"/chat/","blog":"/news/"},"sidebar":{"docs":{"getting_started":{"overview":"overview.html","installation":"installation.html","faq":"faq.html"},"general_usage":{"creating_project":"create_project.html","structure":"structure.html","running_apps":"running_apps.html","dashboard":"dashboard.html","using_the_console":"using_the_console.html","environments":"environments.html","configuration":"configuration.html","pipeline_and_webpack":"pipeline_and_webpack.html","javascript_usage":"javascript_usage.html"},"smart_contracts":{"contracts_configuration":"contracts_configuration.html","contracts_deployment":"contracts_deployment.html","contracts_imports":"contracts_imports.html","contracts_testing":"contracts_testing.html","contracts_javascript":"contracts_javascript.html"},"blockchain_node":{"blockchain_configuration":"blockchain_configuration.html","blockchain_accounts_configuration":"blockchain_accounts_configuration.html"},"storage":{"storage_configuration":"storage_configuration.html","storage_deployment":"storage_deployment.html","storage_javascript":"storage_javascript.html"},"messages":{"messages_configuration":"messages_configuration.html","messages_javascript":"messages_javascript.html"},"naming":{"naming_configuration":"naming_configuration.html","naming_javascript":"naming_javascript.html"},"plugins":{"installing_a_plugin":"installing_plugins.html","creating_a_plugin":"creating_plugins.html","plugin_reference":"plugin_reference.html"},"cockpit":{"cockpit_introduction":"cockpit_introduction.html","cockpit_dashboard":"cockpit_dashboard.html","cockpit_deployment":"cockpit_deployment.html","cockpit_explorer":"cockpit_explorer.html","cockpit_editor":"cockpit_editor.html","cockpit_debugger":"cockpit_debugger.html"},"reference":{"embark_commands":"embark_commands.html"},"miscellaneous":{"migrating_from_3":"migrating_from_3.x.html","troubleshooting":"troubleshooting.html","contributing":"contributing.html"}}},"templates":[{"name":"Vyper Template","description":"Template to demonstrate the use of the Vyper contracts","install":"embark new AppName --template vyper","thumbnail":"vyper.png","link":"https://github.com/embarklabs/embark-vyper-template","tags":["vyper","contracts"]},{"name":"Embark Demo React Template","description":"A React Application showcasing Embark's functionality","install":"embark demo","thumbnail":"react.png","link":"https://embark.embarklabs.io/docs/create_project.html#Creating-a-Demo-Project","tags":["react","contracts","whisper","ipfs"]},{"name":"Typescript Template","description":"Template with Typescript support pre-configured","thumbnail":"typescript.png","install":"embark new AppName --template typescript","link":"https://github.com/embarklabs/embark-typescript-template","tags":["typescript","frontend"]},{"name":"Vue.js Template","description":"Ready to use Template for using Embark with vue.js","thumbnail":"vuejs.png","install":"embark new AppName --template vue","link":"https://github.com/embarklabs/embark-vue-template","tags":["vue.js","frontend"]},{"name":"ethvtx Template","description":"Demo app for ethvtx, an Ethereum-Ready & Framework-Agnostic Redux configuration","thumbnail":"vortex.png","install":"embark new AppName --template Horyus/ethvtx_embark","link":"https://github.com/Horyus/ethvtx_embark","tags":["react"]},{"name":"Bamboo Template","description":"Template to demonstrate use of the Bamboo contracts","install":"embark new AppName --template bamboo","thumbnail":"bamboo.png","link":"https://github.com/embarklabs/embark-bamboo-template","tags":["bamboo","contracts"]},{"name":"Solidity Gas Golfing","description":"Boilerplate and tests for the first Solidity Gas Golfing Contest","thumbnail":"sggc.png","install":"embark new AppName --template embarklabs/sggc","link":"https://github.com/embarklabs/sggc","tags":["solidity","tests","fun"]}],"tutorials":[{"name":"How to create a Token Factory with Ethereum — Part 1","description":"Create and Deploy a Token with Ethereum","link":"/tutorials/token_factory_1.html","tags":["token","ethereum"]},{"name":"How to create a Token Factory with Ethereum — Part 2","description":"Create a DApp that can deploy Tokens on the fly","link":"/tutorials/token_factory_2.html","tags":["token","ethereum","client-side-deployment"]},{"name":"How to deploy to a testnet with Infura","description":"Deploy and interact with your Dapp on a testnet with the use of Infura","link":"/tutorials/infura_guide.html","tags":["ethereum","deployment","testnet"]}],"versions":{"latest":{"label":"stable (v4)","url":"https://embark.embarklabs.io/docs"},"3.2":{"label":"v3.2","url":"https://5ca4e0fdb29712000adde37f--embark-site-versions.netlify.com/docs/"}}}},"excerpt":"","more":"

With embark run there is a console at the bottom which can be used to interact with contracts or with embark itself. type help to see a list of available commands, more commands will be added with each version of Embark.

\n

Interacting with contracts

After contract deployment, you should be able to interact with the web3 object and the deployed contracts.

\n

Other Available Commands

Some commands available include:

\n\n

Custom Commands

It’s possible to extend Embark to include custom commands. See how to create
a plugin

\n
module.exports = function(embark) {\n        embark.registerConsoleCommand(function(cmd, options) {\n          if (cmd === \"hello\") {\n            return \"hello there!\";\n          }\n          // continue to embark or next plugin;\n          return false;\n        });\n    }\n
\n"},{"title":"Accounts & Deployment","layout":"docs","_content":"\nAccounts configuration has moved to the blockchain config. You can learn more [here](/docs/blockchain_accounts_configuration.html).\n\n## Deploying to Infura\n\nTo deploy to Infura or another endpoint, just use the blockchain `endpoint`. More details [here](/docs/blockchain_configuration.html)\n","source":"docs/contracts_deployment.md","raw":"title: Accounts & Deployment\nlayout: docs\n---\n\nAccounts configuration has moved to the blockchain config. You can learn more [here](/docs/blockchain_accounts_configuration.html).\n\n## Deploying to Infura\n\nTo deploy to Infura or another endpoint, just use the blockchain `endpoint`. More details [here](/docs/blockchain_configuration.html)\n","date":"2020-01-17T19:00:03.896Z","updated":"2020-01-17T19:00:03.896Z","path":"docs/contracts_deployment.html","comments":1,"_id":"ck5ijm3rb000w7heg1uvb25hr","content":"

Accounts configuration has moved to the blockchain config. You can learn more here.

\n

Deploying to Infura

To deploy to Infura or another endpoint, just use the blockchain endpoint. More details here

\n","site":{"data":{"authors":{"iuri_matias":{"name":"Iuri Matias","twitter":"iurimatias","image":"https://pbs.twimg.com/profile_images/928272512181563392/iDJdvy2k_400x400.jpg"},"pascal_precht":{"name":"Pascal Precht","twitter":"pascalprecht","image":"https://pbs.twimg.com/profile_images/993785060733194241/p3oAIMDP_400x400.jpg"},"anthony_laibe":{"name":"Anthony Laibe","twitter":"a_laibe","image":"https://pbs.twimg.com/profile_images/257742900/13168239_400x400.jpg"},"jonathan_rainville":{"name":"Jonathan Rainville","twitter":"ShyolGhul","image":"https://pbs.twimg.com/profile_images/993873866878570496/-aE4byjj_400x400.jpg"},"andre_medeiros":{"name":"Andre Medeiros","twitter":"superdealloc","image":"https://pbs.twimg.com/profile_images/965722487735701504/m58KNgWN_400x400.jpg"},"eric_mastro":{"name":"Eric Mastro","twitter":"ericmastro","image":"https://avatars1.githubusercontent.com/u/5089238?s=460&v=4"},"michael_bradley":{"name":"Michael Bradley","image":"https://avatars3.githubusercontent.com/u/194260?s=460&v=4"},"richard_ramos":{"name":"Richard Ramos","twitter":"richardramos_me","image":"https://pbs.twimg.com/profile_images/1063160577973866496/aM313uHG_400x400.jpg"},"jonny_zerah":{"name":"Jonny Zerah","twitter":"jonnyzerah","image":"https://pbs.twimg.com/profile_images/1043774340490248192/gI9aGy17_400x400.jpg"},"robin_percy":{"name":"Robin Percy","twitter":"rbin","image":"https://avatars1.githubusercontent.com/u/29288325?s=400&v=4"}},"categories":{"tutorials":"Tutorials","announcements":"Announcements"},"languages":{"en":"English"},"plugins":[{"name":"embark-bamboo","description":"plugins_page.plugins.bamboo.desc","link":"https://www.npmjs.com/package/embark-bamboo","thumbnail":"bamboo.png","tags":["language","smart-contracts"]},{"name":"embark-solc","description":"plugins_page.plugins.solc.desc","link":"https://www.npmjs.com/package/embark-solc","thumbnail":"solidity.png","tags":["solidity","language","smart-contracts"]},{"name":"embark-solium","description":"plugins_page.plugins.solium.desc","link":"https://www.npmjs.com/package/embark-solium","thumbnail":"solium.png","tags":["linter","solidity","solium"]},{"name":"embark-etherscan-verifier","description":"plugins_page.plugins.verifier.desc","link":"https://www.npmjs.com/package/embark-etherscan-verifier","tags":["solidity","etherscan","smart-contracts"]},{"name":"embark-status","description":"plugins_page.plugins.status.desc","link":"https://www.npmjs.com/package/embark-status-plugin","thumbnail":"status.png","tags":["status","mobile"]},{"name":"embark-remix","description":"plugins_page.plugins.remix.desc","link":"https://www.npmjs.com/package/embark-remix","thumbnail":"remix.png","tags":["remix","debugger"]},{"name":"embark-slither","description":"plugins_page.plugins.slither.desc","link":"https://www.npmjs.com/package/embark-slither","tags":["solidity"]},{"name":"embark-snark","description":"plugins_page.plugins.snark.desc","link":"https://www.npmjs.com/package/embark-snark","tags":["snark"]},{"name":"embark-fortune","description":"plugins_page.plugins.fortune.desc","link":"https://www.npmjs.com/package/embark-fortune","thumbnail":"fortune.jpg","tags":["fun"]},{"name":"embark-pug","description":"plugins_page.plugins.pug.desc","link":"https://www.npmjs.com/package/embark-pug","legacy":true,"thumbnail":"pug.png","tags":["pug","jade","templates"]},{"name":"embark-haml","description":"plugins_page.plugins.haml.desc","link":"https://www.npmjs.com/package/embark-haml","legacy":true,"thumbnail":"haml.png","tags":["haml","templates"]},{"name":"embark-mythx","description":"plugins_page.plugins.mythx.desc","link":"https://www.npmjs.com/package/embark-mythx","thumbnail":"mythx.png","tags":["mythx","smart-contracts"]}],"menu":{"docs":"/docs/","plugins":"/plugins/","chat":"/chat/","blog":"/news/"},"sidebar":{"docs":{"getting_started":{"overview":"overview.html","installation":"installation.html","faq":"faq.html"},"general_usage":{"creating_project":"create_project.html","structure":"structure.html","running_apps":"running_apps.html","dashboard":"dashboard.html","using_the_console":"using_the_console.html","environments":"environments.html","configuration":"configuration.html","pipeline_and_webpack":"pipeline_and_webpack.html","javascript_usage":"javascript_usage.html"},"smart_contracts":{"contracts_configuration":"contracts_configuration.html","contracts_deployment":"contracts_deployment.html","contracts_imports":"contracts_imports.html","contracts_testing":"contracts_testing.html","contracts_javascript":"contracts_javascript.html"},"blockchain_node":{"blockchain_configuration":"blockchain_configuration.html","blockchain_accounts_configuration":"blockchain_accounts_configuration.html"},"storage":{"storage_configuration":"storage_configuration.html","storage_deployment":"storage_deployment.html","storage_javascript":"storage_javascript.html"},"messages":{"messages_configuration":"messages_configuration.html","messages_javascript":"messages_javascript.html"},"naming":{"naming_configuration":"naming_configuration.html","naming_javascript":"naming_javascript.html"},"plugins":{"installing_a_plugin":"installing_plugins.html","creating_a_plugin":"creating_plugins.html","plugin_reference":"plugin_reference.html"},"cockpit":{"cockpit_introduction":"cockpit_introduction.html","cockpit_dashboard":"cockpit_dashboard.html","cockpit_deployment":"cockpit_deployment.html","cockpit_explorer":"cockpit_explorer.html","cockpit_editor":"cockpit_editor.html","cockpit_debugger":"cockpit_debugger.html"},"reference":{"embark_commands":"embark_commands.html"},"miscellaneous":{"migrating_from_3":"migrating_from_3.x.html","troubleshooting":"troubleshooting.html","contributing":"contributing.html"}}},"templates":[{"name":"Vyper Template","description":"Template to demonstrate the use of the Vyper contracts","install":"embark new AppName --template vyper","thumbnail":"vyper.png","link":"https://github.com/embarklabs/embark-vyper-template","tags":["vyper","contracts"]},{"name":"Embark Demo React Template","description":"A React Application showcasing Embark's functionality","install":"embark demo","thumbnail":"react.png","link":"https://embark.embarklabs.io/docs/create_project.html#Creating-a-Demo-Project","tags":["react","contracts","whisper","ipfs"]},{"name":"Typescript Template","description":"Template with Typescript support pre-configured","thumbnail":"typescript.png","install":"embark new AppName --template typescript","link":"https://github.com/embarklabs/embark-typescript-template","tags":["typescript","frontend"]},{"name":"Vue.js Template","description":"Ready to use Template for using Embark with vue.js","thumbnail":"vuejs.png","install":"embark new AppName --template vue","link":"https://github.com/embarklabs/embark-vue-template","tags":["vue.js","frontend"]},{"name":"ethvtx Template","description":"Demo app for ethvtx, an Ethereum-Ready & Framework-Agnostic Redux configuration","thumbnail":"vortex.png","install":"embark new AppName --template Horyus/ethvtx_embark","link":"https://github.com/Horyus/ethvtx_embark","tags":["react"]},{"name":"Bamboo Template","description":"Template to demonstrate use of the Bamboo contracts","install":"embark new AppName --template bamboo","thumbnail":"bamboo.png","link":"https://github.com/embarklabs/embark-bamboo-template","tags":["bamboo","contracts"]},{"name":"Solidity Gas Golfing","description":"Boilerplate and tests for the first Solidity Gas Golfing Contest","thumbnail":"sggc.png","install":"embark new AppName --template embarklabs/sggc","link":"https://github.com/embarklabs/sggc","tags":["solidity","tests","fun"]}],"tutorials":[{"name":"How to create a Token Factory with Ethereum — Part 1","description":"Create and Deploy a Token with Ethereum","link":"/tutorials/token_factory_1.html","tags":["token","ethereum"]},{"name":"How to create a Token Factory with Ethereum — Part 2","description":"Create a DApp that can deploy Tokens on the fly","link":"/tutorials/token_factory_2.html","tags":["token","ethereum","client-side-deployment"]},{"name":"How to deploy to a testnet with Infura","description":"Deploy and interact with your Dapp on a testnet with the use of Infura","link":"/tutorials/infura_guide.html","tags":["ethereum","deployment","testnet"]}],"versions":{"latest":{"label":"stable (v4)","url":"https://embark.embarklabs.io/docs"},"3.2":{"label":"v3.2","url":"https://5ca4e0fdb29712000adde37f--embark-site-versions.netlify.com/docs/"}}}},"excerpt":"","more":"

Accounts configuration has moved to the blockchain config. You can learn more here.

\n

Deploying to Infura

To deploy to Infura or another endpoint, just use the blockchain endpoint. More details here

\n"},{"title":"Special Imports","layout":"docs","_content":"\nDepending on which language for developing Smart Contracts is used, Embark supports special import paths. In this guide we'll discuss the various ways of importing Smart Contract source code in other Smart Contract files.\n\n{% notification info 'Scope of this guide' %}\nThe following features are currently only supported for Smart Contracts written in the Solidity programming language. If you're using another language, such as Vyper, these features may not be available.\n{% endnotification %}\n\n## Importing files\n\nIf using Solidity it's possible to import other Smart Contract files inside a source file from the application's folders that are not explicitly defined in the `deploy` property of `embark.json`.\n\n```\nimport \"another_folder/another_test.sol\";\n```\n\n## Importing from `node_modules`\n\nEmbark also supports convenient imports from installed `node_modules`. Just specify the package name including the path to the Solidity file you wish to import.\n\n```\nimport \"openzeppelin-solidity/contracts/ownership/Ownable.sol\";\n```\n\n## Importing from remote paths\n\nSource files can even be imported straight from Git, Github, IPFS, Swarm or via HTTP(S):\n\n```\nimport \"git://github.com/status/contracts/contracts/identity/ERC725.sol#develop\";\nimport \"github.com/status/contracts/contracts/identity/ERC725.sol\";\nimport \"https://github.com/OpenZeppelin/openzeppelin-solidity/blob/master/contracts/ownership/Ownable.sol\";\nimport \"bzz:/1ffe993abc835f480f688d07ad75ad1dbdbd1ddb368a08b7ed4d3e400771dd63\"\n```\n\n","source":"docs/contracts_imports.md","raw":"title: Special Imports\nlayout: docs\n---\n\nDepending on which language for developing Smart Contracts is used, Embark supports special import paths. In this guide we'll discuss the various ways of importing Smart Contract source code in other Smart Contract files.\n\n{% notification info 'Scope of this guide' %}\nThe following features are currently only supported for Smart Contracts written in the Solidity programming language. If you're using another language, such as Vyper, these features may not be available.\n{% endnotification %}\n\n## Importing files\n\nIf using Solidity it's possible to import other Smart Contract files inside a source file from the application's folders that are not explicitly defined in the `deploy` property of `embark.json`.\n\n```\nimport \"another_folder/another_test.sol\";\n```\n\n## Importing from `node_modules`\n\nEmbark also supports convenient imports from installed `node_modules`. Just specify the package name including the path to the Solidity file you wish to import.\n\n```\nimport \"openzeppelin-solidity/contracts/ownership/Ownable.sol\";\n```\n\n## Importing from remote paths\n\nSource files can even be imported straight from Git, Github, IPFS, Swarm or via HTTP(S):\n\n```\nimport \"git://github.com/status/contracts/contracts/identity/ERC725.sol#develop\";\nimport \"github.com/status/contracts/contracts/identity/ERC725.sol\";\nimport \"https://github.com/OpenZeppelin/openzeppelin-solidity/blob/master/contracts/ownership/Ownable.sol\";\nimport \"bzz:/1ffe993abc835f480f688d07ad75ad1dbdbd1ddb368a08b7ed4d3e400771dd63\"\n```\n\n","date":"2020-01-17T19:00:03.896Z","updated":"2020-01-17T19:00:03.896Z","path":"docs/contracts_imports.html","comments":1,"_id":"ck5ijm3rc000y7hega44j5ops","content":"

Depending on which language for developing Smart Contracts is used, Embark supports special import paths. In this guide we’ll discuss the various ways of importing Smart Contract source code in other Smart Contract files.

\n
\n

Scope of this guide

\n

The following features are currently only supported for Smart Contracts written in the Solidity programming language. If you’re using another language, such as Vyper, these features may not be available.

\n

\n
\n\n\n\n

Importing files

If using Solidity it’s possible to import other Smart Contract files inside a source file from the application’s folders that are not explicitly defined in the deploy property of embark.json.

\n
import "another_folder/another_test.sol";
\n\n

Importing from node_modules

Embark also supports convenient imports from installed node_modules. Just specify the package name including the path to the Solidity file you wish to import.

\n
import "openzeppelin-solidity/contracts/ownership/Ownable.sol";
\n\n

Importing from remote paths

Source files can even be imported straight from Git, Github, IPFS, Swarm or via HTTP(S):

\n
import "git://github.com/status/contracts/contracts/identity/ERC725.sol#develop";
import "github.com/status/contracts/contracts/identity/ERC725.sol";
import "https://github.com/OpenZeppelin/openzeppelin-solidity/blob/master/contracts/ownership/Ownable.sol";
import "bzz:/1ffe993abc835f480f688d07ad75ad1dbdbd1ddb368a08b7ed4d3e400771dd63"
\n\n","site":{"data":{"authors":{"iuri_matias":{"name":"Iuri Matias","twitter":"iurimatias","image":"https://pbs.twimg.com/profile_images/928272512181563392/iDJdvy2k_400x400.jpg"},"pascal_precht":{"name":"Pascal Precht","twitter":"pascalprecht","image":"https://pbs.twimg.com/profile_images/993785060733194241/p3oAIMDP_400x400.jpg"},"anthony_laibe":{"name":"Anthony Laibe","twitter":"a_laibe","image":"https://pbs.twimg.com/profile_images/257742900/13168239_400x400.jpg"},"jonathan_rainville":{"name":"Jonathan Rainville","twitter":"ShyolGhul","image":"https://pbs.twimg.com/profile_images/993873866878570496/-aE4byjj_400x400.jpg"},"andre_medeiros":{"name":"Andre Medeiros","twitter":"superdealloc","image":"https://pbs.twimg.com/profile_images/965722487735701504/m58KNgWN_400x400.jpg"},"eric_mastro":{"name":"Eric Mastro","twitter":"ericmastro","image":"https://avatars1.githubusercontent.com/u/5089238?s=460&v=4"},"michael_bradley":{"name":"Michael Bradley","image":"https://avatars3.githubusercontent.com/u/194260?s=460&v=4"},"richard_ramos":{"name":"Richard Ramos","twitter":"richardramos_me","image":"https://pbs.twimg.com/profile_images/1063160577973866496/aM313uHG_400x400.jpg"},"jonny_zerah":{"name":"Jonny Zerah","twitter":"jonnyzerah","image":"https://pbs.twimg.com/profile_images/1043774340490248192/gI9aGy17_400x400.jpg"},"robin_percy":{"name":"Robin Percy","twitter":"rbin","image":"https://avatars1.githubusercontent.com/u/29288325?s=400&v=4"}},"categories":{"tutorials":"Tutorials","announcements":"Announcements"},"languages":{"en":"English"},"plugins":[{"name":"embark-bamboo","description":"plugins_page.plugins.bamboo.desc","link":"https://www.npmjs.com/package/embark-bamboo","thumbnail":"bamboo.png","tags":["language","smart-contracts"]},{"name":"embark-solc","description":"plugins_page.plugins.solc.desc","link":"https://www.npmjs.com/package/embark-solc","thumbnail":"solidity.png","tags":["solidity","language","smart-contracts"]},{"name":"embark-solium","description":"plugins_page.plugins.solium.desc","link":"https://www.npmjs.com/package/embark-solium","thumbnail":"solium.png","tags":["linter","solidity","solium"]},{"name":"embark-etherscan-verifier","description":"plugins_page.plugins.verifier.desc","link":"https://www.npmjs.com/package/embark-etherscan-verifier","tags":["solidity","etherscan","smart-contracts"]},{"name":"embark-status","description":"plugins_page.plugins.status.desc","link":"https://www.npmjs.com/package/embark-status-plugin","thumbnail":"status.png","tags":["status","mobile"]},{"name":"embark-remix","description":"plugins_page.plugins.remix.desc","link":"https://www.npmjs.com/package/embark-remix","thumbnail":"remix.png","tags":["remix","debugger"]},{"name":"embark-slither","description":"plugins_page.plugins.slither.desc","link":"https://www.npmjs.com/package/embark-slither","tags":["solidity"]},{"name":"embark-snark","description":"plugins_page.plugins.snark.desc","link":"https://www.npmjs.com/package/embark-snark","tags":["snark"]},{"name":"embark-fortune","description":"plugins_page.plugins.fortune.desc","link":"https://www.npmjs.com/package/embark-fortune","thumbnail":"fortune.jpg","tags":["fun"]},{"name":"embark-pug","description":"plugins_page.plugins.pug.desc","link":"https://www.npmjs.com/package/embark-pug","legacy":true,"thumbnail":"pug.png","tags":["pug","jade","templates"]},{"name":"embark-haml","description":"plugins_page.plugins.haml.desc","link":"https://www.npmjs.com/package/embark-haml","legacy":true,"thumbnail":"haml.png","tags":["haml","templates"]},{"name":"embark-mythx","description":"plugins_page.plugins.mythx.desc","link":"https://www.npmjs.com/package/embark-mythx","thumbnail":"mythx.png","tags":["mythx","smart-contracts"]}],"menu":{"docs":"/docs/","plugins":"/plugins/","chat":"/chat/","blog":"/news/"},"sidebar":{"docs":{"getting_started":{"overview":"overview.html","installation":"installation.html","faq":"faq.html"},"general_usage":{"creating_project":"create_project.html","structure":"structure.html","running_apps":"running_apps.html","dashboard":"dashboard.html","using_the_console":"using_the_console.html","environments":"environments.html","configuration":"configuration.html","pipeline_and_webpack":"pipeline_and_webpack.html","javascript_usage":"javascript_usage.html"},"smart_contracts":{"contracts_configuration":"contracts_configuration.html","contracts_deployment":"contracts_deployment.html","contracts_imports":"contracts_imports.html","contracts_testing":"contracts_testing.html","contracts_javascript":"contracts_javascript.html"},"blockchain_node":{"blockchain_configuration":"blockchain_configuration.html","blockchain_accounts_configuration":"blockchain_accounts_configuration.html"},"storage":{"storage_configuration":"storage_configuration.html","storage_deployment":"storage_deployment.html","storage_javascript":"storage_javascript.html"},"messages":{"messages_configuration":"messages_configuration.html","messages_javascript":"messages_javascript.html"},"naming":{"naming_configuration":"naming_configuration.html","naming_javascript":"naming_javascript.html"},"plugins":{"installing_a_plugin":"installing_plugins.html","creating_a_plugin":"creating_plugins.html","plugin_reference":"plugin_reference.html"},"cockpit":{"cockpit_introduction":"cockpit_introduction.html","cockpit_dashboard":"cockpit_dashboard.html","cockpit_deployment":"cockpit_deployment.html","cockpit_explorer":"cockpit_explorer.html","cockpit_editor":"cockpit_editor.html","cockpit_debugger":"cockpit_debugger.html"},"reference":{"embark_commands":"embark_commands.html"},"miscellaneous":{"migrating_from_3":"migrating_from_3.x.html","troubleshooting":"troubleshooting.html","contributing":"contributing.html"}}},"templates":[{"name":"Vyper Template","description":"Template to demonstrate the use of the Vyper contracts","install":"embark new AppName --template vyper","thumbnail":"vyper.png","link":"https://github.com/embarklabs/embark-vyper-template","tags":["vyper","contracts"]},{"name":"Embark Demo React Template","description":"A React Application showcasing Embark's functionality","install":"embark demo","thumbnail":"react.png","link":"https://embark.embarklabs.io/docs/create_project.html#Creating-a-Demo-Project","tags":["react","contracts","whisper","ipfs"]},{"name":"Typescript Template","description":"Template with Typescript support pre-configured","thumbnail":"typescript.png","install":"embark new AppName --template typescript","link":"https://github.com/embarklabs/embark-typescript-template","tags":["typescript","frontend"]},{"name":"Vue.js Template","description":"Ready to use Template for using Embark with vue.js","thumbnail":"vuejs.png","install":"embark new AppName --template vue","link":"https://github.com/embarklabs/embark-vue-template","tags":["vue.js","frontend"]},{"name":"ethvtx Template","description":"Demo app for ethvtx, an Ethereum-Ready & Framework-Agnostic Redux configuration","thumbnail":"vortex.png","install":"embark new AppName --template Horyus/ethvtx_embark","link":"https://github.com/Horyus/ethvtx_embark","tags":["react"]},{"name":"Bamboo Template","description":"Template to demonstrate use of the Bamboo contracts","install":"embark new AppName --template bamboo","thumbnail":"bamboo.png","link":"https://github.com/embarklabs/embark-bamboo-template","tags":["bamboo","contracts"]},{"name":"Solidity Gas Golfing","description":"Boilerplate and tests for the first Solidity Gas Golfing Contest","thumbnail":"sggc.png","install":"embark new AppName --template embarklabs/sggc","link":"https://github.com/embarklabs/sggc","tags":["solidity","tests","fun"]}],"tutorials":[{"name":"How to create a Token Factory with Ethereum — Part 1","description":"Create and Deploy a Token with Ethereum","link":"/tutorials/token_factory_1.html","tags":["token","ethereum"]},{"name":"How to create a Token Factory with Ethereum — Part 2","description":"Create a DApp that can deploy Tokens on the fly","link":"/tutorials/token_factory_2.html","tags":["token","ethereum","client-side-deployment"]},{"name":"How to deploy to a testnet with Infura","description":"Deploy and interact with your Dapp on a testnet with the use of Infura","link":"/tutorials/infura_guide.html","tags":["ethereum","deployment","testnet"]}],"versions":{"latest":{"label":"stable (v4)","url":"https://embark.embarklabs.io/docs"},"3.2":{"label":"v3.2","url":"https://5ca4e0fdb29712000adde37f--embark-site-versions.netlify.com/docs/"}}}},"excerpt":"","more":"

Depending on which language for developing Smart Contracts is used, Embark supports special import paths. In this guide we’ll discuss the various ways of importing Smart Contract source code in other Smart Contract files.

\n
\n

Scope of this guide

\n

The following features are currently only supported for Smart Contracts written in the Solidity programming language. If you’re using another language, such as Vyper, these features may not be available.

\n

\n
\n\n\n\n

Importing files

If using Solidity it’s possible to import other Smart Contract files inside a source file from the application’s folders that are not explicitly defined in the deploy property of embark.json.

\n
import "another_folder/another_test.sol";
\n\n

Importing from node_modules

Embark also supports convenient imports from installed node_modules. Just specify the package name including the path to the Solidity file you wish to import.

\n
import "openzeppelin-solidity/contracts/ownership/Ownable.sol";
\n\n

Importing from remote paths

Source files can even be imported straight from Git, Github, IPFS, Swarm or via HTTP(S):

\n
import "git://github.com/status/contracts/contracts/identity/ERC725.sol#develop";
import "github.com/status/contracts/contracts/identity/ERC725.sol";
import "https://github.com/OpenZeppelin/openzeppelin-solidity/blob/master/contracts/ownership/Ownable.sol";
import "bzz:/1ffe993abc835f480f688d07ad75ad1dbdbd1ddb368a08b7ed4d3e400771dd63"
\n\n"},{"title":"Smart Contracts in JavaScript","layout":"docs","_content":"\nIn order to talk to our deployed Smart Contracts through a web application, we typically need a JavaScript equivalent that offers APIs to make this possible. Embark generates JavaScript artifacts for all Smart Contracts used by our application.\n\nIn this guide we'll take a quick look how to make use of them!\n\n## Importing and using Smart Contracts\n\nEmbark will [automatically generate artifacts](/docs/javascript_usage.html#Embark-Artifacts) for all configured Smart Contracts in our application, making them available to an application's front-end. Allwe have to do is importing them accordingly. For example, the Smart Contract below:\n\n```\ncontract SimpleStorage {\n uint public storedData;\n\n function SimpleStorage(uint initialValue) {\n storedData = initialValue;\n }\n\n function set(uint x) {\n storedData = x;\n }\n function get() constant returns (uint retVal) {\n return storedData;\n }\n}\n```\n\nWill available as JavaScript object, after artifact generation and can be imported as:\n\n```\nimport { SimpleStorage } from './embarkArtifacts/contracts';\n```\n\nNotice that the exact path to the Smart Contract source is configured using the `generationDir` property in [Embark's configuration](/docs/configuration.html#generationDir).\n\nOnce imported, Smart Contract APIs can be used as needed. The code below uses Web.js syntax and might differ from your APIs, depending on what web3 connector you've installed.\n\n```\nSimpleStorage.methods.set(100).send();\n\nSimpleStorage.methods.get().call().then(value => {\n console.log(value);\n});\n\nSimpleStorage.methods.storedData().call().then(value => {\n console.log(value);\n});\n```\n","source":"docs/contracts_javascript.md","raw":"title: Smart Contracts in JavaScript\nlayout: docs\n---\n\nIn order to talk to our deployed Smart Contracts through a web application, we typically need a JavaScript equivalent that offers APIs to make this possible. Embark generates JavaScript artifacts for all Smart Contracts used by our application.\n\nIn this guide we'll take a quick look how to make use of them!\n\n## Importing and using Smart Contracts\n\nEmbark will [automatically generate artifacts](/docs/javascript_usage.html#Embark-Artifacts) for all configured Smart Contracts in our application, making them available to an application's front-end. Allwe have to do is importing them accordingly. For example, the Smart Contract below:\n\n```\ncontract SimpleStorage {\n uint public storedData;\n\n function SimpleStorage(uint initialValue) {\n storedData = initialValue;\n }\n\n function set(uint x) {\n storedData = x;\n }\n function get() constant returns (uint retVal) {\n return storedData;\n }\n}\n```\n\nWill available as JavaScript object, after artifact generation and can be imported as:\n\n```\nimport { SimpleStorage } from './embarkArtifacts/contracts';\n```\n\nNotice that the exact path to the Smart Contract source is configured using the `generationDir` property in [Embark's configuration](/docs/configuration.html#generationDir).\n\nOnce imported, Smart Contract APIs can be used as needed. The code below uses Web.js syntax and might differ from your APIs, depending on what web3 connector you've installed.\n\n```\nSimpleStorage.methods.set(100).send();\n\nSimpleStorage.methods.get().call().then(value => {\n console.log(value);\n});\n\nSimpleStorage.methods.storedData().call().then(value => {\n console.log(value);\n});\n```\n","date":"2020-01-17T19:00:03.896Z","updated":"2020-01-17T19:00:03.896Z","path":"docs/contracts_javascript.html","comments":1,"_id":"ck5ijm3rd000z7heggz02alrd","content":"

In order to talk to our deployed Smart Contracts through a web application, we typically need a JavaScript equivalent that offers APIs to make this possible. Embark generates JavaScript artifacts for all Smart Contracts used by our application.

\n

In this guide we’ll take a quick look how to make use of them!

\n

Importing and using Smart Contracts

Embark will automatically generate artifacts for all configured Smart Contracts in our application, making them available to an application’s front-end. Allwe have to do is importing them accordingly. For example, the Smart Contract below:

\n
contract SimpleStorage {
uint public storedData;

function SimpleStorage(uint initialValue) {
storedData = initialValue;
}

function set(uint x) {
storedData = x;
}
function get() constant returns (uint retVal) {
return storedData;
}
}
\n\n

Will available as JavaScript object, after artifact generation and can be imported as:

\n
import { SimpleStorage } from './embarkArtifacts/contracts';
\n\n

Notice that the exact path to the Smart Contract source is configured using the generationDir property in Embark’s configuration.

\n

Once imported, Smart Contract APIs can be used as needed. The code below uses Web.js syntax and might differ from your APIs, depending on what web3 connector you’ve installed.

\n
SimpleStorage.methods.set(100).send();

SimpleStorage.methods.get().call().then(value => {
console.log(value);
});

SimpleStorage.methods.storedData().call().then(value => {
console.log(value);
});
\n","site":{"data":{"authors":{"iuri_matias":{"name":"Iuri Matias","twitter":"iurimatias","image":"https://pbs.twimg.com/profile_images/928272512181563392/iDJdvy2k_400x400.jpg"},"pascal_precht":{"name":"Pascal Precht","twitter":"pascalprecht","image":"https://pbs.twimg.com/profile_images/993785060733194241/p3oAIMDP_400x400.jpg"},"anthony_laibe":{"name":"Anthony Laibe","twitter":"a_laibe","image":"https://pbs.twimg.com/profile_images/257742900/13168239_400x400.jpg"},"jonathan_rainville":{"name":"Jonathan Rainville","twitter":"ShyolGhul","image":"https://pbs.twimg.com/profile_images/993873866878570496/-aE4byjj_400x400.jpg"},"andre_medeiros":{"name":"Andre Medeiros","twitter":"superdealloc","image":"https://pbs.twimg.com/profile_images/965722487735701504/m58KNgWN_400x400.jpg"},"eric_mastro":{"name":"Eric Mastro","twitter":"ericmastro","image":"https://avatars1.githubusercontent.com/u/5089238?s=460&v=4"},"michael_bradley":{"name":"Michael Bradley","image":"https://avatars3.githubusercontent.com/u/194260?s=460&v=4"},"richard_ramos":{"name":"Richard Ramos","twitter":"richardramos_me","image":"https://pbs.twimg.com/profile_images/1063160577973866496/aM313uHG_400x400.jpg"},"jonny_zerah":{"name":"Jonny Zerah","twitter":"jonnyzerah","image":"https://pbs.twimg.com/profile_images/1043774340490248192/gI9aGy17_400x400.jpg"},"robin_percy":{"name":"Robin Percy","twitter":"rbin","image":"https://avatars1.githubusercontent.com/u/29288325?s=400&v=4"}},"categories":{"tutorials":"Tutorials","announcements":"Announcements"},"languages":{"en":"English"},"plugins":[{"name":"embark-bamboo","description":"plugins_page.plugins.bamboo.desc","link":"https://www.npmjs.com/package/embark-bamboo","thumbnail":"bamboo.png","tags":["language","smart-contracts"]},{"name":"embark-solc","description":"plugins_page.plugins.solc.desc","link":"https://www.npmjs.com/package/embark-solc","thumbnail":"solidity.png","tags":["solidity","language","smart-contracts"]},{"name":"embark-solium","description":"plugins_page.plugins.solium.desc","link":"https://www.npmjs.com/package/embark-solium","thumbnail":"solium.png","tags":["linter","solidity","solium"]},{"name":"embark-etherscan-verifier","description":"plugins_page.plugins.verifier.desc","link":"https://www.npmjs.com/package/embark-etherscan-verifier","tags":["solidity","etherscan","smart-contracts"]},{"name":"embark-status","description":"plugins_page.plugins.status.desc","link":"https://www.npmjs.com/package/embark-status-plugin","thumbnail":"status.png","tags":["status","mobile"]},{"name":"embark-remix","description":"plugins_page.plugins.remix.desc","link":"https://www.npmjs.com/package/embark-remix","thumbnail":"remix.png","tags":["remix","debugger"]},{"name":"embark-slither","description":"plugins_page.plugins.slither.desc","link":"https://www.npmjs.com/package/embark-slither","tags":["solidity"]},{"name":"embark-snark","description":"plugins_page.plugins.snark.desc","link":"https://www.npmjs.com/package/embark-snark","tags":["snark"]},{"name":"embark-fortune","description":"plugins_page.plugins.fortune.desc","link":"https://www.npmjs.com/package/embark-fortune","thumbnail":"fortune.jpg","tags":["fun"]},{"name":"embark-pug","description":"plugins_page.plugins.pug.desc","link":"https://www.npmjs.com/package/embark-pug","legacy":true,"thumbnail":"pug.png","tags":["pug","jade","templates"]},{"name":"embark-haml","description":"plugins_page.plugins.haml.desc","link":"https://www.npmjs.com/package/embark-haml","legacy":true,"thumbnail":"haml.png","tags":["haml","templates"]},{"name":"embark-mythx","description":"plugins_page.plugins.mythx.desc","link":"https://www.npmjs.com/package/embark-mythx","thumbnail":"mythx.png","tags":["mythx","smart-contracts"]}],"menu":{"docs":"/docs/","plugins":"/plugins/","chat":"/chat/","blog":"/news/"},"sidebar":{"docs":{"getting_started":{"overview":"overview.html","installation":"installation.html","faq":"faq.html"},"general_usage":{"creating_project":"create_project.html","structure":"structure.html","running_apps":"running_apps.html","dashboard":"dashboard.html","using_the_console":"using_the_console.html","environments":"environments.html","configuration":"configuration.html","pipeline_and_webpack":"pipeline_and_webpack.html","javascript_usage":"javascript_usage.html"},"smart_contracts":{"contracts_configuration":"contracts_configuration.html","contracts_deployment":"contracts_deployment.html","contracts_imports":"contracts_imports.html","contracts_testing":"contracts_testing.html","contracts_javascript":"contracts_javascript.html"},"blockchain_node":{"blockchain_configuration":"blockchain_configuration.html","blockchain_accounts_configuration":"blockchain_accounts_configuration.html"},"storage":{"storage_configuration":"storage_configuration.html","storage_deployment":"storage_deployment.html","storage_javascript":"storage_javascript.html"},"messages":{"messages_configuration":"messages_configuration.html","messages_javascript":"messages_javascript.html"},"naming":{"naming_configuration":"naming_configuration.html","naming_javascript":"naming_javascript.html"},"plugins":{"installing_a_plugin":"installing_plugins.html","creating_a_plugin":"creating_plugins.html","plugin_reference":"plugin_reference.html"},"cockpit":{"cockpit_introduction":"cockpit_introduction.html","cockpit_dashboard":"cockpit_dashboard.html","cockpit_deployment":"cockpit_deployment.html","cockpit_explorer":"cockpit_explorer.html","cockpit_editor":"cockpit_editor.html","cockpit_debugger":"cockpit_debugger.html"},"reference":{"embark_commands":"embark_commands.html"},"miscellaneous":{"migrating_from_3":"migrating_from_3.x.html","troubleshooting":"troubleshooting.html","contributing":"contributing.html"}}},"templates":[{"name":"Vyper Template","description":"Template to demonstrate the use of the Vyper contracts","install":"embark new AppName --template vyper","thumbnail":"vyper.png","link":"https://github.com/embarklabs/embark-vyper-template","tags":["vyper","contracts"]},{"name":"Embark Demo React Template","description":"A React Application showcasing Embark's functionality","install":"embark demo","thumbnail":"react.png","link":"https://embark.embarklabs.io/docs/create_project.html#Creating-a-Demo-Project","tags":["react","contracts","whisper","ipfs"]},{"name":"Typescript Template","description":"Template with Typescript support pre-configured","thumbnail":"typescript.png","install":"embark new AppName --template typescript","link":"https://github.com/embarklabs/embark-typescript-template","tags":["typescript","frontend"]},{"name":"Vue.js Template","description":"Ready to use Template for using Embark with vue.js","thumbnail":"vuejs.png","install":"embark new AppName --template vue","link":"https://github.com/embarklabs/embark-vue-template","tags":["vue.js","frontend"]},{"name":"ethvtx Template","description":"Demo app for ethvtx, an Ethereum-Ready & Framework-Agnostic Redux configuration","thumbnail":"vortex.png","install":"embark new AppName --template Horyus/ethvtx_embark","link":"https://github.com/Horyus/ethvtx_embark","tags":["react"]},{"name":"Bamboo Template","description":"Template to demonstrate use of the Bamboo contracts","install":"embark new AppName --template bamboo","thumbnail":"bamboo.png","link":"https://github.com/embarklabs/embark-bamboo-template","tags":["bamboo","contracts"]},{"name":"Solidity Gas Golfing","description":"Boilerplate and tests for the first Solidity Gas Golfing Contest","thumbnail":"sggc.png","install":"embark new AppName --template embarklabs/sggc","link":"https://github.com/embarklabs/sggc","tags":["solidity","tests","fun"]}],"tutorials":[{"name":"How to create a Token Factory with Ethereum — Part 1","description":"Create and Deploy a Token with Ethereum","link":"/tutorials/token_factory_1.html","tags":["token","ethereum"]},{"name":"How to create a Token Factory with Ethereum — Part 2","description":"Create a DApp that can deploy Tokens on the fly","link":"/tutorials/token_factory_2.html","tags":["token","ethereum","client-side-deployment"]},{"name":"How to deploy to a testnet with Infura","description":"Deploy and interact with your Dapp on a testnet with the use of Infura","link":"/tutorials/infura_guide.html","tags":["ethereum","deployment","testnet"]}],"versions":{"latest":{"label":"stable (v4)","url":"https://embark.embarklabs.io/docs"},"3.2":{"label":"v3.2","url":"https://5ca4e0fdb29712000adde37f--embark-site-versions.netlify.com/docs/"}}}},"excerpt":"","more":"

In order to talk to our deployed Smart Contracts through a web application, we typically need a JavaScript equivalent that offers APIs to make this possible. Embark generates JavaScript artifacts for all Smart Contracts used by our application.

\n

In this guide we’ll take a quick look how to make use of them!

\n

Importing and using Smart Contracts

Embark will automatically generate artifacts for all configured Smart Contracts in our application, making them available to an application’s front-end. Allwe have to do is importing them accordingly. For example, the Smart Contract below:

\n
contract SimpleStorage {
uint public storedData;

function SimpleStorage(uint initialValue) {
storedData = initialValue;
}

function set(uint x) {
storedData = x;
}
function get() constant returns (uint retVal) {
return storedData;
}
}
\n\n

Will available as JavaScript object, after artifact generation and can be imported as:

\n
import { SimpleStorage } from './embarkArtifacts/contracts';
\n\n

Notice that the exact path to the Smart Contract source is configured using the generationDir property in Embark’s configuration.

\n

Once imported, Smart Contract APIs can be used as needed. The code below uses Web.js syntax and might differ from your APIs, depending on what web3 connector you’ve installed.

\n
SimpleStorage.methods.set(100).send();

SimpleStorage.methods.get().call().then(value => {
console.log(value);
});

SimpleStorage.methods.storedData().call().then(value => {
console.log(value);
});
\n"},{"title":"Creating apps with Embark","layout":"docs","_content":"\nOnce Embark is installed, there are different ways to create a new decentralized application. Whether we intent to create an application that uses only Smart Contracts, or we want to take advantage of other decentralized features like storages and messaging, Embark provides options and templates for various scenarios. Let's take a look!\n\n## Using the `demo` command\n\nAs discussed in our [quickstart guide](/docs/quick_start.html), the fastest way to get up and running with Embark is using its `demo` command. This will scaffold a new demo application and its needed environment in a folder called `embark_demo`. The demo application lets you play with Embark's APIs through a pre-built web interface.\n\n```\n$ embark demo\n```\n\n## Creating a new app\n\nIf you prefer starting entirely from scratch, while still getting a ready to use environment, Embark's `new` command has got you covered. Similar to the `demo` command, it will scaffold a new project folder. However, it will not include the demo application. The green field is all yours.\n\n{% notification info 'Quick tip: Smart Contract only apps' %}\nSmart Contract developers that mainly want to focus on building and deploying Smart Contracts can take advantage of `new` command's `--contracts-only` option, as described [here](create_project.html#Creating-“contracts-only”-apps).\n{% endnotification %}\n\n```\n$ embark new \n```\n\n## Creating apps from templates\n\nAnother possible scenario to start from is taking advantage of a template. Embark [comes with templates](/templates) for various environments and frameworks, but you can also use any template created by the community. In order to create a new app from a template, use the `--template` option and either specify a supported template name, or a Git host URL.\n\nThe following example creates a new application from [Embark's TypeScript template](https://github.com/embarklabs/embark-typescript-template):\n\n```\n$ embark new --template typescript\n```\n\nTo learn more about supported templates, head over to our [templates](/templates) or look out for `embark-[template_name]-template` [repositories](https://github.com/embarklabs?utf8=%E2%9C%93&q=template&type=&language=).\n\nTemplates can also be fetched from external resources as long as they can be referred to via Git host URLs. The following example fetches a template from a GitHub repository and uses that to create that app:\n\n```\n$ embark new --template https://github.com/embarklabs/embark-vue-template\n```\n\nIn fact, in case of GitHub, the same can be done with the username/repository shortcut:\n\n```\n$ embark new --template embarklabs/embark-vue-template\n```\n\nIt is even possible to specify the branch by appending a `#` and the branch name you're interested in:\n\n```\n$ embark new --template status-im/dappcon-workshop-dapp#start-here\n```\n\n## Creating \"contracts-only\" apps\n\nSometimes, all we really want to do is creating, developing, compiling and deploying Smart Contracts without introducing an actual front-end that talks to them. Embark lets us scaffold apps that come with the most minimal setup needed to build and deploy our Smart Contracts, using the `--contracts-only` option.\n\nThe following command will create a project with all Embark services disabled except the blockchain service.\n\n```\n$ embark new --contracts-only\n```\n\nThis will also affect the generated application structure, as Smart Contract only apps are less complex. Learn more about the application structure of Smart Contract only apps [here](structure.html#Simple-template-structure).\n\n{% notification info 'A note on --simple' %}\nIn earlier versions of Embark the same could be achieved using the `--simple` option. This option is still supported but will be deprecated and likely be removed in future versions of Embark.\n{% endnotification %}\n","source":"docs/create_project.md","raw":"title: Creating apps with Embark\nlayout: docs\n---\n\nOnce Embark is installed, there are different ways to create a new decentralized application. Whether we intent to create an application that uses only Smart Contracts, or we want to take advantage of other decentralized features like storages and messaging, Embark provides options and templates for various scenarios. Let's take a look!\n\n## Using the `demo` command\n\nAs discussed in our [quickstart guide](/docs/quick_start.html), the fastest way to get up and running with Embark is using its `demo` command. This will scaffold a new demo application and its needed environment in a folder called `embark_demo`. The demo application lets you play with Embark's APIs through a pre-built web interface.\n\n```\n$ embark demo\n```\n\n## Creating a new app\n\nIf you prefer starting entirely from scratch, while still getting a ready to use environment, Embark's `new` command has got you covered. Similar to the `demo` command, it will scaffold a new project folder. However, it will not include the demo application. The green field is all yours.\n\n{% notification info 'Quick tip: Smart Contract only apps' %}\nSmart Contract developers that mainly want to focus on building and deploying Smart Contracts can take advantage of `new` command's `--contracts-only` option, as described [here](create_project.html#Creating-“contracts-only”-apps).\n{% endnotification %}\n\n```\n$ embark new \n```\n\n## Creating apps from templates\n\nAnother possible scenario to start from is taking advantage of a template. Embark [comes with templates](/templates) for various environments and frameworks, but you can also use any template created by the community. In order to create a new app from a template, use the `--template` option and either specify a supported template name, or a Git host URL.\n\nThe following example creates a new application from [Embark's TypeScript template](https://github.com/embarklabs/embark-typescript-template):\n\n```\n$ embark new --template typescript\n```\n\nTo learn more about supported templates, head over to our [templates](/templates) or look out for `embark-[template_name]-template` [repositories](https://github.com/embarklabs?utf8=%E2%9C%93&q=template&type=&language=).\n\nTemplates can also be fetched from external resources as long as they can be referred to via Git host URLs. The following example fetches a template from a GitHub repository and uses that to create that app:\n\n```\n$ embark new --template https://github.com/embarklabs/embark-vue-template\n```\n\nIn fact, in case of GitHub, the same can be done with the username/repository shortcut:\n\n```\n$ embark new --template embarklabs/embark-vue-template\n```\n\nIt is even possible to specify the branch by appending a `#` and the branch name you're interested in:\n\n```\n$ embark new --template status-im/dappcon-workshop-dapp#start-here\n```\n\n## Creating \"contracts-only\" apps\n\nSometimes, all we really want to do is creating, developing, compiling and deploying Smart Contracts without introducing an actual front-end that talks to them. Embark lets us scaffold apps that come with the most minimal setup needed to build and deploy our Smart Contracts, using the `--contracts-only` option.\n\nThe following command will create a project with all Embark services disabled except the blockchain service.\n\n```\n$ embark new --contracts-only\n```\n\nThis will also affect the generated application structure, as Smart Contract only apps are less complex. Learn more about the application structure of Smart Contract only apps [here](structure.html#Simple-template-structure).\n\n{% notification info 'A note on --simple' %}\nIn earlier versions of Embark the same could be achieved using the `--simple` option. This option is still supported but will be deprecated and likely be removed in future versions of Embark.\n{% endnotification %}\n","date":"2020-01-19T20:56:53.009Z","updated":"2020-01-19T20:56:53.009Z","path":"docs/create_project.html","_id":"ck5ijm3rd00107heggjejgqmv","comments":1,"content":"

Once Embark is installed, there are different ways to create a new decentralized application. Whether we intent to create an application that uses only Smart Contracts, or we want to take advantage of other decentralized features like storages and messaging, Embark provides options and templates for various scenarios. Let’s take a look!

\n

Using the demo command

As discussed in our quickstart guide, the fastest way to get up and running with Embark is using its demo command. This will scaffold a new demo application and its needed environment in a folder called embark_demo. The demo application lets you play with Embark’s APIs through a pre-built web interface.

\n
$ embark demo
\n\n

Creating a new app

If you prefer starting entirely from scratch, while still getting a ready to use environment, Embark’s new command has got you covered. Similar to the demo command, it will scaffold a new project folder. However, it will not include the demo application. The green field is all yours.

\n
\n

Quick tip: Smart Contract only apps

\n

Smart Contract developers that mainly want to focus on building and deploying Smart Contracts can take advantage of new command’s --contracts-only option, as described here.

\n

\n
\n\n\n\n
$ embark new <YourDappName>
\n\n

Creating apps from templates

Another possible scenario to start from is taking advantage of a template. Embark comes with templates for various environments and frameworks, but you can also use any template created by the community. In order to create a new app from a template, use the --template option and either specify a supported template name, or a Git host URL.

\n

The following example creates a new application from Embark’s TypeScript template:

\n
$ embark new <YourDAppName> --template typescript
\n\n

To learn more about supported templates, head over to our templates or look out for embark-[template_name]-template repositories.

\n

Templates can also be fetched from external resources as long as they can be referred to via Git host URLs. The following example fetches a template from a GitHub repository and uses that to create that app:

\n
$ embark new <YourDAppName> --template https://github.com/embarklabs/embark-vue-template
\n\n

In fact, in case of GitHub, the same can be done with the username/repository shortcut:

\n
$ embark new <YourDAppName> --template embarklabs/embark-vue-template
\n\n

It is even possible to specify the branch by appending a # and the branch name you’re interested in:

\n
$ embark new <YourDAppName> --template status-im/dappcon-workshop-dapp#start-here
\n\n

Creating “contracts-only” apps

Sometimes, all we really want to do is creating, developing, compiling and deploying Smart Contracts without introducing an actual front-end that talks to them. Embark lets us scaffold apps that come with the most minimal setup needed to build and deploy our Smart Contracts, using the --contracts-only option.

\n

The following command will create a project with all Embark services disabled except the blockchain service.

\n
$ embark new <YourDAppName> --contracts-only
\n\n

This will also affect the generated application structure, as Smart Contract only apps are less complex. Learn more about the application structure of Smart Contract only apps here.

\n
\n

A note on --simple

\n

In earlier versions of Embark the same could be achieved using the --simple option. This option is still supported but will be deprecated and likely be removed in future versions of Embark.

\n

\n
\n\n\n","site":{"data":{"authors":{"iuri_matias":{"name":"Iuri Matias","twitter":"iurimatias","image":"https://pbs.twimg.com/profile_images/928272512181563392/iDJdvy2k_400x400.jpg"},"pascal_precht":{"name":"Pascal Precht","twitter":"pascalprecht","image":"https://pbs.twimg.com/profile_images/993785060733194241/p3oAIMDP_400x400.jpg"},"anthony_laibe":{"name":"Anthony Laibe","twitter":"a_laibe","image":"https://pbs.twimg.com/profile_images/257742900/13168239_400x400.jpg"},"jonathan_rainville":{"name":"Jonathan Rainville","twitter":"ShyolGhul","image":"https://pbs.twimg.com/profile_images/993873866878570496/-aE4byjj_400x400.jpg"},"andre_medeiros":{"name":"Andre Medeiros","twitter":"superdealloc","image":"https://pbs.twimg.com/profile_images/965722487735701504/m58KNgWN_400x400.jpg"},"eric_mastro":{"name":"Eric Mastro","twitter":"ericmastro","image":"https://avatars1.githubusercontent.com/u/5089238?s=460&v=4"},"michael_bradley":{"name":"Michael Bradley","image":"https://avatars3.githubusercontent.com/u/194260?s=460&v=4"},"richard_ramos":{"name":"Richard Ramos","twitter":"richardramos_me","image":"https://pbs.twimg.com/profile_images/1063160577973866496/aM313uHG_400x400.jpg"},"jonny_zerah":{"name":"Jonny Zerah","twitter":"jonnyzerah","image":"https://pbs.twimg.com/profile_images/1043774340490248192/gI9aGy17_400x400.jpg"},"robin_percy":{"name":"Robin Percy","twitter":"rbin","image":"https://avatars1.githubusercontent.com/u/29288325?s=400&v=4"}},"categories":{"tutorials":"Tutorials","announcements":"Announcements"},"languages":{"en":"English"},"plugins":[{"name":"embark-bamboo","description":"plugins_page.plugins.bamboo.desc","link":"https://www.npmjs.com/package/embark-bamboo","thumbnail":"bamboo.png","tags":["language","smart-contracts"]},{"name":"embark-solc","description":"plugins_page.plugins.solc.desc","link":"https://www.npmjs.com/package/embark-solc","thumbnail":"solidity.png","tags":["solidity","language","smart-contracts"]},{"name":"embark-solium","description":"plugins_page.plugins.solium.desc","link":"https://www.npmjs.com/package/embark-solium","thumbnail":"solium.png","tags":["linter","solidity","solium"]},{"name":"embark-etherscan-verifier","description":"plugins_page.plugins.verifier.desc","link":"https://www.npmjs.com/package/embark-etherscan-verifier","tags":["solidity","etherscan","smart-contracts"]},{"name":"embark-status","description":"plugins_page.plugins.status.desc","link":"https://www.npmjs.com/package/embark-status-plugin","thumbnail":"status.png","tags":["status","mobile"]},{"name":"embark-remix","description":"plugins_page.plugins.remix.desc","link":"https://www.npmjs.com/package/embark-remix","thumbnail":"remix.png","tags":["remix","debugger"]},{"name":"embark-slither","description":"plugins_page.plugins.slither.desc","link":"https://www.npmjs.com/package/embark-slither","tags":["solidity"]},{"name":"embark-snark","description":"plugins_page.plugins.snark.desc","link":"https://www.npmjs.com/package/embark-snark","tags":["snark"]},{"name":"embark-fortune","description":"plugins_page.plugins.fortune.desc","link":"https://www.npmjs.com/package/embark-fortune","thumbnail":"fortune.jpg","tags":["fun"]},{"name":"embark-pug","description":"plugins_page.plugins.pug.desc","link":"https://www.npmjs.com/package/embark-pug","legacy":true,"thumbnail":"pug.png","tags":["pug","jade","templates"]},{"name":"embark-haml","description":"plugins_page.plugins.haml.desc","link":"https://www.npmjs.com/package/embark-haml","legacy":true,"thumbnail":"haml.png","tags":["haml","templates"]},{"name":"embark-mythx","description":"plugins_page.plugins.mythx.desc","link":"https://www.npmjs.com/package/embark-mythx","thumbnail":"mythx.png","tags":["mythx","smart-contracts"]}],"menu":{"docs":"/docs/","plugins":"/plugins/","chat":"/chat/","blog":"/news/"},"sidebar":{"docs":{"getting_started":{"overview":"overview.html","installation":"installation.html","faq":"faq.html"},"general_usage":{"creating_project":"create_project.html","structure":"structure.html","running_apps":"running_apps.html","dashboard":"dashboard.html","using_the_console":"using_the_console.html","environments":"environments.html","configuration":"configuration.html","pipeline_and_webpack":"pipeline_and_webpack.html","javascript_usage":"javascript_usage.html"},"smart_contracts":{"contracts_configuration":"contracts_configuration.html","contracts_deployment":"contracts_deployment.html","contracts_imports":"contracts_imports.html","contracts_testing":"contracts_testing.html","contracts_javascript":"contracts_javascript.html"},"blockchain_node":{"blockchain_configuration":"blockchain_configuration.html","blockchain_accounts_configuration":"blockchain_accounts_configuration.html"},"storage":{"storage_configuration":"storage_configuration.html","storage_deployment":"storage_deployment.html","storage_javascript":"storage_javascript.html"},"messages":{"messages_configuration":"messages_configuration.html","messages_javascript":"messages_javascript.html"},"naming":{"naming_configuration":"naming_configuration.html","naming_javascript":"naming_javascript.html"},"plugins":{"installing_a_plugin":"installing_plugins.html","creating_a_plugin":"creating_plugins.html","plugin_reference":"plugin_reference.html"},"cockpit":{"cockpit_introduction":"cockpit_introduction.html","cockpit_dashboard":"cockpit_dashboard.html","cockpit_deployment":"cockpit_deployment.html","cockpit_explorer":"cockpit_explorer.html","cockpit_editor":"cockpit_editor.html","cockpit_debugger":"cockpit_debugger.html"},"reference":{"embark_commands":"embark_commands.html"},"miscellaneous":{"migrating_from_3":"migrating_from_3.x.html","troubleshooting":"troubleshooting.html","contributing":"contributing.html"}}},"templates":[{"name":"Vyper Template","description":"Template to demonstrate the use of the Vyper contracts","install":"embark new AppName --template vyper","thumbnail":"vyper.png","link":"https://github.com/embarklabs/embark-vyper-template","tags":["vyper","contracts"]},{"name":"Embark Demo React Template","description":"A React Application showcasing Embark's functionality","install":"embark demo","thumbnail":"react.png","link":"https://embark.embarklabs.io/docs/create_project.html#Creating-a-Demo-Project","tags":["react","contracts","whisper","ipfs"]},{"name":"Typescript Template","description":"Template with Typescript support pre-configured","thumbnail":"typescript.png","install":"embark new AppName --template typescript","link":"https://github.com/embarklabs/embark-typescript-template","tags":["typescript","frontend"]},{"name":"Vue.js Template","description":"Ready to use Template for using Embark with vue.js","thumbnail":"vuejs.png","install":"embark new AppName --template vue","link":"https://github.com/embarklabs/embark-vue-template","tags":["vue.js","frontend"]},{"name":"ethvtx Template","description":"Demo app for ethvtx, an Ethereum-Ready & Framework-Agnostic Redux configuration","thumbnail":"vortex.png","install":"embark new AppName --template Horyus/ethvtx_embark","link":"https://github.com/Horyus/ethvtx_embark","tags":["react"]},{"name":"Bamboo Template","description":"Template to demonstrate use of the Bamboo contracts","install":"embark new AppName --template bamboo","thumbnail":"bamboo.png","link":"https://github.com/embarklabs/embark-bamboo-template","tags":["bamboo","contracts"]},{"name":"Solidity Gas Golfing","description":"Boilerplate and tests for the first Solidity Gas Golfing Contest","thumbnail":"sggc.png","install":"embark new AppName --template embarklabs/sggc","link":"https://github.com/embarklabs/sggc","tags":["solidity","tests","fun"]}],"tutorials":[{"name":"How to create a Token Factory with Ethereum — Part 1","description":"Create and Deploy a Token with Ethereum","link":"/tutorials/token_factory_1.html","tags":["token","ethereum"]},{"name":"How to create a Token Factory with Ethereum — Part 2","description":"Create a DApp that can deploy Tokens on the fly","link":"/tutorials/token_factory_2.html","tags":["token","ethereum","client-side-deployment"]},{"name":"How to deploy to a testnet with Infura","description":"Deploy and interact with your Dapp on a testnet with the use of Infura","link":"/tutorials/infura_guide.html","tags":["ethereum","deployment","testnet"]}],"versions":{"latest":{"label":"stable (v4)","url":"https://embark.embarklabs.io/docs"},"3.2":{"label":"v3.2","url":"https://5ca4e0fdb29712000adde37f--embark-site-versions.netlify.com/docs/"}}}},"excerpt":"","more":"

Once Embark is installed, there are different ways to create a new decentralized application. Whether we intent to create an application that uses only Smart Contracts, or we want to take advantage of other decentralized features like storages and messaging, Embark provides options and templates for various scenarios. Let’s take a look!

\n

Using the demo command

As discussed in our quickstart guide, the fastest way to get up and running with Embark is using its demo command. This will scaffold a new demo application and its needed environment in a folder called embark_demo. The demo application lets you play with Embark’s APIs through a pre-built web interface.

\n
$ embark demo
\n\n

Creating a new app

If you prefer starting entirely from scratch, while still getting a ready to use environment, Embark’s new command has got you covered. Similar to the demo command, it will scaffold a new project folder. However, it will not include the demo application. The green field is all yours.

\n
\n

Quick tip: Smart Contract only apps

\n

Smart Contract developers that mainly want to focus on building and deploying Smart Contracts can take advantage of new command’s --contracts-only option, as described here.

\n

\n
\n\n\n\n
$ embark new <YourDappName>
\n\n

Creating apps from templates

Another possible scenario to start from is taking advantage of a template. Embark comes with templates for various environments and frameworks, but you can also use any template created by the community. In order to create a new app from a template, use the --template option and either specify a supported template name, or a Git host URL.

\n

The following example creates a new application from Embark’s TypeScript template:

\n
$ embark new <YourDAppName> --template typescript
\n\n

To learn more about supported templates, head over to our templates or look out for embark-[template_name]-template repositories.

\n

Templates can also be fetched from external resources as long as they can be referred to via Git host URLs. The following example fetches a template from a GitHub repository and uses that to create that app:

\n
$ embark new <YourDAppName> --template https://github.com/embarklabs/embark-vue-template
\n\n

In fact, in case of GitHub, the same can be done with the username/repository shortcut:

\n
$ embark new <YourDAppName> --template embarklabs/embark-vue-template
\n\n

It is even possible to specify the branch by appending a # and the branch name you’re interested in:

\n
$ embark new <YourDAppName> --template status-im/dappcon-workshop-dapp#start-here
\n\n

Creating “contracts-only” apps

Sometimes, all we really want to do is creating, developing, compiling and deploying Smart Contracts without introducing an actual front-end that talks to them. Embark lets us scaffold apps that come with the most minimal setup needed to build and deploy our Smart Contracts, using the --contracts-only option.

\n

The following command will create a project with all Embark services disabled except the blockchain service.

\n
$ embark new <YourDAppName> --contracts-only
\n\n

This will also affect the generated application structure, as Smart Contract only apps are less complex. Learn more about the application structure of Smart Contract only apps here.

\n
\n

A note on --simple

\n

In earlier versions of Embark the same could be achieved using the --simple option. This option is still supported but will be deprecated and likely be removed in future versions of Embark.

\n

\n
\n\n\n"},{"title":"Creating Plugins","layout":"docs","_content":"\nIf you can't [find a plugin](/plugins) that fulfills your needs, it's probably a good time to think about creating your own. In this guide we'll discuss how to set up a custom plugin and briefly talk about various use cases. Later on we'll dive into the available [Plugin APIs](/docs/plugin_reference.html).\n\n## Creating a plugin project\n\nA plugin is really just another NodeJS project that takes a plugin API object and make use of it. To get started, all we have to do is creating a new directory and initializing it as an npm module:\n\n```\n$ mkdir yourpluginname\n$ cd yourpluginname\n$ npm init\n```\n\nOnce that is done we can create an `index.js` file that contains the following code:\n\n```\nmodule.exports = function(embark) {\n // plugin logic goes here\n}\n```\n\nThe `embark` object provides plenty of APIs to extend different functionalities of Embark, which can be found in the [Plugin Api Reference](plugin_reference.html). \n\n## Usecase examples\n\nSince the Plugin API surface is rather big, here are some usecase examples to sparkle some inspiration:\n\n* Adding a Smart Contract file to the list of source files to be watched so they can be used by other Smart Contracts with `addContractFile()`\n* Adding a Smart Contract configuration using `registerContractConfiguration()` (goes well with `addContractFile()`)\n* Adding a hook that's called before a Smart Contract's binary will be deployed using `beforeDeploy()`\n* Configure a custom provider for web3 initialization with `registerClientWeb3Provider()`\n* Create your own custom Smart Contract wrapper logic using `registerContractsGeneration()`\n* Adding a new command to Embark's interactive console using `registerConsoleCommand()`\n* Adding support for other compilers such as Viper, LLL, etc. using `embark.registerCompiler()`\n* Executing certain actions when Smart Contracts are deployed with `embark.events.on()`\n* Registering a service in Embark - `registerServiceCheck()`\n\n","source":"docs/creating_plugins.md","raw":"title: Creating Plugins\nlayout: docs\n---\n\nIf you can't [find a plugin](/plugins) that fulfills your needs, it's probably a good time to think about creating your own. In this guide we'll discuss how to set up a custom plugin and briefly talk about various use cases. Later on we'll dive into the available [Plugin APIs](/docs/plugin_reference.html).\n\n## Creating a plugin project\n\nA plugin is really just another NodeJS project that takes a plugin API object and make use of it. To get started, all we have to do is creating a new directory and initializing it as an npm module:\n\n```\n$ mkdir yourpluginname\n$ cd yourpluginname\n$ npm init\n```\n\nOnce that is done we can create an `index.js` file that contains the following code:\n\n```\nmodule.exports = function(embark) {\n // plugin logic goes here\n}\n```\n\nThe `embark` object provides plenty of APIs to extend different functionalities of Embark, which can be found in the [Plugin Api Reference](plugin_reference.html). \n\n## Usecase examples\n\nSince the Plugin API surface is rather big, here are some usecase examples to sparkle some inspiration:\n\n* Adding a Smart Contract file to the list of source files to be watched so they can be used by other Smart Contracts with `addContractFile()`\n* Adding a Smart Contract configuration using `registerContractConfiguration()` (goes well with `addContractFile()`)\n* Adding a hook that's called before a Smart Contract's binary will be deployed using `beforeDeploy()`\n* Configure a custom provider for web3 initialization with `registerClientWeb3Provider()`\n* Create your own custom Smart Contract wrapper logic using `registerContractsGeneration()`\n* Adding a new command to Embark's interactive console using `registerConsoleCommand()`\n* Adding support for other compilers such as Viper, LLL, etc. using `embark.registerCompiler()`\n* Executing certain actions when Smart Contracts are deployed with `embark.events.on()`\n* Registering a service in Embark - `registerServiceCheck()`\n\n","date":"2020-01-17T19:00:03.900Z","updated":"2020-01-17T19:00:03.900Z","path":"docs/creating_plugins.html","comments":1,"_id":"ck5ijm3rh00117hegf0x15hmt","content":"

If you can’t find a plugin that fulfills your needs, it’s probably a good time to think about creating your own. In this guide we’ll discuss how to set up a custom plugin and briefly talk about various use cases. Later on we’ll dive into the available Plugin APIs.

\n

Creating a plugin project

A plugin is really just another NodeJS project that takes a plugin API object and make use of it. To get started, all we have to do is creating a new directory and initializing it as an npm module:

\n
$ mkdir yourpluginname
$ cd yourpluginname
$ npm init
\n\n

Once that is done we can create an index.js file that contains the following code:

\n
module.exports = function(embark) {
// plugin logic goes here
}
\n\n

The embark object provides plenty of APIs to extend different functionalities of Embark, which can be found in the Plugin Api Reference.

\n

Usecase examples

Since the Plugin API surface is rather big, here are some usecase examples to sparkle some inspiration:

\n
    \n
  • Adding a Smart Contract file to the list of source files to be watched so they can be used by other Smart Contracts with addContractFile()
  • \n
  • Adding a Smart Contract configuration using registerContractConfiguration() (goes well with addContractFile())
  • \n
  • Adding a hook that’s called before a Smart Contract’s binary will be deployed using beforeDeploy()
  • \n
  • Configure a custom provider for web3 initialization with registerClientWeb3Provider()
  • \n
  • Create your own custom Smart Contract wrapper logic using registerContractsGeneration()
  • \n
  • Adding a new command to Embark’s interactive console using registerConsoleCommand()
  • \n
  • Adding support for other compilers such as Viper, LLL, etc. using embark.registerCompiler()
  • \n
  • Executing certain actions when Smart Contracts are deployed with embark.events.on()
  • \n
  • Registering a service in Embark - registerServiceCheck()
  • \n
\n","site":{"data":{"authors":{"iuri_matias":{"name":"Iuri Matias","twitter":"iurimatias","image":"https://pbs.twimg.com/profile_images/928272512181563392/iDJdvy2k_400x400.jpg"},"pascal_precht":{"name":"Pascal Precht","twitter":"pascalprecht","image":"https://pbs.twimg.com/profile_images/993785060733194241/p3oAIMDP_400x400.jpg"},"anthony_laibe":{"name":"Anthony Laibe","twitter":"a_laibe","image":"https://pbs.twimg.com/profile_images/257742900/13168239_400x400.jpg"},"jonathan_rainville":{"name":"Jonathan Rainville","twitter":"ShyolGhul","image":"https://pbs.twimg.com/profile_images/993873866878570496/-aE4byjj_400x400.jpg"},"andre_medeiros":{"name":"Andre Medeiros","twitter":"superdealloc","image":"https://pbs.twimg.com/profile_images/965722487735701504/m58KNgWN_400x400.jpg"},"eric_mastro":{"name":"Eric Mastro","twitter":"ericmastro","image":"https://avatars1.githubusercontent.com/u/5089238?s=460&v=4"},"michael_bradley":{"name":"Michael Bradley","image":"https://avatars3.githubusercontent.com/u/194260?s=460&v=4"},"richard_ramos":{"name":"Richard Ramos","twitter":"richardramos_me","image":"https://pbs.twimg.com/profile_images/1063160577973866496/aM313uHG_400x400.jpg"},"jonny_zerah":{"name":"Jonny Zerah","twitter":"jonnyzerah","image":"https://pbs.twimg.com/profile_images/1043774340490248192/gI9aGy17_400x400.jpg"},"robin_percy":{"name":"Robin Percy","twitter":"rbin","image":"https://avatars1.githubusercontent.com/u/29288325?s=400&v=4"}},"categories":{"tutorials":"Tutorials","announcements":"Announcements"},"languages":{"en":"English"},"plugins":[{"name":"embark-bamboo","description":"plugins_page.plugins.bamboo.desc","link":"https://www.npmjs.com/package/embark-bamboo","thumbnail":"bamboo.png","tags":["language","smart-contracts"]},{"name":"embark-solc","description":"plugins_page.plugins.solc.desc","link":"https://www.npmjs.com/package/embark-solc","thumbnail":"solidity.png","tags":["solidity","language","smart-contracts"]},{"name":"embark-solium","description":"plugins_page.plugins.solium.desc","link":"https://www.npmjs.com/package/embark-solium","thumbnail":"solium.png","tags":["linter","solidity","solium"]},{"name":"embark-etherscan-verifier","description":"plugins_page.plugins.verifier.desc","link":"https://www.npmjs.com/package/embark-etherscan-verifier","tags":["solidity","etherscan","smart-contracts"]},{"name":"embark-status","description":"plugins_page.plugins.status.desc","link":"https://www.npmjs.com/package/embark-status-plugin","thumbnail":"status.png","tags":["status","mobile"]},{"name":"embark-remix","description":"plugins_page.plugins.remix.desc","link":"https://www.npmjs.com/package/embark-remix","thumbnail":"remix.png","tags":["remix","debugger"]},{"name":"embark-slither","description":"plugins_page.plugins.slither.desc","link":"https://www.npmjs.com/package/embark-slither","tags":["solidity"]},{"name":"embark-snark","description":"plugins_page.plugins.snark.desc","link":"https://www.npmjs.com/package/embark-snark","tags":["snark"]},{"name":"embark-fortune","description":"plugins_page.plugins.fortune.desc","link":"https://www.npmjs.com/package/embark-fortune","thumbnail":"fortune.jpg","tags":["fun"]},{"name":"embark-pug","description":"plugins_page.plugins.pug.desc","link":"https://www.npmjs.com/package/embark-pug","legacy":true,"thumbnail":"pug.png","tags":["pug","jade","templates"]},{"name":"embark-haml","description":"plugins_page.plugins.haml.desc","link":"https://www.npmjs.com/package/embark-haml","legacy":true,"thumbnail":"haml.png","tags":["haml","templates"]},{"name":"embark-mythx","description":"plugins_page.plugins.mythx.desc","link":"https://www.npmjs.com/package/embark-mythx","thumbnail":"mythx.png","tags":["mythx","smart-contracts"]}],"menu":{"docs":"/docs/","plugins":"/plugins/","chat":"/chat/","blog":"/news/"},"sidebar":{"docs":{"getting_started":{"overview":"overview.html","installation":"installation.html","faq":"faq.html"},"general_usage":{"creating_project":"create_project.html","structure":"structure.html","running_apps":"running_apps.html","dashboard":"dashboard.html","using_the_console":"using_the_console.html","environments":"environments.html","configuration":"configuration.html","pipeline_and_webpack":"pipeline_and_webpack.html","javascript_usage":"javascript_usage.html"},"smart_contracts":{"contracts_configuration":"contracts_configuration.html","contracts_deployment":"contracts_deployment.html","contracts_imports":"contracts_imports.html","contracts_testing":"contracts_testing.html","contracts_javascript":"contracts_javascript.html"},"blockchain_node":{"blockchain_configuration":"blockchain_configuration.html","blockchain_accounts_configuration":"blockchain_accounts_configuration.html"},"storage":{"storage_configuration":"storage_configuration.html","storage_deployment":"storage_deployment.html","storage_javascript":"storage_javascript.html"},"messages":{"messages_configuration":"messages_configuration.html","messages_javascript":"messages_javascript.html"},"naming":{"naming_configuration":"naming_configuration.html","naming_javascript":"naming_javascript.html"},"plugins":{"installing_a_plugin":"installing_plugins.html","creating_a_plugin":"creating_plugins.html","plugin_reference":"plugin_reference.html"},"cockpit":{"cockpit_introduction":"cockpit_introduction.html","cockpit_dashboard":"cockpit_dashboard.html","cockpit_deployment":"cockpit_deployment.html","cockpit_explorer":"cockpit_explorer.html","cockpit_editor":"cockpit_editor.html","cockpit_debugger":"cockpit_debugger.html"},"reference":{"embark_commands":"embark_commands.html"},"miscellaneous":{"migrating_from_3":"migrating_from_3.x.html","troubleshooting":"troubleshooting.html","contributing":"contributing.html"}}},"templates":[{"name":"Vyper Template","description":"Template to demonstrate the use of the Vyper contracts","install":"embark new AppName --template vyper","thumbnail":"vyper.png","link":"https://github.com/embarklabs/embark-vyper-template","tags":["vyper","contracts"]},{"name":"Embark Demo React Template","description":"A React Application showcasing Embark's functionality","install":"embark demo","thumbnail":"react.png","link":"https://embark.embarklabs.io/docs/create_project.html#Creating-a-Demo-Project","tags":["react","contracts","whisper","ipfs"]},{"name":"Typescript Template","description":"Template with Typescript support pre-configured","thumbnail":"typescript.png","install":"embark new AppName --template typescript","link":"https://github.com/embarklabs/embark-typescript-template","tags":["typescript","frontend"]},{"name":"Vue.js Template","description":"Ready to use Template for using Embark with vue.js","thumbnail":"vuejs.png","install":"embark new AppName --template vue","link":"https://github.com/embarklabs/embark-vue-template","tags":["vue.js","frontend"]},{"name":"ethvtx Template","description":"Demo app for ethvtx, an Ethereum-Ready & Framework-Agnostic Redux configuration","thumbnail":"vortex.png","install":"embark new AppName --template Horyus/ethvtx_embark","link":"https://github.com/Horyus/ethvtx_embark","tags":["react"]},{"name":"Bamboo Template","description":"Template to demonstrate use of the Bamboo contracts","install":"embark new AppName --template bamboo","thumbnail":"bamboo.png","link":"https://github.com/embarklabs/embark-bamboo-template","tags":["bamboo","contracts"]},{"name":"Solidity Gas Golfing","description":"Boilerplate and tests for the first Solidity Gas Golfing Contest","thumbnail":"sggc.png","install":"embark new AppName --template embarklabs/sggc","link":"https://github.com/embarklabs/sggc","tags":["solidity","tests","fun"]}],"tutorials":[{"name":"How to create a Token Factory with Ethereum — Part 1","description":"Create and Deploy a Token with Ethereum","link":"/tutorials/token_factory_1.html","tags":["token","ethereum"]},{"name":"How to create a Token Factory with Ethereum — Part 2","description":"Create a DApp that can deploy Tokens on the fly","link":"/tutorials/token_factory_2.html","tags":["token","ethereum","client-side-deployment"]},{"name":"How to deploy to a testnet with Infura","description":"Deploy and interact with your Dapp on a testnet with the use of Infura","link":"/tutorials/infura_guide.html","tags":["ethereum","deployment","testnet"]}],"versions":{"latest":{"label":"stable (v4)","url":"https://embark.embarklabs.io/docs"},"3.2":{"label":"v3.2","url":"https://5ca4e0fdb29712000adde37f--embark-site-versions.netlify.com/docs/"}}}},"excerpt":"","more":"

If you can’t find a plugin that fulfills your needs, it’s probably a good time to think about creating your own. In this guide we’ll discuss how to set up a custom plugin and briefly talk about various use cases. Later on we’ll dive into the available Plugin APIs.

\n

Creating a plugin project

A plugin is really just another NodeJS project that takes a plugin API object and make use of it. To get started, all we have to do is creating a new directory and initializing it as an npm module:

\n
$ mkdir yourpluginname
$ cd yourpluginname
$ npm init
\n\n

Once that is done we can create an index.js file that contains the following code:

\n
module.exports = function(embark) {
// plugin logic goes here
}
\n\n

The embark object provides plenty of APIs to extend different functionalities of Embark, which can be found in the Plugin Api Reference.

\n

Usecase examples

Since the Plugin API surface is rather big, here are some usecase examples to sparkle some inspiration:

\n
    \n
  • Adding a Smart Contract file to the list of source files to be watched so they can be used by other Smart Contracts with addContractFile()
  • \n
  • Adding a Smart Contract configuration using registerContractConfiguration() (goes well with addContractFile())
  • \n
  • Adding a hook that’s called before a Smart Contract’s binary will be deployed using beforeDeploy()
  • \n
  • Configure a custom provider for web3 initialization with registerClientWeb3Provider()
  • \n
  • Create your own custom Smart Contract wrapper logic using registerContractsGeneration()
  • \n
  • Adding a new command to Embark’s interactive console using registerConsoleCommand()
  • \n
  • Adding support for other compilers such as Viper, LLL, etc. using embark.registerCompiler()
  • \n
  • Executing certain actions when Smart Contracts are deployed with embark.events.on()
  • \n
  • Registering a service in Embark - registerServiceCheck()
  • \n
\n"},{"title":"Using the dashboard","layout":"docs","_content":"\nEmbark provides a very useful dashboard view that aims to make it easier for developers to keep track of things, such as running services, compilation and deployments. In this guide, we'll take a closer look at the dashboard and its features.\n\n## Overview\n\nEmbark spins up the dashboard view automatically for us, whenever we run `embark run` inside an Embark project. Here's what it looks like:\n\n![Dashboard](/assets/images/embark-dashboard.png)\n\nThe dashboard is separated into different sections, each with their own responsibility. The sections are:\n\n- **Contracts** - This section shows you not only all the Smart Contracts within your project, but also their status on whether they are being deployed at the moment or not. Notice that, as we make changes to our Smart Contracts, the dashboard will reflect the automatic redeployment in this section as well, making it very easy to stay on top of things.\n\n- **Environment** - This is the name of the [environment](environments.html) we're running Embark in at the moment. If we don't specify an environment when running `embark run`, Embark will default to `development`.\n\n- **Status** - As mentioned, Embark watches for changes in our application's source code and will recompile, rebuild and redeploy components accordingly. The status section tells us what status Embark is currently in. Which could be one of the following:\n\n - **Compiling** - Compiles application's Smart Contracts\n - **Building** - Builds application's front-end\n - **Ready** - Ready and IDLE\n\n- **Available Services** - This section displays all services available to our application. If a service is down or unreachable, it will show up in red.\n\n- **Logs and Console** - While the logs section simply prints out all of Embark's output, the console can be used to either interact with our application's Smart Contracts or Embark itself. Use the `help` command to get a list of all available commands supported by Embark's console, or head over to our guide on [Using the the console](/docs/using_the_console.html) to learn more.\n\n## Running without a dashboard\n\nEmbark can be run without spinning up the dashboard view using the `--nodashboard` option. Head over to our guide on [running apps](running_apps.html#Running-an-app-without-the-dashboard) for more information.\n\n","source":"docs/dashboard.md","raw":"title: Using the dashboard\nlayout: docs\n---\n\nEmbark provides a very useful dashboard view that aims to make it easier for developers to keep track of things, such as running services, compilation and deployments. In this guide, we'll take a closer look at the dashboard and its features.\n\n## Overview\n\nEmbark spins up the dashboard view automatically for us, whenever we run `embark run` inside an Embark project. Here's what it looks like:\n\n![Dashboard](/assets/images/embark-dashboard.png)\n\nThe dashboard is separated into different sections, each with their own responsibility. The sections are:\n\n- **Contracts** - This section shows you not only all the Smart Contracts within your project, but also their status on whether they are being deployed at the moment or not. Notice that, as we make changes to our Smart Contracts, the dashboard will reflect the automatic redeployment in this section as well, making it very easy to stay on top of things.\n\n- **Environment** - This is the name of the [environment](environments.html) we're running Embark in at the moment. If we don't specify an environment when running `embark run`, Embark will default to `development`.\n\n- **Status** - As mentioned, Embark watches for changes in our application's source code and will recompile, rebuild and redeploy components accordingly. The status section tells us what status Embark is currently in. Which could be one of the following:\n\n - **Compiling** - Compiles application's Smart Contracts\n - **Building** - Builds application's front-end\n - **Ready** - Ready and IDLE\n\n- **Available Services** - This section displays all services available to our application. If a service is down or unreachable, it will show up in red.\n\n- **Logs and Console** - While the logs section simply prints out all of Embark's output, the console can be used to either interact with our application's Smart Contracts or Embark itself. Use the `help` command to get a list of all available commands supported by Embark's console, or head over to our guide on [Using the the console](/docs/using_the_console.html) to learn more.\n\n## Running without a dashboard\n\nEmbark can be run without spinning up the dashboard view using the `--nodashboard` option. Head over to our guide on [running apps](running_apps.html#Running-an-app-without-the-dashboard) for more information.\n\n","date":"2020-01-17T19:00:03.900Z","updated":"2020-01-17T19:00:03.900Z","path":"docs/dashboard.html","comments":1,"_id":"ck5ijm3ri00127heg8epn5ngz","content":"

Embark provides a very useful dashboard view that aims to make it easier for developers to keep track of things, such as running services, compilation and deployments. In this guide, we’ll take a closer look at the dashboard and its features.

\n

Overview

Embark spins up the dashboard view automatically for us, whenever we run embark run inside an Embark project. Here’s what it looks like:

\n

\"Dashboard\"

\n

The dashboard is separated into different sections, each with their own responsibility. The sections are:

\n
    \n
  • Contracts - This section shows you not only all the Smart Contracts within your project, but also their status on whether they are being deployed at the moment or not. Notice that, as we make changes to our Smart Contracts, the dashboard will reflect the automatic redeployment in this section as well, making it very easy to stay on top of things.

    \n
  • \n
  • Environment - This is the name of the environment we’re running Embark in at the moment. If we don’t specify an environment when running embark run, Embark will default to development.

    \n
  • \n
  • Status - As mentioned, Embark watches for changes in our application’s source code and will recompile, rebuild and redeploy components accordingly. The status section tells us what status Embark is currently in. Which could be one of the following:

    \n
      \n
    • Compiling - Compiles application’s Smart Contracts
    • \n
    • Building - Builds application’s front-end
    • \n
    • Ready - Ready and IDLE
    • \n
    \n
  • \n
  • Available Services - This section displays all services available to our application. If a service is down or unreachable, it will show up in red.

    \n
  • \n
  • Logs and Console - While the logs section simply prints out all of Embark’s output, the console can be used to either interact with our application’s Smart Contracts or Embark itself. Use the help command to get a list of all available commands supported by Embark’s console, or head over to our guide on Using the the console to learn more.

    \n
  • \n
\n

Running without a dashboard

Embark can be run without spinning up the dashboard view using the --nodashboard option. Head over to our guide on running apps for more information.

\n","site":{"data":{"authors":{"iuri_matias":{"name":"Iuri Matias","twitter":"iurimatias","image":"https://pbs.twimg.com/profile_images/928272512181563392/iDJdvy2k_400x400.jpg"},"pascal_precht":{"name":"Pascal Precht","twitter":"pascalprecht","image":"https://pbs.twimg.com/profile_images/993785060733194241/p3oAIMDP_400x400.jpg"},"anthony_laibe":{"name":"Anthony Laibe","twitter":"a_laibe","image":"https://pbs.twimg.com/profile_images/257742900/13168239_400x400.jpg"},"jonathan_rainville":{"name":"Jonathan Rainville","twitter":"ShyolGhul","image":"https://pbs.twimg.com/profile_images/993873866878570496/-aE4byjj_400x400.jpg"},"andre_medeiros":{"name":"Andre Medeiros","twitter":"superdealloc","image":"https://pbs.twimg.com/profile_images/965722487735701504/m58KNgWN_400x400.jpg"},"eric_mastro":{"name":"Eric Mastro","twitter":"ericmastro","image":"https://avatars1.githubusercontent.com/u/5089238?s=460&v=4"},"michael_bradley":{"name":"Michael Bradley","image":"https://avatars3.githubusercontent.com/u/194260?s=460&v=4"},"richard_ramos":{"name":"Richard Ramos","twitter":"richardramos_me","image":"https://pbs.twimg.com/profile_images/1063160577973866496/aM313uHG_400x400.jpg"},"jonny_zerah":{"name":"Jonny Zerah","twitter":"jonnyzerah","image":"https://pbs.twimg.com/profile_images/1043774340490248192/gI9aGy17_400x400.jpg"},"robin_percy":{"name":"Robin Percy","twitter":"rbin","image":"https://avatars1.githubusercontent.com/u/29288325?s=400&v=4"}},"categories":{"tutorials":"Tutorials","announcements":"Announcements"},"languages":{"en":"English"},"plugins":[{"name":"embark-bamboo","description":"plugins_page.plugins.bamboo.desc","link":"https://www.npmjs.com/package/embark-bamboo","thumbnail":"bamboo.png","tags":["language","smart-contracts"]},{"name":"embark-solc","description":"plugins_page.plugins.solc.desc","link":"https://www.npmjs.com/package/embark-solc","thumbnail":"solidity.png","tags":["solidity","language","smart-contracts"]},{"name":"embark-solium","description":"plugins_page.plugins.solium.desc","link":"https://www.npmjs.com/package/embark-solium","thumbnail":"solium.png","tags":["linter","solidity","solium"]},{"name":"embark-etherscan-verifier","description":"plugins_page.plugins.verifier.desc","link":"https://www.npmjs.com/package/embark-etherscan-verifier","tags":["solidity","etherscan","smart-contracts"]},{"name":"embark-status","description":"plugins_page.plugins.status.desc","link":"https://www.npmjs.com/package/embark-status-plugin","thumbnail":"status.png","tags":["status","mobile"]},{"name":"embark-remix","description":"plugins_page.plugins.remix.desc","link":"https://www.npmjs.com/package/embark-remix","thumbnail":"remix.png","tags":["remix","debugger"]},{"name":"embark-slither","description":"plugins_page.plugins.slither.desc","link":"https://www.npmjs.com/package/embark-slither","tags":["solidity"]},{"name":"embark-snark","description":"plugins_page.plugins.snark.desc","link":"https://www.npmjs.com/package/embark-snark","tags":["snark"]},{"name":"embark-fortune","description":"plugins_page.plugins.fortune.desc","link":"https://www.npmjs.com/package/embark-fortune","thumbnail":"fortune.jpg","tags":["fun"]},{"name":"embark-pug","description":"plugins_page.plugins.pug.desc","link":"https://www.npmjs.com/package/embark-pug","legacy":true,"thumbnail":"pug.png","tags":["pug","jade","templates"]},{"name":"embark-haml","description":"plugins_page.plugins.haml.desc","link":"https://www.npmjs.com/package/embark-haml","legacy":true,"thumbnail":"haml.png","tags":["haml","templates"]},{"name":"embark-mythx","description":"plugins_page.plugins.mythx.desc","link":"https://www.npmjs.com/package/embark-mythx","thumbnail":"mythx.png","tags":["mythx","smart-contracts"]}],"menu":{"docs":"/docs/","plugins":"/plugins/","chat":"/chat/","blog":"/news/"},"sidebar":{"docs":{"getting_started":{"overview":"overview.html","installation":"installation.html","faq":"faq.html"},"general_usage":{"creating_project":"create_project.html","structure":"structure.html","running_apps":"running_apps.html","dashboard":"dashboard.html","using_the_console":"using_the_console.html","environments":"environments.html","configuration":"configuration.html","pipeline_and_webpack":"pipeline_and_webpack.html","javascript_usage":"javascript_usage.html"},"smart_contracts":{"contracts_configuration":"contracts_configuration.html","contracts_deployment":"contracts_deployment.html","contracts_imports":"contracts_imports.html","contracts_testing":"contracts_testing.html","contracts_javascript":"contracts_javascript.html"},"blockchain_node":{"blockchain_configuration":"blockchain_configuration.html","blockchain_accounts_configuration":"blockchain_accounts_configuration.html"},"storage":{"storage_configuration":"storage_configuration.html","storage_deployment":"storage_deployment.html","storage_javascript":"storage_javascript.html"},"messages":{"messages_configuration":"messages_configuration.html","messages_javascript":"messages_javascript.html"},"naming":{"naming_configuration":"naming_configuration.html","naming_javascript":"naming_javascript.html"},"plugins":{"installing_a_plugin":"installing_plugins.html","creating_a_plugin":"creating_plugins.html","plugin_reference":"plugin_reference.html"},"cockpit":{"cockpit_introduction":"cockpit_introduction.html","cockpit_dashboard":"cockpit_dashboard.html","cockpit_deployment":"cockpit_deployment.html","cockpit_explorer":"cockpit_explorer.html","cockpit_editor":"cockpit_editor.html","cockpit_debugger":"cockpit_debugger.html"},"reference":{"embark_commands":"embark_commands.html"},"miscellaneous":{"migrating_from_3":"migrating_from_3.x.html","troubleshooting":"troubleshooting.html","contributing":"contributing.html"}}},"templates":[{"name":"Vyper Template","description":"Template to demonstrate the use of the Vyper contracts","install":"embark new AppName --template vyper","thumbnail":"vyper.png","link":"https://github.com/embarklabs/embark-vyper-template","tags":["vyper","contracts"]},{"name":"Embark Demo React Template","description":"A React Application showcasing Embark's functionality","install":"embark demo","thumbnail":"react.png","link":"https://embark.embarklabs.io/docs/create_project.html#Creating-a-Demo-Project","tags":["react","contracts","whisper","ipfs"]},{"name":"Typescript Template","description":"Template with Typescript support pre-configured","thumbnail":"typescript.png","install":"embark new AppName --template typescript","link":"https://github.com/embarklabs/embark-typescript-template","tags":["typescript","frontend"]},{"name":"Vue.js Template","description":"Ready to use Template for using Embark with vue.js","thumbnail":"vuejs.png","install":"embark new AppName --template vue","link":"https://github.com/embarklabs/embark-vue-template","tags":["vue.js","frontend"]},{"name":"ethvtx Template","description":"Demo app for ethvtx, an Ethereum-Ready & Framework-Agnostic Redux configuration","thumbnail":"vortex.png","install":"embark new AppName --template Horyus/ethvtx_embark","link":"https://github.com/Horyus/ethvtx_embark","tags":["react"]},{"name":"Bamboo Template","description":"Template to demonstrate use of the Bamboo contracts","install":"embark new AppName --template bamboo","thumbnail":"bamboo.png","link":"https://github.com/embarklabs/embark-bamboo-template","tags":["bamboo","contracts"]},{"name":"Solidity Gas Golfing","description":"Boilerplate and tests for the first Solidity Gas Golfing Contest","thumbnail":"sggc.png","install":"embark new AppName --template embarklabs/sggc","link":"https://github.com/embarklabs/sggc","tags":["solidity","tests","fun"]}],"tutorials":[{"name":"How to create a Token Factory with Ethereum — Part 1","description":"Create and Deploy a Token with Ethereum","link":"/tutorials/token_factory_1.html","tags":["token","ethereum"]},{"name":"How to create a Token Factory with Ethereum — Part 2","description":"Create a DApp that can deploy Tokens on the fly","link":"/tutorials/token_factory_2.html","tags":["token","ethereum","client-side-deployment"]},{"name":"How to deploy to a testnet with Infura","description":"Deploy and interact with your Dapp on a testnet with the use of Infura","link":"/tutorials/infura_guide.html","tags":["ethereum","deployment","testnet"]}],"versions":{"latest":{"label":"stable (v4)","url":"https://embark.embarklabs.io/docs"},"3.2":{"label":"v3.2","url":"https://5ca4e0fdb29712000adde37f--embark-site-versions.netlify.com/docs/"}}}},"excerpt":"","more":"

Embark provides a very useful dashboard view that aims to make it easier for developers to keep track of things, such as running services, compilation and deployments. In this guide, we’ll take a closer look at the dashboard and its features.

\n

Overview

Embark spins up the dashboard view automatically for us, whenever we run embark run inside an Embark project. Here’s what it looks like:

\n

\"Dashboard\"

\n

The dashboard is separated into different sections, each with their own responsibility. The sections are:

\n
    \n
  • Contracts - This section shows you not only all the Smart Contracts within your project, but also their status on whether they are being deployed at the moment or not. Notice that, as we make changes to our Smart Contracts, the dashboard will reflect the automatic redeployment in this section as well, making it very easy to stay on top of things.

    \n
  • \n
  • Environment - This is the name of the environment we’re running Embark in at the moment. If we don’t specify an environment when running embark run, Embark will default to development.

    \n
  • \n
  • Status - As mentioned, Embark watches for changes in our application’s source code and will recompile, rebuild and redeploy components accordingly. The status section tells us what status Embark is currently in. Which could be one of the following:

    \n
      \n
    • Compiling - Compiles application’s Smart Contracts
    • \n
    • Building - Builds application’s front-end
    • \n
    • Ready - Ready and IDLE
    • \n
    \n
  • \n
  • Available Services - This section displays all services available to our application. If a service is down or unreachable, it will show up in red.

    \n
  • \n
  • Logs and Console - While the logs section simply prints out all of Embark’s output, the console can be used to either interact with our application’s Smart Contracts or Embark itself. Use the help command to get a list of all available commands supported by Embark’s console, or head over to our guide on Using the the console to learn more.

    \n
  • \n
\n

Running without a dashboard

Embark can be run without spinning up the dashboard view using the --nodashboard option. Head over to our guide on running apps for more information.

\n"},{"title":"Embark CLI Commands","layout":"docs","_content":"\nThis is the Embark CLI command reference.\n\n## new\n\n```\n$ embark new dappName\n```\n\nCreates a new empty DApp project. If no `dappName` is provided, Embark will ask for the dappName.\n\nOption | Description\n--- | ---\n`--contracts-only` | create a barebones project meant only for contract development\n`--simple` | an alias for `--contracts-only`\n`--template` | download a template using a known name or a git host URL\n\nThe `--template` option supports several URL styles and shortcuts for git hosts:\n\n```\ngit@github.com:ghuser/repo_name\nhttps://github.com/ghuser/repo_name\ngithub:ghuser/repo_name\nghuser/repo_name\n```\n\nIt's possible to append a branch name to any of the above, for example:\n\n```\nhttps://github.com/ghuser/repo_name#branch_name\nghuser/repo_name#branch_name\n```\n\nBitbucket and GitLab URLs and shortcuts are also supported, for example:\n\n```\nbitbucket:bbuser/repo_name#branch_name\ngitlab:gluser/repo_name#branch_name\n```\n\nA short name can be used for templates maintained in the Embark GitHub organization, for example:\n\n```\n$ embark new --template typescript\n```\n\nPlease see our list of [officially supported templates](/templates/).\n\n## demo\n\n```\n$ embark demo\n```\n\nGenerates a demo Embark Project with a working contract and examples of working with contracts, IPFS and Whisper.\n\n## build\n\n```\n$ embark build [environment]\n```\n\nDeploys and Builds the DApp at dist/. If no `environment` is provider embark will use `development` by default.\n\n## run\n\n```\n$ embark run [environment]\n```\n\nDeploys and Builds the DApp at `dist/`. By default will launch a dashboard and start a dev server at `http://localhost:8000/`. If no `environment` is provider embark will use `development` by default.\n\nOption | Description\n--- | ---\n`-p`, `--port` | `port` to run the dev webserver (default: 8000)\n`-b`, `--host` | `host` to run the dev webserver (default: localhost)\n`--noserver` | disable the development webserver\n`--nodashboard` | simple mode, disables the dashboard\n`--nobrowser` | prevent the development webserver from automatically opening a web browser\n`--no-color` | no colors in case it's needed for compatbility purposes\n`--logfile` | `filename` to output logs (default: none)\n\n## eject-build-config\n\n```\n$ embark eject-build-config\n```\n\nCopies Embark's default `webpack.config.js` file into your DApp so that you can customize it. If a file named `webpack.config.js` is present in your top-level DApp directory, Embark will use your webpack config file instead of its own.\n\n## blockchain\n\n```\n$ embark blockchain [environment]\n```\n\nTakes the config at `config/blockchain.json` for the `environment` specified and starts a blockchain node. If no `environment` is provider embark will use `development` by default.\n\nIf you want, you can skip the step of running `embark blockchain`, as `embark run`, `build` and `upload` now all start a blockchain node in a separate process if there is not one already started using the same configurations.\n\n## simulator\n\n```\n$ embark simulator [environment]\n```\n\nTakes the config at `config/blockchain.json` for the `environment` specified and starts a blockchain simulator. If no `environment` is provider embark will use `development` by default.\n\nOption | Description\n--- | ---\n`-p`, `--port` | `port` to run the rpc simulator (default: 8545)\n`-h`, `--host` | `host` to run the rpc simulator (default: localhost)\n`-a`, `--accounts` | `num` of accounts to start the simulator (default: 10)\n`-e`, `--defaultBalanceEther` | `balance` in ether to assign each test account (default: 100)\n`-l`, `--gasLimit` | custom `gasLimit` (default: 8000000)\n\n## test\n\n```\n$ embark test [file]\n```\n\nRuns Tests. If `file` is not specified then it will run all the tests inside the `test/` directory.\n\nOption | Description\n--- | ---\n`-n`, `--node` | node for running the tests (default: vm)\n`-d`, `--gasDetails` | print the gas cost for each contract deployment when running the tests\n`-c`, `--coverage` | generate a coverage report after running the tests (vm only)\n\nThe `--node` option supports several values:\n\nValue | Description\n--- | ---\n`vm` | start and use an Ethereum simulator (ganache)\n`embark` | use the node of a running embark process\n`` | connect to and use the specified node\n\nExample of endpoint usage: `embark test --node ws://localhost:8556`\n\n## reset\n\n```\n$ embark reset\n```\n\nResets embarks state on this dapp including clearing cache.\n\n## upload\n\n```\n$ embark upload [platform] [environment]\n```\n\nUploads the DApp to a decentralized storage such as IPFS. `platform` can be `ipfs` or `swarm` or another parameter if supported by a plugin. If no `environment` is provider embark will use `development` by default.\n\n## graph\n\n```\n$ embark graph\n```\n\nGenerates documentation based on the smart contracts configured\n\n## version\n\n```\n$ embark version\n```\n\nDisplays version information.\n","source":"docs/embark_commands.md","raw":"title: Embark CLI Commands\nlayout: docs\n---\n\nThis is the Embark CLI command reference.\n\n## new\n\n```\n$ embark new dappName\n```\n\nCreates a new empty DApp project. If no `dappName` is provided, Embark will ask for the dappName.\n\nOption | Description\n--- | ---\n`--contracts-only` | create a barebones project meant only for contract development\n`--simple` | an alias for `--contracts-only`\n`--template` | download a template using a known name or a git host URL\n\nThe `--template` option supports several URL styles and shortcuts for git hosts:\n\n```\ngit@github.com:ghuser/repo_name\nhttps://github.com/ghuser/repo_name\ngithub:ghuser/repo_name\nghuser/repo_name\n```\n\nIt's possible to append a branch name to any of the above, for example:\n\n```\nhttps://github.com/ghuser/repo_name#branch_name\nghuser/repo_name#branch_name\n```\n\nBitbucket and GitLab URLs and shortcuts are also supported, for example:\n\n```\nbitbucket:bbuser/repo_name#branch_name\ngitlab:gluser/repo_name#branch_name\n```\n\nA short name can be used for templates maintained in the Embark GitHub organization, for example:\n\n```\n$ embark new --template typescript\n```\n\nPlease see our list of [officially supported templates](/templates/).\n\n## demo\n\n```\n$ embark demo\n```\n\nGenerates a demo Embark Project with a working contract and examples of working with contracts, IPFS and Whisper.\n\n## build\n\n```\n$ embark build [environment]\n```\n\nDeploys and Builds the DApp at dist/. If no `environment` is provider embark will use `development` by default.\n\n## run\n\n```\n$ embark run [environment]\n```\n\nDeploys and Builds the DApp at `dist/`. By default will launch a dashboard and start a dev server at `http://localhost:8000/`. If no `environment` is provider embark will use `development` by default.\n\nOption | Description\n--- | ---\n`-p`, `--port` | `port` to run the dev webserver (default: 8000)\n`-b`, `--host` | `host` to run the dev webserver (default: localhost)\n`--noserver` | disable the development webserver\n`--nodashboard` | simple mode, disables the dashboard\n`--nobrowser` | prevent the development webserver from automatically opening a web browser\n`--no-color` | no colors in case it's needed for compatbility purposes\n`--logfile` | `filename` to output logs (default: none)\n\n## eject-build-config\n\n```\n$ embark eject-build-config\n```\n\nCopies Embark's default `webpack.config.js` file into your DApp so that you can customize it. If a file named `webpack.config.js` is present in your top-level DApp directory, Embark will use your webpack config file instead of its own.\n\n## blockchain\n\n```\n$ embark blockchain [environment]\n```\n\nTakes the config at `config/blockchain.json` for the `environment` specified and starts a blockchain node. If no `environment` is provider embark will use `development` by default.\n\nIf you want, you can skip the step of running `embark blockchain`, as `embark run`, `build` and `upload` now all start a blockchain node in a separate process if there is not one already started using the same configurations.\n\n## simulator\n\n```\n$ embark simulator [environment]\n```\n\nTakes the config at `config/blockchain.json` for the `environment` specified and starts a blockchain simulator. If no `environment` is provider embark will use `development` by default.\n\nOption | Description\n--- | ---\n`-p`, `--port` | `port` to run the rpc simulator (default: 8545)\n`-h`, `--host` | `host` to run the rpc simulator (default: localhost)\n`-a`, `--accounts` | `num` of accounts to start the simulator (default: 10)\n`-e`, `--defaultBalanceEther` | `balance` in ether to assign each test account (default: 100)\n`-l`, `--gasLimit` | custom `gasLimit` (default: 8000000)\n\n## test\n\n```\n$ embark test [file]\n```\n\nRuns Tests. If `file` is not specified then it will run all the tests inside the `test/` directory.\n\nOption | Description\n--- | ---\n`-n`, `--node` | node for running the tests (default: vm)\n`-d`, `--gasDetails` | print the gas cost for each contract deployment when running the tests\n`-c`, `--coverage` | generate a coverage report after running the tests (vm only)\n\nThe `--node` option supports several values:\n\nValue | Description\n--- | ---\n`vm` | start and use an Ethereum simulator (ganache)\n`embark` | use the node of a running embark process\n`` | connect to and use the specified node\n\nExample of endpoint usage: `embark test --node ws://localhost:8556`\n\n## reset\n\n```\n$ embark reset\n```\n\nResets embarks state on this dapp including clearing cache.\n\n## upload\n\n```\n$ embark upload [platform] [environment]\n```\n\nUploads the DApp to a decentralized storage such as IPFS. `platform` can be `ipfs` or `swarm` or another parameter if supported by a plugin. If no `environment` is provider embark will use `development` by default.\n\n## graph\n\n```\n$ embark graph\n```\n\nGenerates documentation based on the smart contracts configured\n\n## version\n\n```\n$ embark version\n```\n\nDisplays version information.\n","date":"2020-01-17T19:00:03.900Z","updated":"2020-01-17T19:00:03.900Z","path":"docs/embark_commands.html","comments":1,"_id":"ck5ijm3ri00137heg9p19hso3","content":"

This is the Embark CLI command reference.

\n

new

$ embark new dappName
\n\n

Creates a new empty DApp project. If no dappName is provided, Embark will ask for the dappName.

\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
OptionDescription
--contracts-onlycreate a barebones project meant only for contract development
--simplean alias for --contracts-only
--templatedownload a template using a known name or a git host URL
\n

The --template option supports several URL styles and shortcuts for git hosts:

\n
git@github.com:ghuser/repo_name
https://github.com/ghuser/repo_name
github:ghuser/repo_name
ghuser/repo_name
\n\n

It’s possible to append a branch name to any of the above, for example:

\n
https://github.com/ghuser/repo_name#branch_name
ghuser/repo_name#branch_name
\n\n

Bitbucket and GitLab URLs and shortcuts are also supported, for example:

\n
bitbucket:bbuser/repo_name#branch_name
gitlab:gluser/repo_name#branch_name
\n\n

A short name can be used for templates maintained in the Embark GitHub organization, for example:

\n
$ embark new --template typescript
\n\n

Please see our list of officially supported templates.

\n

demo

$ embark demo
\n\n

Generates a demo Embark Project with a working contract and examples of working with contracts, IPFS and Whisper.

\n

build

$ embark build [environment]
\n\n

Deploys and Builds the DApp at dist/. If no environment is provider embark will use development by default.

\n

run

$ embark run [environment]
\n\n

Deploys and Builds the DApp at dist/. By default will launch a dashboard and start a dev server at http://localhost:8000/. If no environment is provider embark will use development by default.

\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
OptionDescription
-p, --portport to run the dev webserver (default: 8000)
-b, --hosthost to run the dev webserver (default: localhost)
--noserverdisable the development webserver
--nodashboardsimple mode, disables the dashboard
--nobrowserprevent the development webserver from automatically opening a web browser
--no-colorno colors in case it’s needed for compatbility purposes
--logfilefilename to output logs (default: none)
\n

eject-build-config

$ embark eject-build-config
\n\n

Copies Embark’s default webpack.config.js file into your DApp so that you can customize it. If a file named webpack.config.js is present in your top-level DApp directory, Embark will use your webpack config file instead of its own.

\n

blockchain

$ embark blockchain [environment]
\n\n

Takes the config at config/blockchain.json for the environment specified and starts a blockchain node. If no environment is provider embark will use development by default.

\n

If you want, you can skip the step of running embark blockchain, as embark run, build and upload now all start a blockchain node in a separate process if there is not one already started using the same configurations.

\n

simulator

$ embark simulator [environment]
\n\n

Takes the config at config/blockchain.json for the environment specified and starts a blockchain simulator. If no environment is provider embark will use development by default.

\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
OptionDescription
-p, --portport to run the rpc simulator (default: 8545)
-h, --hosthost to run the rpc simulator (default: localhost)
-a, --accountsnum of accounts to start the simulator (default: 10)
-e, --defaultBalanceEtherbalance in ether to assign each test account (default: 100)
-l, --gasLimitcustom gasLimit (default: 8000000)
\n

test

$ embark test [file]
\n\n

Runs Tests. If file is not specified then it will run all the tests inside the test/ directory.

\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
OptionDescription
-n, --nodenode for running the tests (default: vm)
-d, --gasDetailsprint the gas cost for each contract deployment when running the tests
-c, --coveragegenerate a coverage report after running the tests (vm only)
\n

The --node option supports several values:

\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
ValueDescription
vmstart and use an Ethereum simulator (ganache)
embarkuse the node of a running embark process
<endpoint>connect to and use the specified node
\n

Example of endpoint usage: embark test --node ws://localhost:8556

\n

reset

$ embark reset
\n\n

Resets embarks state on this dapp including clearing cache.

\n

upload

$ embark upload [platform] [environment]
\n\n

Uploads the DApp to a decentralized storage such as IPFS. platform can be ipfs or swarm or another parameter if supported by a plugin. If no environment is provider embark will use development by default.

\n

graph

$ embark graph
\n\n

Generates documentation based on the smart contracts configured

\n

version

$ embark version
\n\n

Displays version information.

\n","site":{"data":{"authors":{"iuri_matias":{"name":"Iuri Matias","twitter":"iurimatias","image":"https://pbs.twimg.com/profile_images/928272512181563392/iDJdvy2k_400x400.jpg"},"pascal_precht":{"name":"Pascal Precht","twitter":"pascalprecht","image":"https://pbs.twimg.com/profile_images/993785060733194241/p3oAIMDP_400x400.jpg"},"anthony_laibe":{"name":"Anthony Laibe","twitter":"a_laibe","image":"https://pbs.twimg.com/profile_images/257742900/13168239_400x400.jpg"},"jonathan_rainville":{"name":"Jonathan Rainville","twitter":"ShyolGhul","image":"https://pbs.twimg.com/profile_images/993873866878570496/-aE4byjj_400x400.jpg"},"andre_medeiros":{"name":"Andre Medeiros","twitter":"superdealloc","image":"https://pbs.twimg.com/profile_images/965722487735701504/m58KNgWN_400x400.jpg"},"eric_mastro":{"name":"Eric Mastro","twitter":"ericmastro","image":"https://avatars1.githubusercontent.com/u/5089238?s=460&v=4"},"michael_bradley":{"name":"Michael Bradley","image":"https://avatars3.githubusercontent.com/u/194260?s=460&v=4"},"richard_ramos":{"name":"Richard Ramos","twitter":"richardramos_me","image":"https://pbs.twimg.com/profile_images/1063160577973866496/aM313uHG_400x400.jpg"},"jonny_zerah":{"name":"Jonny Zerah","twitter":"jonnyzerah","image":"https://pbs.twimg.com/profile_images/1043774340490248192/gI9aGy17_400x400.jpg"},"robin_percy":{"name":"Robin Percy","twitter":"rbin","image":"https://avatars1.githubusercontent.com/u/29288325?s=400&v=4"}},"categories":{"tutorials":"Tutorials","announcements":"Announcements"},"languages":{"en":"English"},"plugins":[{"name":"embark-bamboo","description":"plugins_page.plugins.bamboo.desc","link":"https://www.npmjs.com/package/embark-bamboo","thumbnail":"bamboo.png","tags":["language","smart-contracts"]},{"name":"embark-solc","description":"plugins_page.plugins.solc.desc","link":"https://www.npmjs.com/package/embark-solc","thumbnail":"solidity.png","tags":["solidity","language","smart-contracts"]},{"name":"embark-solium","description":"plugins_page.plugins.solium.desc","link":"https://www.npmjs.com/package/embark-solium","thumbnail":"solium.png","tags":["linter","solidity","solium"]},{"name":"embark-etherscan-verifier","description":"plugins_page.plugins.verifier.desc","link":"https://www.npmjs.com/package/embark-etherscan-verifier","tags":["solidity","etherscan","smart-contracts"]},{"name":"embark-status","description":"plugins_page.plugins.status.desc","link":"https://www.npmjs.com/package/embark-status-plugin","thumbnail":"status.png","tags":["status","mobile"]},{"name":"embark-remix","description":"plugins_page.plugins.remix.desc","link":"https://www.npmjs.com/package/embark-remix","thumbnail":"remix.png","tags":["remix","debugger"]},{"name":"embark-slither","description":"plugins_page.plugins.slither.desc","link":"https://www.npmjs.com/package/embark-slither","tags":["solidity"]},{"name":"embark-snark","description":"plugins_page.plugins.snark.desc","link":"https://www.npmjs.com/package/embark-snark","tags":["snark"]},{"name":"embark-fortune","description":"plugins_page.plugins.fortune.desc","link":"https://www.npmjs.com/package/embark-fortune","thumbnail":"fortune.jpg","tags":["fun"]},{"name":"embark-pug","description":"plugins_page.plugins.pug.desc","link":"https://www.npmjs.com/package/embark-pug","legacy":true,"thumbnail":"pug.png","tags":["pug","jade","templates"]},{"name":"embark-haml","description":"plugins_page.plugins.haml.desc","link":"https://www.npmjs.com/package/embark-haml","legacy":true,"thumbnail":"haml.png","tags":["haml","templates"]},{"name":"embark-mythx","description":"plugins_page.plugins.mythx.desc","link":"https://www.npmjs.com/package/embark-mythx","thumbnail":"mythx.png","tags":["mythx","smart-contracts"]}],"menu":{"docs":"/docs/","plugins":"/plugins/","chat":"/chat/","blog":"/news/"},"sidebar":{"docs":{"getting_started":{"overview":"overview.html","installation":"installation.html","faq":"faq.html"},"general_usage":{"creating_project":"create_project.html","structure":"structure.html","running_apps":"running_apps.html","dashboard":"dashboard.html","using_the_console":"using_the_console.html","environments":"environments.html","configuration":"configuration.html","pipeline_and_webpack":"pipeline_and_webpack.html","javascript_usage":"javascript_usage.html"},"smart_contracts":{"contracts_configuration":"contracts_configuration.html","contracts_deployment":"contracts_deployment.html","contracts_imports":"contracts_imports.html","contracts_testing":"contracts_testing.html","contracts_javascript":"contracts_javascript.html"},"blockchain_node":{"blockchain_configuration":"blockchain_configuration.html","blockchain_accounts_configuration":"blockchain_accounts_configuration.html"},"storage":{"storage_configuration":"storage_configuration.html","storage_deployment":"storage_deployment.html","storage_javascript":"storage_javascript.html"},"messages":{"messages_configuration":"messages_configuration.html","messages_javascript":"messages_javascript.html"},"naming":{"naming_configuration":"naming_configuration.html","naming_javascript":"naming_javascript.html"},"plugins":{"installing_a_plugin":"installing_plugins.html","creating_a_plugin":"creating_plugins.html","plugin_reference":"plugin_reference.html"},"cockpit":{"cockpit_introduction":"cockpit_introduction.html","cockpit_dashboard":"cockpit_dashboard.html","cockpit_deployment":"cockpit_deployment.html","cockpit_explorer":"cockpit_explorer.html","cockpit_editor":"cockpit_editor.html","cockpit_debugger":"cockpit_debugger.html"},"reference":{"embark_commands":"embark_commands.html"},"miscellaneous":{"migrating_from_3":"migrating_from_3.x.html","troubleshooting":"troubleshooting.html","contributing":"contributing.html"}}},"templates":[{"name":"Vyper Template","description":"Template to demonstrate the use of the Vyper contracts","install":"embark new AppName --template vyper","thumbnail":"vyper.png","link":"https://github.com/embarklabs/embark-vyper-template","tags":["vyper","contracts"]},{"name":"Embark Demo React Template","description":"A React Application showcasing Embark's functionality","install":"embark demo","thumbnail":"react.png","link":"https://embark.embarklabs.io/docs/create_project.html#Creating-a-Demo-Project","tags":["react","contracts","whisper","ipfs"]},{"name":"Typescript Template","description":"Template with Typescript support pre-configured","thumbnail":"typescript.png","install":"embark new AppName --template typescript","link":"https://github.com/embarklabs/embark-typescript-template","tags":["typescript","frontend"]},{"name":"Vue.js Template","description":"Ready to use Template for using Embark with vue.js","thumbnail":"vuejs.png","install":"embark new AppName --template vue","link":"https://github.com/embarklabs/embark-vue-template","tags":["vue.js","frontend"]},{"name":"ethvtx Template","description":"Demo app for ethvtx, an Ethereum-Ready & Framework-Agnostic Redux configuration","thumbnail":"vortex.png","install":"embark new AppName --template Horyus/ethvtx_embark","link":"https://github.com/Horyus/ethvtx_embark","tags":["react"]},{"name":"Bamboo Template","description":"Template to demonstrate use of the Bamboo contracts","install":"embark new AppName --template bamboo","thumbnail":"bamboo.png","link":"https://github.com/embarklabs/embark-bamboo-template","tags":["bamboo","contracts"]},{"name":"Solidity Gas Golfing","description":"Boilerplate and tests for the first Solidity Gas Golfing Contest","thumbnail":"sggc.png","install":"embark new AppName --template embarklabs/sggc","link":"https://github.com/embarklabs/sggc","tags":["solidity","tests","fun"]}],"tutorials":[{"name":"How to create a Token Factory with Ethereum — Part 1","description":"Create and Deploy a Token with Ethereum","link":"/tutorials/token_factory_1.html","tags":["token","ethereum"]},{"name":"How to create a Token Factory with Ethereum — Part 2","description":"Create a DApp that can deploy Tokens on the fly","link":"/tutorials/token_factory_2.html","tags":["token","ethereum","client-side-deployment"]},{"name":"How to deploy to a testnet with Infura","description":"Deploy and interact with your Dapp on a testnet with the use of Infura","link":"/tutorials/infura_guide.html","tags":["ethereum","deployment","testnet"]}],"versions":{"latest":{"label":"stable (v4)","url":"https://embark.embarklabs.io/docs"},"3.2":{"label":"v3.2","url":"https://5ca4e0fdb29712000adde37f--embark-site-versions.netlify.com/docs/"}}}},"excerpt":"","more":"

This is the Embark CLI command reference.

\n

new

$ embark new dappName
\n\n

Creates a new empty DApp project. If no dappName is provided, Embark will ask for the dappName.

\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
OptionDescription
--contracts-onlycreate a barebones project meant only for contract development
--simplean alias for --contracts-only
--templatedownload a template using a known name or a git host URL
\n

The --template option supports several URL styles and shortcuts for git hosts:

\n
git@github.com:ghuser/repo_name
https://github.com/ghuser/repo_name
github:ghuser/repo_name
ghuser/repo_name
\n\n

It’s possible to append a branch name to any of the above, for example:

\n
https://github.com/ghuser/repo_name#branch_name
ghuser/repo_name#branch_name
\n\n

Bitbucket and GitLab URLs and shortcuts are also supported, for example:

\n
bitbucket:bbuser/repo_name#branch_name
gitlab:gluser/repo_name#branch_name
\n\n

A short name can be used for templates maintained in the Embark GitHub organization, for example:

\n
$ embark new --template typescript
\n\n

Please see our list of officially supported templates.

\n

demo

$ embark demo
\n\n

Generates a demo Embark Project with a working contract and examples of working with contracts, IPFS and Whisper.

\n

build

$ embark build [environment]
\n\n

Deploys and Builds the DApp at dist/. If no environment is provider embark will use development by default.

\n

run

$ embark run [environment]
\n\n

Deploys and Builds the DApp at dist/. By default will launch a dashboard and start a dev server at http://localhost:8000/. If no environment is provider embark will use development by default.

\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
OptionDescription
-p, --portport to run the dev webserver (default: 8000)
-b, --hosthost to run the dev webserver (default: localhost)
--noserverdisable the development webserver
--nodashboardsimple mode, disables the dashboard
--nobrowserprevent the development webserver from automatically opening a web browser
--no-colorno colors in case it’s needed for compatbility purposes
--logfilefilename to output logs (default: none)
\n

eject-build-config

$ embark eject-build-config
\n\n

Copies Embark’s default webpack.config.js file into your DApp so that you can customize it. If a file named webpack.config.js is present in your top-level DApp directory, Embark will use your webpack config file instead of its own.

\n

blockchain

$ embark blockchain [environment]
\n\n

Takes the config at config/blockchain.json for the environment specified and starts a blockchain node. If no environment is provider embark will use development by default.

\n

If you want, you can skip the step of running embark blockchain, as embark run, build and upload now all start a blockchain node in a separate process if there is not one already started using the same configurations.

\n

simulator

$ embark simulator [environment]
\n\n

Takes the config at config/blockchain.json for the environment specified and starts a blockchain simulator. If no environment is provider embark will use development by default.

\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
OptionDescription
-p, --portport to run the rpc simulator (default: 8545)
-h, --hosthost to run the rpc simulator (default: localhost)
-a, --accountsnum of accounts to start the simulator (default: 10)
-e, --defaultBalanceEtherbalance in ether to assign each test account (default: 100)
-l, --gasLimitcustom gasLimit (default: 8000000)
\n

test

$ embark test [file]
\n\n

Runs Tests. If file is not specified then it will run all the tests inside the test/ directory.

\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
OptionDescription
-n, --nodenode for running the tests (default: vm)
-d, --gasDetailsprint the gas cost for each contract deployment when running the tests
-c, --coveragegenerate a coverage report after running the tests (vm only)
\n

The --node option supports several values:

\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
ValueDescription
vmstart and use an Ethereum simulator (ganache)
embarkuse the node of a running embark process
<endpoint>connect to and use the specified node
\n

Example of endpoint usage: embark test --node ws://localhost:8556

\n

reset

$ embark reset
\n\n

Resets embarks state on this dapp including clearing cache.

\n

upload

$ embark upload [platform] [environment]
\n\n

Uploads the DApp to a decentralized storage such as IPFS. platform can be ipfs or swarm or another parameter if supported by a plugin. If no environment is provider embark will use development by default.

\n

graph

$ embark graph
\n\n

Generates documentation based on the smart contracts configured

\n

version

$ embark version
\n\n

Displays version information.

\n"},{"title":"Understanding Environments","layout":"docs","_content":"\nEmbark comes with the concept of \"Environments\", which make it easy to switch between different configurations of various parts of our applications that alter how the application is being built and deployed. For example, during development we probably prefer deploying our Smart Contracts on a local blockchain or testnet, until we're sure the code is ready for prime time and can be deployed in a production environment.\n\nIn this guide we'll discuss how to take advantage of environments within various configuration files of our Embark application.\n\n## Default environment\n\nIn our guide covering [application structures](structure.html) in Embark, we've talked about that every component of our decentralized application, such as IPFS as a storage solution and Geth as a blockchain client, can be configured using a dedicated configuration file. We'll dive more into what each configuration looks like in our guides on [configuring Smart Contracts](contracts_configuration.html), [configuring decentralized storages](storage_configuration.html) and [configuring communication channels](messages_configuration.html). For now, we'll focus on the concept of **default environments**.\n\nEnvironments can be defined as part of a configuration file for a dedicated service or component of our application. We can introduce as many environments as we like. It is important to understand that `default` is a special environment that can be **extended** by other environments.\n\nLet's take a look at the `config/contracts.js` file that we've created in the [Quickstart](quick_start.html):\n\n```\nmodule.exports = {\n default: {\n dappConnection: [\n \"$WEB3\",\n \"ws://localhost:8546\",\n \"http://localhost:8545\"\n ],\n gas: \"auto\",\n deploy: {\n SimpleStorage: {\n args: [100]\n }\n }\n }\n}\n```\n\nDon't get too overwhelmed by all the different options and what they mean. We'll discuss those in-depth in [configuring Smart Contracts](contracts_configuration.html) and `dappConneciton` [here](/docs/javascript_usage.html#Using-dappConnection). The important part here is that `contracts.js` exports an object that provides a `default` configuration. This configuration is the default environment and can be overwritten or extended by other environments. \n\nIf we execute `$ embark run`, Embark will use the `default` configuration to deploy our application's Smart Contracts.\n\n## Adding and extending environments\n\nAs mentioned earlier, the `default` environment can be easily extended and overwritten by other configurations. Let's say we had a `custom` environment as well, which should come with the same configuration as `default`, but deploy `SimpleStorage` with a different constructor parameter value. We can do that by simply introducing a configuration for `custom` and specify the options as we need:\n\n```\nmodule.exports = {\n ...\n custom: {\n deploy: {\n SimpleStorage: {\n args: [200]\n }\n }\n }\n}\n```\n\nNow, when running Embark with the `custom` environment as discussed in our guide on [Running applications](/docs/running_apps.html#Switching-environments), Embark will merge the `custom` configuration with `default` and use the resulting configuration object accordingly:\n\n```\n$ embark run custom\n```\n\n{% notification info Quick tip: %}\nNotice that Embark usually already provides an additional `development` configuration. As a matter of fact, when no environment is specified in `embark run`, Embark will use the `development` configuration. \n\nThis means that\n\n
$ embark run
\n\nis the same as\n\n
$ embark run development
\n\n{% endnotification %}\n\nIn the next chapter, we'll take a closer look at how our application can be configured using the `embark.json` configuration file.\n","source":"docs/environments.md","raw":"title: Understanding Environments\nlayout: docs\n---\n\nEmbark comes with the concept of \"Environments\", which make it easy to switch between different configurations of various parts of our applications that alter how the application is being built and deployed. For example, during development we probably prefer deploying our Smart Contracts on a local blockchain or testnet, until we're sure the code is ready for prime time and can be deployed in a production environment.\n\nIn this guide we'll discuss how to take advantage of environments within various configuration files of our Embark application.\n\n## Default environment\n\nIn our guide covering [application structures](structure.html) in Embark, we've talked about that every component of our decentralized application, such as IPFS as a storage solution and Geth as a blockchain client, can be configured using a dedicated configuration file. We'll dive more into what each configuration looks like in our guides on [configuring Smart Contracts](contracts_configuration.html), [configuring decentralized storages](storage_configuration.html) and [configuring communication channels](messages_configuration.html). For now, we'll focus on the concept of **default environments**.\n\nEnvironments can be defined as part of a configuration file for a dedicated service or component of our application. We can introduce as many environments as we like. It is important to understand that `default` is a special environment that can be **extended** by other environments.\n\nLet's take a look at the `config/contracts.js` file that we've created in the [Quickstart](quick_start.html):\n\n```\nmodule.exports = {\n default: {\n dappConnection: [\n \"$WEB3\",\n \"ws://localhost:8546\",\n \"http://localhost:8545\"\n ],\n gas: \"auto\",\n deploy: {\n SimpleStorage: {\n args: [100]\n }\n }\n }\n}\n```\n\nDon't get too overwhelmed by all the different options and what they mean. We'll discuss those in-depth in [configuring Smart Contracts](contracts_configuration.html) and `dappConneciton` [here](/docs/javascript_usage.html#Using-dappConnection). The important part here is that `contracts.js` exports an object that provides a `default` configuration. This configuration is the default environment and can be overwritten or extended by other environments. \n\nIf we execute `$ embark run`, Embark will use the `default` configuration to deploy our application's Smart Contracts.\n\n## Adding and extending environments\n\nAs mentioned earlier, the `default` environment can be easily extended and overwritten by other configurations. Let's say we had a `custom` environment as well, which should come with the same configuration as `default`, but deploy `SimpleStorage` with a different constructor parameter value. We can do that by simply introducing a configuration for `custom` and specify the options as we need:\n\n```\nmodule.exports = {\n ...\n custom: {\n deploy: {\n SimpleStorage: {\n args: [200]\n }\n }\n }\n}\n```\n\nNow, when running Embark with the `custom` environment as discussed in our guide on [Running applications](/docs/running_apps.html#Switching-environments), Embark will merge the `custom` configuration with `default` and use the resulting configuration object accordingly:\n\n```\n$ embark run custom\n```\n\n{% notification info Quick tip: %}\nNotice that Embark usually already provides an additional `development` configuration. As a matter of fact, when no environment is specified in `embark run`, Embark will use the `development` configuration. \n\nThis means that\n\n
$ embark run
\n\nis the same as\n\n
$ embark run development
\n\n{% endnotification %}\n\nIn the next chapter, we'll take a closer look at how our application can be configured using the `embark.json` configuration file.\n","date":"2020-01-17T19:00:03.900Z","updated":"2020-01-17T19:00:03.900Z","path":"docs/environments.html","comments":1,"_id":"ck5ijm3rj00147hegebu2ckjy","content":"

Embark comes with the concept of “Environments”, which make it easy to switch between different configurations of various parts of our applications that alter how the application is being built and deployed. For example, during development we probably prefer deploying our Smart Contracts on a local blockchain or testnet, until we’re sure the code is ready for prime time and can be deployed in a production environment.

\n

In this guide we’ll discuss how to take advantage of environments within various configuration files of our Embark application.

\n

Default environment

In our guide covering application structures in Embark, we’ve talked about that every component of our decentralized application, such as IPFS as a storage solution and Geth as a blockchain client, can be configured using a dedicated configuration file. We’ll dive more into what each configuration looks like in our guides on configuring Smart Contracts, configuring decentralized storages and configuring communication channels. For now, we’ll focus on the concept of default environments.

\n

Environments can be defined as part of a configuration file for a dedicated service or component of our application. We can introduce as many environments as we like. It is important to understand that default is a special environment that can be extended by other environments.

\n

Let’s take a look at the config/contracts.js file that we’ve created in the Quickstart:

\n
module.exports = {
default: {
dappConnection: [
"$WEB3",
"ws://localhost:8546",
"http://localhost:8545"
],
gas: "auto",
deploy: {
SimpleStorage: {
args: [100]
}
}
}
}
\n\n

Don’t get too overwhelmed by all the different options and what they mean. We’ll discuss those in-depth in configuring Smart Contracts and dappConneciton here. The important part here is that contracts.js exports an object that provides a default configuration. This configuration is the default environment and can be overwritten or extended by other environments.

\n

If we execute $ embark run, Embark will use the default configuration to deploy our application’s Smart Contracts.

\n

Adding and extending environments

As mentioned earlier, the default environment can be easily extended and overwritten by other configurations. Let’s say we had a custom environment as well, which should come with the same configuration as default, but deploy SimpleStorage with a different constructor parameter value. We can do that by simply introducing a configuration for custom and specify the options as we need:

\n
module.exports = {
...
custom: {
deploy: {
SimpleStorage: {
args: [200]
}
}
}
}
\n\n

Now, when running Embark with the custom environment as discussed in our guide on Running applications, Embark will merge the custom configuration with default and use the resulting configuration object accordingly:

\n
$ embark run custom
\n\n
\n

Quick

\n

Notice that Embark usually already provides an additional development configuration. As a matter of fact, when no environment is specified in embark run, Embark will use the development configuration.

\n

This means that

\n
$ embark run
\n\n

is the same as

\n
$ embark run development
\n

\n
\n\n\n\n

In the next chapter, we’ll take a closer look at how our application can be configured using the embark.json configuration file.

\n","site":{"data":{"authors":{"iuri_matias":{"name":"Iuri Matias","twitter":"iurimatias","image":"https://pbs.twimg.com/profile_images/928272512181563392/iDJdvy2k_400x400.jpg"},"pascal_precht":{"name":"Pascal Precht","twitter":"pascalprecht","image":"https://pbs.twimg.com/profile_images/993785060733194241/p3oAIMDP_400x400.jpg"},"anthony_laibe":{"name":"Anthony Laibe","twitter":"a_laibe","image":"https://pbs.twimg.com/profile_images/257742900/13168239_400x400.jpg"},"jonathan_rainville":{"name":"Jonathan Rainville","twitter":"ShyolGhul","image":"https://pbs.twimg.com/profile_images/993873866878570496/-aE4byjj_400x400.jpg"},"andre_medeiros":{"name":"Andre Medeiros","twitter":"superdealloc","image":"https://pbs.twimg.com/profile_images/965722487735701504/m58KNgWN_400x400.jpg"},"eric_mastro":{"name":"Eric Mastro","twitter":"ericmastro","image":"https://avatars1.githubusercontent.com/u/5089238?s=460&v=4"},"michael_bradley":{"name":"Michael Bradley","image":"https://avatars3.githubusercontent.com/u/194260?s=460&v=4"},"richard_ramos":{"name":"Richard Ramos","twitter":"richardramos_me","image":"https://pbs.twimg.com/profile_images/1063160577973866496/aM313uHG_400x400.jpg"},"jonny_zerah":{"name":"Jonny Zerah","twitter":"jonnyzerah","image":"https://pbs.twimg.com/profile_images/1043774340490248192/gI9aGy17_400x400.jpg"},"robin_percy":{"name":"Robin Percy","twitter":"rbin","image":"https://avatars1.githubusercontent.com/u/29288325?s=400&v=4"}},"categories":{"tutorials":"Tutorials","announcements":"Announcements"},"languages":{"en":"English"},"plugins":[{"name":"embark-bamboo","description":"plugins_page.plugins.bamboo.desc","link":"https://www.npmjs.com/package/embark-bamboo","thumbnail":"bamboo.png","tags":["language","smart-contracts"]},{"name":"embark-solc","description":"plugins_page.plugins.solc.desc","link":"https://www.npmjs.com/package/embark-solc","thumbnail":"solidity.png","tags":["solidity","language","smart-contracts"]},{"name":"embark-solium","description":"plugins_page.plugins.solium.desc","link":"https://www.npmjs.com/package/embark-solium","thumbnail":"solium.png","tags":["linter","solidity","solium"]},{"name":"embark-etherscan-verifier","description":"plugins_page.plugins.verifier.desc","link":"https://www.npmjs.com/package/embark-etherscan-verifier","tags":["solidity","etherscan","smart-contracts"]},{"name":"embark-status","description":"plugins_page.plugins.status.desc","link":"https://www.npmjs.com/package/embark-status-plugin","thumbnail":"status.png","tags":["status","mobile"]},{"name":"embark-remix","description":"plugins_page.plugins.remix.desc","link":"https://www.npmjs.com/package/embark-remix","thumbnail":"remix.png","tags":["remix","debugger"]},{"name":"embark-slither","description":"plugins_page.plugins.slither.desc","link":"https://www.npmjs.com/package/embark-slither","tags":["solidity"]},{"name":"embark-snark","description":"plugins_page.plugins.snark.desc","link":"https://www.npmjs.com/package/embark-snark","tags":["snark"]},{"name":"embark-fortune","description":"plugins_page.plugins.fortune.desc","link":"https://www.npmjs.com/package/embark-fortune","thumbnail":"fortune.jpg","tags":["fun"]},{"name":"embark-pug","description":"plugins_page.plugins.pug.desc","link":"https://www.npmjs.com/package/embark-pug","legacy":true,"thumbnail":"pug.png","tags":["pug","jade","templates"]},{"name":"embark-haml","description":"plugins_page.plugins.haml.desc","link":"https://www.npmjs.com/package/embark-haml","legacy":true,"thumbnail":"haml.png","tags":["haml","templates"]},{"name":"embark-mythx","description":"plugins_page.plugins.mythx.desc","link":"https://www.npmjs.com/package/embark-mythx","thumbnail":"mythx.png","tags":["mythx","smart-contracts"]}],"menu":{"docs":"/docs/","plugins":"/plugins/","chat":"/chat/","blog":"/news/"},"sidebar":{"docs":{"getting_started":{"overview":"overview.html","installation":"installation.html","faq":"faq.html"},"general_usage":{"creating_project":"create_project.html","structure":"structure.html","running_apps":"running_apps.html","dashboard":"dashboard.html","using_the_console":"using_the_console.html","environments":"environments.html","configuration":"configuration.html","pipeline_and_webpack":"pipeline_and_webpack.html","javascript_usage":"javascript_usage.html"},"smart_contracts":{"contracts_configuration":"contracts_configuration.html","contracts_deployment":"contracts_deployment.html","contracts_imports":"contracts_imports.html","contracts_testing":"contracts_testing.html","contracts_javascript":"contracts_javascript.html"},"blockchain_node":{"blockchain_configuration":"blockchain_configuration.html","blockchain_accounts_configuration":"blockchain_accounts_configuration.html"},"storage":{"storage_configuration":"storage_configuration.html","storage_deployment":"storage_deployment.html","storage_javascript":"storage_javascript.html"},"messages":{"messages_configuration":"messages_configuration.html","messages_javascript":"messages_javascript.html"},"naming":{"naming_configuration":"naming_configuration.html","naming_javascript":"naming_javascript.html"},"plugins":{"installing_a_plugin":"installing_plugins.html","creating_a_plugin":"creating_plugins.html","plugin_reference":"plugin_reference.html"},"cockpit":{"cockpit_introduction":"cockpit_introduction.html","cockpit_dashboard":"cockpit_dashboard.html","cockpit_deployment":"cockpit_deployment.html","cockpit_explorer":"cockpit_explorer.html","cockpit_editor":"cockpit_editor.html","cockpit_debugger":"cockpit_debugger.html"},"reference":{"embark_commands":"embark_commands.html"},"miscellaneous":{"migrating_from_3":"migrating_from_3.x.html","troubleshooting":"troubleshooting.html","contributing":"contributing.html"}}},"templates":[{"name":"Vyper Template","description":"Template to demonstrate the use of the Vyper contracts","install":"embark new AppName --template vyper","thumbnail":"vyper.png","link":"https://github.com/embarklabs/embark-vyper-template","tags":["vyper","contracts"]},{"name":"Embark Demo React Template","description":"A React Application showcasing Embark's functionality","install":"embark demo","thumbnail":"react.png","link":"https://embark.embarklabs.io/docs/create_project.html#Creating-a-Demo-Project","tags":["react","contracts","whisper","ipfs"]},{"name":"Typescript Template","description":"Template with Typescript support pre-configured","thumbnail":"typescript.png","install":"embark new AppName --template typescript","link":"https://github.com/embarklabs/embark-typescript-template","tags":["typescript","frontend"]},{"name":"Vue.js Template","description":"Ready to use Template for using Embark with vue.js","thumbnail":"vuejs.png","install":"embark new AppName --template vue","link":"https://github.com/embarklabs/embark-vue-template","tags":["vue.js","frontend"]},{"name":"ethvtx Template","description":"Demo app for ethvtx, an Ethereum-Ready & Framework-Agnostic Redux configuration","thumbnail":"vortex.png","install":"embark new AppName --template Horyus/ethvtx_embark","link":"https://github.com/Horyus/ethvtx_embark","tags":["react"]},{"name":"Bamboo Template","description":"Template to demonstrate use of the Bamboo contracts","install":"embark new AppName --template bamboo","thumbnail":"bamboo.png","link":"https://github.com/embarklabs/embark-bamboo-template","tags":["bamboo","contracts"]},{"name":"Solidity Gas Golfing","description":"Boilerplate and tests for the first Solidity Gas Golfing Contest","thumbnail":"sggc.png","install":"embark new AppName --template embarklabs/sggc","link":"https://github.com/embarklabs/sggc","tags":["solidity","tests","fun"]}],"tutorials":[{"name":"How to create a Token Factory with Ethereum — Part 1","description":"Create and Deploy a Token with Ethereum","link":"/tutorials/token_factory_1.html","tags":["token","ethereum"]},{"name":"How to create a Token Factory with Ethereum — Part 2","description":"Create a DApp that can deploy Tokens on the fly","link":"/tutorials/token_factory_2.html","tags":["token","ethereum","client-side-deployment"]},{"name":"How to deploy to a testnet with Infura","description":"Deploy and interact with your Dapp on a testnet with the use of Infura","link":"/tutorials/infura_guide.html","tags":["ethereum","deployment","testnet"]}],"versions":{"latest":{"label":"stable (v4)","url":"https://embark.embarklabs.io/docs"},"3.2":{"label":"v3.2","url":"https://5ca4e0fdb29712000adde37f--embark-site-versions.netlify.com/docs/"}}}},"excerpt":"","more":"

Embark comes with the concept of “Environments”, which make it easy to switch between different configurations of various parts of our applications that alter how the application is being built and deployed. For example, during development we probably prefer deploying our Smart Contracts on a local blockchain or testnet, until we’re sure the code is ready for prime time and can be deployed in a production environment.

\n

In this guide we’ll discuss how to take advantage of environments within various configuration files of our Embark application.

\n

Default environment

In our guide covering application structures in Embark, we’ve talked about that every component of our decentralized application, such as IPFS as a storage solution and Geth as a blockchain client, can be configured using a dedicated configuration file. We’ll dive more into what each configuration looks like in our guides on configuring Smart Contracts, configuring decentralized storages and configuring communication channels. For now, we’ll focus on the concept of default environments.

\n

Environments can be defined as part of a configuration file for a dedicated service or component of our application. We can introduce as many environments as we like. It is important to understand that default is a special environment that can be extended by other environments.

\n

Let’s take a look at the config/contracts.js file that we’ve created in the Quickstart:

\n
module.exports = {
default: {
dappConnection: [
"$WEB3",
"ws://localhost:8546",
"http://localhost:8545"
],
gas: "auto",
deploy: {
SimpleStorage: {
args: [100]
}
}
}
}
\n\n

Don’t get too overwhelmed by all the different options and what they mean. We’ll discuss those in-depth in configuring Smart Contracts and dappConneciton here. The important part here is that contracts.js exports an object that provides a default configuration. This configuration is the default environment and can be overwritten or extended by other environments.

\n

If we execute $ embark run, Embark will use the default configuration to deploy our application’s Smart Contracts.

\n

Adding and extending environments

As mentioned earlier, the default environment can be easily extended and overwritten by other configurations. Let’s say we had a custom environment as well, which should come with the same configuration as default, but deploy SimpleStorage with a different constructor parameter value. We can do that by simply introducing a configuration for custom and specify the options as we need:

\n
module.exports = {
...
custom: {
deploy: {
SimpleStorage: {
args: [200]
}
}
}
}
\n\n

Now, when running Embark with the custom environment as discussed in our guide on Running applications, Embark will merge the custom configuration with default and use the resulting configuration object accordingly:

\n
$ embark run custom
\n\n
\n

Quick

\n

Notice that Embark usually already provides an additional development configuration. As a matter of fact, when no environment is specified in embark run, Embark will use the development configuration.

\n

This means that

\n
$ embark run
\n\n

is the same as

\n
$ embark run development
\n

\n
\n\n\n\n

In the next chapter, we’ll take a closer look at how our application can be configured using the embark.json configuration file.

\n"},{"title":"Frequently Asked Questions","layout":"docs","_content":"\nIf you're new to Embark you probably have a lot questions about what it can do and whether it supports the features you're looking for. Check out our frequently asked questions and don't hesitate to let us know if there's anything missing!\n\n#### Embark in one sentence?\n\nEmbark is a developer environment for building, testing, and deploying Smart Contracts, as well as fully decentralized applications — computation (EVM), storage (IPFS, Swarm), and communication (Whisper).\n\n#### How does Embark differ from other tools?\n\nWhile Embark does have quite some things in common with tools like [Truffle](https://truffleframework.com/), it goes far beyond managing and deploying Smart Contracts, **if you want to**. Embark aims to be extensible so you can choose what features make most sense to you when building decentralized apps.\n\nWhether you want to purely focus on [building and deploying Smart Contracts](create_project.html#Creating-%E2%80%9Ccontracts-only%E2%80%9D-apps), or you want to build a static website that should be deployed on IPFS. Or even all of that! The sky is the limit.\n\n#### Can I use Embark purely for Smart Contract development?\n\nAbsolutely! Simply create your application using the `--contracts-only` option as discussed in our guide on [Creating Apps](create_project.html#Creating-“contracts-only”-apps) and you're good to go.\n\n[Embark's configurations](configuration.html) make it very easy to switch to a fully featured decentralized application later on, in case you change your mind.\n\n#### Can Embark connect to a simulated blockchain like Ganache?\n\nYes it can! In fact, Embark comes with [ganache-cli](https://truffleframework.com/ganache) and batteries included. Simply run `embark simulator` to [spin up a simulated blockchain](running_apps.html#Using-the-blockchain-simulator). For more information, check out the dedicated [command reference](embark_commands.html#simulator).\n\n#### Is it Luri or Iuri?\n\n[Iuri](https://twitter.com/iurimatias), it is!\n","source":"docs/faq.md","raw":"title: Frequently Asked Questions\nlayout: docs\n---\n\nIf you're new to Embark you probably have a lot questions about what it can do and whether it supports the features you're looking for. Check out our frequently asked questions and don't hesitate to let us know if there's anything missing!\n\n#### Embark in one sentence?\n\nEmbark is a developer environment for building, testing, and deploying Smart Contracts, as well as fully decentralized applications — computation (EVM), storage (IPFS, Swarm), and communication (Whisper).\n\n#### How does Embark differ from other tools?\n\nWhile Embark does have quite some things in common with tools like [Truffle](https://truffleframework.com/), it goes far beyond managing and deploying Smart Contracts, **if you want to**. Embark aims to be extensible so you can choose what features make most sense to you when building decentralized apps.\n\nWhether you want to purely focus on [building and deploying Smart Contracts](create_project.html#Creating-%E2%80%9Ccontracts-only%E2%80%9D-apps), or you want to build a static website that should be deployed on IPFS. Or even all of that! The sky is the limit.\n\n#### Can I use Embark purely for Smart Contract development?\n\nAbsolutely! Simply create your application using the `--contracts-only` option as discussed in our guide on [Creating Apps](create_project.html#Creating-“contracts-only”-apps) and you're good to go.\n\n[Embark's configurations](configuration.html) make it very easy to switch to a fully featured decentralized application later on, in case you change your mind.\n\n#### Can Embark connect to a simulated blockchain like Ganache?\n\nYes it can! In fact, Embark comes with [ganache-cli](https://truffleframework.com/ganache) and batteries included. Simply run `embark simulator` to [spin up a simulated blockchain](running_apps.html#Using-the-blockchain-simulator). For more information, check out the dedicated [command reference](embark_commands.html#simulator).\n\n#### Is it Luri or Iuri?\n\n[Iuri](https://twitter.com/iurimatias), it is!\n","date":"2020-01-17T19:00:03.900Z","updated":"2020-01-17T19:00:03.900Z","path":"docs/faq.html","comments":1,"_id":"ck5ijm3rk00157hegaau59e16","content":"

If you’re new to Embark you probably have a lot questions about what it can do and whether it supports the features you’re looking for. Check out our frequently asked questions and don’t hesitate to let us know if there’s anything missing!

\n

Embark in one sentence?

Embark is a developer environment for building, testing, and deploying Smart Contracts, as well as fully decentralized applications — computation (EVM), storage (IPFS, Swarm), and communication (Whisper).

\n

How does Embark differ from other tools?

While Embark does have quite some things in common with tools like Truffle, it goes far beyond managing and deploying Smart Contracts, if you want to. Embark aims to be extensible so you can choose what features make most sense to you when building decentralized apps.

\n

Whether you want to purely focus on building and deploying Smart Contracts, or you want to build a static website that should be deployed on IPFS. Or even all of that! The sky is the limit.

\n

Can I use Embark purely for Smart Contract development?

Absolutely! Simply create your application using the --contracts-only option as discussed in our guide on Creating Apps and you’re good to go.

\n

Embark’s configurations make it very easy to switch to a fully featured decentralized application later on, in case you change your mind.

\n

Can Embark connect to a simulated blockchain like Ganache?

Yes it can! In fact, Embark comes with ganache-cli and batteries included. Simply run embark simulator to spin up a simulated blockchain. For more information, check out the dedicated command reference.

\n

Is it Luri or Iuri?

Iuri, it is!

\n","site":{"data":{"authors":{"iuri_matias":{"name":"Iuri Matias","twitter":"iurimatias","image":"https://pbs.twimg.com/profile_images/928272512181563392/iDJdvy2k_400x400.jpg"},"pascal_precht":{"name":"Pascal Precht","twitter":"pascalprecht","image":"https://pbs.twimg.com/profile_images/993785060733194241/p3oAIMDP_400x400.jpg"},"anthony_laibe":{"name":"Anthony Laibe","twitter":"a_laibe","image":"https://pbs.twimg.com/profile_images/257742900/13168239_400x400.jpg"},"jonathan_rainville":{"name":"Jonathan Rainville","twitter":"ShyolGhul","image":"https://pbs.twimg.com/profile_images/993873866878570496/-aE4byjj_400x400.jpg"},"andre_medeiros":{"name":"Andre Medeiros","twitter":"superdealloc","image":"https://pbs.twimg.com/profile_images/965722487735701504/m58KNgWN_400x400.jpg"},"eric_mastro":{"name":"Eric Mastro","twitter":"ericmastro","image":"https://avatars1.githubusercontent.com/u/5089238?s=460&v=4"},"michael_bradley":{"name":"Michael Bradley","image":"https://avatars3.githubusercontent.com/u/194260?s=460&v=4"},"richard_ramos":{"name":"Richard Ramos","twitter":"richardramos_me","image":"https://pbs.twimg.com/profile_images/1063160577973866496/aM313uHG_400x400.jpg"},"jonny_zerah":{"name":"Jonny Zerah","twitter":"jonnyzerah","image":"https://pbs.twimg.com/profile_images/1043774340490248192/gI9aGy17_400x400.jpg"},"robin_percy":{"name":"Robin Percy","twitter":"rbin","image":"https://avatars1.githubusercontent.com/u/29288325?s=400&v=4"}},"categories":{"tutorials":"Tutorials","announcements":"Announcements"},"languages":{"en":"English"},"plugins":[{"name":"embark-bamboo","description":"plugins_page.plugins.bamboo.desc","link":"https://www.npmjs.com/package/embark-bamboo","thumbnail":"bamboo.png","tags":["language","smart-contracts"]},{"name":"embark-solc","description":"plugins_page.plugins.solc.desc","link":"https://www.npmjs.com/package/embark-solc","thumbnail":"solidity.png","tags":["solidity","language","smart-contracts"]},{"name":"embark-solium","description":"plugins_page.plugins.solium.desc","link":"https://www.npmjs.com/package/embark-solium","thumbnail":"solium.png","tags":["linter","solidity","solium"]},{"name":"embark-etherscan-verifier","description":"plugins_page.plugins.verifier.desc","link":"https://www.npmjs.com/package/embark-etherscan-verifier","tags":["solidity","etherscan","smart-contracts"]},{"name":"embark-status","description":"plugins_page.plugins.status.desc","link":"https://www.npmjs.com/package/embark-status-plugin","thumbnail":"status.png","tags":["status","mobile"]},{"name":"embark-remix","description":"plugins_page.plugins.remix.desc","link":"https://www.npmjs.com/package/embark-remix","thumbnail":"remix.png","tags":["remix","debugger"]},{"name":"embark-slither","description":"plugins_page.plugins.slither.desc","link":"https://www.npmjs.com/package/embark-slither","tags":["solidity"]},{"name":"embark-snark","description":"plugins_page.plugins.snark.desc","link":"https://www.npmjs.com/package/embark-snark","tags":["snark"]},{"name":"embark-fortune","description":"plugins_page.plugins.fortune.desc","link":"https://www.npmjs.com/package/embark-fortune","thumbnail":"fortune.jpg","tags":["fun"]},{"name":"embark-pug","description":"plugins_page.plugins.pug.desc","link":"https://www.npmjs.com/package/embark-pug","legacy":true,"thumbnail":"pug.png","tags":["pug","jade","templates"]},{"name":"embark-haml","description":"plugins_page.plugins.haml.desc","link":"https://www.npmjs.com/package/embark-haml","legacy":true,"thumbnail":"haml.png","tags":["haml","templates"]},{"name":"embark-mythx","description":"plugins_page.plugins.mythx.desc","link":"https://www.npmjs.com/package/embark-mythx","thumbnail":"mythx.png","tags":["mythx","smart-contracts"]}],"menu":{"docs":"/docs/","plugins":"/plugins/","chat":"/chat/","blog":"/news/"},"sidebar":{"docs":{"getting_started":{"overview":"overview.html","installation":"installation.html","faq":"faq.html"},"general_usage":{"creating_project":"create_project.html","structure":"structure.html","running_apps":"running_apps.html","dashboard":"dashboard.html","using_the_console":"using_the_console.html","environments":"environments.html","configuration":"configuration.html","pipeline_and_webpack":"pipeline_and_webpack.html","javascript_usage":"javascript_usage.html"},"smart_contracts":{"contracts_configuration":"contracts_configuration.html","contracts_deployment":"contracts_deployment.html","contracts_imports":"contracts_imports.html","contracts_testing":"contracts_testing.html","contracts_javascript":"contracts_javascript.html"},"blockchain_node":{"blockchain_configuration":"blockchain_configuration.html","blockchain_accounts_configuration":"blockchain_accounts_configuration.html"},"storage":{"storage_configuration":"storage_configuration.html","storage_deployment":"storage_deployment.html","storage_javascript":"storage_javascript.html"},"messages":{"messages_configuration":"messages_configuration.html","messages_javascript":"messages_javascript.html"},"naming":{"naming_configuration":"naming_configuration.html","naming_javascript":"naming_javascript.html"},"plugins":{"installing_a_plugin":"installing_plugins.html","creating_a_plugin":"creating_plugins.html","plugin_reference":"plugin_reference.html"},"cockpit":{"cockpit_introduction":"cockpit_introduction.html","cockpit_dashboard":"cockpit_dashboard.html","cockpit_deployment":"cockpit_deployment.html","cockpit_explorer":"cockpit_explorer.html","cockpit_editor":"cockpit_editor.html","cockpit_debugger":"cockpit_debugger.html"},"reference":{"embark_commands":"embark_commands.html"},"miscellaneous":{"migrating_from_3":"migrating_from_3.x.html","troubleshooting":"troubleshooting.html","contributing":"contributing.html"}}},"templates":[{"name":"Vyper Template","description":"Template to demonstrate the use of the Vyper contracts","install":"embark new AppName --template vyper","thumbnail":"vyper.png","link":"https://github.com/embarklabs/embark-vyper-template","tags":["vyper","contracts"]},{"name":"Embark Demo React Template","description":"A React Application showcasing Embark's functionality","install":"embark demo","thumbnail":"react.png","link":"https://embark.embarklabs.io/docs/create_project.html#Creating-a-Demo-Project","tags":["react","contracts","whisper","ipfs"]},{"name":"Typescript Template","description":"Template with Typescript support pre-configured","thumbnail":"typescript.png","install":"embark new AppName --template typescript","link":"https://github.com/embarklabs/embark-typescript-template","tags":["typescript","frontend"]},{"name":"Vue.js Template","description":"Ready to use Template for using Embark with vue.js","thumbnail":"vuejs.png","install":"embark new AppName --template vue","link":"https://github.com/embarklabs/embark-vue-template","tags":["vue.js","frontend"]},{"name":"ethvtx Template","description":"Demo app for ethvtx, an Ethereum-Ready & Framework-Agnostic Redux configuration","thumbnail":"vortex.png","install":"embark new AppName --template Horyus/ethvtx_embark","link":"https://github.com/Horyus/ethvtx_embark","tags":["react"]},{"name":"Bamboo Template","description":"Template to demonstrate use of the Bamboo contracts","install":"embark new AppName --template bamboo","thumbnail":"bamboo.png","link":"https://github.com/embarklabs/embark-bamboo-template","tags":["bamboo","contracts"]},{"name":"Solidity Gas Golfing","description":"Boilerplate and tests for the first Solidity Gas Golfing Contest","thumbnail":"sggc.png","install":"embark new AppName --template embarklabs/sggc","link":"https://github.com/embarklabs/sggc","tags":["solidity","tests","fun"]}],"tutorials":[{"name":"How to create a Token Factory with Ethereum — Part 1","description":"Create and Deploy a Token with Ethereum","link":"/tutorials/token_factory_1.html","tags":["token","ethereum"]},{"name":"How to create a Token Factory with Ethereum — Part 2","description":"Create a DApp that can deploy Tokens on the fly","link":"/tutorials/token_factory_2.html","tags":["token","ethereum","client-side-deployment"]},{"name":"How to deploy to a testnet with Infura","description":"Deploy and interact with your Dapp on a testnet with the use of Infura","link":"/tutorials/infura_guide.html","tags":["ethereum","deployment","testnet"]}],"versions":{"latest":{"label":"stable (v4)","url":"https://embark.embarklabs.io/docs"},"3.2":{"label":"v3.2","url":"https://5ca4e0fdb29712000adde37f--embark-site-versions.netlify.com/docs/"}}}},"excerpt":"","more":"

If you’re new to Embark you probably have a lot questions about what it can do and whether it supports the features you’re looking for. Check out our frequently asked questions and don’t hesitate to let us know if there’s anything missing!

\n

Embark in one sentence?

Embark is a developer environment for building, testing, and deploying Smart Contracts, as well as fully decentralized applications — computation (EVM), storage (IPFS, Swarm), and communication (Whisper).

\n

How does Embark differ from other tools?

While Embark does have quite some things in common with tools like Truffle, it goes far beyond managing and deploying Smart Contracts, if you want to. Embark aims to be extensible so you can choose what features make most sense to you when building decentralized apps.

\n

Whether you want to purely focus on building and deploying Smart Contracts, or you want to build a static website that should be deployed on IPFS. Or even all of that! The sky is the limit.

\n

Can I use Embark purely for Smart Contract development?

Absolutely! Simply create your application using the --contracts-only option as discussed in our guide on Creating Apps and you’re good to go.

\n

Embark’s configurations make it very easy to switch to a fully featured decentralized application later on, in case you change your mind.

\n

Can Embark connect to a simulated blockchain like Ganache?

Yes it can! In fact, Embark comes with ganache-cli and batteries included. Simply run embark simulator to spin up a simulated blockchain. For more information, check out the dedicated command reference.

\n

Is it Luri or Iuri?

Iuri, it is!

\n"},{"title":"docs_landing_page.header.title","layout":"docs-landing","_content":"\n","source":"docs/index.md","raw":"title: docs_landing_page.header.title\nlayout: docs-landing\n---\n\n","date":"2020-01-17T19:00:03.900Z","updated":"2020-01-17T19:00:03.900Z","path":"docs/index.html","comments":1,"_id":"ck5ijm3rk00167heg9sji3hx1","content":"","site":{"data":{"authors":{"iuri_matias":{"name":"Iuri Matias","twitter":"iurimatias","image":"https://pbs.twimg.com/profile_images/928272512181563392/iDJdvy2k_400x400.jpg"},"pascal_precht":{"name":"Pascal Precht","twitter":"pascalprecht","image":"https://pbs.twimg.com/profile_images/993785060733194241/p3oAIMDP_400x400.jpg"},"anthony_laibe":{"name":"Anthony Laibe","twitter":"a_laibe","image":"https://pbs.twimg.com/profile_images/257742900/13168239_400x400.jpg"},"jonathan_rainville":{"name":"Jonathan Rainville","twitter":"ShyolGhul","image":"https://pbs.twimg.com/profile_images/993873866878570496/-aE4byjj_400x400.jpg"},"andre_medeiros":{"name":"Andre Medeiros","twitter":"superdealloc","image":"https://pbs.twimg.com/profile_images/965722487735701504/m58KNgWN_400x400.jpg"},"eric_mastro":{"name":"Eric Mastro","twitter":"ericmastro","image":"https://avatars1.githubusercontent.com/u/5089238?s=460&v=4"},"michael_bradley":{"name":"Michael Bradley","image":"https://avatars3.githubusercontent.com/u/194260?s=460&v=4"},"richard_ramos":{"name":"Richard Ramos","twitter":"richardramos_me","image":"https://pbs.twimg.com/profile_images/1063160577973866496/aM313uHG_400x400.jpg"},"jonny_zerah":{"name":"Jonny Zerah","twitter":"jonnyzerah","image":"https://pbs.twimg.com/profile_images/1043774340490248192/gI9aGy17_400x400.jpg"},"robin_percy":{"name":"Robin Percy","twitter":"rbin","image":"https://avatars1.githubusercontent.com/u/29288325?s=400&v=4"}},"categories":{"tutorials":"Tutorials","announcements":"Announcements"},"languages":{"en":"English"},"plugins":[{"name":"embark-bamboo","description":"plugins_page.plugins.bamboo.desc","link":"https://www.npmjs.com/package/embark-bamboo","thumbnail":"bamboo.png","tags":["language","smart-contracts"]},{"name":"embark-solc","description":"plugins_page.plugins.solc.desc","link":"https://www.npmjs.com/package/embark-solc","thumbnail":"solidity.png","tags":["solidity","language","smart-contracts"]},{"name":"embark-solium","description":"plugins_page.plugins.solium.desc","link":"https://www.npmjs.com/package/embark-solium","thumbnail":"solium.png","tags":["linter","solidity","solium"]},{"name":"embark-etherscan-verifier","description":"plugins_page.plugins.verifier.desc","link":"https://www.npmjs.com/package/embark-etherscan-verifier","tags":["solidity","etherscan","smart-contracts"]},{"name":"embark-status","description":"plugins_page.plugins.status.desc","link":"https://www.npmjs.com/package/embark-status-plugin","thumbnail":"status.png","tags":["status","mobile"]},{"name":"embark-remix","description":"plugins_page.plugins.remix.desc","link":"https://www.npmjs.com/package/embark-remix","thumbnail":"remix.png","tags":["remix","debugger"]},{"name":"embark-slither","description":"plugins_page.plugins.slither.desc","link":"https://www.npmjs.com/package/embark-slither","tags":["solidity"]},{"name":"embark-snark","description":"plugins_page.plugins.snark.desc","link":"https://www.npmjs.com/package/embark-snark","tags":["snark"]},{"name":"embark-fortune","description":"plugins_page.plugins.fortune.desc","link":"https://www.npmjs.com/package/embark-fortune","thumbnail":"fortune.jpg","tags":["fun"]},{"name":"embark-pug","description":"plugins_page.plugins.pug.desc","link":"https://www.npmjs.com/package/embark-pug","legacy":true,"thumbnail":"pug.png","tags":["pug","jade","templates"]},{"name":"embark-haml","description":"plugins_page.plugins.haml.desc","link":"https://www.npmjs.com/package/embark-haml","legacy":true,"thumbnail":"haml.png","tags":["haml","templates"]},{"name":"embark-mythx","description":"plugins_page.plugins.mythx.desc","link":"https://www.npmjs.com/package/embark-mythx","thumbnail":"mythx.png","tags":["mythx","smart-contracts"]}],"menu":{"docs":"/docs/","plugins":"/plugins/","chat":"/chat/","blog":"/news/"},"sidebar":{"docs":{"getting_started":{"overview":"overview.html","installation":"installation.html","faq":"faq.html"},"general_usage":{"creating_project":"create_project.html","structure":"structure.html","running_apps":"running_apps.html","dashboard":"dashboard.html","using_the_console":"using_the_console.html","environments":"environments.html","configuration":"configuration.html","pipeline_and_webpack":"pipeline_and_webpack.html","javascript_usage":"javascript_usage.html"},"smart_contracts":{"contracts_configuration":"contracts_configuration.html","contracts_deployment":"contracts_deployment.html","contracts_imports":"contracts_imports.html","contracts_testing":"contracts_testing.html","contracts_javascript":"contracts_javascript.html"},"blockchain_node":{"blockchain_configuration":"blockchain_configuration.html","blockchain_accounts_configuration":"blockchain_accounts_configuration.html"},"storage":{"storage_configuration":"storage_configuration.html","storage_deployment":"storage_deployment.html","storage_javascript":"storage_javascript.html"},"messages":{"messages_configuration":"messages_configuration.html","messages_javascript":"messages_javascript.html"},"naming":{"naming_configuration":"naming_configuration.html","naming_javascript":"naming_javascript.html"},"plugins":{"installing_a_plugin":"installing_plugins.html","creating_a_plugin":"creating_plugins.html","plugin_reference":"plugin_reference.html"},"cockpit":{"cockpit_introduction":"cockpit_introduction.html","cockpit_dashboard":"cockpit_dashboard.html","cockpit_deployment":"cockpit_deployment.html","cockpit_explorer":"cockpit_explorer.html","cockpit_editor":"cockpit_editor.html","cockpit_debugger":"cockpit_debugger.html"},"reference":{"embark_commands":"embark_commands.html"},"miscellaneous":{"migrating_from_3":"migrating_from_3.x.html","troubleshooting":"troubleshooting.html","contributing":"contributing.html"}}},"templates":[{"name":"Vyper Template","description":"Template to demonstrate the use of the Vyper contracts","install":"embark new AppName --template vyper","thumbnail":"vyper.png","link":"https://github.com/embarklabs/embark-vyper-template","tags":["vyper","contracts"]},{"name":"Embark Demo React Template","description":"A React Application showcasing Embark's functionality","install":"embark demo","thumbnail":"react.png","link":"https://embark.embarklabs.io/docs/create_project.html#Creating-a-Demo-Project","tags":["react","contracts","whisper","ipfs"]},{"name":"Typescript Template","description":"Template with Typescript support pre-configured","thumbnail":"typescript.png","install":"embark new AppName --template typescript","link":"https://github.com/embarklabs/embark-typescript-template","tags":["typescript","frontend"]},{"name":"Vue.js Template","description":"Ready to use Template for using Embark with vue.js","thumbnail":"vuejs.png","install":"embark new AppName --template vue","link":"https://github.com/embarklabs/embark-vue-template","tags":["vue.js","frontend"]},{"name":"ethvtx Template","description":"Demo app for ethvtx, an Ethereum-Ready & Framework-Agnostic Redux configuration","thumbnail":"vortex.png","install":"embark new AppName --template Horyus/ethvtx_embark","link":"https://github.com/Horyus/ethvtx_embark","tags":["react"]},{"name":"Bamboo Template","description":"Template to demonstrate use of the Bamboo contracts","install":"embark new AppName --template bamboo","thumbnail":"bamboo.png","link":"https://github.com/embarklabs/embark-bamboo-template","tags":["bamboo","contracts"]},{"name":"Solidity Gas Golfing","description":"Boilerplate and tests for the first Solidity Gas Golfing Contest","thumbnail":"sggc.png","install":"embark new AppName --template embarklabs/sggc","link":"https://github.com/embarklabs/sggc","tags":["solidity","tests","fun"]}],"tutorials":[{"name":"How to create a Token Factory with Ethereum — Part 1","description":"Create and Deploy a Token with Ethereum","link":"/tutorials/token_factory_1.html","tags":["token","ethereum"]},{"name":"How to create a Token Factory with Ethereum — Part 2","description":"Create a DApp that can deploy Tokens on the fly","link":"/tutorials/token_factory_2.html","tags":["token","ethereum","client-side-deployment"]},{"name":"How to deploy to a testnet with Infura","description":"Deploy and interact with your Dapp on a testnet with the use of Infura","link":"/tutorials/infura_guide.html","tags":["ethereum","deployment","testnet"]}],"versions":{"latest":{"label":"stable (v4)","url":"https://embark.embarklabs.io/docs"},"3.2":{"label":"v3.2","url":"https://5ca4e0fdb29712000adde37f--embark-site-versions.netlify.com/docs/"}}}},"excerpt":"","more":""},{"title":"Installation","layout":"docs","_content":"In this guide we'll cover all the different ways of installing Embark on your local machine, starting with prerequisites.\n\n## Prerequisites\n\nIn order to make Embark work on our computer, we need to have some tools installed first. Make sure you have the following ready and in the correct version:\n\n- [Node](#Node)\n- [Ethereum Client](#Ethereum-Client-Optional)\n- [IPFS](#IPFS-Optional)\n\nOnce done, go ahead and [install Embark](#Installing-Embark).\n\n### Node\n\nPlease install [Node.js](http://nodejs.org/) in version 10.17.0 LTS or higher.\n\n{% notification info 'Quick Tip' %}\nWe recommend installing Node using the [Node Version Manager](https://github.com/creationix/nvm/blob/master/README.md). This is because it makes it very easy to install different versions of Node in isolated environments that don't require users to [change their permissions](https://docs.npmjs.com/getting-started/fixing-npm-permissions) when installing packages. Find instructions on how to install NVM [here](https://github.com/creationix/nvm/blob/master/README.md#install-script).\n\nOnce that is done, we can install and select a specific Node version or use the `--lts` option to get the latest version with long term support like this:\n\n
$ nvm install --lts\n$ nvm use --lts\n
\n{% endnotification %}\n\n### IPFS (Optional)\n\nIPFS can be used to distribute our application's content on the decentralized IPFS nodes. This can be skipped in case this isn't planned, however we do recommend it. Checkout IPFS' [installation guide](https://docs.ipfs.io/guides/guides/install/) to learn how to install IPFS on our local machine.\n\nTo verify that the installation was successful, simply run the following command:\n\n```\n$ ipfs --version\n```\n\nThis outputs something like\n\n```\n$ ipfs version 0.4.17\n```\n\n### Ethereum Client (Optional)\n\nEmbark can spin up an Ethereum node for us. To make this happen, an Ethereum client has to be installed on our machine as well. Embark already comes with [Ganache CLI](https://truffleframework.com/ganache), a blockchain node emulator, which is accessible via [Embark's simulator](embark_commands.html#simulator) command.\n\nIn case we want to run a real node, [geth](https://geth.ethereum.org/) is a pretty good one. Check out the [installation guide](https://ethereum.github.io/go-ethereum/install/) for our platform and verify our installation with:\n\n```\n$ geth version\n```\n\nWhich should result in an output that looks like this (note that the exact version numbers may be different):\n\n```\nGeth\nVersion: 1.8.15-stable\nGit Commit: 89451f7c382ad2185987ee369f16416f89c28a7d\nArchitecture: amd64\nProtocol Versions: [63 62]\nNetwork Id: 1\nGo Version: go1.10.4\nOperating System: darwin\nGOPATH=\nGOROOT=/Users/travis/.gimme/versions/go1.10.4.darwin.amd64\n```\n\n## Installing Embark\n\nAlright, let's install Embark so we can build our first application. As mentioned earlier, if anything is unclear or you run into problems, make sure to reach out to us on our dedicated channels, [submit an issue on GitHub](https://github.com/embarklabs/embark/issues), or take a look at our [troubleshooting guide](troubleshooting.html).\n\nWe can install Embark using the Node Package Manager (no worries, that one comes with Node), like this:\n\n```\n$ npm -g install embark\n```\n\nAfter that, `embark` should be available as a global command in our terminal of choice. Let's verify this by running the following command:\n\n```\n$ embark --version\n```\n\nAt the time of writing this guide, the output looked like this:\n\n```\n4.0.0\n```\n\nAwesome! We're all set up. If you're brand new to Embark, now would be a good time to take our [Quickstart](/docs/quick_start.html) in which you'll build your first application!\n","source":"docs/installation.md","raw":"title: Installation\nlayout: docs\n---\nIn this guide we'll cover all the different ways of installing Embark on your local machine, starting with prerequisites.\n\n## Prerequisites\n\nIn order to make Embark work on our computer, we need to have some tools installed first. Make sure you have the following ready and in the correct version:\n\n- [Node](#Node)\n- [Ethereum Client](#Ethereum-Client-Optional)\n- [IPFS](#IPFS-Optional)\n\nOnce done, go ahead and [install Embark](#Installing-Embark).\n\n### Node\n\nPlease install [Node.js](http://nodejs.org/) in version 10.17.0 LTS or higher.\n\n{% notification info 'Quick Tip' %}\nWe recommend installing Node using the [Node Version Manager](https://github.com/creationix/nvm/blob/master/README.md). This is because it makes it very easy to install different versions of Node in isolated environments that don't require users to [change their permissions](https://docs.npmjs.com/getting-started/fixing-npm-permissions) when installing packages. Find instructions on how to install NVM [here](https://github.com/creationix/nvm/blob/master/README.md#install-script).\n\nOnce that is done, we can install and select a specific Node version or use the `--lts` option to get the latest version with long term support like this:\n\n
$ nvm install --lts\n$ nvm use --lts\n
\n{% endnotification %}\n\n### IPFS (Optional)\n\nIPFS can be used to distribute our application's content on the decentralized IPFS nodes. This can be skipped in case this isn't planned, however we do recommend it. Checkout IPFS' [installation guide](https://docs.ipfs.io/guides/guides/install/) to learn how to install IPFS on our local machine.\n\nTo verify that the installation was successful, simply run the following command:\n\n```\n$ ipfs --version\n```\n\nThis outputs something like\n\n```\n$ ipfs version 0.4.17\n```\n\n### Ethereum Client (Optional)\n\nEmbark can spin up an Ethereum node for us. To make this happen, an Ethereum client has to be installed on our machine as well. Embark already comes with [Ganache CLI](https://truffleframework.com/ganache), a blockchain node emulator, which is accessible via [Embark's simulator](embark_commands.html#simulator) command.\n\nIn case we want to run a real node, [geth](https://geth.ethereum.org/) is a pretty good one. Check out the [installation guide](https://ethereum.github.io/go-ethereum/install/) for our platform and verify our installation with:\n\n```\n$ geth version\n```\n\nWhich should result in an output that looks like this (note that the exact version numbers may be different):\n\n```\nGeth\nVersion: 1.8.15-stable\nGit Commit: 89451f7c382ad2185987ee369f16416f89c28a7d\nArchitecture: amd64\nProtocol Versions: [63 62]\nNetwork Id: 1\nGo Version: go1.10.4\nOperating System: darwin\nGOPATH=\nGOROOT=/Users/travis/.gimme/versions/go1.10.4.darwin.amd64\n```\n\n## Installing Embark\n\nAlright, let's install Embark so we can build our first application. As mentioned earlier, if anything is unclear or you run into problems, make sure to reach out to us on our dedicated channels, [submit an issue on GitHub](https://github.com/embarklabs/embark/issues), or take a look at our [troubleshooting guide](troubleshooting.html).\n\nWe can install Embark using the Node Package Manager (no worries, that one comes with Node), like this:\n\n```\n$ npm -g install embark\n```\n\nAfter that, `embark` should be available as a global command in our terminal of choice. Let's verify this by running the following command:\n\n```\n$ embark --version\n```\n\nAt the time of writing this guide, the output looked like this:\n\n```\n4.0.0\n```\n\nAwesome! We're all set up. If you're brand new to Embark, now would be a good time to take our [Quickstart](/docs/quick_start.html) in which you'll build your first application!\n","date":"2020-01-19T20:56:53.010Z","updated":"2020-01-19T20:56:53.010Z","path":"docs/installation.html","_id":"ck5ijm3rl00177hegaq8kaid6","comments":1,"content":"

In this guide we’ll cover all the different ways of installing Embark on your local machine, starting with prerequisites.

\n

Prerequisites

In order to make Embark work on our computer, we need to have some tools installed first. Make sure you have the following ready and in the correct version:

\n\n

Once done, go ahead and install Embark.

\n

Node

Please install Node.js in version 10.17.0 LTS or higher.

\n
\n

Quick Tip

\n

We recommend installing Node using the Node Version Manager. This is because it makes it very easy to install different versions of Node in isolated environments that don’t require users to change their permissions when installing packages. Find instructions on how to install NVM here.

\n

Once that is done, we can install and select a specific Node version or use the --lts option to get the latest version with long term support like this:

\n
$ nvm install --lts\n$ nvm use --lts\n

\n
\n\n\n\n

IPFS (Optional)

IPFS can be used to distribute our application’s content on the decentralized IPFS nodes. This can be skipped in case this isn’t planned, however we do recommend it. Checkout IPFS’ installation guide to learn how to install IPFS on our local machine.

\n

To verify that the installation was successful, simply run the following command:

\n
$ ipfs --version
\n\n

This outputs something like

\n
$ ipfs version 0.4.17
\n\n

Ethereum Client (Optional)

Embark can spin up an Ethereum node for us. To make this happen, an Ethereum client has to be installed on our machine as well. Embark already comes with Ganache CLI, a blockchain node emulator, which is accessible via Embark’s simulator command.

\n

In case we want to run a real node, geth is a pretty good one. Check out the installation guide for our platform and verify our installation with:

\n
$ geth version
\n\n

Which should result in an output that looks like this (note that the exact version numbers may be different):

\n
Geth
Version: 1.8.15-stable
Git Commit: 89451f7c382ad2185987ee369f16416f89c28a7d
Architecture: amd64
Protocol Versions: [63 62]
Network Id: 1
Go Version: go1.10.4
Operating System: darwin
GOPATH=
GOROOT=/Users/travis/.gimme/versions/go1.10.4.darwin.amd64
\n\n

Installing Embark

Alright, let’s install Embark so we can build our first application. As mentioned earlier, if anything is unclear or you run into problems, make sure to reach out to us on our dedicated channels, submit an issue on GitHub, or take a look at our troubleshooting guide.

\n

We can install Embark using the Node Package Manager (no worries, that one comes with Node), like this:

\n
$ npm -g install embark
\n\n

After that, embark should be available as a global command in our terminal of choice. Let’s verify this by running the following command:

\n
$ embark --version
\n\n

At the time of writing this guide, the output looked like this:

\n
4.0.0
\n\n

Awesome! We’re all set up. If you’re brand new to Embark, now would be a good time to take our Quickstart in which you’ll build your first application!

\n","site":{"data":{"authors":{"iuri_matias":{"name":"Iuri Matias","twitter":"iurimatias","image":"https://pbs.twimg.com/profile_images/928272512181563392/iDJdvy2k_400x400.jpg"},"pascal_precht":{"name":"Pascal Precht","twitter":"pascalprecht","image":"https://pbs.twimg.com/profile_images/993785060733194241/p3oAIMDP_400x400.jpg"},"anthony_laibe":{"name":"Anthony Laibe","twitter":"a_laibe","image":"https://pbs.twimg.com/profile_images/257742900/13168239_400x400.jpg"},"jonathan_rainville":{"name":"Jonathan Rainville","twitter":"ShyolGhul","image":"https://pbs.twimg.com/profile_images/993873866878570496/-aE4byjj_400x400.jpg"},"andre_medeiros":{"name":"Andre Medeiros","twitter":"superdealloc","image":"https://pbs.twimg.com/profile_images/965722487735701504/m58KNgWN_400x400.jpg"},"eric_mastro":{"name":"Eric Mastro","twitter":"ericmastro","image":"https://avatars1.githubusercontent.com/u/5089238?s=460&v=4"},"michael_bradley":{"name":"Michael Bradley","image":"https://avatars3.githubusercontent.com/u/194260?s=460&v=4"},"richard_ramos":{"name":"Richard Ramos","twitter":"richardramos_me","image":"https://pbs.twimg.com/profile_images/1063160577973866496/aM313uHG_400x400.jpg"},"jonny_zerah":{"name":"Jonny Zerah","twitter":"jonnyzerah","image":"https://pbs.twimg.com/profile_images/1043774340490248192/gI9aGy17_400x400.jpg"},"robin_percy":{"name":"Robin Percy","twitter":"rbin","image":"https://avatars1.githubusercontent.com/u/29288325?s=400&v=4"}},"categories":{"tutorials":"Tutorials","announcements":"Announcements"},"languages":{"en":"English"},"plugins":[{"name":"embark-bamboo","description":"plugins_page.plugins.bamboo.desc","link":"https://www.npmjs.com/package/embark-bamboo","thumbnail":"bamboo.png","tags":["language","smart-contracts"]},{"name":"embark-solc","description":"plugins_page.plugins.solc.desc","link":"https://www.npmjs.com/package/embark-solc","thumbnail":"solidity.png","tags":["solidity","language","smart-contracts"]},{"name":"embark-solium","description":"plugins_page.plugins.solium.desc","link":"https://www.npmjs.com/package/embark-solium","thumbnail":"solium.png","tags":["linter","solidity","solium"]},{"name":"embark-etherscan-verifier","description":"plugins_page.plugins.verifier.desc","link":"https://www.npmjs.com/package/embark-etherscan-verifier","tags":["solidity","etherscan","smart-contracts"]},{"name":"embark-status","description":"plugins_page.plugins.status.desc","link":"https://www.npmjs.com/package/embark-status-plugin","thumbnail":"status.png","tags":["status","mobile"]},{"name":"embark-remix","description":"plugins_page.plugins.remix.desc","link":"https://www.npmjs.com/package/embark-remix","thumbnail":"remix.png","tags":["remix","debugger"]},{"name":"embark-slither","description":"plugins_page.plugins.slither.desc","link":"https://www.npmjs.com/package/embark-slither","tags":["solidity"]},{"name":"embark-snark","description":"plugins_page.plugins.snark.desc","link":"https://www.npmjs.com/package/embark-snark","tags":["snark"]},{"name":"embark-fortune","description":"plugins_page.plugins.fortune.desc","link":"https://www.npmjs.com/package/embark-fortune","thumbnail":"fortune.jpg","tags":["fun"]},{"name":"embark-pug","description":"plugins_page.plugins.pug.desc","link":"https://www.npmjs.com/package/embark-pug","legacy":true,"thumbnail":"pug.png","tags":["pug","jade","templates"]},{"name":"embark-haml","description":"plugins_page.plugins.haml.desc","link":"https://www.npmjs.com/package/embark-haml","legacy":true,"thumbnail":"haml.png","tags":["haml","templates"]},{"name":"embark-mythx","description":"plugins_page.plugins.mythx.desc","link":"https://www.npmjs.com/package/embark-mythx","thumbnail":"mythx.png","tags":["mythx","smart-contracts"]}],"menu":{"docs":"/docs/","plugins":"/plugins/","chat":"/chat/","blog":"/news/"},"sidebar":{"docs":{"getting_started":{"overview":"overview.html","installation":"installation.html","faq":"faq.html"},"general_usage":{"creating_project":"create_project.html","structure":"structure.html","running_apps":"running_apps.html","dashboard":"dashboard.html","using_the_console":"using_the_console.html","environments":"environments.html","configuration":"configuration.html","pipeline_and_webpack":"pipeline_and_webpack.html","javascript_usage":"javascript_usage.html"},"smart_contracts":{"contracts_configuration":"contracts_configuration.html","contracts_deployment":"contracts_deployment.html","contracts_imports":"contracts_imports.html","contracts_testing":"contracts_testing.html","contracts_javascript":"contracts_javascript.html"},"blockchain_node":{"blockchain_configuration":"blockchain_configuration.html","blockchain_accounts_configuration":"blockchain_accounts_configuration.html"},"storage":{"storage_configuration":"storage_configuration.html","storage_deployment":"storage_deployment.html","storage_javascript":"storage_javascript.html"},"messages":{"messages_configuration":"messages_configuration.html","messages_javascript":"messages_javascript.html"},"naming":{"naming_configuration":"naming_configuration.html","naming_javascript":"naming_javascript.html"},"plugins":{"installing_a_plugin":"installing_plugins.html","creating_a_plugin":"creating_plugins.html","plugin_reference":"plugin_reference.html"},"cockpit":{"cockpit_introduction":"cockpit_introduction.html","cockpit_dashboard":"cockpit_dashboard.html","cockpit_deployment":"cockpit_deployment.html","cockpit_explorer":"cockpit_explorer.html","cockpit_editor":"cockpit_editor.html","cockpit_debugger":"cockpit_debugger.html"},"reference":{"embark_commands":"embark_commands.html"},"miscellaneous":{"migrating_from_3":"migrating_from_3.x.html","troubleshooting":"troubleshooting.html","contributing":"contributing.html"}}},"templates":[{"name":"Vyper Template","description":"Template to demonstrate the use of the Vyper contracts","install":"embark new AppName --template vyper","thumbnail":"vyper.png","link":"https://github.com/embarklabs/embark-vyper-template","tags":["vyper","contracts"]},{"name":"Embark Demo React Template","description":"A React Application showcasing Embark's functionality","install":"embark demo","thumbnail":"react.png","link":"https://embark.embarklabs.io/docs/create_project.html#Creating-a-Demo-Project","tags":["react","contracts","whisper","ipfs"]},{"name":"Typescript Template","description":"Template with Typescript support pre-configured","thumbnail":"typescript.png","install":"embark new AppName --template typescript","link":"https://github.com/embarklabs/embark-typescript-template","tags":["typescript","frontend"]},{"name":"Vue.js Template","description":"Ready to use Template for using Embark with vue.js","thumbnail":"vuejs.png","install":"embark new AppName --template vue","link":"https://github.com/embarklabs/embark-vue-template","tags":["vue.js","frontend"]},{"name":"ethvtx Template","description":"Demo app for ethvtx, an Ethereum-Ready & Framework-Agnostic Redux configuration","thumbnail":"vortex.png","install":"embark new AppName --template Horyus/ethvtx_embark","link":"https://github.com/Horyus/ethvtx_embark","tags":["react"]},{"name":"Bamboo Template","description":"Template to demonstrate use of the Bamboo contracts","install":"embark new AppName --template bamboo","thumbnail":"bamboo.png","link":"https://github.com/embarklabs/embark-bamboo-template","tags":["bamboo","contracts"]},{"name":"Solidity Gas Golfing","description":"Boilerplate and tests for the first Solidity Gas Golfing Contest","thumbnail":"sggc.png","install":"embark new AppName --template embarklabs/sggc","link":"https://github.com/embarklabs/sggc","tags":["solidity","tests","fun"]}],"tutorials":[{"name":"How to create a Token Factory with Ethereum — Part 1","description":"Create and Deploy a Token with Ethereum","link":"/tutorials/token_factory_1.html","tags":["token","ethereum"]},{"name":"How to create a Token Factory with Ethereum — Part 2","description":"Create a DApp that can deploy Tokens on the fly","link":"/tutorials/token_factory_2.html","tags":["token","ethereum","client-side-deployment"]},{"name":"How to deploy to a testnet with Infura","description":"Deploy and interact with your Dapp on a testnet with the use of Infura","link":"/tutorials/infura_guide.html","tags":["ethereum","deployment","testnet"]}],"versions":{"latest":{"label":"stable (v4)","url":"https://embark.embarklabs.io/docs"},"3.2":{"label":"v3.2","url":"https://5ca4e0fdb29712000adde37f--embark-site-versions.netlify.com/docs/"}}}},"excerpt":"","more":"

In this guide we’ll cover all the different ways of installing Embark on your local machine, starting with prerequisites.

\n

Prerequisites

In order to make Embark work on our computer, we need to have some tools installed first. Make sure you have the following ready and in the correct version:

\n\n

Once done, go ahead and install Embark.

\n

Node

Please install Node.js in version 10.17.0 LTS or higher.

\n
\n

Quick Tip

\n

We recommend installing Node using the Node Version Manager. This is because it makes it very easy to install different versions of Node in isolated environments that don’t require users to change their permissions when installing packages. Find instructions on how to install NVM here.

\n

Once that is done, we can install and select a specific Node version or use the --lts option to get the latest version with long term support like this:

\n
$ nvm install --lts\n$ nvm use --lts\n

\n
\n\n\n\n

IPFS (Optional)

IPFS can be used to distribute our application’s content on the decentralized IPFS nodes. This can be skipped in case this isn’t planned, however we do recommend it. Checkout IPFS’ installation guide to learn how to install IPFS on our local machine.

\n

To verify that the installation was successful, simply run the following command:

\n
$ ipfs --version
\n\n

This outputs something like

\n
$ ipfs version 0.4.17
\n\n

Ethereum Client (Optional)

Embark can spin up an Ethereum node for us. To make this happen, an Ethereum client has to be installed on our machine as well. Embark already comes with Ganache CLI, a blockchain node emulator, which is accessible via Embark’s simulator command.

\n

In case we want to run a real node, geth is a pretty good one. Check out the installation guide for our platform and verify our installation with:

\n
$ geth version
\n\n

Which should result in an output that looks like this (note that the exact version numbers may be different):

\n
Geth
Version: 1.8.15-stable
Git Commit: 89451f7c382ad2185987ee369f16416f89c28a7d
Architecture: amd64
Protocol Versions: [63 62]
Network Id: 1
Go Version: go1.10.4
Operating System: darwin
GOPATH=
GOROOT=/Users/travis/.gimme/versions/go1.10.4.darwin.amd64
\n\n

Installing Embark

Alright, let’s install Embark so we can build our first application. As mentioned earlier, if anything is unclear or you run into problems, make sure to reach out to us on our dedicated channels, submit an issue on GitHub, or take a look at our troubleshooting guide.

\n

We can install Embark using the Node Package Manager (no worries, that one comes with Node), like this:

\n
$ npm -g install embark
\n\n

After that, embark should be available as a global command in our terminal of choice. Let’s verify this by running the following command:

\n
$ embark --version
\n\n

At the time of writing this guide, the output looked like this:

\n
4.0.0
\n\n

Awesome! We’re all set up. If you’re brand new to Embark, now would be a good time to take our Quickstart in which you’ll build your first application!

\n"},{"title":"Configuring EmbarkJS","layout":"docs","_content":"\nEmbark includes in your Dapp the EmbarkJS library. This library abstracts different functionalities, so you can easily & quickly build powerful Dapps that leverage different decentralized technologies.\nEmbark will automatically initialize EmbarkJS with the configurations set for your particular environment. You just need to connect it to a blockchain node, like explained [below](#Connecting).\n\n### Connecting\n\nBefore using EmbarkJS and Contract functions, we need to make sure that Embark is connected to a blockchain node.\n\nFor that, EmbarkJS provides the `Blockchain.connect()` function that receives a configuration object.\nLuckily, Embark generates the necessary config by looking at your configuration files and outputs it in its generation folder. The default directory is `embarkArtifacts/`, but you can change that in `embark.json` by changing `generationDir`.\n\nLet's see what that generated config file looks like at `embarkArtifacts/config/blockchain.json`:\n\n```\n{\n \"dappConnection\": [\n \"$WEB3\",\n \"$EMBARK\",\n \"ws://localhost:8546\"\n ],\n \"dappAutoEnable\": true,\n \"warnIfMetamask\": true,\n \"blockchainClient\": \"geth\"\n}\n```\n\n\n#### Connection parameters:\n\n- **dappConnection**: Copied from the contracts config. This is the list of connections Embark will try to connect to in order. For more information, look at [the guide on EmbakJS](/docs/javascript_usage.html#Using-dappConnection).\n- **dappAutoEnable**: Copied from the contracts config. This tells EmbarkJS to either automatically connect to Metamask (or Mist) or wait for the developper (you) to do it.\n - Read more on it [below](#Provider)\n- **warnIfMetamask**: Is true when `isDev` is true in the blockchain config. Will warn you in the console if Metamask is detected, to make sure you connect Metamask correctly to the local node.\n- **blockchainClient**: Copied from the blockchain config. This tells EmbarkJS which blockchain client it is connecting to and it will warn about the different problematic behaviours you could experience.\n\n\n### Utilities\n\nEmbarkJS also includes a `onReady` function. This is very useful to ensure that your Dapp only starts interacting with contracts when the proper connection to web3 has been made and ready to use.\n\n```\nimport EmbarkJS from 'Embark/EmbarkJS';\nimport SimpleStorage from 'Embark/contracts/SimpleStorage';\n\nEmbarkJS.onReady((error) => {\n if (error) {\n console.error('Error while connecting to web3', error);\n return;\n }\n SimpleStorage.methods.set(100).send();\n});\n```\n\n### Provider\n\nAs of [EIP1102](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-1102.md), decentralized applications MUST request account access. Embark offers several options on how to implement this.\n\nAn Embark application's Smart Contract configuration file (typically located in `config/contracts.js`) comes with a `dappAutoEnable` property which controls whether or not EmbarkJS should automatically try to request account access:\n```\n...\n // Automatically call `ethereum.enable` if true.\n // If false, the following code must run before sending any transaction: `await EmbarkJS.enableEthereum();`\n // Default value is true.\n // dappAutoEnable: true,\n...\n```\n\n\nBy default, the value of `dappAutoEnable` is true which means that Embark will call `ethereum.enable` for you to request account access when the first page of the dapp is loaded.\n\nIf you want more control, you can set `dappAutoEnable` to false.\nThen, if you want to request account access, you can use the following code:\n\n```\n...\n try {\n const accounts = await EmbarkJS.enableEthereum();\n // access granted\n } catch() {\n // access not granted\n }\n...\n```\n\nThis will request account access and if the user grants access to his accounts, you will be able to make transaction calls.\n\n\n### Components\n\n* [EmbarkJS.Contract](contracts_javascript.html) - To interact with smart contracts. Typically Embark automatically initializes all your deployed contracts with this. uses web3.js 1.2.1\n* [EmbarkJS.Storage](storage_javascript.html) - To interact with the configured decentralized storage. Includes bindings to save & retrieve data, upload & download files, etc..\n* [EmbarkJS.Communication](messages_javascript.html) - To interact with the configured decentralized messages system. Includes bindings to listen to topics and send messages.\n* [EmbarkJS.Names](naming_javascript.html) - To interact with the configured decentralized naming system such as ENS. Includes bindings to look up the address of a domain name as well as retrieve a domain name given an address.\n","source":"docs/installing_embarkjs.md","raw":"title: Configuring EmbarkJS\nlayout: docs\n---\n\nEmbark includes in your Dapp the EmbarkJS library. This library abstracts different functionalities, so you can easily & quickly build powerful Dapps that leverage different decentralized technologies.\nEmbark will automatically initialize EmbarkJS with the configurations set for your particular environment. You just need to connect it to a blockchain node, like explained [below](#Connecting).\n\n### Connecting\n\nBefore using EmbarkJS and Contract functions, we need to make sure that Embark is connected to a blockchain node.\n\nFor that, EmbarkJS provides the `Blockchain.connect()` function that receives a configuration object.\nLuckily, Embark generates the necessary config by looking at your configuration files and outputs it in its generation folder. The default directory is `embarkArtifacts/`, but you can change that in `embark.json` by changing `generationDir`.\n\nLet's see what that generated config file looks like at `embarkArtifacts/config/blockchain.json`:\n\n```\n{\n \"dappConnection\": [\n \"$WEB3\",\n \"$EMBARK\",\n \"ws://localhost:8546\"\n ],\n \"dappAutoEnable\": true,\n \"warnIfMetamask\": true,\n \"blockchainClient\": \"geth\"\n}\n```\n\n\n#### Connection parameters:\n\n- **dappConnection**: Copied from the contracts config. This is the list of connections Embark will try to connect to in order. For more information, look at [the guide on EmbakJS](/docs/javascript_usage.html#Using-dappConnection).\n- **dappAutoEnable**: Copied from the contracts config. This tells EmbarkJS to either automatically connect to Metamask (or Mist) or wait for the developper (you) to do it.\n - Read more on it [below](#Provider)\n- **warnIfMetamask**: Is true when `isDev` is true in the blockchain config. Will warn you in the console if Metamask is detected, to make sure you connect Metamask correctly to the local node.\n- **blockchainClient**: Copied from the blockchain config. This tells EmbarkJS which blockchain client it is connecting to and it will warn about the different problematic behaviours you could experience.\n\n\n### Utilities\n\nEmbarkJS also includes a `onReady` function. This is very useful to ensure that your Dapp only starts interacting with contracts when the proper connection to web3 has been made and ready to use.\n\n```\nimport EmbarkJS from 'Embark/EmbarkJS';\nimport SimpleStorage from 'Embark/contracts/SimpleStorage';\n\nEmbarkJS.onReady((error) => {\n if (error) {\n console.error('Error while connecting to web3', error);\n return;\n }\n SimpleStorage.methods.set(100).send();\n});\n```\n\n### Provider\n\nAs of [EIP1102](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-1102.md), decentralized applications MUST request account access. Embark offers several options on how to implement this.\n\nAn Embark application's Smart Contract configuration file (typically located in `config/contracts.js`) comes with a `dappAutoEnable` property which controls whether or not EmbarkJS should automatically try to request account access:\n```\n...\n // Automatically call `ethereum.enable` if true.\n // If false, the following code must run before sending any transaction: `await EmbarkJS.enableEthereum();`\n // Default value is true.\n // dappAutoEnable: true,\n...\n```\n\n\nBy default, the value of `dappAutoEnable` is true which means that Embark will call `ethereum.enable` for you to request account access when the first page of the dapp is loaded.\n\nIf you want more control, you can set `dappAutoEnable` to false.\nThen, if you want to request account access, you can use the following code:\n\n```\n...\n try {\n const accounts = await EmbarkJS.enableEthereum();\n // access granted\n } catch() {\n // access not granted\n }\n...\n```\n\nThis will request account access and if the user grants access to his accounts, you will be able to make transaction calls.\n\n\n### Components\n\n* [EmbarkJS.Contract](contracts_javascript.html) - To interact with smart contracts. Typically Embark automatically initializes all your deployed contracts with this. uses web3.js 1.2.1\n* [EmbarkJS.Storage](storage_javascript.html) - To interact with the configured decentralized storage. Includes bindings to save & retrieve data, upload & download files, etc..\n* [EmbarkJS.Communication](messages_javascript.html) - To interact with the configured decentralized messages system. Includes bindings to listen to topics and send messages.\n* [EmbarkJS.Names](naming_javascript.html) - To interact with the configured decentralized naming system such as ENS. Includes bindings to look up the address of a domain name as well as retrieve a domain name given an address.\n","date":"2020-01-17T19:00:03.900Z","updated":"2020-01-17T19:00:03.900Z","path":"docs/installing_embarkjs.html","comments":1,"_id":"ck5ijm3rm00187hege76085yd","content":"

Embark includes in your Dapp the EmbarkJS library. This library abstracts different functionalities, so you can easily & quickly build powerful Dapps that leverage different decentralized technologies.
Embark will automatically initialize EmbarkJS with the configurations set for your particular environment. You just need to connect it to a blockchain node, like explained below.

\n

Connecting

Before using EmbarkJS and Contract functions, we need to make sure that Embark is connected to a blockchain node.

\n

For that, EmbarkJS provides the Blockchain.connect() function that receives a configuration object.
Luckily, Embark generates the necessary config by looking at your configuration files and outputs it in its generation folder. The default directory is embarkArtifacts/, but you can change that in embark.json by changing generationDir.

\n

Let’s see what that generated config file looks like at embarkArtifacts/config/blockchain.json:

\n
{
"dappConnection": [
"$WEB3",
"$EMBARK",
"ws://localhost:8546"
],
"dappAutoEnable": true,
"warnIfMetamask": true,
"blockchainClient": "geth"
}
\n\n\n

Connection parameters:

    \n
  • dappConnection: Copied from the contracts config. This is the list of connections Embark will try to connect to in order. For more information, look at the guide on EmbakJS.
  • \n
  • dappAutoEnable: Copied from the contracts config. This tells EmbarkJS to either automatically connect to Metamask (or Mist) or wait for the developper (you) to do it.
      \n
    • Read more on it below
    • \n
    \n
  • \n
  • warnIfMetamask: Is true when isDev is true in the blockchain config. Will warn you in the console if Metamask is detected, to make sure you connect Metamask correctly to the local node.
  • \n
  • blockchainClient: Copied from the blockchain config. This tells EmbarkJS which blockchain client it is connecting to and it will warn about the different problematic behaviours you could experience.
  • \n
\n

Utilities

EmbarkJS also includes a onReady function. This is very useful to ensure that your Dapp only starts interacting with contracts when the proper connection to web3 has been made and ready to use.

\n
import EmbarkJS from 'Embark/EmbarkJS';
import SimpleStorage from 'Embark/contracts/SimpleStorage';

EmbarkJS.onReady((error) => {
if (error) {
console.error('Error while connecting to web3', error);
return;
}
SimpleStorage.methods.set(100).send();
});
\n\n

Provider

As of EIP1102, decentralized applications MUST request account access. Embark offers several options on how to implement this.

\n

An Embark application’s Smart Contract configuration file (typically located in config/contracts.js) comes with a dappAutoEnable property which controls whether or not EmbarkJS should automatically try to request account access:

\n
...
// Automatically call `ethereum.enable` if true.
// If false, the following code must run before sending any transaction: `await EmbarkJS.enableEthereum();`
// Default value is true.
// dappAutoEnable: true,
...
\n\n\n

By default, the value of dappAutoEnable is true which means that Embark will call ethereum.enable for you to request account access when the first page of the dapp is loaded.

\n

If you want more control, you can set dappAutoEnable to false.
Then, if you want to request account access, you can use the following code:

\n
...
try {
const accounts = await EmbarkJS.enableEthereum();
// access granted
} catch() {
// access not granted
}
...
\n\n

This will request account access and if the user grants access to his accounts, you will be able to make transaction calls.

\n

Components

    \n
  • EmbarkJS.Contract - To interact with smart contracts. Typically Embark automatically initializes all your deployed contracts with this. uses web3.js 1.2.1
  • \n
  • EmbarkJS.Storage - To interact with the configured decentralized storage. Includes bindings to save & retrieve data, upload & download files, etc..
  • \n
  • EmbarkJS.Communication - To interact with the configured decentralized messages system. Includes bindings to listen to topics and send messages.
  • \n
  • EmbarkJS.Names - To interact with the configured decentralized naming system such as ENS. Includes bindings to look up the address of a domain name as well as retrieve a domain name given an address.
  • \n
\n","site":{"data":{"authors":{"iuri_matias":{"name":"Iuri Matias","twitter":"iurimatias","image":"https://pbs.twimg.com/profile_images/928272512181563392/iDJdvy2k_400x400.jpg"},"pascal_precht":{"name":"Pascal Precht","twitter":"pascalprecht","image":"https://pbs.twimg.com/profile_images/993785060733194241/p3oAIMDP_400x400.jpg"},"anthony_laibe":{"name":"Anthony Laibe","twitter":"a_laibe","image":"https://pbs.twimg.com/profile_images/257742900/13168239_400x400.jpg"},"jonathan_rainville":{"name":"Jonathan Rainville","twitter":"ShyolGhul","image":"https://pbs.twimg.com/profile_images/993873866878570496/-aE4byjj_400x400.jpg"},"andre_medeiros":{"name":"Andre Medeiros","twitter":"superdealloc","image":"https://pbs.twimg.com/profile_images/965722487735701504/m58KNgWN_400x400.jpg"},"eric_mastro":{"name":"Eric Mastro","twitter":"ericmastro","image":"https://avatars1.githubusercontent.com/u/5089238?s=460&v=4"},"michael_bradley":{"name":"Michael Bradley","image":"https://avatars3.githubusercontent.com/u/194260?s=460&v=4"},"richard_ramos":{"name":"Richard Ramos","twitter":"richardramos_me","image":"https://pbs.twimg.com/profile_images/1063160577973866496/aM313uHG_400x400.jpg"},"jonny_zerah":{"name":"Jonny Zerah","twitter":"jonnyzerah","image":"https://pbs.twimg.com/profile_images/1043774340490248192/gI9aGy17_400x400.jpg"},"robin_percy":{"name":"Robin Percy","twitter":"rbin","image":"https://avatars1.githubusercontent.com/u/29288325?s=400&v=4"}},"categories":{"tutorials":"Tutorials","announcements":"Announcements"},"languages":{"en":"English"},"plugins":[{"name":"embark-bamboo","description":"plugins_page.plugins.bamboo.desc","link":"https://www.npmjs.com/package/embark-bamboo","thumbnail":"bamboo.png","tags":["language","smart-contracts"]},{"name":"embark-solc","description":"plugins_page.plugins.solc.desc","link":"https://www.npmjs.com/package/embark-solc","thumbnail":"solidity.png","tags":["solidity","language","smart-contracts"]},{"name":"embark-solium","description":"plugins_page.plugins.solium.desc","link":"https://www.npmjs.com/package/embark-solium","thumbnail":"solium.png","tags":["linter","solidity","solium"]},{"name":"embark-etherscan-verifier","description":"plugins_page.plugins.verifier.desc","link":"https://www.npmjs.com/package/embark-etherscan-verifier","tags":["solidity","etherscan","smart-contracts"]},{"name":"embark-status","description":"plugins_page.plugins.status.desc","link":"https://www.npmjs.com/package/embark-status-plugin","thumbnail":"status.png","tags":["status","mobile"]},{"name":"embark-remix","description":"plugins_page.plugins.remix.desc","link":"https://www.npmjs.com/package/embark-remix","thumbnail":"remix.png","tags":["remix","debugger"]},{"name":"embark-slither","description":"plugins_page.plugins.slither.desc","link":"https://www.npmjs.com/package/embark-slither","tags":["solidity"]},{"name":"embark-snark","description":"plugins_page.plugins.snark.desc","link":"https://www.npmjs.com/package/embark-snark","tags":["snark"]},{"name":"embark-fortune","description":"plugins_page.plugins.fortune.desc","link":"https://www.npmjs.com/package/embark-fortune","thumbnail":"fortune.jpg","tags":["fun"]},{"name":"embark-pug","description":"plugins_page.plugins.pug.desc","link":"https://www.npmjs.com/package/embark-pug","legacy":true,"thumbnail":"pug.png","tags":["pug","jade","templates"]},{"name":"embark-haml","description":"plugins_page.plugins.haml.desc","link":"https://www.npmjs.com/package/embark-haml","legacy":true,"thumbnail":"haml.png","tags":["haml","templates"]},{"name":"embark-mythx","description":"plugins_page.plugins.mythx.desc","link":"https://www.npmjs.com/package/embark-mythx","thumbnail":"mythx.png","tags":["mythx","smart-contracts"]}],"menu":{"docs":"/docs/","plugins":"/plugins/","chat":"/chat/","blog":"/news/"},"sidebar":{"docs":{"getting_started":{"overview":"overview.html","installation":"installation.html","faq":"faq.html"},"general_usage":{"creating_project":"create_project.html","structure":"structure.html","running_apps":"running_apps.html","dashboard":"dashboard.html","using_the_console":"using_the_console.html","environments":"environments.html","configuration":"configuration.html","pipeline_and_webpack":"pipeline_and_webpack.html","javascript_usage":"javascript_usage.html"},"smart_contracts":{"contracts_configuration":"contracts_configuration.html","contracts_deployment":"contracts_deployment.html","contracts_imports":"contracts_imports.html","contracts_testing":"contracts_testing.html","contracts_javascript":"contracts_javascript.html"},"blockchain_node":{"blockchain_configuration":"blockchain_configuration.html","blockchain_accounts_configuration":"blockchain_accounts_configuration.html"},"storage":{"storage_configuration":"storage_configuration.html","storage_deployment":"storage_deployment.html","storage_javascript":"storage_javascript.html"},"messages":{"messages_configuration":"messages_configuration.html","messages_javascript":"messages_javascript.html"},"naming":{"naming_configuration":"naming_configuration.html","naming_javascript":"naming_javascript.html"},"plugins":{"installing_a_plugin":"installing_plugins.html","creating_a_plugin":"creating_plugins.html","plugin_reference":"plugin_reference.html"},"cockpit":{"cockpit_introduction":"cockpit_introduction.html","cockpit_dashboard":"cockpit_dashboard.html","cockpit_deployment":"cockpit_deployment.html","cockpit_explorer":"cockpit_explorer.html","cockpit_editor":"cockpit_editor.html","cockpit_debugger":"cockpit_debugger.html"},"reference":{"embark_commands":"embark_commands.html"},"miscellaneous":{"migrating_from_3":"migrating_from_3.x.html","troubleshooting":"troubleshooting.html","contributing":"contributing.html"}}},"templates":[{"name":"Vyper Template","description":"Template to demonstrate the use of the Vyper contracts","install":"embark new AppName --template vyper","thumbnail":"vyper.png","link":"https://github.com/embarklabs/embark-vyper-template","tags":["vyper","contracts"]},{"name":"Embark Demo React Template","description":"A React Application showcasing Embark's functionality","install":"embark demo","thumbnail":"react.png","link":"https://embark.embarklabs.io/docs/create_project.html#Creating-a-Demo-Project","tags":["react","contracts","whisper","ipfs"]},{"name":"Typescript Template","description":"Template with Typescript support pre-configured","thumbnail":"typescript.png","install":"embark new AppName --template typescript","link":"https://github.com/embarklabs/embark-typescript-template","tags":["typescript","frontend"]},{"name":"Vue.js Template","description":"Ready to use Template for using Embark with vue.js","thumbnail":"vuejs.png","install":"embark new AppName --template vue","link":"https://github.com/embarklabs/embark-vue-template","tags":["vue.js","frontend"]},{"name":"ethvtx Template","description":"Demo app for ethvtx, an Ethereum-Ready & Framework-Agnostic Redux configuration","thumbnail":"vortex.png","install":"embark new AppName --template Horyus/ethvtx_embark","link":"https://github.com/Horyus/ethvtx_embark","tags":["react"]},{"name":"Bamboo Template","description":"Template to demonstrate use of the Bamboo contracts","install":"embark new AppName --template bamboo","thumbnail":"bamboo.png","link":"https://github.com/embarklabs/embark-bamboo-template","tags":["bamboo","contracts"]},{"name":"Solidity Gas Golfing","description":"Boilerplate and tests for the first Solidity Gas Golfing Contest","thumbnail":"sggc.png","install":"embark new AppName --template embarklabs/sggc","link":"https://github.com/embarklabs/sggc","tags":["solidity","tests","fun"]}],"tutorials":[{"name":"How to create a Token Factory with Ethereum — Part 1","description":"Create and Deploy a Token with Ethereum","link":"/tutorials/token_factory_1.html","tags":["token","ethereum"]},{"name":"How to create a Token Factory with Ethereum — Part 2","description":"Create a DApp that can deploy Tokens on the fly","link":"/tutorials/token_factory_2.html","tags":["token","ethereum","client-side-deployment"]},{"name":"How to deploy to a testnet with Infura","description":"Deploy and interact with your Dapp on a testnet with the use of Infura","link":"/tutorials/infura_guide.html","tags":["ethereum","deployment","testnet"]}],"versions":{"latest":{"label":"stable (v4)","url":"https://embark.embarklabs.io/docs"},"3.2":{"label":"v3.2","url":"https://5ca4e0fdb29712000adde37f--embark-site-versions.netlify.com/docs/"}}}},"excerpt":"","more":"

Embark includes in your Dapp the EmbarkJS library. This library abstracts different functionalities, so you can easily & quickly build powerful Dapps that leverage different decentralized technologies.
Embark will automatically initialize EmbarkJS with the configurations set for your particular environment. You just need to connect it to a blockchain node, like explained below.

\n

Connecting

Before using EmbarkJS and Contract functions, we need to make sure that Embark is connected to a blockchain node.

\n

For that, EmbarkJS provides the Blockchain.connect() function that receives a configuration object.
Luckily, Embark generates the necessary config by looking at your configuration files and outputs it in its generation folder. The default directory is embarkArtifacts/, but you can change that in embark.json by changing generationDir.

\n

Let’s see what that generated config file looks like at embarkArtifacts/config/blockchain.json:

\n
{
"dappConnection": [
"$WEB3",
"$EMBARK",
"ws://localhost:8546"
],
"dappAutoEnable": true,
"warnIfMetamask": true,
"blockchainClient": "geth"
}
\n\n\n

Connection parameters:

    \n
  • dappConnection: Copied from the contracts config. This is the list of connections Embark will try to connect to in order. For more information, look at the guide on EmbakJS.
  • \n
  • dappAutoEnable: Copied from the contracts config. This tells EmbarkJS to either automatically connect to Metamask (or Mist) or wait for the developper (you) to do it.
      \n
    • Read more on it below
    • \n
    \n
  • \n
  • warnIfMetamask: Is true when isDev is true in the blockchain config. Will warn you in the console if Metamask is detected, to make sure you connect Metamask correctly to the local node.
  • \n
  • blockchainClient: Copied from the blockchain config. This tells EmbarkJS which blockchain client it is connecting to and it will warn about the different problematic behaviours you could experience.
  • \n
\n

Utilities

EmbarkJS also includes a onReady function. This is very useful to ensure that your Dapp only starts interacting with contracts when the proper connection to web3 has been made and ready to use.

\n
import EmbarkJS from 'Embark/EmbarkJS';
import SimpleStorage from 'Embark/contracts/SimpleStorage';

EmbarkJS.onReady((error) => {
if (error) {
console.error('Error while connecting to web3', error);
return;
}
SimpleStorage.methods.set(100).send();
});
\n\n

Provider

As of EIP1102, decentralized applications MUST request account access. Embark offers several options on how to implement this.

\n

An Embark application’s Smart Contract configuration file (typically located in config/contracts.js) comes with a dappAutoEnable property which controls whether or not EmbarkJS should automatically try to request account access:

\n
...
// Automatically call `ethereum.enable` if true.
// If false, the following code must run before sending any transaction: `await EmbarkJS.enableEthereum();`
// Default value is true.
// dappAutoEnable: true,
...
\n\n\n

By default, the value of dappAutoEnable is true which means that Embark will call ethereum.enable for you to request account access when the first page of the dapp is loaded.

\n

If you want more control, you can set dappAutoEnable to false.
Then, if you want to request account access, you can use the following code:

\n
...
try {
const accounts = await EmbarkJS.enableEthereum();
// access granted
} catch() {
// access not granted
}
...
\n\n

This will request account access and if the user grants access to his accounts, you will be able to make transaction calls.

\n

Components

    \n
  • EmbarkJS.Contract - To interact with smart contracts. Typically Embark automatically initializes all your deployed contracts with this. uses web3.js 1.2.1
  • \n
  • EmbarkJS.Storage - To interact with the configured decentralized storage. Includes bindings to save & retrieve data, upload & download files, etc..
  • \n
  • EmbarkJS.Communication - To interact with the configured decentralized messages system. Includes bindings to listen to topics and send messages.
  • \n
  • EmbarkJS.Names - To interact with the configured decentralized naming system such as ENS. Includes bindings to look up the address of a domain name as well as retrieve a domain name given an address.
  • \n
\n"},{"title":"Installing Plugins","layout":"docs","_content":"Embark offers a variety of [plugins](/plugins) you can choose from and you can even [build your own](/docs/creating_plugins.html) to make Embark work with your tool of choice. Let's take a look at how to install and configure plugins for Embark.\n\n## Finding the right plugin\n\nBefore we can install a plugin we need to know which one we want to install first. Finding the right plugin shouldn't be too hard. Supported Embark plugins are listed on the [Plugins](/plugins) page. Sometimes it's also helpful to search for repositories on GitHub that have an `embark-` prefix.\n\n## Downloading plugins\n\nOnce we know what plugin we're interested in, it's really just a matter of adding them to our existing project. This can be done either by downloading and installing them via a package manager such as npm, or even through simple cloning using Git.\n\nThe following command installs a plugin for the `solc` compiler:\n\n```\n$ npm install embark-solc --save\n```\n\nThis will also update our projects `package.json` as we're adding the plugin as a project dependency.\n\n## Configuring plugins\n\nAfter installation, we can configure the plugin. What configuration options exist depends entirely on the plugin but the way how configuration works is always the same.\n\nTo configure a plugin, add a dedicated section to your project's `embark.json` file:\n\n```\n...\n\"plugins\": {\n \"embark-solc\": {}\n}\n...\n```\n\nOnce that is done, check out the available configuration options for your plugin of choice. The `embark-solc` plugin allows for configuring whether the plugin should generate binary output or not using the `outputBinary` option. \n\nThe following code sets activates this feature:\n\n```\n...\n\"plugins\": {\n \"embark-solc\": {\n \"outputBinary\": true\n }\n}\n...\n```\n\n","source":"docs/installing_plugins.md","raw":"title: Installing Plugins\nlayout: docs\n---\nEmbark offers a variety of [plugins](/plugins) you can choose from and you can even [build your own](/docs/creating_plugins.html) to make Embark work with your tool of choice. Let's take a look at how to install and configure plugins for Embark.\n\n## Finding the right plugin\n\nBefore we can install a plugin we need to know which one we want to install first. Finding the right plugin shouldn't be too hard. Supported Embark plugins are listed on the [Plugins](/plugins) page. Sometimes it's also helpful to search for repositories on GitHub that have an `embark-` prefix.\n\n## Downloading plugins\n\nOnce we know what plugin we're interested in, it's really just a matter of adding them to our existing project. This can be done either by downloading and installing them via a package manager such as npm, or even through simple cloning using Git.\n\nThe following command installs a plugin for the `solc` compiler:\n\n```\n$ npm install embark-solc --save\n```\n\nThis will also update our projects `package.json` as we're adding the plugin as a project dependency.\n\n## Configuring plugins\n\nAfter installation, we can configure the plugin. What configuration options exist depends entirely on the plugin but the way how configuration works is always the same.\n\nTo configure a plugin, add a dedicated section to your project's `embark.json` file:\n\n```\n...\n\"plugins\": {\n \"embark-solc\": {}\n}\n...\n```\n\nOnce that is done, check out the available configuration options for your plugin of choice. The `embark-solc` plugin allows for configuring whether the plugin should generate binary output or not using the `outputBinary` option. \n\nThe following code sets activates this feature:\n\n```\n...\n\"plugins\": {\n \"embark-solc\": {\n \"outputBinary\": true\n }\n}\n...\n```\n\n","date":"2020-01-17T19:00:03.900Z","updated":"2020-01-17T19:00:03.900Z","path":"docs/installing_plugins.html","comments":1,"_id":"ck5ijm3rm00197hegb39td76m","content":"

Embark offers a variety of plugins you can choose from and you can even build your own to make Embark work with your tool of choice. Let’s take a look at how to install and configure plugins for Embark.

\n

Finding the right plugin

Before we can install a plugin we need to know which one we want to install first. Finding the right plugin shouldn’t be too hard. Supported Embark plugins are listed on the Plugins page. Sometimes it’s also helpful to search for repositories on GitHub that have an embark- prefix.

\n

Downloading plugins

Once we know what plugin we’re interested in, it’s really just a matter of adding them to our existing project. This can be done either by downloading and installing them via a package manager such as npm, or even through simple cloning using Git.

\n

The following command installs a plugin for the solc compiler:

\n
$ npm install embark-solc --save
\n\n

This will also update our projects package.json as we’re adding the plugin as a project dependency.

\n

Configuring plugins

After installation, we can configure the plugin. What configuration options exist depends entirely on the plugin but the way how configuration works is always the same.

\n

To configure a plugin, add a dedicated section to your project’s embark.json file:

\n
...
"plugins": {
"embark-solc": {}
}
...
\n\n

Once that is done, check out the available configuration options for your plugin of choice. The embark-solc plugin allows for configuring whether the plugin should generate binary output or not using the outputBinary option.

\n

The following code sets activates this feature:

\n
...
"plugins": {
"embark-solc": {
"outputBinary": true
}
}
...
\n\n","site":{"data":{"authors":{"iuri_matias":{"name":"Iuri Matias","twitter":"iurimatias","image":"https://pbs.twimg.com/profile_images/928272512181563392/iDJdvy2k_400x400.jpg"},"pascal_precht":{"name":"Pascal Precht","twitter":"pascalprecht","image":"https://pbs.twimg.com/profile_images/993785060733194241/p3oAIMDP_400x400.jpg"},"anthony_laibe":{"name":"Anthony Laibe","twitter":"a_laibe","image":"https://pbs.twimg.com/profile_images/257742900/13168239_400x400.jpg"},"jonathan_rainville":{"name":"Jonathan Rainville","twitter":"ShyolGhul","image":"https://pbs.twimg.com/profile_images/993873866878570496/-aE4byjj_400x400.jpg"},"andre_medeiros":{"name":"Andre Medeiros","twitter":"superdealloc","image":"https://pbs.twimg.com/profile_images/965722487735701504/m58KNgWN_400x400.jpg"},"eric_mastro":{"name":"Eric Mastro","twitter":"ericmastro","image":"https://avatars1.githubusercontent.com/u/5089238?s=460&v=4"},"michael_bradley":{"name":"Michael Bradley","image":"https://avatars3.githubusercontent.com/u/194260?s=460&v=4"},"richard_ramos":{"name":"Richard Ramos","twitter":"richardramos_me","image":"https://pbs.twimg.com/profile_images/1063160577973866496/aM313uHG_400x400.jpg"},"jonny_zerah":{"name":"Jonny Zerah","twitter":"jonnyzerah","image":"https://pbs.twimg.com/profile_images/1043774340490248192/gI9aGy17_400x400.jpg"},"robin_percy":{"name":"Robin Percy","twitter":"rbin","image":"https://avatars1.githubusercontent.com/u/29288325?s=400&v=4"}},"categories":{"tutorials":"Tutorials","announcements":"Announcements"},"languages":{"en":"English"},"plugins":[{"name":"embark-bamboo","description":"plugins_page.plugins.bamboo.desc","link":"https://www.npmjs.com/package/embark-bamboo","thumbnail":"bamboo.png","tags":["language","smart-contracts"]},{"name":"embark-solc","description":"plugins_page.plugins.solc.desc","link":"https://www.npmjs.com/package/embark-solc","thumbnail":"solidity.png","tags":["solidity","language","smart-contracts"]},{"name":"embark-solium","description":"plugins_page.plugins.solium.desc","link":"https://www.npmjs.com/package/embark-solium","thumbnail":"solium.png","tags":["linter","solidity","solium"]},{"name":"embark-etherscan-verifier","description":"plugins_page.plugins.verifier.desc","link":"https://www.npmjs.com/package/embark-etherscan-verifier","tags":["solidity","etherscan","smart-contracts"]},{"name":"embark-status","description":"plugins_page.plugins.status.desc","link":"https://www.npmjs.com/package/embark-status-plugin","thumbnail":"status.png","tags":["status","mobile"]},{"name":"embark-remix","description":"plugins_page.plugins.remix.desc","link":"https://www.npmjs.com/package/embark-remix","thumbnail":"remix.png","tags":["remix","debugger"]},{"name":"embark-slither","description":"plugins_page.plugins.slither.desc","link":"https://www.npmjs.com/package/embark-slither","tags":["solidity"]},{"name":"embark-snark","description":"plugins_page.plugins.snark.desc","link":"https://www.npmjs.com/package/embark-snark","tags":["snark"]},{"name":"embark-fortune","description":"plugins_page.plugins.fortune.desc","link":"https://www.npmjs.com/package/embark-fortune","thumbnail":"fortune.jpg","tags":["fun"]},{"name":"embark-pug","description":"plugins_page.plugins.pug.desc","link":"https://www.npmjs.com/package/embark-pug","legacy":true,"thumbnail":"pug.png","tags":["pug","jade","templates"]},{"name":"embark-haml","description":"plugins_page.plugins.haml.desc","link":"https://www.npmjs.com/package/embark-haml","legacy":true,"thumbnail":"haml.png","tags":["haml","templates"]},{"name":"embark-mythx","description":"plugins_page.plugins.mythx.desc","link":"https://www.npmjs.com/package/embark-mythx","thumbnail":"mythx.png","tags":["mythx","smart-contracts"]}],"menu":{"docs":"/docs/","plugins":"/plugins/","chat":"/chat/","blog":"/news/"},"sidebar":{"docs":{"getting_started":{"overview":"overview.html","installation":"installation.html","faq":"faq.html"},"general_usage":{"creating_project":"create_project.html","structure":"structure.html","running_apps":"running_apps.html","dashboard":"dashboard.html","using_the_console":"using_the_console.html","environments":"environments.html","configuration":"configuration.html","pipeline_and_webpack":"pipeline_and_webpack.html","javascript_usage":"javascript_usage.html"},"smart_contracts":{"contracts_configuration":"contracts_configuration.html","contracts_deployment":"contracts_deployment.html","contracts_imports":"contracts_imports.html","contracts_testing":"contracts_testing.html","contracts_javascript":"contracts_javascript.html"},"blockchain_node":{"blockchain_configuration":"blockchain_configuration.html","blockchain_accounts_configuration":"blockchain_accounts_configuration.html"},"storage":{"storage_configuration":"storage_configuration.html","storage_deployment":"storage_deployment.html","storage_javascript":"storage_javascript.html"},"messages":{"messages_configuration":"messages_configuration.html","messages_javascript":"messages_javascript.html"},"naming":{"naming_configuration":"naming_configuration.html","naming_javascript":"naming_javascript.html"},"plugins":{"installing_a_plugin":"installing_plugins.html","creating_a_plugin":"creating_plugins.html","plugin_reference":"plugin_reference.html"},"cockpit":{"cockpit_introduction":"cockpit_introduction.html","cockpit_dashboard":"cockpit_dashboard.html","cockpit_deployment":"cockpit_deployment.html","cockpit_explorer":"cockpit_explorer.html","cockpit_editor":"cockpit_editor.html","cockpit_debugger":"cockpit_debugger.html"},"reference":{"embark_commands":"embark_commands.html"},"miscellaneous":{"migrating_from_3":"migrating_from_3.x.html","troubleshooting":"troubleshooting.html","contributing":"contributing.html"}}},"templates":[{"name":"Vyper Template","description":"Template to demonstrate the use of the Vyper contracts","install":"embark new AppName --template vyper","thumbnail":"vyper.png","link":"https://github.com/embarklabs/embark-vyper-template","tags":["vyper","contracts"]},{"name":"Embark Demo React Template","description":"A React Application showcasing Embark's functionality","install":"embark demo","thumbnail":"react.png","link":"https://embark.embarklabs.io/docs/create_project.html#Creating-a-Demo-Project","tags":["react","contracts","whisper","ipfs"]},{"name":"Typescript Template","description":"Template with Typescript support pre-configured","thumbnail":"typescript.png","install":"embark new AppName --template typescript","link":"https://github.com/embarklabs/embark-typescript-template","tags":["typescript","frontend"]},{"name":"Vue.js Template","description":"Ready to use Template for using Embark with vue.js","thumbnail":"vuejs.png","install":"embark new AppName --template vue","link":"https://github.com/embarklabs/embark-vue-template","tags":["vue.js","frontend"]},{"name":"ethvtx Template","description":"Demo app for ethvtx, an Ethereum-Ready & Framework-Agnostic Redux configuration","thumbnail":"vortex.png","install":"embark new AppName --template Horyus/ethvtx_embark","link":"https://github.com/Horyus/ethvtx_embark","tags":["react"]},{"name":"Bamboo Template","description":"Template to demonstrate use of the Bamboo contracts","install":"embark new AppName --template bamboo","thumbnail":"bamboo.png","link":"https://github.com/embarklabs/embark-bamboo-template","tags":["bamboo","contracts"]},{"name":"Solidity Gas Golfing","description":"Boilerplate and tests for the first Solidity Gas Golfing Contest","thumbnail":"sggc.png","install":"embark new AppName --template embarklabs/sggc","link":"https://github.com/embarklabs/sggc","tags":["solidity","tests","fun"]}],"tutorials":[{"name":"How to create a Token Factory with Ethereum — Part 1","description":"Create and Deploy a Token with Ethereum","link":"/tutorials/token_factory_1.html","tags":["token","ethereum"]},{"name":"How to create a Token Factory with Ethereum — Part 2","description":"Create a DApp that can deploy Tokens on the fly","link":"/tutorials/token_factory_2.html","tags":["token","ethereum","client-side-deployment"]},{"name":"How to deploy to a testnet with Infura","description":"Deploy and interact with your Dapp on a testnet with the use of Infura","link":"/tutorials/infura_guide.html","tags":["ethereum","deployment","testnet"]}],"versions":{"latest":{"label":"stable (v4)","url":"https://embark.embarklabs.io/docs"},"3.2":{"label":"v3.2","url":"https://5ca4e0fdb29712000adde37f--embark-site-versions.netlify.com/docs/"}}}},"excerpt":"","more":"

Embark offers a variety of plugins you can choose from and you can even build your own to make Embark work with your tool of choice. Let’s take a look at how to install and configure plugins for Embark.

\n

Finding the right plugin

Before we can install a plugin we need to know which one we want to install first. Finding the right plugin shouldn’t be too hard. Supported Embark plugins are listed on the Plugins page. Sometimes it’s also helpful to search for repositories on GitHub that have an embark- prefix.

\n

Downloading plugins

Once we know what plugin we’re interested in, it’s really just a matter of adding them to our existing project. This can be done either by downloading and installing them via a package manager such as npm, or even through simple cloning using Git.

\n

The following command installs a plugin for the solc compiler:

\n
$ npm install embark-solc --save
\n\n

This will also update our projects package.json as we’re adding the plugin as a project dependency.

\n

Configuring plugins

After installation, we can configure the plugin. What configuration options exist depends entirely on the plugin but the way how configuration works is always the same.

\n

To configure a plugin, add a dedicated section to your project’s embark.json file:

\n
...
"plugins": {
"embark-solc": {}
}
...
\n\n

Once that is done, check out the available configuration options for your plugin of choice. The embark-solc plugin allows for configuring whether the plugin should generate binary output or not using the outputBinary option.

\n

The following code sets activates this feature:

\n
...
"plugins": {
"embark-solc": {
"outputBinary": true
}
}
...
\n\n"},{"title":"Using EmbarkJS","layout":"docs","_content":"\nIn order to make decentralized app development as easy as possible, Embark offers a useful companion JavaScript library called **EmbarkJS**. It comes with many APIs that make your applications connect to decentralized services such as your Smart Contracts or IPFS. This guide gives a brief overview on how to set up EmbarkJS and make it connect to a blockchain node.\n\n## Embark Artifacts\n\nFirst of all it's important to understand where EmbarkJS comes from. Whenever `embark run` is executed, Embark will generate the EmbarkJS library and put it in the configured `generationDir`, as discussed in [configuring Embark](/docs/configuration.html). This EmbarkJS library is called an artifact and is just one of many other artifacts that Embark generates for later usage.\n\nOther artifacts that Embark generates are:\n\n- Smart Contract ABIs\n- Bootstrapping code\n- Configuration data\n\nWe'll discuss these more in this guide.\n\n## Importing EmbarkJS\n\nOnce Embark has generated all necessary artifacts, we can start using them when building an application. Artifacts are really just written to disc, so if we want to get hold of any of them, it's really just a matter of importing them accordingly.\n\nThe following code imports EmbarkJS:\n\n```\nimport EmbarkJS from './embarkArtifacts/embarkjs';\n```\n\n## Waiting for EmbarkJS to be ready\n\nEmbarkJS also includes a `onReady` function. This is very useful to ensure that your Dapp only starts interacting with contracts when the proper connection to web3 has been made and ready to use.\n\n```\nimport EmbarkJS from 'Embark/EmbarkJS';\nimport SimpleStorage from 'Embark/contracts/SimpleStorage';\n\nEmbarkJS.onReady((error) => {\n if (error) {\n console.error('Error while connecting to web3', error);\n return;\n }\n SimpleStorage.methods.set(100).send();\n});\n```\n\n## Using `dappConnection`\n\nAfter reading the section above on `EmbarkJS.onReady`, you might be wondering where EmbarkJS establishes a connection.\n\nThe answer is: you decide! You can configure it using `dappConnection`, a config property you can find in the Smart Contract config (by default at `config/contracts.js`).\n\nYou will notice that property name reused in some other config files too, like the Storage one, because you can configure where those connect as well.\n\nThe expressions used within `dappConnection` come with special semantics. Here's how they work: it is an array of strings where EmbarkJS will try each of those in order (from 0 to N) and as soon as one of the connections work, it will stop.\n\nIn the case of the Smart Contract config `dappConnection`, the one that is used to connect to the blockchain node and that is indirectly used in `EmbarkJS.onReady`, you will see two special entities: `$WEB3` and `$EMBARK`.\n\n- `$WEB3` tells EmbarkJS to connect to the browser's web3 instance. For example, Metamask or Status.\n- `$EMBARK` tells EmbarkJS to connect to Embark's wallet, implemented using a proxy in between the Dapp and the blockchain node.\n - This let's you use you own accounts, as set up in your Blockchain config's `accounts` section\n - If you don't use custom accounts, using `$EMBARK` is still useful, because it connects to the node more easily for you and uses the unlocked accounts on the node, like when using the `dev` `miningMode`\n - Also, Embark gets to see the transactions processed and logs them back to you in a human readable manner\n \nIf you want, you can also put a valid node URL in the `dappConnection` array. In that case, EmbarkJS will connect directly to the node, without using Embark's proxy.\nIt is, however, not recommended as you lose some of Embark's features, like the transaction logger.\n\nIf you want to use an external node, like Infura, we instead recommend to set it in the Blockchain config (`config/blockchain.js`) using the property `endpoint`.\nThen, using `$EMBARK` will use Embark's proxy, which in part will be connected to that endpoint.\n\n## Requesting account access\n\nAs of [EIP1102](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-1102.md), decentralized applications MUST request access to a DApp's user accounts. Embark offers several options on how to implement this.\n\nAn Embark application's Smart Contract configuration file (typically located in `config/contracts.js`) comes with a `dappAutoEnable` property which controls whether or not EmbarkJS should automatically try to request account access:\n```\nmodule.exports = {\n ...\n // Automatically call `ethereum.enable` if true.\n // If false, the following code must run before sending any transaction: `await EmbarkJS.enableEthereum();`\n dappAutoEnable: true,\n ...\n}\n```\n\nBy default, the value of `dappAutoEnable` is `true` which means that Embark will call `ethereum.enable` for us to request account access when the first page of the DApp is loaded.\n\nIf we want more control over when our application should request account access, we can set `dappAutoEnable` to false and make use of `EmbarkJS.enableEthereum()`.\n\nThis method will essentially cause our application to request account access, giving us full control over when this should happen.\n\n```\ntry {\n const accounts = await EmbarkJS.enableEthereum();\n // access granted\n} catch() {\n // access not granted\n}\n```\n\n## Additional APIs\n\nThis guide only touched on getting started with EmbarkJS. There are many more APIs to explore, depending on what we're achieving to build. Have a look at the dedicated guides to learn more:\n\n* [EmbarkJS.Contract](contracts_javascript.html) - To interact with smart contracts. Typically Embark automatically initializes all your deployed contracts with this. uses web3.js 1.2.1\n* [EmbarkJS.Storage](storage_javascript.html) - To interact with the configured decentralized storage. Includes bindings to save & retrieve data, upload & download files, etc..\n* [EmbarkJS.Communication](messages_javascript.html) - To interact with the configured decentralized messages system. Includes bindings to listen to topics and send messages.\n* [EmbarkJS.Names](naming_javascript.html) - To interact with the configured decentralized naming system such as ENS. Includes bindings to look up the address of a domain name as well as retrieve a domain name given an address.\n","source":"docs/javascript_usage.md","raw":"title: Using EmbarkJS\nlayout: docs\n---\n\nIn order to make decentralized app development as easy as possible, Embark offers a useful companion JavaScript library called **EmbarkJS**. It comes with many APIs that make your applications connect to decentralized services such as your Smart Contracts or IPFS. This guide gives a brief overview on how to set up EmbarkJS and make it connect to a blockchain node.\n\n## Embark Artifacts\n\nFirst of all it's important to understand where EmbarkJS comes from. Whenever `embark run` is executed, Embark will generate the EmbarkJS library and put it in the configured `generationDir`, as discussed in [configuring Embark](/docs/configuration.html). This EmbarkJS library is called an artifact and is just one of many other artifacts that Embark generates for later usage.\n\nOther artifacts that Embark generates are:\n\n- Smart Contract ABIs\n- Bootstrapping code\n- Configuration data\n\nWe'll discuss these more in this guide.\n\n## Importing EmbarkJS\n\nOnce Embark has generated all necessary artifacts, we can start using them when building an application. Artifacts are really just written to disc, so if we want to get hold of any of them, it's really just a matter of importing them accordingly.\n\nThe following code imports EmbarkJS:\n\n```\nimport EmbarkJS from './embarkArtifacts/embarkjs';\n```\n\n## Waiting for EmbarkJS to be ready\n\nEmbarkJS also includes a `onReady` function. This is very useful to ensure that your Dapp only starts interacting with contracts when the proper connection to web3 has been made and ready to use.\n\n```\nimport EmbarkJS from 'Embark/EmbarkJS';\nimport SimpleStorage from 'Embark/contracts/SimpleStorage';\n\nEmbarkJS.onReady((error) => {\n if (error) {\n console.error('Error while connecting to web3', error);\n return;\n }\n SimpleStorage.methods.set(100).send();\n});\n```\n\n## Using `dappConnection`\n\nAfter reading the section above on `EmbarkJS.onReady`, you might be wondering where EmbarkJS establishes a connection.\n\nThe answer is: you decide! You can configure it using `dappConnection`, a config property you can find in the Smart Contract config (by default at `config/contracts.js`).\n\nYou will notice that property name reused in some other config files too, like the Storage one, because you can configure where those connect as well.\n\nThe expressions used within `dappConnection` come with special semantics. Here's how they work: it is an array of strings where EmbarkJS will try each of those in order (from 0 to N) and as soon as one of the connections work, it will stop.\n\nIn the case of the Smart Contract config `dappConnection`, the one that is used to connect to the blockchain node and that is indirectly used in `EmbarkJS.onReady`, you will see two special entities: `$WEB3` and `$EMBARK`.\n\n- `$WEB3` tells EmbarkJS to connect to the browser's web3 instance. For example, Metamask or Status.\n- `$EMBARK` tells EmbarkJS to connect to Embark's wallet, implemented using a proxy in between the Dapp and the blockchain node.\n - This let's you use you own accounts, as set up in your Blockchain config's `accounts` section\n - If you don't use custom accounts, using `$EMBARK` is still useful, because it connects to the node more easily for you and uses the unlocked accounts on the node, like when using the `dev` `miningMode`\n - Also, Embark gets to see the transactions processed and logs them back to you in a human readable manner\n \nIf you want, you can also put a valid node URL in the `dappConnection` array. In that case, EmbarkJS will connect directly to the node, without using Embark's proxy.\nIt is, however, not recommended as you lose some of Embark's features, like the transaction logger.\n\nIf you want to use an external node, like Infura, we instead recommend to set it in the Blockchain config (`config/blockchain.js`) using the property `endpoint`.\nThen, using `$EMBARK` will use Embark's proxy, which in part will be connected to that endpoint.\n\n## Requesting account access\n\nAs of [EIP1102](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-1102.md), decentralized applications MUST request access to a DApp's user accounts. Embark offers several options on how to implement this.\n\nAn Embark application's Smart Contract configuration file (typically located in `config/contracts.js`) comes with a `dappAutoEnable` property which controls whether or not EmbarkJS should automatically try to request account access:\n```\nmodule.exports = {\n ...\n // Automatically call `ethereum.enable` if true.\n // If false, the following code must run before sending any transaction: `await EmbarkJS.enableEthereum();`\n dappAutoEnable: true,\n ...\n}\n```\n\nBy default, the value of `dappAutoEnable` is `true` which means that Embark will call `ethereum.enable` for us to request account access when the first page of the DApp is loaded.\n\nIf we want more control over when our application should request account access, we can set `dappAutoEnable` to false and make use of `EmbarkJS.enableEthereum()`.\n\nThis method will essentially cause our application to request account access, giving us full control over when this should happen.\n\n```\ntry {\n const accounts = await EmbarkJS.enableEthereum();\n // access granted\n} catch() {\n // access not granted\n}\n```\n\n## Additional APIs\n\nThis guide only touched on getting started with EmbarkJS. There are many more APIs to explore, depending on what we're achieving to build. Have a look at the dedicated guides to learn more:\n\n* [EmbarkJS.Contract](contracts_javascript.html) - To interact with smart contracts. Typically Embark automatically initializes all your deployed contracts with this. uses web3.js 1.2.1\n* [EmbarkJS.Storage](storage_javascript.html) - To interact with the configured decentralized storage. Includes bindings to save & retrieve data, upload & download files, etc..\n* [EmbarkJS.Communication](messages_javascript.html) - To interact with the configured decentralized messages system. Includes bindings to listen to topics and send messages.\n* [EmbarkJS.Names](naming_javascript.html) - To interact with the configured decentralized naming system such as ENS. Includes bindings to look up the address of a domain name as well as retrieve a domain name given an address.\n","date":"2020-01-17T19:00:03.900Z","updated":"2020-01-17T19:00:03.900Z","path":"docs/javascript_usage.html","comments":1,"_id":"ck5ijm3rn001a7hegd50edf60","content":"

In order to make decentralized app development as easy as possible, Embark offers a useful companion JavaScript library called EmbarkJS. It comes with many APIs that make your applications connect to decentralized services such as your Smart Contracts or IPFS. This guide gives a brief overview on how to set up EmbarkJS and make it connect to a blockchain node.

\n

Embark Artifacts

First of all it’s important to understand where EmbarkJS comes from. Whenever embark run is executed, Embark will generate the EmbarkJS library and put it in the configured generationDir, as discussed in configuring Embark. This EmbarkJS library is called an artifact and is just one of many other artifacts that Embark generates for later usage.

\n

Other artifacts that Embark generates are:

\n
    \n
  • Smart Contract ABIs
  • \n
  • Bootstrapping code
  • \n
  • Configuration data
  • \n
\n

We’ll discuss these more in this guide.

\n

Importing EmbarkJS

Once Embark has generated all necessary artifacts, we can start using them when building an application. Artifacts are really just written to disc, so if we want to get hold of any of them, it’s really just a matter of importing them accordingly.

\n

The following code imports EmbarkJS:

\n
import EmbarkJS from './embarkArtifacts/embarkjs';
\n\n

Waiting for EmbarkJS to be ready

EmbarkJS also includes a onReady function. This is very useful to ensure that your Dapp only starts interacting with contracts when the proper connection to web3 has been made and ready to use.

\n
import EmbarkJS from 'Embark/EmbarkJS';
import SimpleStorage from 'Embark/contracts/SimpleStorage';

EmbarkJS.onReady((error) => {
if (error) {
console.error('Error while connecting to web3', error);
return;
}
SimpleStorage.methods.set(100).send();
});
\n\n

Using dappConnection

After reading the section above on EmbarkJS.onReady, you might be wondering where EmbarkJS establishes a connection.

\n

The answer is: you decide! You can configure it using dappConnection, a config property you can find in the Smart Contract config (by default at config/contracts.js).

\n

You will notice that property name reused in some other config files too, like the Storage one, because you can configure where those connect as well.

\n

The expressions used within dappConnection come with special semantics. Here’s how they work: it is an array of strings where EmbarkJS will try each of those in order (from 0 to N) and as soon as one of the connections work, it will stop.

\n

In the case of the Smart Contract config dappConnection, the one that is used to connect to the blockchain node and that is indirectly used in EmbarkJS.onReady, you will see two special entities: $WEB3 and $EMBARK.

\n
    \n
  • $WEB3 tells EmbarkJS to connect to the browser’s web3 instance. For example, Metamask or Status.
  • \n
  • $EMBARK tells EmbarkJS to connect to Embark’s wallet, implemented using a proxy in between the Dapp and the blockchain node.
      \n
    • This let’s you use you own accounts, as set up in your Blockchain config’s accounts section
        \n
      • If you don’t use custom accounts, using $EMBARK is still useful, because it connects to the node more easily for you and uses the unlocked accounts on the node, like when using the dev miningMode
      • \n
      \n
    • \n
    • Also, Embark gets to see the transactions processed and logs them back to you in a human readable manner
    • \n
    \n
  • \n
\n

If you want, you can also put a valid node URL in the dappConnection array. In that case, EmbarkJS will connect directly to the node, without using Embark’s proxy.
It is, however, not recommended as you lose some of Embark’s features, like the transaction logger.

\n

If you want to use an external node, like Infura, we instead recommend to set it in the Blockchain config (config/blockchain.js) using the property endpoint.
Then, using $EMBARK will use Embark’s proxy, which in part will be connected to that endpoint.

\n

Requesting account access

As of EIP1102, decentralized applications MUST request access to a DApp’s user accounts. Embark offers several options on how to implement this.

\n

An Embark application’s Smart Contract configuration file (typically located in config/contracts.js) comes with a dappAutoEnable property which controls whether or not EmbarkJS should automatically try to request account access:

\n
module.exports = {
...
// Automatically call `ethereum.enable` if true.
// If false, the following code must run before sending any transaction: `await EmbarkJS.enableEthereum();`
dappAutoEnable: true,
...
}
\n\n

By default, the value of dappAutoEnable is true which means that Embark will call ethereum.enable for us to request account access when the first page of the DApp is loaded.

\n

If we want more control over when our application should request account access, we can set dappAutoEnable to false and make use of EmbarkJS.enableEthereum().

\n

This method will essentially cause our application to request account access, giving us full control over when this should happen.

\n
try {
const accounts = await EmbarkJS.enableEthereum();
// access granted
} catch() {
// access not granted
}
\n\n

Additional APIs

This guide only touched on getting started with EmbarkJS. There are many more APIs to explore, depending on what we’re achieving to build. Have a look at the dedicated guides to learn more:

\n
    \n
  • EmbarkJS.Contract - To interact with smart contracts. Typically Embark automatically initializes all your deployed contracts with this. uses web3.js 1.2.1
  • \n
  • EmbarkJS.Storage - To interact with the configured decentralized storage. Includes bindings to save & retrieve data, upload & download files, etc..
  • \n
  • EmbarkJS.Communication - To interact with the configured decentralized messages system. Includes bindings to listen to topics and send messages.
  • \n
  • EmbarkJS.Names - To interact with the configured decentralized naming system such as ENS. Includes bindings to look up the address of a domain name as well as retrieve a domain name given an address.
  • \n
\n","site":{"data":{"authors":{"iuri_matias":{"name":"Iuri Matias","twitter":"iurimatias","image":"https://pbs.twimg.com/profile_images/928272512181563392/iDJdvy2k_400x400.jpg"},"pascal_precht":{"name":"Pascal Precht","twitter":"pascalprecht","image":"https://pbs.twimg.com/profile_images/993785060733194241/p3oAIMDP_400x400.jpg"},"anthony_laibe":{"name":"Anthony Laibe","twitter":"a_laibe","image":"https://pbs.twimg.com/profile_images/257742900/13168239_400x400.jpg"},"jonathan_rainville":{"name":"Jonathan Rainville","twitter":"ShyolGhul","image":"https://pbs.twimg.com/profile_images/993873866878570496/-aE4byjj_400x400.jpg"},"andre_medeiros":{"name":"Andre Medeiros","twitter":"superdealloc","image":"https://pbs.twimg.com/profile_images/965722487735701504/m58KNgWN_400x400.jpg"},"eric_mastro":{"name":"Eric Mastro","twitter":"ericmastro","image":"https://avatars1.githubusercontent.com/u/5089238?s=460&v=4"},"michael_bradley":{"name":"Michael Bradley","image":"https://avatars3.githubusercontent.com/u/194260?s=460&v=4"},"richard_ramos":{"name":"Richard Ramos","twitter":"richardramos_me","image":"https://pbs.twimg.com/profile_images/1063160577973866496/aM313uHG_400x400.jpg"},"jonny_zerah":{"name":"Jonny Zerah","twitter":"jonnyzerah","image":"https://pbs.twimg.com/profile_images/1043774340490248192/gI9aGy17_400x400.jpg"},"robin_percy":{"name":"Robin Percy","twitter":"rbin","image":"https://avatars1.githubusercontent.com/u/29288325?s=400&v=4"}},"categories":{"tutorials":"Tutorials","announcements":"Announcements"},"languages":{"en":"English"},"plugins":[{"name":"embark-bamboo","description":"plugins_page.plugins.bamboo.desc","link":"https://www.npmjs.com/package/embark-bamboo","thumbnail":"bamboo.png","tags":["language","smart-contracts"]},{"name":"embark-solc","description":"plugins_page.plugins.solc.desc","link":"https://www.npmjs.com/package/embark-solc","thumbnail":"solidity.png","tags":["solidity","language","smart-contracts"]},{"name":"embark-solium","description":"plugins_page.plugins.solium.desc","link":"https://www.npmjs.com/package/embark-solium","thumbnail":"solium.png","tags":["linter","solidity","solium"]},{"name":"embark-etherscan-verifier","description":"plugins_page.plugins.verifier.desc","link":"https://www.npmjs.com/package/embark-etherscan-verifier","tags":["solidity","etherscan","smart-contracts"]},{"name":"embark-status","description":"plugins_page.plugins.status.desc","link":"https://www.npmjs.com/package/embark-status-plugin","thumbnail":"status.png","tags":["status","mobile"]},{"name":"embark-remix","description":"plugins_page.plugins.remix.desc","link":"https://www.npmjs.com/package/embark-remix","thumbnail":"remix.png","tags":["remix","debugger"]},{"name":"embark-slither","description":"plugins_page.plugins.slither.desc","link":"https://www.npmjs.com/package/embark-slither","tags":["solidity"]},{"name":"embark-snark","description":"plugins_page.plugins.snark.desc","link":"https://www.npmjs.com/package/embark-snark","tags":["snark"]},{"name":"embark-fortune","description":"plugins_page.plugins.fortune.desc","link":"https://www.npmjs.com/package/embark-fortune","thumbnail":"fortune.jpg","tags":["fun"]},{"name":"embark-pug","description":"plugins_page.plugins.pug.desc","link":"https://www.npmjs.com/package/embark-pug","legacy":true,"thumbnail":"pug.png","tags":["pug","jade","templates"]},{"name":"embark-haml","description":"plugins_page.plugins.haml.desc","link":"https://www.npmjs.com/package/embark-haml","legacy":true,"thumbnail":"haml.png","tags":["haml","templates"]},{"name":"embark-mythx","description":"plugins_page.plugins.mythx.desc","link":"https://www.npmjs.com/package/embark-mythx","thumbnail":"mythx.png","tags":["mythx","smart-contracts"]}],"menu":{"docs":"/docs/","plugins":"/plugins/","chat":"/chat/","blog":"/news/"},"sidebar":{"docs":{"getting_started":{"overview":"overview.html","installation":"installation.html","faq":"faq.html"},"general_usage":{"creating_project":"create_project.html","structure":"structure.html","running_apps":"running_apps.html","dashboard":"dashboard.html","using_the_console":"using_the_console.html","environments":"environments.html","configuration":"configuration.html","pipeline_and_webpack":"pipeline_and_webpack.html","javascript_usage":"javascript_usage.html"},"smart_contracts":{"contracts_configuration":"contracts_configuration.html","contracts_deployment":"contracts_deployment.html","contracts_imports":"contracts_imports.html","contracts_testing":"contracts_testing.html","contracts_javascript":"contracts_javascript.html"},"blockchain_node":{"blockchain_configuration":"blockchain_configuration.html","blockchain_accounts_configuration":"blockchain_accounts_configuration.html"},"storage":{"storage_configuration":"storage_configuration.html","storage_deployment":"storage_deployment.html","storage_javascript":"storage_javascript.html"},"messages":{"messages_configuration":"messages_configuration.html","messages_javascript":"messages_javascript.html"},"naming":{"naming_configuration":"naming_configuration.html","naming_javascript":"naming_javascript.html"},"plugins":{"installing_a_plugin":"installing_plugins.html","creating_a_plugin":"creating_plugins.html","plugin_reference":"plugin_reference.html"},"cockpit":{"cockpit_introduction":"cockpit_introduction.html","cockpit_dashboard":"cockpit_dashboard.html","cockpit_deployment":"cockpit_deployment.html","cockpit_explorer":"cockpit_explorer.html","cockpit_editor":"cockpit_editor.html","cockpit_debugger":"cockpit_debugger.html"},"reference":{"embark_commands":"embark_commands.html"},"miscellaneous":{"migrating_from_3":"migrating_from_3.x.html","troubleshooting":"troubleshooting.html","contributing":"contributing.html"}}},"templates":[{"name":"Vyper Template","description":"Template to demonstrate the use of the Vyper contracts","install":"embark new AppName --template vyper","thumbnail":"vyper.png","link":"https://github.com/embarklabs/embark-vyper-template","tags":["vyper","contracts"]},{"name":"Embark Demo React Template","description":"A React Application showcasing Embark's functionality","install":"embark demo","thumbnail":"react.png","link":"https://embark.embarklabs.io/docs/create_project.html#Creating-a-Demo-Project","tags":["react","contracts","whisper","ipfs"]},{"name":"Typescript Template","description":"Template with Typescript support pre-configured","thumbnail":"typescript.png","install":"embark new AppName --template typescript","link":"https://github.com/embarklabs/embark-typescript-template","tags":["typescript","frontend"]},{"name":"Vue.js Template","description":"Ready to use Template for using Embark with vue.js","thumbnail":"vuejs.png","install":"embark new AppName --template vue","link":"https://github.com/embarklabs/embark-vue-template","tags":["vue.js","frontend"]},{"name":"ethvtx Template","description":"Demo app for ethvtx, an Ethereum-Ready & Framework-Agnostic Redux configuration","thumbnail":"vortex.png","install":"embark new AppName --template Horyus/ethvtx_embark","link":"https://github.com/Horyus/ethvtx_embark","tags":["react"]},{"name":"Bamboo Template","description":"Template to demonstrate use of the Bamboo contracts","install":"embark new AppName --template bamboo","thumbnail":"bamboo.png","link":"https://github.com/embarklabs/embark-bamboo-template","tags":["bamboo","contracts"]},{"name":"Solidity Gas Golfing","description":"Boilerplate and tests for the first Solidity Gas Golfing Contest","thumbnail":"sggc.png","install":"embark new AppName --template embarklabs/sggc","link":"https://github.com/embarklabs/sggc","tags":["solidity","tests","fun"]}],"tutorials":[{"name":"How to create a Token Factory with Ethereum — Part 1","description":"Create and Deploy a Token with Ethereum","link":"/tutorials/token_factory_1.html","tags":["token","ethereum"]},{"name":"How to create a Token Factory with Ethereum — Part 2","description":"Create a DApp that can deploy Tokens on the fly","link":"/tutorials/token_factory_2.html","tags":["token","ethereum","client-side-deployment"]},{"name":"How to deploy to a testnet with Infura","description":"Deploy and interact with your Dapp on a testnet with the use of Infura","link":"/tutorials/infura_guide.html","tags":["ethereum","deployment","testnet"]}],"versions":{"latest":{"label":"stable (v4)","url":"https://embark.embarklabs.io/docs"},"3.2":{"label":"v3.2","url":"https://5ca4e0fdb29712000adde37f--embark-site-versions.netlify.com/docs/"}}}},"excerpt":"","more":"

In order to make decentralized app development as easy as possible, Embark offers a useful companion JavaScript library called EmbarkJS. It comes with many APIs that make your applications connect to decentralized services such as your Smart Contracts or IPFS. This guide gives a brief overview on how to set up EmbarkJS and make it connect to a blockchain node.

\n

Embark Artifacts

First of all it’s important to understand where EmbarkJS comes from. Whenever embark run is executed, Embark will generate the EmbarkJS library and put it in the configured generationDir, as discussed in configuring Embark. This EmbarkJS library is called an artifact and is just one of many other artifacts that Embark generates for later usage.

\n

Other artifacts that Embark generates are:

\n
    \n
  • Smart Contract ABIs
  • \n
  • Bootstrapping code
  • \n
  • Configuration data
  • \n
\n

We’ll discuss these more in this guide.

\n

Importing EmbarkJS

Once Embark has generated all necessary artifacts, we can start using them when building an application. Artifacts are really just written to disc, so if we want to get hold of any of them, it’s really just a matter of importing them accordingly.

\n

The following code imports EmbarkJS:

\n
import EmbarkJS from './embarkArtifacts/embarkjs';
\n\n

Waiting for EmbarkJS to be ready

EmbarkJS also includes a onReady function. This is very useful to ensure that your Dapp only starts interacting with contracts when the proper connection to web3 has been made and ready to use.

\n
import EmbarkJS from 'Embark/EmbarkJS';
import SimpleStorage from 'Embark/contracts/SimpleStorage';

EmbarkJS.onReady((error) => {
if (error) {
console.error('Error while connecting to web3', error);
return;
}
SimpleStorage.methods.set(100).send();
});
\n\n

Using dappConnection

After reading the section above on EmbarkJS.onReady, you might be wondering where EmbarkJS establishes a connection.

\n

The answer is: you decide! You can configure it using dappConnection, a config property you can find in the Smart Contract config (by default at config/contracts.js).

\n

You will notice that property name reused in some other config files too, like the Storage one, because you can configure where those connect as well.

\n

The expressions used within dappConnection come with special semantics. Here’s how they work: it is an array of strings where EmbarkJS will try each of those in order (from 0 to N) and as soon as one of the connections work, it will stop.

\n

In the case of the Smart Contract config dappConnection, the one that is used to connect to the blockchain node and that is indirectly used in EmbarkJS.onReady, you will see two special entities: $WEB3 and $EMBARK.

\n
    \n
  • $WEB3 tells EmbarkJS to connect to the browser’s web3 instance. For example, Metamask or Status.
  • \n
  • $EMBARK tells EmbarkJS to connect to Embark’s wallet, implemented using a proxy in between the Dapp and the blockchain node.
      \n
    • This let’s you use you own accounts, as set up in your Blockchain config’s accounts section
        \n
      • If you don’t use custom accounts, using $EMBARK is still useful, because it connects to the node more easily for you and uses the unlocked accounts on the node, like when using the dev miningMode
      • \n
      \n
    • \n
    • Also, Embark gets to see the transactions processed and logs them back to you in a human readable manner
    • \n
    \n
  • \n
\n

If you want, you can also put a valid node URL in the dappConnection array. In that case, EmbarkJS will connect directly to the node, without using Embark’s proxy.
It is, however, not recommended as you lose some of Embark’s features, like the transaction logger.

\n

If you want to use an external node, like Infura, we instead recommend to set it in the Blockchain config (config/blockchain.js) using the property endpoint.
Then, using $EMBARK will use Embark’s proxy, which in part will be connected to that endpoint.

\n

Requesting account access

As of EIP1102, decentralized applications MUST request access to a DApp’s user accounts. Embark offers several options on how to implement this.

\n

An Embark application’s Smart Contract configuration file (typically located in config/contracts.js) comes with a dappAutoEnable property which controls whether or not EmbarkJS should automatically try to request account access:

\n
module.exports = {
...
// Automatically call `ethereum.enable` if true.
// If false, the following code must run before sending any transaction: `await EmbarkJS.enableEthereum();`
dappAutoEnable: true,
...
}
\n\n

By default, the value of dappAutoEnable is true which means that Embark will call ethereum.enable for us to request account access when the first page of the DApp is loaded.

\n

If we want more control over when our application should request account access, we can set dappAutoEnable to false and make use of EmbarkJS.enableEthereum().

\n

This method will essentially cause our application to request account access, giving us full control over when this should happen.

\n
try {
const accounts = await EmbarkJS.enableEthereum();
// access granted
} catch() {
// access not granted
}
\n\n

Additional APIs

This guide only touched on getting started with EmbarkJS. There are many more APIs to explore, depending on what we’re achieving to build. Have a look at the dedicated guides to learn more:

\n
    \n
  • EmbarkJS.Contract - To interact with smart contracts. Typically Embark automatically initializes all your deployed contracts with this. uses web3.js 1.2.1
  • \n
  • EmbarkJS.Storage - To interact with the configured decentralized storage. Includes bindings to save & retrieve data, upload & download files, etc..
  • \n
  • EmbarkJS.Communication - To interact with the configured decentralized messages system. Includes bindings to listen to topics and send messages.
  • \n
  • EmbarkJS.Names - To interact with the configured decentralized naming system such as ENS. Includes bindings to look up the address of a domain name as well as retrieve a domain name given an address.
  • \n
\n"},{"title":"Configuring Messages with Whisper","layout":"docs","_content":"\nWith Embark it's very easy to connect to messaging channels using Whisper. In this guide we'll discuss how to set everything up to add messaging support to our applications.\n\n## Configuration basics\n\nBy default, Embark will check our preferred communication configuration in the file `config/communication.js`. This file contains the preferred configuration for each environment, with `default` being the configuration that applies to every environment (for more information about environments, check out [this guide](/docs/environments.html). Each of these options can be individually overridden on a per environment basis.\n\nHere's an example configuration:\n\n```\nmodule.exports = {\n default: {\n enabled: true,\n provider: 'whisper',\n available_providers: ['whisper']\n }\n}\n```\n\nAvailable options:\n\n\nOption | Type: `default` | Value \n--- | --- | --- \n`enabled` | boolean: `true/false` | To enable or completely disable communication support\n`provider` | string: `whisper` | Desired provider to automatically connect to in the dapp.\n`available_providers` | array: `[\"whisper\"]` | List of communication platforms to be supported in the dapp. This will affect what's available with the EmbarkJS library in the dapp so if you don't need Whisper for example, removing it from this will considerably reduce the file size of the generated JS code.\n\n","source":"docs/messages_configuration.md","raw":"title: Configuring Messages with Whisper\nlayout: docs\n---\n\nWith Embark it's very easy to connect to messaging channels using Whisper. In this guide we'll discuss how to set everything up to add messaging support to our applications.\n\n## Configuration basics\n\nBy default, Embark will check our preferred communication configuration in the file `config/communication.js`. This file contains the preferred configuration for each environment, with `default` being the configuration that applies to every environment (for more information about environments, check out [this guide](/docs/environments.html). Each of these options can be individually overridden on a per environment basis.\n\nHere's an example configuration:\n\n```\nmodule.exports = {\n default: {\n enabled: true,\n provider: 'whisper',\n available_providers: ['whisper']\n }\n}\n```\n\nAvailable options:\n\n\nOption | Type: `default` | Value \n--- | --- | --- \n`enabled` | boolean: `true/false` | To enable or completely disable communication support\n`provider` | string: `whisper` | Desired provider to automatically connect to in the dapp.\n`available_providers` | array: `[\"whisper\"]` | List of communication platforms to be supported in the dapp. This will affect what's available with the EmbarkJS library in the dapp so if you don't need Whisper for example, removing it from this will considerably reduce the file size of the generated JS code.\n\n","date":"2020-01-17T19:00:03.900Z","updated":"2020-01-17T19:00:03.900Z","path":"docs/messages_configuration.html","comments":1,"_id":"ck5ijm3ro001b7hege89ragpf","content":"

With Embark it’s very easy to connect to messaging channels using Whisper. In this guide we’ll discuss how to set everything up to add messaging support to our applications.

\n

Configuration basics

By default, Embark will check our preferred communication configuration in the file config/communication.js. This file contains the preferred configuration for each environment, with default being the configuration that applies to every environment (for more information about environments, check out this guide. Each of these options can be individually overridden on a per environment basis.

\n

Here’s an example configuration:

\n
module.exports = {
default: {
enabled: true,
provider: 'whisper',
available_providers: ['whisper']
}
}
\n\n

Available options:

\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
OptionType: defaultValue
enabledboolean: true/falseTo enable or completely disable communication support
providerstring: whisperDesired provider to automatically connect to in the dapp.
available_providersarray: ["whisper"]List of communication platforms to be supported in the dapp. This will affect what’s available with the EmbarkJS library in the dapp so if you don’t need Whisper for example, removing it from this will considerably reduce the file size of the generated JS code.
\n","site":{"data":{"authors":{"iuri_matias":{"name":"Iuri Matias","twitter":"iurimatias","image":"https://pbs.twimg.com/profile_images/928272512181563392/iDJdvy2k_400x400.jpg"},"pascal_precht":{"name":"Pascal Precht","twitter":"pascalprecht","image":"https://pbs.twimg.com/profile_images/993785060733194241/p3oAIMDP_400x400.jpg"},"anthony_laibe":{"name":"Anthony Laibe","twitter":"a_laibe","image":"https://pbs.twimg.com/profile_images/257742900/13168239_400x400.jpg"},"jonathan_rainville":{"name":"Jonathan Rainville","twitter":"ShyolGhul","image":"https://pbs.twimg.com/profile_images/993873866878570496/-aE4byjj_400x400.jpg"},"andre_medeiros":{"name":"Andre Medeiros","twitter":"superdealloc","image":"https://pbs.twimg.com/profile_images/965722487735701504/m58KNgWN_400x400.jpg"},"eric_mastro":{"name":"Eric Mastro","twitter":"ericmastro","image":"https://avatars1.githubusercontent.com/u/5089238?s=460&v=4"},"michael_bradley":{"name":"Michael Bradley","image":"https://avatars3.githubusercontent.com/u/194260?s=460&v=4"},"richard_ramos":{"name":"Richard Ramos","twitter":"richardramos_me","image":"https://pbs.twimg.com/profile_images/1063160577973866496/aM313uHG_400x400.jpg"},"jonny_zerah":{"name":"Jonny Zerah","twitter":"jonnyzerah","image":"https://pbs.twimg.com/profile_images/1043774340490248192/gI9aGy17_400x400.jpg"},"robin_percy":{"name":"Robin Percy","twitter":"rbin","image":"https://avatars1.githubusercontent.com/u/29288325?s=400&v=4"}},"categories":{"tutorials":"Tutorials","announcements":"Announcements"},"languages":{"en":"English"},"plugins":[{"name":"embark-bamboo","description":"plugins_page.plugins.bamboo.desc","link":"https://www.npmjs.com/package/embark-bamboo","thumbnail":"bamboo.png","tags":["language","smart-contracts"]},{"name":"embark-solc","description":"plugins_page.plugins.solc.desc","link":"https://www.npmjs.com/package/embark-solc","thumbnail":"solidity.png","tags":["solidity","language","smart-contracts"]},{"name":"embark-solium","description":"plugins_page.plugins.solium.desc","link":"https://www.npmjs.com/package/embark-solium","thumbnail":"solium.png","tags":["linter","solidity","solium"]},{"name":"embark-etherscan-verifier","description":"plugins_page.plugins.verifier.desc","link":"https://www.npmjs.com/package/embark-etherscan-verifier","tags":["solidity","etherscan","smart-contracts"]},{"name":"embark-status","description":"plugins_page.plugins.status.desc","link":"https://www.npmjs.com/package/embark-status-plugin","thumbnail":"status.png","tags":["status","mobile"]},{"name":"embark-remix","description":"plugins_page.plugins.remix.desc","link":"https://www.npmjs.com/package/embark-remix","thumbnail":"remix.png","tags":["remix","debugger"]},{"name":"embark-slither","description":"plugins_page.plugins.slither.desc","link":"https://www.npmjs.com/package/embark-slither","tags":["solidity"]},{"name":"embark-snark","description":"plugins_page.plugins.snark.desc","link":"https://www.npmjs.com/package/embark-snark","tags":["snark"]},{"name":"embark-fortune","description":"plugins_page.plugins.fortune.desc","link":"https://www.npmjs.com/package/embark-fortune","thumbnail":"fortune.jpg","tags":["fun"]},{"name":"embark-pug","description":"plugins_page.plugins.pug.desc","link":"https://www.npmjs.com/package/embark-pug","legacy":true,"thumbnail":"pug.png","tags":["pug","jade","templates"]},{"name":"embark-haml","description":"plugins_page.plugins.haml.desc","link":"https://www.npmjs.com/package/embark-haml","legacy":true,"thumbnail":"haml.png","tags":["haml","templates"]},{"name":"embark-mythx","description":"plugins_page.plugins.mythx.desc","link":"https://www.npmjs.com/package/embark-mythx","thumbnail":"mythx.png","tags":["mythx","smart-contracts"]}],"menu":{"docs":"/docs/","plugins":"/plugins/","chat":"/chat/","blog":"/news/"},"sidebar":{"docs":{"getting_started":{"overview":"overview.html","installation":"installation.html","faq":"faq.html"},"general_usage":{"creating_project":"create_project.html","structure":"structure.html","running_apps":"running_apps.html","dashboard":"dashboard.html","using_the_console":"using_the_console.html","environments":"environments.html","configuration":"configuration.html","pipeline_and_webpack":"pipeline_and_webpack.html","javascript_usage":"javascript_usage.html"},"smart_contracts":{"contracts_configuration":"contracts_configuration.html","contracts_deployment":"contracts_deployment.html","contracts_imports":"contracts_imports.html","contracts_testing":"contracts_testing.html","contracts_javascript":"contracts_javascript.html"},"blockchain_node":{"blockchain_configuration":"blockchain_configuration.html","blockchain_accounts_configuration":"blockchain_accounts_configuration.html"},"storage":{"storage_configuration":"storage_configuration.html","storage_deployment":"storage_deployment.html","storage_javascript":"storage_javascript.html"},"messages":{"messages_configuration":"messages_configuration.html","messages_javascript":"messages_javascript.html"},"naming":{"naming_configuration":"naming_configuration.html","naming_javascript":"naming_javascript.html"},"plugins":{"installing_a_plugin":"installing_plugins.html","creating_a_plugin":"creating_plugins.html","plugin_reference":"plugin_reference.html"},"cockpit":{"cockpit_introduction":"cockpit_introduction.html","cockpit_dashboard":"cockpit_dashboard.html","cockpit_deployment":"cockpit_deployment.html","cockpit_explorer":"cockpit_explorer.html","cockpit_editor":"cockpit_editor.html","cockpit_debugger":"cockpit_debugger.html"},"reference":{"embark_commands":"embark_commands.html"},"miscellaneous":{"migrating_from_3":"migrating_from_3.x.html","troubleshooting":"troubleshooting.html","contributing":"contributing.html"}}},"templates":[{"name":"Vyper Template","description":"Template to demonstrate the use of the Vyper contracts","install":"embark new AppName --template vyper","thumbnail":"vyper.png","link":"https://github.com/embarklabs/embark-vyper-template","tags":["vyper","contracts"]},{"name":"Embark Demo React Template","description":"A React Application showcasing Embark's functionality","install":"embark demo","thumbnail":"react.png","link":"https://embark.embarklabs.io/docs/create_project.html#Creating-a-Demo-Project","tags":["react","contracts","whisper","ipfs"]},{"name":"Typescript Template","description":"Template with Typescript support pre-configured","thumbnail":"typescript.png","install":"embark new AppName --template typescript","link":"https://github.com/embarklabs/embark-typescript-template","tags":["typescript","frontend"]},{"name":"Vue.js Template","description":"Ready to use Template for using Embark with vue.js","thumbnail":"vuejs.png","install":"embark new AppName --template vue","link":"https://github.com/embarklabs/embark-vue-template","tags":["vue.js","frontend"]},{"name":"ethvtx Template","description":"Demo app for ethvtx, an Ethereum-Ready & Framework-Agnostic Redux configuration","thumbnail":"vortex.png","install":"embark new AppName --template Horyus/ethvtx_embark","link":"https://github.com/Horyus/ethvtx_embark","tags":["react"]},{"name":"Bamboo Template","description":"Template to demonstrate use of the Bamboo contracts","install":"embark new AppName --template bamboo","thumbnail":"bamboo.png","link":"https://github.com/embarklabs/embark-bamboo-template","tags":["bamboo","contracts"]},{"name":"Solidity Gas Golfing","description":"Boilerplate and tests for the first Solidity Gas Golfing Contest","thumbnail":"sggc.png","install":"embark new AppName --template embarklabs/sggc","link":"https://github.com/embarklabs/sggc","tags":["solidity","tests","fun"]}],"tutorials":[{"name":"How to create a Token Factory with Ethereum — Part 1","description":"Create and Deploy a Token with Ethereum","link":"/tutorials/token_factory_1.html","tags":["token","ethereum"]},{"name":"How to create a Token Factory with Ethereum — Part 2","description":"Create a DApp that can deploy Tokens on the fly","link":"/tutorials/token_factory_2.html","tags":["token","ethereum","client-side-deployment"]},{"name":"How to deploy to a testnet with Infura","description":"Deploy and interact with your Dapp on a testnet with the use of Infura","link":"/tutorials/infura_guide.html","tags":["ethereum","deployment","testnet"]}],"versions":{"latest":{"label":"stable (v4)","url":"https://embark.embarklabs.io/docs"},"3.2":{"label":"v3.2","url":"https://5ca4e0fdb29712000adde37f--embark-site-versions.netlify.com/docs/"}}}},"excerpt":"","more":"

With Embark it’s very easy to connect to messaging channels using Whisper. In this guide we’ll discuss how to set everything up to add messaging support to our applications.

\n

Configuration basics

By default, Embark will check our preferred communication configuration in the file config/communication.js. This file contains the preferred configuration for each environment, with default being the configuration that applies to every environment (for more information about environments, check out this guide. Each of these options can be individually overridden on a per environment basis.

\n

Here’s an example configuration:

\n
module.exports = {
default: {
enabled: true,
provider: 'whisper',
available_providers: ['whisper']
}
}
\n\n

Available options:

\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
OptionType: defaultValue
enabledboolean: true/falseTo enable or completely disable communication support
providerstring: whisperDesired provider to automatically connect to in the dapp.
available_providersarray: ["whisper"]List of communication platforms to be supported in the dapp. This will affect what’s available with the EmbarkJS library in the dapp so if you don’t need Whisper for example, removing it from this will considerably reduce the file size of the generated JS code.
\n"},{"title":"Messages in JavaScript","layout":"docs","_content":"\nEmbark's companion library EmbarkJS comes with some convenient APIs to easily subscribe to and sending messages using messages protocols like Whisper. In this guide we'll take a closer look how this works.\n\nMake sure to read our guide in [using EmbarkJS](/docs/javascript.html) first.\n\n## Setting up EmbarkJS\n\nBy default Embark will initialize EmbarkJS with the provider configured at `config/communication.js`. However if we are using EmbarkJS directly or wish to change the provider configuration at runtime, we can do so using the `setProvider()` method:\n\n```\nEmbarkJS.Messages.setProvider('whisper')\n```\n\n## Listening to messages\n\nWe can subscribe to channels using the `listenTo()` method by specifying a list of channel topics like this:\n\n```\nEmbarkJS.Messages.listenTo({\n topic: ['topic1', 'topic2']\n}).subscribe(message {\n console.log('received: ' + message);\n});\n```\n\n`listenTo()` returns an Observable that we can subscribe to. Observables work great if multiple values can be emitted over time, which is exactly the case for messages being emitted with Whisper. In other words, this is a long-living Observable, so it's important to unsubscribe from it once we're no longer interested in the data. Otherwise we'll introduce memory leaks.\n\n## Sending messages\n\nSending messages can be done using the `sendMessage()` method and it's entirely up to use whether we want to send plain text messages or even objects.\n\n\nHere's how to send a plain text message to the `sometopic` topic:\n\n```\nEmbarkJS.Messages.sendMessage({\n topic: 'sometopic',\n data: 'hello world'\n});\n```\n\nAnd this code snippet shows how to send an object structure:\n\n```\nEmbarkJS.Messages.sendMessage({\n topic: 'sometopic',\n data: { msg: 'hello world' }\n});\n```\n\nNotice that a topic/channel name has to be at least 4 characters long. Whisper will otherwise emit an error on the subscription.\n\n{% notification info 'On topic arrays:' %}\nArray of topics are considered an AND. In Whisper you can use another array for OR combinations of several topics e.g `[\"topic1\", [\"topic2\", \"topic3\"]]` => `topic1 AND (topic2 OR topic 3)`.\n{% endnotification %}\n\n","source":"docs/messages_javascript.md","raw":"title: Messages in JavaScript\nlayout: docs\n---\n\nEmbark's companion library EmbarkJS comes with some convenient APIs to easily subscribe to and sending messages using messages protocols like Whisper. In this guide we'll take a closer look how this works.\n\nMake sure to read our guide in [using EmbarkJS](/docs/javascript.html) first.\n\n## Setting up EmbarkJS\n\nBy default Embark will initialize EmbarkJS with the provider configured at `config/communication.js`. However if we are using EmbarkJS directly or wish to change the provider configuration at runtime, we can do so using the `setProvider()` method:\n\n```\nEmbarkJS.Messages.setProvider('whisper')\n```\n\n## Listening to messages\n\nWe can subscribe to channels using the `listenTo()` method by specifying a list of channel topics like this:\n\n```\nEmbarkJS.Messages.listenTo({\n topic: ['topic1', 'topic2']\n}).subscribe(message {\n console.log('received: ' + message);\n});\n```\n\n`listenTo()` returns an Observable that we can subscribe to. Observables work great if multiple values can be emitted over time, which is exactly the case for messages being emitted with Whisper. In other words, this is a long-living Observable, so it's important to unsubscribe from it once we're no longer interested in the data. Otherwise we'll introduce memory leaks.\n\n## Sending messages\n\nSending messages can be done using the `sendMessage()` method and it's entirely up to use whether we want to send plain text messages or even objects.\n\n\nHere's how to send a plain text message to the `sometopic` topic:\n\n```\nEmbarkJS.Messages.sendMessage({\n topic: 'sometopic',\n data: 'hello world'\n});\n```\n\nAnd this code snippet shows how to send an object structure:\n\n```\nEmbarkJS.Messages.sendMessage({\n topic: 'sometopic',\n data: { msg: 'hello world' }\n});\n```\n\nNotice that a topic/channel name has to be at least 4 characters long. Whisper will otherwise emit an error on the subscription.\n\n{% notification info 'On topic arrays:' %}\nArray of topics are considered an AND. In Whisper you can use another array for OR combinations of several topics e.g `[\"topic1\", [\"topic2\", \"topic3\"]]` => `topic1 AND (topic2 OR topic 3)`.\n{% endnotification %}\n\n","date":"2020-01-17T19:00:03.900Z","updated":"2020-01-17T19:00:03.900Z","path":"docs/messages_javascript.html","comments":1,"_id":"ck5ijm3rp001c7heg49d3513w","content":"

Embark’s companion library EmbarkJS comes with some convenient APIs to easily subscribe to and sending messages using messages protocols like Whisper. In this guide we’ll take a closer look how this works.

\n

Make sure to read our guide in using EmbarkJS first.

\n

Setting up EmbarkJS

By default Embark will initialize EmbarkJS with the provider configured at config/communication.js. However if we are using EmbarkJS directly or wish to change the provider configuration at runtime, we can do so using the setProvider() method:

\n
EmbarkJS.Messages.setProvider('whisper')
\n\n

Listening to messages

We can subscribe to channels using the listenTo() method by specifying a list of channel topics like this:

\n
EmbarkJS.Messages.listenTo({
topic: ['topic1', 'topic2']
}).subscribe(message {
console.log('received: ' + message);
});
\n\n

listenTo() returns an Observable that we can subscribe to. Observables work great if multiple values can be emitted over time, which is exactly the case for messages being emitted with Whisper. In other words, this is a long-living Observable, so it’s important to unsubscribe from it once we’re no longer interested in the data. Otherwise we’ll introduce memory leaks.

\n

Sending messages

Sending messages can be done using the sendMessage() method and it’s entirely up to use whether we want to send plain text messages or even objects.

\n

Here’s how to send a plain text message to the sometopic topic:

\n
EmbarkJS.Messages.sendMessage({
topic: 'sometopic',
data: 'hello world'
});
\n\n

And this code snippet shows how to send an object structure:

\n
EmbarkJS.Messages.sendMessage({
topic: 'sometopic',
data: { msg: 'hello world' }
});
\n\n

Notice that a topic/channel name has to be at least 4 characters long. Whisper will otherwise emit an error on the subscription.

\n
\n

On topic arrays:

\n

Array of topics are considered an AND. In Whisper you can use another array for OR combinations of several topics e.g ["topic1", ["topic2", "topic3"]] => topic1 AND (topic2 OR topic 3).

\n

\n
\n\n\n\n","site":{"data":{"authors":{"iuri_matias":{"name":"Iuri Matias","twitter":"iurimatias","image":"https://pbs.twimg.com/profile_images/928272512181563392/iDJdvy2k_400x400.jpg"},"pascal_precht":{"name":"Pascal Precht","twitter":"pascalprecht","image":"https://pbs.twimg.com/profile_images/993785060733194241/p3oAIMDP_400x400.jpg"},"anthony_laibe":{"name":"Anthony Laibe","twitter":"a_laibe","image":"https://pbs.twimg.com/profile_images/257742900/13168239_400x400.jpg"},"jonathan_rainville":{"name":"Jonathan Rainville","twitter":"ShyolGhul","image":"https://pbs.twimg.com/profile_images/993873866878570496/-aE4byjj_400x400.jpg"},"andre_medeiros":{"name":"Andre Medeiros","twitter":"superdealloc","image":"https://pbs.twimg.com/profile_images/965722487735701504/m58KNgWN_400x400.jpg"},"eric_mastro":{"name":"Eric Mastro","twitter":"ericmastro","image":"https://avatars1.githubusercontent.com/u/5089238?s=460&v=4"},"michael_bradley":{"name":"Michael Bradley","image":"https://avatars3.githubusercontent.com/u/194260?s=460&v=4"},"richard_ramos":{"name":"Richard Ramos","twitter":"richardramos_me","image":"https://pbs.twimg.com/profile_images/1063160577973866496/aM313uHG_400x400.jpg"},"jonny_zerah":{"name":"Jonny Zerah","twitter":"jonnyzerah","image":"https://pbs.twimg.com/profile_images/1043774340490248192/gI9aGy17_400x400.jpg"},"robin_percy":{"name":"Robin Percy","twitter":"rbin","image":"https://avatars1.githubusercontent.com/u/29288325?s=400&v=4"}},"categories":{"tutorials":"Tutorials","announcements":"Announcements"},"languages":{"en":"English"},"plugins":[{"name":"embark-bamboo","description":"plugins_page.plugins.bamboo.desc","link":"https://www.npmjs.com/package/embark-bamboo","thumbnail":"bamboo.png","tags":["language","smart-contracts"]},{"name":"embark-solc","description":"plugins_page.plugins.solc.desc","link":"https://www.npmjs.com/package/embark-solc","thumbnail":"solidity.png","tags":["solidity","language","smart-contracts"]},{"name":"embark-solium","description":"plugins_page.plugins.solium.desc","link":"https://www.npmjs.com/package/embark-solium","thumbnail":"solium.png","tags":["linter","solidity","solium"]},{"name":"embark-etherscan-verifier","description":"plugins_page.plugins.verifier.desc","link":"https://www.npmjs.com/package/embark-etherscan-verifier","tags":["solidity","etherscan","smart-contracts"]},{"name":"embark-status","description":"plugins_page.plugins.status.desc","link":"https://www.npmjs.com/package/embark-status-plugin","thumbnail":"status.png","tags":["status","mobile"]},{"name":"embark-remix","description":"plugins_page.plugins.remix.desc","link":"https://www.npmjs.com/package/embark-remix","thumbnail":"remix.png","tags":["remix","debugger"]},{"name":"embark-slither","description":"plugins_page.plugins.slither.desc","link":"https://www.npmjs.com/package/embark-slither","tags":["solidity"]},{"name":"embark-snark","description":"plugins_page.plugins.snark.desc","link":"https://www.npmjs.com/package/embark-snark","tags":["snark"]},{"name":"embark-fortune","description":"plugins_page.plugins.fortune.desc","link":"https://www.npmjs.com/package/embark-fortune","thumbnail":"fortune.jpg","tags":["fun"]},{"name":"embark-pug","description":"plugins_page.plugins.pug.desc","link":"https://www.npmjs.com/package/embark-pug","legacy":true,"thumbnail":"pug.png","tags":["pug","jade","templates"]},{"name":"embark-haml","description":"plugins_page.plugins.haml.desc","link":"https://www.npmjs.com/package/embark-haml","legacy":true,"thumbnail":"haml.png","tags":["haml","templates"]},{"name":"embark-mythx","description":"plugins_page.plugins.mythx.desc","link":"https://www.npmjs.com/package/embark-mythx","thumbnail":"mythx.png","tags":["mythx","smart-contracts"]}],"menu":{"docs":"/docs/","plugins":"/plugins/","chat":"/chat/","blog":"/news/"},"sidebar":{"docs":{"getting_started":{"overview":"overview.html","installation":"installation.html","faq":"faq.html"},"general_usage":{"creating_project":"create_project.html","structure":"structure.html","running_apps":"running_apps.html","dashboard":"dashboard.html","using_the_console":"using_the_console.html","environments":"environments.html","configuration":"configuration.html","pipeline_and_webpack":"pipeline_and_webpack.html","javascript_usage":"javascript_usage.html"},"smart_contracts":{"contracts_configuration":"contracts_configuration.html","contracts_deployment":"contracts_deployment.html","contracts_imports":"contracts_imports.html","contracts_testing":"contracts_testing.html","contracts_javascript":"contracts_javascript.html"},"blockchain_node":{"blockchain_configuration":"blockchain_configuration.html","blockchain_accounts_configuration":"blockchain_accounts_configuration.html"},"storage":{"storage_configuration":"storage_configuration.html","storage_deployment":"storage_deployment.html","storage_javascript":"storage_javascript.html"},"messages":{"messages_configuration":"messages_configuration.html","messages_javascript":"messages_javascript.html"},"naming":{"naming_configuration":"naming_configuration.html","naming_javascript":"naming_javascript.html"},"plugins":{"installing_a_plugin":"installing_plugins.html","creating_a_plugin":"creating_plugins.html","plugin_reference":"plugin_reference.html"},"cockpit":{"cockpit_introduction":"cockpit_introduction.html","cockpit_dashboard":"cockpit_dashboard.html","cockpit_deployment":"cockpit_deployment.html","cockpit_explorer":"cockpit_explorer.html","cockpit_editor":"cockpit_editor.html","cockpit_debugger":"cockpit_debugger.html"},"reference":{"embark_commands":"embark_commands.html"},"miscellaneous":{"migrating_from_3":"migrating_from_3.x.html","troubleshooting":"troubleshooting.html","contributing":"contributing.html"}}},"templates":[{"name":"Vyper Template","description":"Template to demonstrate the use of the Vyper contracts","install":"embark new AppName --template vyper","thumbnail":"vyper.png","link":"https://github.com/embarklabs/embark-vyper-template","tags":["vyper","contracts"]},{"name":"Embark Demo React Template","description":"A React Application showcasing Embark's functionality","install":"embark demo","thumbnail":"react.png","link":"https://embark.embarklabs.io/docs/create_project.html#Creating-a-Demo-Project","tags":["react","contracts","whisper","ipfs"]},{"name":"Typescript Template","description":"Template with Typescript support pre-configured","thumbnail":"typescript.png","install":"embark new AppName --template typescript","link":"https://github.com/embarklabs/embark-typescript-template","tags":["typescript","frontend"]},{"name":"Vue.js Template","description":"Ready to use Template for using Embark with vue.js","thumbnail":"vuejs.png","install":"embark new AppName --template vue","link":"https://github.com/embarklabs/embark-vue-template","tags":["vue.js","frontend"]},{"name":"ethvtx Template","description":"Demo app for ethvtx, an Ethereum-Ready & Framework-Agnostic Redux configuration","thumbnail":"vortex.png","install":"embark new AppName --template Horyus/ethvtx_embark","link":"https://github.com/Horyus/ethvtx_embark","tags":["react"]},{"name":"Bamboo Template","description":"Template to demonstrate use of the Bamboo contracts","install":"embark new AppName --template bamboo","thumbnail":"bamboo.png","link":"https://github.com/embarklabs/embark-bamboo-template","tags":["bamboo","contracts"]},{"name":"Solidity Gas Golfing","description":"Boilerplate and tests for the first Solidity Gas Golfing Contest","thumbnail":"sggc.png","install":"embark new AppName --template embarklabs/sggc","link":"https://github.com/embarklabs/sggc","tags":["solidity","tests","fun"]}],"tutorials":[{"name":"How to create a Token Factory with Ethereum — Part 1","description":"Create and Deploy a Token with Ethereum","link":"/tutorials/token_factory_1.html","tags":["token","ethereum"]},{"name":"How to create a Token Factory with Ethereum — Part 2","description":"Create a DApp that can deploy Tokens on the fly","link":"/tutorials/token_factory_2.html","tags":["token","ethereum","client-side-deployment"]},{"name":"How to deploy to a testnet with Infura","description":"Deploy and interact with your Dapp on a testnet with the use of Infura","link":"/tutorials/infura_guide.html","tags":["ethereum","deployment","testnet"]}],"versions":{"latest":{"label":"stable (v4)","url":"https://embark.embarklabs.io/docs"},"3.2":{"label":"v3.2","url":"https://5ca4e0fdb29712000adde37f--embark-site-versions.netlify.com/docs/"}}}},"excerpt":"","more":"

Embark’s companion library EmbarkJS comes with some convenient APIs to easily subscribe to and sending messages using messages protocols like Whisper. In this guide we’ll take a closer look how this works.

\n

Make sure to read our guide in using EmbarkJS first.

\n

Setting up EmbarkJS

By default Embark will initialize EmbarkJS with the provider configured at config/communication.js. However if we are using EmbarkJS directly or wish to change the provider configuration at runtime, we can do so using the setProvider() method:

\n
EmbarkJS.Messages.setProvider('whisper')
\n\n

Listening to messages

We can subscribe to channels using the listenTo() method by specifying a list of channel topics like this:

\n
EmbarkJS.Messages.listenTo({
topic: ['topic1', 'topic2']
}).subscribe(message {
console.log('received: ' + message);
});
\n\n

listenTo() returns an Observable that we can subscribe to. Observables work great if multiple values can be emitted over time, which is exactly the case for messages being emitted with Whisper. In other words, this is a long-living Observable, so it’s important to unsubscribe from it once we’re no longer interested in the data. Otherwise we’ll introduce memory leaks.

\n

Sending messages

Sending messages can be done using the sendMessage() method and it’s entirely up to use whether we want to send plain text messages or even objects.

\n

Here’s how to send a plain text message to the sometopic topic:

\n
EmbarkJS.Messages.sendMessage({
topic: 'sometopic',
data: 'hello world'
});
\n\n

And this code snippet shows how to send an object structure:

\n
EmbarkJS.Messages.sendMessage({
topic: 'sometopic',
data: { msg: 'hello world' }
});
\n\n

Notice that a topic/channel name has to be at least 4 characters long. Whisper will otherwise emit an error on the subscription.

\n
\n

On topic arrays:

\n

Array of topics are considered an AND. In Whisper you can use another array for OR combinations of several topics e.g ["topic1", ["topic2", "topic3"]] => topic1 AND (topic2 OR topic 3).

\n

\n
\n\n\n\n"},{"title":"Migrating from Embark 3.x","layout":"docs","_content":"\nWith the release of version 4, Embark has introduced a few breaking changes that require developers to take action, if they plan to upgrade.\n\nIn this guide we'll discuss the few steps to take a project from Embark 3.2.x to 4.x.\n\n## Upgrading to v4\n\nIn order to take an existing Embark 3.2.x project to version 4.x, the following steps are required:\n\n1. Adding a `generationDir` to the project's `embark.json`\n2. Updating \"magic\" EmbarkJS imports\n3. Installing a blockchain connector\n4. Updating blockchain account configurations\n\nLet's walk through them step by step!\n\n### Adding a `generationDir` to `embark.json`\n\nSince version 4, Embark generates project [specific artifacts](/docs/javascript_usage.html#Embark-Artifacts). We need to tell Embark where to generate those artifacts. For new projects, this is not a problem as Embark will create the necessary configuration. However, for existing projects, we'll have to add a [`generationDir`](/docs/configuration.html#generationDir) property to our project's `embark.json` file.\n\n```\n...\n\"generationDir\": \"artifacts\"\n...\n```\n\nThe value of `generationDir` is the name of the folder in which we want Embark to generate artifacts. For new projects, `artifacts` is the default.\n\n### Updating \"magic\" EmbarkJS imports\n\nBefore version 4, EmbarkJS provided a couple of \"magic\" imports for applications that made it very convenient to get access to EmbarkJS itself, as well as Smart Contract instances.\n\nThe EmbarkJS library as well as Smart Contract instances will now be generated artifacts, meaning we'll have to update our imports to point to the right location.\n\nFor EmbarkJS, replace this import:\n\n```\nimport EmbarkJS from 'Embark/EmbarkJS';\n```\nwith\n```\nimport EmbarkJS from './artifacts/embarkjs';\n```\n\n{% notification info 'Attention!' %}\nNotice that the import path has to match the path we've specified in `generationDir` earlier.\n{% endnotification %}\n\nFor Smart Contract instances, replace:\n\n```\nimport CONTRACT_NAME from 'Embark/contracts/CONTRACT_NAME';\n```\n\nwith\n\n```\nimport CONTRACT_NAME from './artifacts/contracts/CONTRACT_NAME';\n```\n\n#### Remove web3 imports\n\nPrior to version 4, EmbarkJS exported a Web3 instance as well. This is no longer the case as it caused a lot of compatibility issues with different Web3 versions. Please rely on the globally available Web3 instance instead.\n\nRemove the following import from your application:\n\n```\nimport web3 from 'Embark/web3';\n```\n\n### Updating blockchain configurations\n\nEmbark 4 adds some new blockchain account configurations. To try to keep things as simple as possible, these additions are really similar to the ones in the Smart Contract configuration. For more information, please read the [Accounts Blockchain configuration guide](/docs/blockchain_accounts_configuration.html) in our docs.\n\nHowever, we did introduce some small breaking changes. We removed:\n\n- **account**: This is completely replaced by the new accounts property (notice the s at the end of accounts). It gives the developer more flexibility. To have exactly the same behavior as before, just use the `nodeAccounts` account type as described in the docs\n- **simulatorMnemonic**: Removed in favor of Ganache’s default mnemonic. If this functionality is still needed, please specify the desired mnemonic in the [blockchain config’s mnemonic account type](/docs/blockchain_accounts_configuration.md#parameter-descriptions).\n\n\n## Updating to v5\n\nSummary:\n- Contract config\n - Removed the deployment section (now all part of blockchain config)\n - `contracts` renamed `deploy` to match `beforeDeploy` and `afterDeploy` and for tests\n- Blockchain config\n - A lot of new defaults, so less that you need to configure [Source](/docs/blockchain_configuration.html#Common-Parameters)\n - A lot of renamed parameters\n - isDev: `miningMode: 'dev'`\n - mineWhenNeeded: `miningMode: 'auto'`\n - ethereumClientName: `client`\n - New `endpoint` parameter that let's you connect to an external endpoint or configure more easily which local endpoint to start [Source](/docs/blockchain_configuration.html#Parameter-descriptions)\n - Now is the only source for accounts [Source](/docs/blockchain_accounts_configuration.html)\n- Tests\n - Can now configure module configuration\n - Storage, namesystem (ENS) and communication modules can now be configured \n - Configure them just like in the configuration files\n - Tests default to the `test` environment\n - Modules are turned off by default\n - Config merges with `test` and `default` so no need to rewrite all the provider configs\n - `deployement` section removed\n - You can now configure the accounts and the endpoint in the `blockchain` section\n - `contracts` renamed `deploy` and put inside the `contracts` section\n","source":"docs/migrating_from_3.x.md","raw":"title: Migrating from Embark 3.x\nlayout: docs\n---\n\nWith the release of version 4, Embark has introduced a few breaking changes that require developers to take action, if they plan to upgrade.\n\nIn this guide we'll discuss the few steps to take a project from Embark 3.2.x to 4.x.\n\n## Upgrading to v4\n\nIn order to take an existing Embark 3.2.x project to version 4.x, the following steps are required:\n\n1. Adding a `generationDir` to the project's `embark.json`\n2. Updating \"magic\" EmbarkJS imports\n3. Installing a blockchain connector\n4. Updating blockchain account configurations\n\nLet's walk through them step by step!\n\n### Adding a `generationDir` to `embark.json`\n\nSince version 4, Embark generates project [specific artifacts](/docs/javascript_usage.html#Embark-Artifacts). We need to tell Embark where to generate those artifacts. For new projects, this is not a problem as Embark will create the necessary configuration. However, for existing projects, we'll have to add a [`generationDir`](/docs/configuration.html#generationDir) property to our project's `embark.json` file.\n\n```\n...\n\"generationDir\": \"artifacts\"\n...\n```\n\nThe value of `generationDir` is the name of the folder in which we want Embark to generate artifacts. For new projects, `artifacts` is the default.\n\n### Updating \"magic\" EmbarkJS imports\n\nBefore version 4, EmbarkJS provided a couple of \"magic\" imports for applications that made it very convenient to get access to EmbarkJS itself, as well as Smart Contract instances.\n\nThe EmbarkJS library as well as Smart Contract instances will now be generated artifacts, meaning we'll have to update our imports to point to the right location.\n\nFor EmbarkJS, replace this import:\n\n```\nimport EmbarkJS from 'Embark/EmbarkJS';\n```\nwith\n```\nimport EmbarkJS from './artifacts/embarkjs';\n```\n\n{% notification info 'Attention!' %}\nNotice that the import path has to match the path we've specified in `generationDir` earlier.\n{% endnotification %}\n\nFor Smart Contract instances, replace:\n\n```\nimport CONTRACT_NAME from 'Embark/contracts/CONTRACT_NAME';\n```\n\nwith\n\n```\nimport CONTRACT_NAME from './artifacts/contracts/CONTRACT_NAME';\n```\n\n#### Remove web3 imports\n\nPrior to version 4, EmbarkJS exported a Web3 instance as well. This is no longer the case as it caused a lot of compatibility issues with different Web3 versions. Please rely on the globally available Web3 instance instead.\n\nRemove the following import from your application:\n\n```\nimport web3 from 'Embark/web3';\n```\n\n### Updating blockchain configurations\n\nEmbark 4 adds some new blockchain account configurations. To try to keep things as simple as possible, these additions are really similar to the ones in the Smart Contract configuration. For more information, please read the [Accounts Blockchain configuration guide](/docs/blockchain_accounts_configuration.html) in our docs.\n\nHowever, we did introduce some small breaking changes. We removed:\n\n- **account**: This is completely replaced by the new accounts property (notice the s at the end of accounts). It gives the developer more flexibility. To have exactly the same behavior as before, just use the `nodeAccounts` account type as described in the docs\n- **simulatorMnemonic**: Removed in favor of Ganache’s default mnemonic. If this functionality is still needed, please specify the desired mnemonic in the [blockchain config’s mnemonic account type](/docs/blockchain_accounts_configuration.md#parameter-descriptions).\n\n\n## Updating to v5\n\nSummary:\n- Contract config\n - Removed the deployment section (now all part of blockchain config)\n - `contracts` renamed `deploy` to match `beforeDeploy` and `afterDeploy` and for tests\n- Blockchain config\n - A lot of new defaults, so less that you need to configure [Source](/docs/blockchain_configuration.html#Common-Parameters)\n - A lot of renamed parameters\n - isDev: `miningMode: 'dev'`\n - mineWhenNeeded: `miningMode: 'auto'`\n - ethereumClientName: `client`\n - New `endpoint` parameter that let's you connect to an external endpoint or configure more easily which local endpoint to start [Source](/docs/blockchain_configuration.html#Parameter-descriptions)\n - Now is the only source for accounts [Source](/docs/blockchain_accounts_configuration.html)\n- Tests\n - Can now configure module configuration\n - Storage, namesystem (ENS) and communication modules can now be configured \n - Configure them just like in the configuration files\n - Tests default to the `test` environment\n - Modules are turned off by default\n - Config merges with `test` and `default` so no need to rewrite all the provider configs\n - `deployement` section removed\n - You can now configure the accounts and the endpoint in the `blockchain` section\n - `contracts` renamed `deploy` and put inside the `contracts` section\n","date":"2020-01-17T19:00:03.900Z","updated":"2020-01-17T19:00:03.900Z","path":"docs/migrating_from_3.x.html","comments":1,"_id":"ck5ijm3rp001d7hegbn1k2bi5","content":"

With the release of version 4, Embark has introduced a few breaking changes that require developers to take action, if they plan to upgrade.

\n

In this guide we’ll discuss the few steps to take a project from Embark 3.2.x to 4.x.

\n

Upgrading to v4

In order to take an existing Embark 3.2.x project to version 4.x, the following steps are required:

\n
    \n
  1. Adding a generationDir to the project’s embark.json
  2. \n
  3. Updating “magic” EmbarkJS imports
  4. \n
  5. Installing a blockchain connector
  6. \n
  7. Updating blockchain account configurations
  8. \n
\n

Let’s walk through them step by step!

\n

Adding a generationDir to embark.json

Since version 4, Embark generates project specific artifacts. We need to tell Embark where to generate those artifacts. For new projects, this is not a problem as Embark will create the necessary configuration. However, for existing projects, we’ll have to add a generationDir property to our project’s embark.json file.

\n
...
"generationDir": "artifacts"
...
\n\n

The value of generationDir is the name of the folder in which we want Embark to generate artifacts. For new projects, artifacts is the default.

\n

Updating “magic” EmbarkJS imports

Before version 4, EmbarkJS provided a couple of “magic” imports for applications that made it very convenient to get access to EmbarkJS itself, as well as Smart Contract instances.

\n

The EmbarkJS library as well as Smart Contract instances will now be generated artifacts, meaning we’ll have to update our imports to point to the right location.

\n

For EmbarkJS, replace this import:

\n
import EmbarkJS from 'Embark/EmbarkJS';
\n

with

\n
import EmbarkJS from './artifacts/embarkjs';
\n\n
\n

Attention!

\n

Notice that the import path has to match the path we’ve specified in generationDir earlier.

\n

\n
\n\n\n\n

For Smart Contract instances, replace:

\n
import CONTRACT_NAME from 'Embark/contracts/CONTRACT_NAME';
\n\n

with

\n
import CONTRACT_NAME from './artifacts/contracts/CONTRACT_NAME';
\n\n

Remove web3 imports

Prior to version 4, EmbarkJS exported a Web3 instance as well. This is no longer the case as it caused a lot of compatibility issues with different Web3 versions. Please rely on the globally available Web3 instance instead.

\n

Remove the following import from your application:

\n
import web3 from 'Embark/web3';
\n\n

Updating blockchain configurations

Embark 4 adds some new blockchain account configurations. To try to keep things as simple as possible, these additions are really similar to the ones in the Smart Contract configuration. For more information, please read the Accounts Blockchain configuration guide in our docs.

\n

However, we did introduce some small breaking changes. We removed:

\n
    \n
  • account: This is completely replaced by the new accounts property (notice the s at the end of accounts). It gives the developer more flexibility. To have exactly the same behavior as before, just use the nodeAccounts account type as described in the docs
  • \n
  • simulatorMnemonic: Removed in favor of Ganache’s default mnemonic. If this functionality is still needed, please specify the desired mnemonic in the blockchain config’s mnemonic account type.
  • \n
\n

Updating to v5

Summary:

\n
    \n
  • Contract config
      \n
    • Removed the deployment section (now all part of blockchain config)
    • \n
    • contracts renamed deploy to match beforeDeploy and afterDeploy and for tests
    • \n
    \n
  • \n
  • Blockchain config
      \n
    • A lot of new defaults, so less that you need to configure Source
    • \n
    • A lot of renamed parameters
        \n
      • isDev: miningMode: 'dev'
      • \n
      • mineWhenNeeded: miningMode: 'auto'
      • \n
      • ethereumClientName: client
      • \n
      \n
    • \n
    • New endpoint parameter that let’s you connect to an external endpoint or configure more easily which local endpoint to start Source
    • \n
    • Now is the only source for accounts Source
    • \n
    \n
  • \n
  • Tests
      \n
    • Can now configure module configuration
        \n
      • Storage, namesystem (ENS) and communication modules can now be configured
          \n
        • Configure them just like in the configuration files
        • \n
        • Tests default to the test environment
        • \n
        • Modules are turned off by default
        • \n
        • Config merges with test and default so no need to rewrite all the provider configs
        • \n
        \n
      • \n
      \n
    • \n
    • deployement section removed
        \n
      • You can now configure the accounts and the endpoint in the blockchain section
      • \n
      \n
    • \n
    • contracts renamed deploy and put inside the contracts section
    • \n
    \n
  • \n
\n","site":{"data":{"authors":{"iuri_matias":{"name":"Iuri Matias","twitter":"iurimatias","image":"https://pbs.twimg.com/profile_images/928272512181563392/iDJdvy2k_400x400.jpg"},"pascal_precht":{"name":"Pascal Precht","twitter":"pascalprecht","image":"https://pbs.twimg.com/profile_images/993785060733194241/p3oAIMDP_400x400.jpg"},"anthony_laibe":{"name":"Anthony Laibe","twitter":"a_laibe","image":"https://pbs.twimg.com/profile_images/257742900/13168239_400x400.jpg"},"jonathan_rainville":{"name":"Jonathan Rainville","twitter":"ShyolGhul","image":"https://pbs.twimg.com/profile_images/993873866878570496/-aE4byjj_400x400.jpg"},"andre_medeiros":{"name":"Andre Medeiros","twitter":"superdealloc","image":"https://pbs.twimg.com/profile_images/965722487735701504/m58KNgWN_400x400.jpg"},"eric_mastro":{"name":"Eric Mastro","twitter":"ericmastro","image":"https://avatars1.githubusercontent.com/u/5089238?s=460&v=4"},"michael_bradley":{"name":"Michael Bradley","image":"https://avatars3.githubusercontent.com/u/194260?s=460&v=4"},"richard_ramos":{"name":"Richard Ramos","twitter":"richardramos_me","image":"https://pbs.twimg.com/profile_images/1063160577973866496/aM313uHG_400x400.jpg"},"jonny_zerah":{"name":"Jonny Zerah","twitter":"jonnyzerah","image":"https://pbs.twimg.com/profile_images/1043774340490248192/gI9aGy17_400x400.jpg"},"robin_percy":{"name":"Robin Percy","twitter":"rbin","image":"https://avatars1.githubusercontent.com/u/29288325?s=400&v=4"}},"categories":{"tutorials":"Tutorials","announcements":"Announcements"},"languages":{"en":"English"},"plugins":[{"name":"embark-bamboo","description":"plugins_page.plugins.bamboo.desc","link":"https://www.npmjs.com/package/embark-bamboo","thumbnail":"bamboo.png","tags":["language","smart-contracts"]},{"name":"embark-solc","description":"plugins_page.plugins.solc.desc","link":"https://www.npmjs.com/package/embark-solc","thumbnail":"solidity.png","tags":["solidity","language","smart-contracts"]},{"name":"embark-solium","description":"plugins_page.plugins.solium.desc","link":"https://www.npmjs.com/package/embark-solium","thumbnail":"solium.png","tags":["linter","solidity","solium"]},{"name":"embark-etherscan-verifier","description":"plugins_page.plugins.verifier.desc","link":"https://www.npmjs.com/package/embark-etherscan-verifier","tags":["solidity","etherscan","smart-contracts"]},{"name":"embark-status","description":"plugins_page.plugins.status.desc","link":"https://www.npmjs.com/package/embark-status-plugin","thumbnail":"status.png","tags":["status","mobile"]},{"name":"embark-remix","description":"plugins_page.plugins.remix.desc","link":"https://www.npmjs.com/package/embark-remix","thumbnail":"remix.png","tags":["remix","debugger"]},{"name":"embark-slither","description":"plugins_page.plugins.slither.desc","link":"https://www.npmjs.com/package/embark-slither","tags":["solidity"]},{"name":"embark-snark","description":"plugins_page.plugins.snark.desc","link":"https://www.npmjs.com/package/embark-snark","tags":["snark"]},{"name":"embark-fortune","description":"plugins_page.plugins.fortune.desc","link":"https://www.npmjs.com/package/embark-fortune","thumbnail":"fortune.jpg","tags":["fun"]},{"name":"embark-pug","description":"plugins_page.plugins.pug.desc","link":"https://www.npmjs.com/package/embark-pug","legacy":true,"thumbnail":"pug.png","tags":["pug","jade","templates"]},{"name":"embark-haml","description":"plugins_page.plugins.haml.desc","link":"https://www.npmjs.com/package/embark-haml","legacy":true,"thumbnail":"haml.png","tags":["haml","templates"]},{"name":"embark-mythx","description":"plugins_page.plugins.mythx.desc","link":"https://www.npmjs.com/package/embark-mythx","thumbnail":"mythx.png","tags":["mythx","smart-contracts"]}],"menu":{"docs":"/docs/","plugins":"/plugins/","chat":"/chat/","blog":"/news/"},"sidebar":{"docs":{"getting_started":{"overview":"overview.html","installation":"installation.html","faq":"faq.html"},"general_usage":{"creating_project":"create_project.html","structure":"structure.html","running_apps":"running_apps.html","dashboard":"dashboard.html","using_the_console":"using_the_console.html","environments":"environments.html","configuration":"configuration.html","pipeline_and_webpack":"pipeline_and_webpack.html","javascript_usage":"javascript_usage.html"},"smart_contracts":{"contracts_configuration":"contracts_configuration.html","contracts_deployment":"contracts_deployment.html","contracts_imports":"contracts_imports.html","contracts_testing":"contracts_testing.html","contracts_javascript":"contracts_javascript.html"},"blockchain_node":{"blockchain_configuration":"blockchain_configuration.html","blockchain_accounts_configuration":"blockchain_accounts_configuration.html"},"storage":{"storage_configuration":"storage_configuration.html","storage_deployment":"storage_deployment.html","storage_javascript":"storage_javascript.html"},"messages":{"messages_configuration":"messages_configuration.html","messages_javascript":"messages_javascript.html"},"naming":{"naming_configuration":"naming_configuration.html","naming_javascript":"naming_javascript.html"},"plugins":{"installing_a_plugin":"installing_plugins.html","creating_a_plugin":"creating_plugins.html","plugin_reference":"plugin_reference.html"},"cockpit":{"cockpit_introduction":"cockpit_introduction.html","cockpit_dashboard":"cockpit_dashboard.html","cockpit_deployment":"cockpit_deployment.html","cockpit_explorer":"cockpit_explorer.html","cockpit_editor":"cockpit_editor.html","cockpit_debugger":"cockpit_debugger.html"},"reference":{"embark_commands":"embark_commands.html"},"miscellaneous":{"migrating_from_3":"migrating_from_3.x.html","troubleshooting":"troubleshooting.html","contributing":"contributing.html"}}},"templates":[{"name":"Vyper Template","description":"Template to demonstrate the use of the Vyper contracts","install":"embark new AppName --template vyper","thumbnail":"vyper.png","link":"https://github.com/embarklabs/embark-vyper-template","tags":["vyper","contracts"]},{"name":"Embark Demo React Template","description":"A React Application showcasing Embark's functionality","install":"embark demo","thumbnail":"react.png","link":"https://embark.embarklabs.io/docs/create_project.html#Creating-a-Demo-Project","tags":["react","contracts","whisper","ipfs"]},{"name":"Typescript Template","description":"Template with Typescript support pre-configured","thumbnail":"typescript.png","install":"embark new AppName --template typescript","link":"https://github.com/embarklabs/embark-typescript-template","tags":["typescript","frontend"]},{"name":"Vue.js Template","description":"Ready to use Template for using Embark with vue.js","thumbnail":"vuejs.png","install":"embark new AppName --template vue","link":"https://github.com/embarklabs/embark-vue-template","tags":["vue.js","frontend"]},{"name":"ethvtx Template","description":"Demo app for ethvtx, an Ethereum-Ready & Framework-Agnostic Redux configuration","thumbnail":"vortex.png","install":"embark new AppName --template Horyus/ethvtx_embark","link":"https://github.com/Horyus/ethvtx_embark","tags":["react"]},{"name":"Bamboo Template","description":"Template to demonstrate use of the Bamboo contracts","install":"embark new AppName --template bamboo","thumbnail":"bamboo.png","link":"https://github.com/embarklabs/embark-bamboo-template","tags":["bamboo","contracts"]},{"name":"Solidity Gas Golfing","description":"Boilerplate and tests for the first Solidity Gas Golfing Contest","thumbnail":"sggc.png","install":"embark new AppName --template embarklabs/sggc","link":"https://github.com/embarklabs/sggc","tags":["solidity","tests","fun"]}],"tutorials":[{"name":"How to create a Token Factory with Ethereum — Part 1","description":"Create and Deploy a Token with Ethereum","link":"/tutorials/token_factory_1.html","tags":["token","ethereum"]},{"name":"How to create a Token Factory with Ethereum — Part 2","description":"Create a DApp that can deploy Tokens on the fly","link":"/tutorials/token_factory_2.html","tags":["token","ethereum","client-side-deployment"]},{"name":"How to deploy to a testnet with Infura","description":"Deploy and interact with your Dapp on a testnet with the use of Infura","link":"/tutorials/infura_guide.html","tags":["ethereum","deployment","testnet"]}],"versions":{"latest":{"label":"stable (v4)","url":"https://embark.embarklabs.io/docs"},"3.2":{"label":"v3.2","url":"https://5ca4e0fdb29712000adde37f--embark-site-versions.netlify.com/docs/"}}}},"excerpt":"","more":"

With the release of version 4, Embark has introduced a few breaking changes that require developers to take action, if they plan to upgrade.

\n

In this guide we’ll discuss the few steps to take a project from Embark 3.2.x to 4.x.

\n

Upgrading to v4

In order to take an existing Embark 3.2.x project to version 4.x, the following steps are required:

\n
    \n
  1. Adding a generationDir to the project’s embark.json
  2. \n
  3. Updating “magic” EmbarkJS imports
  4. \n
  5. Installing a blockchain connector
  6. \n
  7. Updating blockchain account configurations
  8. \n
\n

Let’s walk through them step by step!

\n

Adding a generationDir to embark.json

Since version 4, Embark generates project specific artifacts. We need to tell Embark where to generate those artifacts. For new projects, this is not a problem as Embark will create the necessary configuration. However, for existing projects, we’ll have to add a generationDir property to our project’s embark.json file.

\n
...
"generationDir": "artifacts"
...
\n\n

The value of generationDir is the name of the folder in which we want Embark to generate artifacts. For new projects, artifacts is the default.

\n

Updating “magic” EmbarkJS imports

Before version 4, EmbarkJS provided a couple of “magic” imports for applications that made it very convenient to get access to EmbarkJS itself, as well as Smart Contract instances.

\n

The EmbarkJS library as well as Smart Contract instances will now be generated artifacts, meaning we’ll have to update our imports to point to the right location.

\n

For EmbarkJS, replace this import:

\n
import EmbarkJS from 'Embark/EmbarkJS';
\n

with

\n
import EmbarkJS from './artifacts/embarkjs';
\n\n
\n

Attention!

\n

Notice that the import path has to match the path we’ve specified in generationDir earlier.

\n

\n
\n\n\n\n

For Smart Contract instances, replace:

\n
import CONTRACT_NAME from 'Embark/contracts/CONTRACT_NAME';
\n\n

with

\n
import CONTRACT_NAME from './artifacts/contracts/CONTRACT_NAME';
\n\n

Remove web3 imports

Prior to version 4, EmbarkJS exported a Web3 instance as well. This is no longer the case as it caused a lot of compatibility issues with different Web3 versions. Please rely on the globally available Web3 instance instead.

\n

Remove the following import from your application:

\n
import web3 from 'Embark/web3';
\n\n

Updating blockchain configurations

Embark 4 adds some new blockchain account configurations. To try to keep things as simple as possible, these additions are really similar to the ones in the Smart Contract configuration. For more information, please read the Accounts Blockchain configuration guide in our docs.

\n

However, we did introduce some small breaking changes. We removed:

\n
    \n
  • account: This is completely replaced by the new accounts property (notice the s at the end of accounts). It gives the developer more flexibility. To have exactly the same behavior as before, just use the nodeAccounts account type as described in the docs
  • \n
  • simulatorMnemonic: Removed in favor of Ganache’s default mnemonic. If this functionality is still needed, please specify the desired mnemonic in the blockchain config’s mnemonic account type.
  • \n
\n

Updating to v5

Summary:

\n
    \n
  • Contract config
      \n
    • Removed the deployment section (now all part of blockchain config)
    • \n
    • contracts renamed deploy to match beforeDeploy and afterDeploy and for tests
    • \n
    \n
  • \n
  • Blockchain config
      \n
    • A lot of new defaults, so less that you need to configure Source
    • \n
    • A lot of renamed parameters
        \n
      • isDev: miningMode: 'dev'
      • \n
      • mineWhenNeeded: miningMode: 'auto'
      • \n
      • ethereumClientName: client
      • \n
      \n
    • \n
    • New endpoint parameter that let’s you connect to an external endpoint or configure more easily which local endpoint to start Source
    • \n
    • Now is the only source for accounts Source
    • \n
    \n
  • \n
  • Tests
      \n
    • Can now configure module configuration
        \n
      • Storage, namesystem (ENS) and communication modules can now be configured
          \n
        • Configure them just like in the configuration files
        • \n
        • Tests default to the test environment
        • \n
        • Modules are turned off by default
        • \n
        • Config merges with test and default so no need to rewrite all the provider configs
        • \n
        \n
      • \n
      \n
    • \n
    • deployement section removed
        \n
      • You can now configure the accounts and the endpoint in the blockchain section
      • \n
      \n
    • \n
    • contracts renamed deploy and put inside the contracts section
    • \n
    \n
  • \n
\n"},{"title":"Naming System Configuration","layout":"docs","_content":"\nWe can configure different naming systems in Embark. In this guide we'll explore how this is done using the Ethereum Name Service.\n\n## Configuration basics\n\nEmbark checks our configuration in `config/namesystem.js` by default. A naming system configuration isn't crucial to run Embark, so this only needs to be enabled when planing to use a naming system.\n\nWhen using ENS as our provider, we can set the `register` section to pre-register sub-domains. This feature is only available in the development environment:\n\n```\nmodule.exports = {\n default: {\n enabled: true,\n available_providers: ['ens', 'ipns'],\n provider: 'ens',\n register: {\n rootDomain: 'embark.eth',\n subdomains: {\n // List of subdomains.\n // The key is the name (eg: status -> status.embark.eth)\n // The value is the address to where the subdomain points\n 'status': '0x1a2f3b98e434c02363f3dac3174af93c1d690914'\n }\n }\n }\n};\n```\n","source":"docs/naming_configuration.md","raw":"title: Naming System Configuration\nlayout: docs\n---\n\nWe can configure different naming systems in Embark. In this guide we'll explore how this is done using the Ethereum Name Service.\n\n## Configuration basics\n\nEmbark checks our configuration in `config/namesystem.js` by default. A naming system configuration isn't crucial to run Embark, so this only needs to be enabled when planing to use a naming system.\n\nWhen using ENS as our provider, we can set the `register` section to pre-register sub-domains. This feature is only available in the development environment:\n\n```\nmodule.exports = {\n default: {\n enabled: true,\n available_providers: ['ens', 'ipns'],\n provider: 'ens',\n register: {\n rootDomain: 'embark.eth',\n subdomains: {\n // List of subdomains.\n // The key is the name (eg: status -> status.embark.eth)\n // The value is the address to where the subdomain points\n 'status': '0x1a2f3b98e434c02363f3dac3174af93c1d690914'\n }\n }\n }\n};\n```\n","date":"2020-01-17T19:00:03.900Z","updated":"2020-01-17T19:00:03.900Z","path":"docs/naming_configuration.html","comments":1,"_id":"ck5ijm3rq001e7hegcf0yf8ex","content":"

We can configure different naming systems in Embark. In this guide we’ll explore how this is done using the Ethereum Name Service.

\n

Configuration basics

Embark checks our configuration in config/namesystem.js by default. A naming system configuration isn’t crucial to run Embark, so this only needs to be enabled when planing to use a naming system.

\n

When using ENS as our provider, we can set the register section to pre-register sub-domains. This feature is only available in the development environment:

\n
module.exports = {
default: {
enabled: true,
available_providers: ['ens', 'ipns'],
provider: 'ens',
register: {
rootDomain: 'embark.eth',
subdomains: {
// List of subdomains.
// The key is the name (eg: status -> status.embark.eth)
// The value is the address to where the subdomain points
'status': '0x1a2f3b98e434c02363f3dac3174af93c1d690914'
}
}
}
};
\n","site":{"data":{"authors":{"iuri_matias":{"name":"Iuri Matias","twitter":"iurimatias","image":"https://pbs.twimg.com/profile_images/928272512181563392/iDJdvy2k_400x400.jpg"},"pascal_precht":{"name":"Pascal Precht","twitter":"pascalprecht","image":"https://pbs.twimg.com/profile_images/993785060733194241/p3oAIMDP_400x400.jpg"},"anthony_laibe":{"name":"Anthony Laibe","twitter":"a_laibe","image":"https://pbs.twimg.com/profile_images/257742900/13168239_400x400.jpg"},"jonathan_rainville":{"name":"Jonathan Rainville","twitter":"ShyolGhul","image":"https://pbs.twimg.com/profile_images/993873866878570496/-aE4byjj_400x400.jpg"},"andre_medeiros":{"name":"Andre Medeiros","twitter":"superdealloc","image":"https://pbs.twimg.com/profile_images/965722487735701504/m58KNgWN_400x400.jpg"},"eric_mastro":{"name":"Eric Mastro","twitter":"ericmastro","image":"https://avatars1.githubusercontent.com/u/5089238?s=460&v=4"},"michael_bradley":{"name":"Michael Bradley","image":"https://avatars3.githubusercontent.com/u/194260?s=460&v=4"},"richard_ramos":{"name":"Richard Ramos","twitter":"richardramos_me","image":"https://pbs.twimg.com/profile_images/1063160577973866496/aM313uHG_400x400.jpg"},"jonny_zerah":{"name":"Jonny Zerah","twitter":"jonnyzerah","image":"https://pbs.twimg.com/profile_images/1043774340490248192/gI9aGy17_400x400.jpg"},"robin_percy":{"name":"Robin Percy","twitter":"rbin","image":"https://avatars1.githubusercontent.com/u/29288325?s=400&v=4"}},"categories":{"tutorials":"Tutorials","announcements":"Announcements"},"languages":{"en":"English"},"plugins":[{"name":"embark-bamboo","description":"plugins_page.plugins.bamboo.desc","link":"https://www.npmjs.com/package/embark-bamboo","thumbnail":"bamboo.png","tags":["language","smart-contracts"]},{"name":"embark-solc","description":"plugins_page.plugins.solc.desc","link":"https://www.npmjs.com/package/embark-solc","thumbnail":"solidity.png","tags":["solidity","language","smart-contracts"]},{"name":"embark-solium","description":"plugins_page.plugins.solium.desc","link":"https://www.npmjs.com/package/embark-solium","thumbnail":"solium.png","tags":["linter","solidity","solium"]},{"name":"embark-etherscan-verifier","description":"plugins_page.plugins.verifier.desc","link":"https://www.npmjs.com/package/embark-etherscan-verifier","tags":["solidity","etherscan","smart-contracts"]},{"name":"embark-status","description":"plugins_page.plugins.status.desc","link":"https://www.npmjs.com/package/embark-status-plugin","thumbnail":"status.png","tags":["status","mobile"]},{"name":"embark-remix","description":"plugins_page.plugins.remix.desc","link":"https://www.npmjs.com/package/embark-remix","thumbnail":"remix.png","tags":["remix","debugger"]},{"name":"embark-slither","description":"plugins_page.plugins.slither.desc","link":"https://www.npmjs.com/package/embark-slither","tags":["solidity"]},{"name":"embark-snark","description":"plugins_page.plugins.snark.desc","link":"https://www.npmjs.com/package/embark-snark","tags":["snark"]},{"name":"embark-fortune","description":"plugins_page.plugins.fortune.desc","link":"https://www.npmjs.com/package/embark-fortune","thumbnail":"fortune.jpg","tags":["fun"]},{"name":"embark-pug","description":"plugins_page.plugins.pug.desc","link":"https://www.npmjs.com/package/embark-pug","legacy":true,"thumbnail":"pug.png","tags":["pug","jade","templates"]},{"name":"embark-haml","description":"plugins_page.plugins.haml.desc","link":"https://www.npmjs.com/package/embark-haml","legacy":true,"thumbnail":"haml.png","tags":["haml","templates"]},{"name":"embark-mythx","description":"plugins_page.plugins.mythx.desc","link":"https://www.npmjs.com/package/embark-mythx","thumbnail":"mythx.png","tags":["mythx","smart-contracts"]}],"menu":{"docs":"/docs/","plugins":"/plugins/","chat":"/chat/","blog":"/news/"},"sidebar":{"docs":{"getting_started":{"overview":"overview.html","installation":"installation.html","faq":"faq.html"},"general_usage":{"creating_project":"create_project.html","structure":"structure.html","running_apps":"running_apps.html","dashboard":"dashboard.html","using_the_console":"using_the_console.html","environments":"environments.html","configuration":"configuration.html","pipeline_and_webpack":"pipeline_and_webpack.html","javascript_usage":"javascript_usage.html"},"smart_contracts":{"contracts_configuration":"contracts_configuration.html","contracts_deployment":"contracts_deployment.html","contracts_imports":"contracts_imports.html","contracts_testing":"contracts_testing.html","contracts_javascript":"contracts_javascript.html"},"blockchain_node":{"blockchain_configuration":"blockchain_configuration.html","blockchain_accounts_configuration":"blockchain_accounts_configuration.html"},"storage":{"storage_configuration":"storage_configuration.html","storage_deployment":"storage_deployment.html","storage_javascript":"storage_javascript.html"},"messages":{"messages_configuration":"messages_configuration.html","messages_javascript":"messages_javascript.html"},"naming":{"naming_configuration":"naming_configuration.html","naming_javascript":"naming_javascript.html"},"plugins":{"installing_a_plugin":"installing_plugins.html","creating_a_plugin":"creating_plugins.html","plugin_reference":"plugin_reference.html"},"cockpit":{"cockpit_introduction":"cockpit_introduction.html","cockpit_dashboard":"cockpit_dashboard.html","cockpit_deployment":"cockpit_deployment.html","cockpit_explorer":"cockpit_explorer.html","cockpit_editor":"cockpit_editor.html","cockpit_debugger":"cockpit_debugger.html"},"reference":{"embark_commands":"embark_commands.html"},"miscellaneous":{"migrating_from_3":"migrating_from_3.x.html","troubleshooting":"troubleshooting.html","contributing":"contributing.html"}}},"templates":[{"name":"Vyper Template","description":"Template to demonstrate the use of the Vyper contracts","install":"embark new AppName --template vyper","thumbnail":"vyper.png","link":"https://github.com/embarklabs/embark-vyper-template","tags":["vyper","contracts"]},{"name":"Embark Demo React Template","description":"A React Application showcasing Embark's functionality","install":"embark demo","thumbnail":"react.png","link":"https://embark.embarklabs.io/docs/create_project.html#Creating-a-Demo-Project","tags":["react","contracts","whisper","ipfs"]},{"name":"Typescript Template","description":"Template with Typescript support pre-configured","thumbnail":"typescript.png","install":"embark new AppName --template typescript","link":"https://github.com/embarklabs/embark-typescript-template","tags":["typescript","frontend"]},{"name":"Vue.js Template","description":"Ready to use Template for using Embark with vue.js","thumbnail":"vuejs.png","install":"embark new AppName --template vue","link":"https://github.com/embarklabs/embark-vue-template","tags":["vue.js","frontend"]},{"name":"ethvtx Template","description":"Demo app for ethvtx, an Ethereum-Ready & Framework-Agnostic Redux configuration","thumbnail":"vortex.png","install":"embark new AppName --template Horyus/ethvtx_embark","link":"https://github.com/Horyus/ethvtx_embark","tags":["react"]},{"name":"Bamboo Template","description":"Template to demonstrate use of the Bamboo contracts","install":"embark new AppName --template bamboo","thumbnail":"bamboo.png","link":"https://github.com/embarklabs/embark-bamboo-template","tags":["bamboo","contracts"]},{"name":"Solidity Gas Golfing","description":"Boilerplate and tests for the first Solidity Gas Golfing Contest","thumbnail":"sggc.png","install":"embark new AppName --template embarklabs/sggc","link":"https://github.com/embarklabs/sggc","tags":["solidity","tests","fun"]}],"tutorials":[{"name":"How to create a Token Factory with Ethereum — Part 1","description":"Create and Deploy a Token with Ethereum","link":"/tutorials/token_factory_1.html","tags":["token","ethereum"]},{"name":"How to create a Token Factory with Ethereum — Part 2","description":"Create a DApp that can deploy Tokens on the fly","link":"/tutorials/token_factory_2.html","tags":["token","ethereum","client-side-deployment"]},{"name":"How to deploy to a testnet with Infura","description":"Deploy and interact with your Dapp on a testnet with the use of Infura","link":"/tutorials/infura_guide.html","tags":["ethereum","deployment","testnet"]}],"versions":{"latest":{"label":"stable (v4)","url":"https://embark.embarklabs.io/docs"},"3.2":{"label":"v3.2","url":"https://5ca4e0fdb29712000adde37f--embark-site-versions.netlify.com/docs/"}}}},"excerpt":"","more":"

We can configure different naming systems in Embark. In this guide we’ll explore how this is done using the Ethereum Name Service.

\n

Configuration basics

Embark checks our configuration in config/namesystem.js by default. A naming system configuration isn’t crucial to run Embark, so this only needs to be enabled when planing to use a naming system.

\n

When using ENS as our provider, we can set the register section to pre-register sub-domains. This feature is only available in the development environment:

\n
module.exports = {
default: {
enabled: true,
available_providers: ['ens', 'ipns'],
provider: 'ens',
register: {
rootDomain: 'embark.eth',
subdomains: {
// List of subdomains.
// The key is the name (eg: status -> status.embark.eth)
// The value is the address to where the subdomain points
'status': '0x1a2f3b98e434c02363f3dac3174af93c1d690914'
}
}
}
};
\n"},{"title":"Naming System (ENS) in JavaScript","layout":"docs","_content":"\nIn order to improve the user experience of decentralized applications that deal with smart contracts or Ethereum addresses in general, it's a good practice to take advantage of the [Ethereum Name Service](https://ens.domains/) and its registered, human-readable names. Embark provides APIs to either resolve a given domain to its corresponding address, or lookup a registered name by a given address.\n\nLet's take a look at how this is done.\n\n## Resolving a Domain to an address\n\nResolving a domain to its corresponding address is done by calling `EmbarkJS.Names.resolve()`, which takes the domain in question as first argument and a callback function that has access to the resolved address as a second argument:\n\n```\nEmbarkJS.Names.resolve('ethereum.eth', (err, result) => {\n console.log('ENS address', result)\n});\n```\n\nIf you prefer using Promises, Embark has got you covered! `EmbarkJS.Names.resolve()` returns a promise that resolves with the corresponding address, or an error message in case the given domain doesn't resolve to an address:\n\n```\nEmbarkJS.Names.resolve(\"ethereum.eth\").then(address => {\n console.log(\"the address for ethereum.eth is: \" + address);\n})\n```\n\n## Reverse resolve an ENS domain\n\nSimilar to resolving addresses, looking up domains is really just a matter of calling `EmbarkJS.Names.lookup`, which takes an address as argument. Just like `EmbarkJS.Names.resolve`, a callback can be used to get notified whether the lookup was successful or not:\n\n```\nEmbarkJS.Names.lookup(\"0xfb6916095ca1df60bb79ce92ce3ea74c37c5d359\", (err, name) => {\n console.log(\"the domain is: \" + name);\n})\n```\n\nGuess what, `EmbarkJS.Names.lookup()` also returns a Promise in case you prefer using those over callbacks:\n\n```\nEmbarkJS.Names.lookup(\"0xfb6916095ca1df60bb79ce92ce3ea74c37c5d359\").then(name => {\n console.log(\"the domain is: \" + name);\n})\n```\n\n## Registering a subdomain\n\nThis enables you to register some others sub-domains. This is mostly for demo purposes as it is only available in development.\n\n```\nEmbarkJS.Names.registerSubDomain('newsubdomain', '0x4a17f35f0a9927fb4141aa91cbbc72c1b31598de', (err, transaction) => {\n console.log(`Successfully registered with ${transaction.gasUsed} gas`);\n});\n```\n","source":"docs/naming_javascript.md","raw":"title: Naming System (ENS) in JavaScript\nlayout: docs\n---\n\nIn order to improve the user experience of decentralized applications that deal with smart contracts or Ethereum addresses in general, it's a good practice to take advantage of the [Ethereum Name Service](https://ens.domains/) and its registered, human-readable names. Embark provides APIs to either resolve a given domain to its corresponding address, or lookup a registered name by a given address.\n\nLet's take a look at how this is done.\n\n## Resolving a Domain to an address\n\nResolving a domain to its corresponding address is done by calling `EmbarkJS.Names.resolve()`, which takes the domain in question as first argument and a callback function that has access to the resolved address as a second argument:\n\n```\nEmbarkJS.Names.resolve('ethereum.eth', (err, result) => {\n console.log('ENS address', result)\n});\n```\n\nIf you prefer using Promises, Embark has got you covered! `EmbarkJS.Names.resolve()` returns a promise that resolves with the corresponding address, or an error message in case the given domain doesn't resolve to an address:\n\n```\nEmbarkJS.Names.resolve(\"ethereum.eth\").then(address => {\n console.log(\"the address for ethereum.eth is: \" + address);\n})\n```\n\n## Reverse resolve an ENS domain\n\nSimilar to resolving addresses, looking up domains is really just a matter of calling `EmbarkJS.Names.lookup`, which takes an address as argument. Just like `EmbarkJS.Names.resolve`, a callback can be used to get notified whether the lookup was successful or not:\n\n```\nEmbarkJS.Names.lookup(\"0xfb6916095ca1df60bb79ce92ce3ea74c37c5d359\", (err, name) => {\n console.log(\"the domain is: \" + name);\n})\n```\n\nGuess what, `EmbarkJS.Names.lookup()` also returns a Promise in case you prefer using those over callbacks:\n\n```\nEmbarkJS.Names.lookup(\"0xfb6916095ca1df60bb79ce92ce3ea74c37c5d359\").then(name => {\n console.log(\"the domain is: \" + name);\n})\n```\n\n## Registering a subdomain\n\nThis enables you to register some others sub-domains. This is mostly for demo purposes as it is only available in development.\n\n```\nEmbarkJS.Names.registerSubDomain('newsubdomain', '0x4a17f35f0a9927fb4141aa91cbbc72c1b31598de', (err, transaction) => {\n console.log(`Successfully registered with ${transaction.gasUsed} gas`);\n});\n```\n","date":"2020-01-17T19:00:03.900Z","updated":"2020-01-17T19:00:03.900Z","path":"docs/naming_javascript.html","comments":1,"_id":"ck5ijm3rr001f7hegcvbhgqxy","content":"

In order to improve the user experience of decentralized applications that deal with smart contracts or Ethereum addresses in general, it’s a good practice to take advantage of the Ethereum Name Service and its registered, human-readable names. Embark provides APIs to either resolve a given domain to its corresponding address, or lookup a registered name by a given address.

\n

Let’s take a look at how this is done.

\n

Resolving a Domain to an address

Resolving a domain to its corresponding address is done by calling EmbarkJS.Names.resolve(), which takes the domain in question as first argument and a callback function that has access to the resolved address as a second argument:

\n
EmbarkJS.Names.resolve('ethereum.eth', (err, result) => {
console.log('ENS address', result)
});
\n\n

If you prefer using Promises, Embark has got you covered! EmbarkJS.Names.resolve() returns a promise that resolves with the corresponding address, or an error message in case the given domain doesn’t resolve to an address:

\n
EmbarkJS.Names.resolve("ethereum.eth").then(address => {
console.log("the address for ethereum.eth is: " + address);
})
\n\n

Reverse resolve an ENS domain

Similar to resolving addresses, looking up domains is really just a matter of calling EmbarkJS.Names.lookup, which takes an address as argument. Just like EmbarkJS.Names.resolve, a callback can be used to get notified whether the lookup was successful or not:

\n
EmbarkJS.Names.lookup("0xfb6916095ca1df60bb79ce92ce3ea74c37c5d359", (err, name) => {
console.log("the domain is: " + name);
})
\n\n

Guess what, EmbarkJS.Names.lookup() also returns a Promise in case you prefer using those over callbacks:

\n
EmbarkJS.Names.lookup("0xfb6916095ca1df60bb79ce92ce3ea74c37c5d359").then(name => {
console.log("the domain is: " + name);
})
\n\n

Registering a subdomain

This enables you to register some others sub-domains. This is mostly for demo purposes as it is only available in development.

\n
EmbarkJS.Names.registerSubDomain('newsubdomain', '0x4a17f35f0a9927fb4141aa91cbbc72c1b31598de', (err, transaction) => {
console.log(`Successfully registered with ${transaction.gasUsed} gas`);
});
\n","site":{"data":{"authors":{"iuri_matias":{"name":"Iuri Matias","twitter":"iurimatias","image":"https://pbs.twimg.com/profile_images/928272512181563392/iDJdvy2k_400x400.jpg"},"pascal_precht":{"name":"Pascal Precht","twitter":"pascalprecht","image":"https://pbs.twimg.com/profile_images/993785060733194241/p3oAIMDP_400x400.jpg"},"anthony_laibe":{"name":"Anthony Laibe","twitter":"a_laibe","image":"https://pbs.twimg.com/profile_images/257742900/13168239_400x400.jpg"},"jonathan_rainville":{"name":"Jonathan Rainville","twitter":"ShyolGhul","image":"https://pbs.twimg.com/profile_images/993873866878570496/-aE4byjj_400x400.jpg"},"andre_medeiros":{"name":"Andre Medeiros","twitter":"superdealloc","image":"https://pbs.twimg.com/profile_images/965722487735701504/m58KNgWN_400x400.jpg"},"eric_mastro":{"name":"Eric Mastro","twitter":"ericmastro","image":"https://avatars1.githubusercontent.com/u/5089238?s=460&v=4"},"michael_bradley":{"name":"Michael Bradley","image":"https://avatars3.githubusercontent.com/u/194260?s=460&v=4"},"richard_ramos":{"name":"Richard Ramos","twitter":"richardramos_me","image":"https://pbs.twimg.com/profile_images/1063160577973866496/aM313uHG_400x400.jpg"},"jonny_zerah":{"name":"Jonny Zerah","twitter":"jonnyzerah","image":"https://pbs.twimg.com/profile_images/1043774340490248192/gI9aGy17_400x400.jpg"},"robin_percy":{"name":"Robin Percy","twitter":"rbin","image":"https://avatars1.githubusercontent.com/u/29288325?s=400&v=4"}},"categories":{"tutorials":"Tutorials","announcements":"Announcements"},"languages":{"en":"English"},"plugins":[{"name":"embark-bamboo","description":"plugins_page.plugins.bamboo.desc","link":"https://www.npmjs.com/package/embark-bamboo","thumbnail":"bamboo.png","tags":["language","smart-contracts"]},{"name":"embark-solc","description":"plugins_page.plugins.solc.desc","link":"https://www.npmjs.com/package/embark-solc","thumbnail":"solidity.png","tags":["solidity","language","smart-contracts"]},{"name":"embark-solium","description":"plugins_page.plugins.solium.desc","link":"https://www.npmjs.com/package/embark-solium","thumbnail":"solium.png","tags":["linter","solidity","solium"]},{"name":"embark-etherscan-verifier","description":"plugins_page.plugins.verifier.desc","link":"https://www.npmjs.com/package/embark-etherscan-verifier","tags":["solidity","etherscan","smart-contracts"]},{"name":"embark-status","description":"plugins_page.plugins.status.desc","link":"https://www.npmjs.com/package/embark-status-plugin","thumbnail":"status.png","tags":["status","mobile"]},{"name":"embark-remix","description":"plugins_page.plugins.remix.desc","link":"https://www.npmjs.com/package/embark-remix","thumbnail":"remix.png","tags":["remix","debugger"]},{"name":"embark-slither","description":"plugins_page.plugins.slither.desc","link":"https://www.npmjs.com/package/embark-slither","tags":["solidity"]},{"name":"embark-snark","description":"plugins_page.plugins.snark.desc","link":"https://www.npmjs.com/package/embark-snark","tags":["snark"]},{"name":"embark-fortune","description":"plugins_page.plugins.fortune.desc","link":"https://www.npmjs.com/package/embark-fortune","thumbnail":"fortune.jpg","tags":["fun"]},{"name":"embark-pug","description":"plugins_page.plugins.pug.desc","link":"https://www.npmjs.com/package/embark-pug","legacy":true,"thumbnail":"pug.png","tags":["pug","jade","templates"]},{"name":"embark-haml","description":"plugins_page.plugins.haml.desc","link":"https://www.npmjs.com/package/embark-haml","legacy":true,"thumbnail":"haml.png","tags":["haml","templates"]},{"name":"embark-mythx","description":"plugins_page.plugins.mythx.desc","link":"https://www.npmjs.com/package/embark-mythx","thumbnail":"mythx.png","tags":["mythx","smart-contracts"]}],"menu":{"docs":"/docs/","plugins":"/plugins/","chat":"/chat/","blog":"/news/"},"sidebar":{"docs":{"getting_started":{"overview":"overview.html","installation":"installation.html","faq":"faq.html"},"general_usage":{"creating_project":"create_project.html","structure":"structure.html","running_apps":"running_apps.html","dashboard":"dashboard.html","using_the_console":"using_the_console.html","environments":"environments.html","configuration":"configuration.html","pipeline_and_webpack":"pipeline_and_webpack.html","javascript_usage":"javascript_usage.html"},"smart_contracts":{"contracts_configuration":"contracts_configuration.html","contracts_deployment":"contracts_deployment.html","contracts_imports":"contracts_imports.html","contracts_testing":"contracts_testing.html","contracts_javascript":"contracts_javascript.html"},"blockchain_node":{"blockchain_configuration":"blockchain_configuration.html","blockchain_accounts_configuration":"blockchain_accounts_configuration.html"},"storage":{"storage_configuration":"storage_configuration.html","storage_deployment":"storage_deployment.html","storage_javascript":"storage_javascript.html"},"messages":{"messages_configuration":"messages_configuration.html","messages_javascript":"messages_javascript.html"},"naming":{"naming_configuration":"naming_configuration.html","naming_javascript":"naming_javascript.html"},"plugins":{"installing_a_plugin":"installing_plugins.html","creating_a_plugin":"creating_plugins.html","plugin_reference":"plugin_reference.html"},"cockpit":{"cockpit_introduction":"cockpit_introduction.html","cockpit_dashboard":"cockpit_dashboard.html","cockpit_deployment":"cockpit_deployment.html","cockpit_explorer":"cockpit_explorer.html","cockpit_editor":"cockpit_editor.html","cockpit_debugger":"cockpit_debugger.html"},"reference":{"embark_commands":"embark_commands.html"},"miscellaneous":{"migrating_from_3":"migrating_from_3.x.html","troubleshooting":"troubleshooting.html","contributing":"contributing.html"}}},"templates":[{"name":"Vyper Template","description":"Template to demonstrate the use of the Vyper contracts","install":"embark new AppName --template vyper","thumbnail":"vyper.png","link":"https://github.com/embarklabs/embark-vyper-template","tags":["vyper","contracts"]},{"name":"Embark Demo React Template","description":"A React Application showcasing Embark's functionality","install":"embark demo","thumbnail":"react.png","link":"https://embark.embarklabs.io/docs/create_project.html#Creating-a-Demo-Project","tags":["react","contracts","whisper","ipfs"]},{"name":"Typescript Template","description":"Template with Typescript support pre-configured","thumbnail":"typescript.png","install":"embark new AppName --template typescript","link":"https://github.com/embarklabs/embark-typescript-template","tags":["typescript","frontend"]},{"name":"Vue.js Template","description":"Ready to use Template for using Embark with vue.js","thumbnail":"vuejs.png","install":"embark new AppName --template vue","link":"https://github.com/embarklabs/embark-vue-template","tags":["vue.js","frontend"]},{"name":"ethvtx Template","description":"Demo app for ethvtx, an Ethereum-Ready & Framework-Agnostic Redux configuration","thumbnail":"vortex.png","install":"embark new AppName --template Horyus/ethvtx_embark","link":"https://github.com/Horyus/ethvtx_embark","tags":["react"]},{"name":"Bamboo Template","description":"Template to demonstrate use of the Bamboo contracts","install":"embark new AppName --template bamboo","thumbnail":"bamboo.png","link":"https://github.com/embarklabs/embark-bamboo-template","tags":["bamboo","contracts"]},{"name":"Solidity Gas Golfing","description":"Boilerplate and tests for the first Solidity Gas Golfing Contest","thumbnail":"sggc.png","install":"embark new AppName --template embarklabs/sggc","link":"https://github.com/embarklabs/sggc","tags":["solidity","tests","fun"]}],"tutorials":[{"name":"How to create a Token Factory with Ethereum — Part 1","description":"Create and Deploy a Token with Ethereum","link":"/tutorials/token_factory_1.html","tags":["token","ethereum"]},{"name":"How to create a Token Factory with Ethereum — Part 2","description":"Create a DApp that can deploy Tokens on the fly","link":"/tutorials/token_factory_2.html","tags":["token","ethereum","client-side-deployment"]},{"name":"How to deploy to a testnet with Infura","description":"Deploy and interact with your Dapp on a testnet with the use of Infura","link":"/tutorials/infura_guide.html","tags":["ethereum","deployment","testnet"]}],"versions":{"latest":{"label":"stable (v4)","url":"https://embark.embarklabs.io/docs"},"3.2":{"label":"v3.2","url":"https://5ca4e0fdb29712000adde37f--embark-site-versions.netlify.com/docs/"}}}},"excerpt":"","more":"

In order to improve the user experience of decentralized applications that deal with smart contracts or Ethereum addresses in general, it’s a good practice to take advantage of the Ethereum Name Service and its registered, human-readable names. Embark provides APIs to either resolve a given domain to its corresponding address, or lookup a registered name by a given address.

\n

Let’s take a look at how this is done.

\n

Resolving a Domain to an address

Resolving a domain to its corresponding address is done by calling EmbarkJS.Names.resolve(), which takes the domain in question as first argument and a callback function that has access to the resolved address as a second argument:

\n
EmbarkJS.Names.resolve('ethereum.eth', (err, result) => {
console.log('ENS address', result)
});
\n\n

If you prefer using Promises, Embark has got you covered! EmbarkJS.Names.resolve() returns a promise that resolves with the corresponding address, or an error message in case the given domain doesn’t resolve to an address:

\n
EmbarkJS.Names.resolve("ethereum.eth").then(address => {
console.log("the address for ethereum.eth is: " + address);
})
\n\n

Reverse resolve an ENS domain

Similar to resolving addresses, looking up domains is really just a matter of calling EmbarkJS.Names.lookup, which takes an address as argument. Just like EmbarkJS.Names.resolve, a callback can be used to get notified whether the lookup was successful or not:

\n
EmbarkJS.Names.lookup("0xfb6916095ca1df60bb79ce92ce3ea74c37c5d359", (err, name) => {
console.log("the domain is: " + name);
})
\n\n

Guess what, EmbarkJS.Names.lookup() also returns a Promise in case you prefer using those over callbacks:

\n
EmbarkJS.Names.lookup("0xfb6916095ca1df60bb79ce92ce3ea74c37c5d359").then(name => {
console.log("the domain is: " + name);
})
\n\n

Registering a subdomain

This enables you to register some others sub-domains. This is mostly for demo purposes as it is only available in development.

\n
EmbarkJS.Names.registerSubDomain('newsubdomain', '0x4a17f35f0a9927fb4141aa91cbbc72c1b31598de', (err, transaction) => {
console.log(`Successfully registered with ${transaction.gasUsed} gas`);
});
\n"},{"title":"Getting Started","layout":"docs","_content":"Welcome to the Embark documentation! The following guides will help you guiding your way through your journey of building decentralized applications. If you encounter any problems when using Embark, or find anything unclear described here, please have a look at the [troubleshooting guide](troubleshooting.html), raise an issue on [GitHub](https://github.com/embarklabs/embark/issues) or ask in the [Gitter Chatroom](https://gitter.im/embark-framework/Lobby) respectively.\n\n{% notification info 'Migrating from 3.2.x' %}\nIf you're planning to upgrade your Embark 3.2.x application to 4.x, head over to our [Migration Guide](/docs/migrating_from_3.x.html).\n{% endnotification %}\n## What is Embark?\n\nEmbark is a fast, easy to use, and powerful developer environment to build and deploy decentralized applications, also known as \"DApps\". It integrates with [Ethereum](https://ethereum.org/) blockchains, decentralized storages like [IPFS](https://ipfs.io) and [Swarm](https://swarm-guide.readthedocs.io/en/latest/introduction.html), and decentralized communication platforms like [Whisper](https://github.com/ethereum/wiki/wiki/Whisper).\n\nEmbark's goal is to make building decentralized applications as easy as possible, by providing all the tools needed and staying extensible at the same time.\n\nSome of Embark's features, but not all of them, are:\n\n* **Automatic Smart Contract deployment** - Embark takes care of deploying your Smart Contracts as well as redeploying them as you make changes to your code. [Learn more](/docs/contracts_configuration.html)\n* **Client development** - Build your application with the framework of your choice right within Embark.\n* **Testing** - Test your applications and Smart Contracts through Web3 in JavaScript. [Learn More](/docs/contracts_testing.html)\n* **Decentralized app distribution** - Embark integrates with decentralized storages like IPFS and helps you distributing your app in the network. [Learn more](/docs/storage_configuration.html)\n* **Peer-to-peer messaging** - Send and receive messages via communication protocols like Whisper. [Learn more](/docs/messages_configuration.html)\n* **Cockpit** - An companion application to make developing and debugging decentralized applications a breeze. [Learn more](/docs/cockpit_introduction.html)\n\nThere's so much more, but let's take it one step at a time. Make sure to check out our other guides in case you're looking for a particular feature.\n\nIf you haven't yet, this is a good time to [install Embark](installation.html) on your machine. Read on for more information!\n\n\n","source":"docs/overview.md","raw":"title: Getting Started\nlayout: docs\n---\nWelcome to the Embark documentation! The following guides will help you guiding your way through your journey of building decentralized applications. If you encounter any problems when using Embark, or find anything unclear described here, please have a look at the [troubleshooting guide](troubleshooting.html), raise an issue on [GitHub](https://github.com/embarklabs/embark/issues) or ask in the [Gitter Chatroom](https://gitter.im/embark-framework/Lobby) respectively.\n\n{% notification info 'Migrating from 3.2.x' %}\nIf you're planning to upgrade your Embark 3.2.x application to 4.x, head over to our [Migration Guide](/docs/migrating_from_3.x.html).\n{% endnotification %}\n## What is Embark?\n\nEmbark is a fast, easy to use, and powerful developer environment to build and deploy decentralized applications, also known as \"DApps\". It integrates with [Ethereum](https://ethereum.org/) blockchains, decentralized storages like [IPFS](https://ipfs.io) and [Swarm](https://swarm-guide.readthedocs.io/en/latest/introduction.html), and decentralized communication platforms like [Whisper](https://github.com/ethereum/wiki/wiki/Whisper).\n\nEmbark's goal is to make building decentralized applications as easy as possible, by providing all the tools needed and staying extensible at the same time.\n\nSome of Embark's features, but not all of them, are:\n\n* **Automatic Smart Contract deployment** - Embark takes care of deploying your Smart Contracts as well as redeploying them as you make changes to your code. [Learn more](/docs/contracts_configuration.html)\n* **Client development** - Build your application with the framework of your choice right within Embark.\n* **Testing** - Test your applications and Smart Contracts through Web3 in JavaScript. [Learn More](/docs/contracts_testing.html)\n* **Decentralized app distribution** - Embark integrates with decentralized storages like IPFS and helps you distributing your app in the network. [Learn more](/docs/storage_configuration.html)\n* **Peer-to-peer messaging** - Send and receive messages via communication protocols like Whisper. [Learn more](/docs/messages_configuration.html)\n* **Cockpit** - An companion application to make developing and debugging decentralized applications a breeze. [Learn more](/docs/cockpit_introduction.html)\n\nThere's so much more, but let's take it one step at a time. Make sure to check out our other guides in case you're looking for a particular feature.\n\nIf you haven't yet, this is a good time to [install Embark](installation.html) on your machine. Read on for more information!\n\n\n","date":"2020-01-19T20:56:53.012Z","updated":"2020-01-19T20:56:53.012Z","path":"docs/overview.html","_id":"ck5ijm3rs001g7hegemr1hvpm","comments":1,"content":"

Welcome to the Embark documentation! The following guides will help you guiding your way through your journey of building decentralized applications. If you encounter any problems when using Embark, or find anything unclear described here, please have a look at the troubleshooting guide, raise an issue on GitHub or ask in the Gitter Chatroom respectively.

\n
\n

Migrating from 3.2.x

\n

If you’re planning to upgrade your Embark 3.2.x application to 4.x, head over to our Migration Guide.

\n

\n
\n\n\n

What is Embark?

Embark is a fast, easy to use, and powerful developer environment to build and deploy decentralized applications, also known as “DApps”. It integrates with Ethereum blockchains, decentralized storages like IPFS and Swarm, and decentralized communication platforms like Whisper.

\n

Embark’s goal is to make building decentralized applications as easy as possible, by providing all the tools needed and staying extensible at the same time.

\n

Some of Embark’s features, but not all of them, are:

\n
    \n
  • Automatic Smart Contract deployment - Embark takes care of deploying your Smart Contracts as well as redeploying them as you make changes to your code. Learn more
  • \n
  • Client development - Build your application with the framework of your choice right within Embark.
  • \n
  • Testing - Test your applications and Smart Contracts through Web3 in JavaScript. Learn More
  • \n
  • Decentralized app distribution - Embark integrates with decentralized storages like IPFS and helps you distributing your app in the network. Learn more
  • \n
  • Peer-to-peer messaging - Send and receive messages via communication protocols like Whisper. Learn more
  • \n
  • Cockpit - An companion application to make developing and debugging decentralized applications a breeze. Learn more
  • \n
\n

There’s so much more, but let’s take it one step at a time. Make sure to check out our other guides in case you’re looking for a particular feature.

\n

If you haven’t yet, this is a good time to install Embark on your machine. Read on for more information!

\n","site":{"data":{"authors":{"iuri_matias":{"name":"Iuri Matias","twitter":"iurimatias","image":"https://pbs.twimg.com/profile_images/928272512181563392/iDJdvy2k_400x400.jpg"},"pascal_precht":{"name":"Pascal Precht","twitter":"pascalprecht","image":"https://pbs.twimg.com/profile_images/993785060733194241/p3oAIMDP_400x400.jpg"},"anthony_laibe":{"name":"Anthony Laibe","twitter":"a_laibe","image":"https://pbs.twimg.com/profile_images/257742900/13168239_400x400.jpg"},"jonathan_rainville":{"name":"Jonathan Rainville","twitter":"ShyolGhul","image":"https://pbs.twimg.com/profile_images/993873866878570496/-aE4byjj_400x400.jpg"},"andre_medeiros":{"name":"Andre Medeiros","twitter":"superdealloc","image":"https://pbs.twimg.com/profile_images/965722487735701504/m58KNgWN_400x400.jpg"},"eric_mastro":{"name":"Eric Mastro","twitter":"ericmastro","image":"https://avatars1.githubusercontent.com/u/5089238?s=460&v=4"},"michael_bradley":{"name":"Michael Bradley","image":"https://avatars3.githubusercontent.com/u/194260?s=460&v=4"},"richard_ramos":{"name":"Richard Ramos","twitter":"richardramos_me","image":"https://pbs.twimg.com/profile_images/1063160577973866496/aM313uHG_400x400.jpg"},"jonny_zerah":{"name":"Jonny Zerah","twitter":"jonnyzerah","image":"https://pbs.twimg.com/profile_images/1043774340490248192/gI9aGy17_400x400.jpg"},"robin_percy":{"name":"Robin Percy","twitter":"rbin","image":"https://avatars1.githubusercontent.com/u/29288325?s=400&v=4"}},"categories":{"tutorials":"Tutorials","announcements":"Announcements"},"languages":{"en":"English"},"plugins":[{"name":"embark-bamboo","description":"plugins_page.plugins.bamboo.desc","link":"https://www.npmjs.com/package/embark-bamboo","thumbnail":"bamboo.png","tags":["language","smart-contracts"]},{"name":"embark-solc","description":"plugins_page.plugins.solc.desc","link":"https://www.npmjs.com/package/embark-solc","thumbnail":"solidity.png","tags":["solidity","language","smart-contracts"]},{"name":"embark-solium","description":"plugins_page.plugins.solium.desc","link":"https://www.npmjs.com/package/embark-solium","thumbnail":"solium.png","tags":["linter","solidity","solium"]},{"name":"embark-etherscan-verifier","description":"plugins_page.plugins.verifier.desc","link":"https://www.npmjs.com/package/embark-etherscan-verifier","tags":["solidity","etherscan","smart-contracts"]},{"name":"embark-status","description":"plugins_page.plugins.status.desc","link":"https://www.npmjs.com/package/embark-status-plugin","thumbnail":"status.png","tags":["status","mobile"]},{"name":"embark-remix","description":"plugins_page.plugins.remix.desc","link":"https://www.npmjs.com/package/embark-remix","thumbnail":"remix.png","tags":["remix","debugger"]},{"name":"embark-slither","description":"plugins_page.plugins.slither.desc","link":"https://www.npmjs.com/package/embark-slither","tags":["solidity"]},{"name":"embark-snark","description":"plugins_page.plugins.snark.desc","link":"https://www.npmjs.com/package/embark-snark","tags":["snark"]},{"name":"embark-fortune","description":"plugins_page.plugins.fortune.desc","link":"https://www.npmjs.com/package/embark-fortune","thumbnail":"fortune.jpg","tags":["fun"]},{"name":"embark-pug","description":"plugins_page.plugins.pug.desc","link":"https://www.npmjs.com/package/embark-pug","legacy":true,"thumbnail":"pug.png","tags":["pug","jade","templates"]},{"name":"embark-haml","description":"plugins_page.plugins.haml.desc","link":"https://www.npmjs.com/package/embark-haml","legacy":true,"thumbnail":"haml.png","tags":["haml","templates"]},{"name":"embark-mythx","description":"plugins_page.plugins.mythx.desc","link":"https://www.npmjs.com/package/embark-mythx","thumbnail":"mythx.png","tags":["mythx","smart-contracts"]}],"menu":{"docs":"/docs/","plugins":"/plugins/","chat":"/chat/","blog":"/news/"},"sidebar":{"docs":{"getting_started":{"overview":"overview.html","installation":"installation.html","faq":"faq.html"},"general_usage":{"creating_project":"create_project.html","structure":"structure.html","running_apps":"running_apps.html","dashboard":"dashboard.html","using_the_console":"using_the_console.html","environments":"environments.html","configuration":"configuration.html","pipeline_and_webpack":"pipeline_and_webpack.html","javascript_usage":"javascript_usage.html"},"smart_contracts":{"contracts_configuration":"contracts_configuration.html","contracts_deployment":"contracts_deployment.html","contracts_imports":"contracts_imports.html","contracts_testing":"contracts_testing.html","contracts_javascript":"contracts_javascript.html"},"blockchain_node":{"blockchain_configuration":"blockchain_configuration.html","blockchain_accounts_configuration":"blockchain_accounts_configuration.html"},"storage":{"storage_configuration":"storage_configuration.html","storage_deployment":"storage_deployment.html","storage_javascript":"storage_javascript.html"},"messages":{"messages_configuration":"messages_configuration.html","messages_javascript":"messages_javascript.html"},"naming":{"naming_configuration":"naming_configuration.html","naming_javascript":"naming_javascript.html"},"plugins":{"installing_a_plugin":"installing_plugins.html","creating_a_plugin":"creating_plugins.html","plugin_reference":"plugin_reference.html"},"cockpit":{"cockpit_introduction":"cockpit_introduction.html","cockpit_dashboard":"cockpit_dashboard.html","cockpit_deployment":"cockpit_deployment.html","cockpit_explorer":"cockpit_explorer.html","cockpit_editor":"cockpit_editor.html","cockpit_debugger":"cockpit_debugger.html"},"reference":{"embark_commands":"embark_commands.html"},"miscellaneous":{"migrating_from_3":"migrating_from_3.x.html","troubleshooting":"troubleshooting.html","contributing":"contributing.html"}}},"templates":[{"name":"Vyper Template","description":"Template to demonstrate the use of the Vyper contracts","install":"embark new AppName --template vyper","thumbnail":"vyper.png","link":"https://github.com/embarklabs/embark-vyper-template","tags":["vyper","contracts"]},{"name":"Embark Demo React Template","description":"A React Application showcasing Embark's functionality","install":"embark demo","thumbnail":"react.png","link":"https://embark.embarklabs.io/docs/create_project.html#Creating-a-Demo-Project","tags":["react","contracts","whisper","ipfs"]},{"name":"Typescript Template","description":"Template with Typescript support pre-configured","thumbnail":"typescript.png","install":"embark new AppName --template typescript","link":"https://github.com/embarklabs/embark-typescript-template","tags":["typescript","frontend"]},{"name":"Vue.js Template","description":"Ready to use Template for using Embark with vue.js","thumbnail":"vuejs.png","install":"embark new AppName --template vue","link":"https://github.com/embarklabs/embark-vue-template","tags":["vue.js","frontend"]},{"name":"ethvtx Template","description":"Demo app for ethvtx, an Ethereum-Ready & Framework-Agnostic Redux configuration","thumbnail":"vortex.png","install":"embark new AppName --template Horyus/ethvtx_embark","link":"https://github.com/Horyus/ethvtx_embark","tags":["react"]},{"name":"Bamboo Template","description":"Template to demonstrate use of the Bamboo contracts","install":"embark new AppName --template bamboo","thumbnail":"bamboo.png","link":"https://github.com/embarklabs/embark-bamboo-template","tags":["bamboo","contracts"]},{"name":"Solidity Gas Golfing","description":"Boilerplate and tests for the first Solidity Gas Golfing Contest","thumbnail":"sggc.png","install":"embark new AppName --template embarklabs/sggc","link":"https://github.com/embarklabs/sggc","tags":["solidity","tests","fun"]}],"tutorials":[{"name":"How to create a Token Factory with Ethereum — Part 1","description":"Create and Deploy a Token with Ethereum","link":"/tutorials/token_factory_1.html","tags":["token","ethereum"]},{"name":"How to create a Token Factory with Ethereum — Part 2","description":"Create a DApp that can deploy Tokens on the fly","link":"/tutorials/token_factory_2.html","tags":["token","ethereum","client-side-deployment"]},{"name":"How to deploy to a testnet with Infura","description":"Deploy and interact with your Dapp on a testnet with the use of Infura","link":"/tutorials/infura_guide.html","tags":["ethereum","deployment","testnet"]}],"versions":{"latest":{"label":"stable (v4)","url":"https://embark.embarklabs.io/docs"},"3.2":{"label":"v3.2","url":"https://5ca4e0fdb29712000adde37f--embark-site-versions.netlify.com/docs/"}}}},"excerpt":"","more":"

Welcome to the Embark documentation! The following guides will help you guiding your way through your journey of building decentralized applications. If you encounter any problems when using Embark, or find anything unclear described here, please have a look at the troubleshooting guide, raise an issue on GitHub or ask in the Gitter Chatroom respectively.

\n
\n

Migrating from 3.2.x

\n

If you’re planning to upgrade your Embark 3.2.x application to 4.x, head over to our Migration Guide.

\n

\n
\n\n\n

What is Embark?

Embark is a fast, easy to use, and powerful developer environment to build and deploy decentralized applications, also known as “DApps”. It integrates with Ethereum blockchains, decentralized storages like IPFS and Swarm, and decentralized communication platforms like Whisper.

\n

Embark’s goal is to make building decentralized applications as easy as possible, by providing all the tools needed and staying extensible at the same time.

\n

Some of Embark’s features, but not all of them, are:

\n
    \n
  • Automatic Smart Contract deployment - Embark takes care of deploying your Smart Contracts as well as redeploying them as you make changes to your code. Learn more
  • \n
  • Client development - Build your application with the framework of your choice right within Embark.
  • \n
  • Testing - Test your applications and Smart Contracts through Web3 in JavaScript. Learn More
  • \n
  • Decentralized app distribution - Embark integrates with decentralized storages like IPFS and helps you distributing your app in the network. Learn more
  • \n
  • Peer-to-peer messaging - Send and receive messages via communication protocols like Whisper. Learn more
  • \n
  • Cockpit - An companion application to make developing and debugging decentralized applications a breeze. Learn more
  • \n
\n

There’s so much more, but let’s take it one step at a time. Make sure to check out our other guides in case you’re looking for a particular feature.

\n

If you haven’t yet, this is a good time to install Embark on your machine. Read on for more information!

\n"},{"title":"Building & Asset Pipeline","layout":"docs","_content":"\nAs discussed in [Running Apps](running_apps.html#Using-the-run-command), Embark takes care of quite a few things developing applications, including compiling Smart Contracts, JavaScript and other assets. In this guide we'll learn how to take full advantage of Embark's flexibility to build our Smart Contracts or even replace the entire build pipeline for our application's assets.\n\n## Building your app\n\nEmbark's `build` command enables us to build our decentralized application and deploy it accordingly. Similar to `embark run`, it compiles our Smart Contracts, deploys them to a blockchain network that our app is connected to, processes our app's assets and uploads them to the configured decentralized storage (e.g. IPFS).\n\nBy default, `embark build` will use the `production` mode to build our application.\n\n```\n$ embark build\n```\n### Specifying a mode using `--pipeline`\n\n\nEmbark comes with two modes for building our application:\n\n* **development** - This mode is for development purposes and produces sourcemaps as well as unoptimized client-side code. Whenever we use `embark run` or `embark console`, this mode is used by default. Since this mode skips code optimizations, it's also the faster mode.\n* **production** - Unsurprisingly, this mode is used to create production artifacts of our application. It produces optimized code and therefore, takes longer to build. However, client-side code will be highly optimized, thus smaller in file size. This mode is the default for `embark build` and `embark upload` commands.\n\nWe can specify a mode using the `--pipeline` option. This is available for both, `embark run` and `embark build` commands:\n\n```\n$ embark build --pipeline development\n```\n\n## Compiling Smart Contracts only\n\nIf we're building a [Smart Contract only application](http://localhost:4000/docs/create_project.html#Creating-%E2%80%9Ccontracts-only%E2%80%9D-apps), or we're simply not interested in building the entire application and deploying it, but just want to compile our Smart Contracts, we can use the `build` command's `--contracts` option:\n\n```\n$ embark build --contracts\n```\n\n## Understanding the build pipeline\n\nEmbark uses [webpack](https://webpack.js.org/) to bundle and postprocess all kinds of assets of our decentralized application. This also includes things like:\n\n* ES2015+ syntax using Babel\n* Importing of CSS, SCSS, PNG, SVG & Fonts in JavaScript\n* Support for React & JSX\n* Automatic support for older browsers via Babel's preset-env (by default, Embark uses a browser list setting of `['last 1 version', 'not dead', '> 0.2%']`\n* Sourcemaps generation (when in development mode)\n* Minification and tree shaking (when in production mode)\n\n{% notification danger 'Deprecation warning:' %}\nSince Embark version 4.0.0 it's possible (and recommended) to use Embark in combination with other front-end tooling, such as Angular CLI, Vue CLI or Create React App, making Embark's own build pipeline obsolete.\n\nWhen using Embark with any other existing front-end tooling, please turn off Embark's internal build pipeline by setting the following configuration option in `config/pipeline.js`:\n\n
\nenabled: false\n
\n{% endnotification %}\n\n\n\n### Customizing the build process\n\nSometimes we run into scenarios where our setup is so specific that the build process for our application needs further customization. For those cases, where Embark's built-in build pipeline isn't enough, it enables us to \"eject\" the internally used `webpack.config.js` file, so we can change it to our needs and fully bypass Embark's internal build process.\n\nEjecting the internally used config file is as simple as using Embark's `eject-build-config` command like this:\n\n```\n$ embark eject-build-config\n```\n\n{% notification info 'On --eject-webpack option' %}\nIn older versions of Embark, the same could be achieved using the `--eject-webpack` option. This option still works, but is now considered deprecated and will be removed in future versions of Embark.\n{% endnotification %}\n\n{% notification danger 'Deprecation warning:' %}\nAs mentioned earlier in this guide, we recommend using existing front-end tooling for building and optimizing your application's front-end code. This command will be deprecated in future versions of Embark.\n{% endnotification %}\n\n","source":"docs/pipeline_and_webpack.md","raw":"title: Building & Asset Pipeline\nlayout: docs\n---\n\nAs discussed in [Running Apps](running_apps.html#Using-the-run-command), Embark takes care of quite a few things developing applications, including compiling Smart Contracts, JavaScript and other assets. In this guide we'll learn how to take full advantage of Embark's flexibility to build our Smart Contracts or even replace the entire build pipeline for our application's assets.\n\n## Building your app\n\nEmbark's `build` command enables us to build our decentralized application and deploy it accordingly. Similar to `embark run`, it compiles our Smart Contracts, deploys them to a blockchain network that our app is connected to, processes our app's assets and uploads them to the configured decentralized storage (e.g. IPFS).\n\nBy default, `embark build` will use the `production` mode to build our application.\n\n```\n$ embark build\n```\n### Specifying a mode using `--pipeline`\n\n\nEmbark comes with two modes for building our application:\n\n* **development** - This mode is for development purposes and produces sourcemaps as well as unoptimized client-side code. Whenever we use `embark run` or `embark console`, this mode is used by default. Since this mode skips code optimizations, it's also the faster mode.\n* **production** - Unsurprisingly, this mode is used to create production artifacts of our application. It produces optimized code and therefore, takes longer to build. However, client-side code will be highly optimized, thus smaller in file size. This mode is the default for `embark build` and `embark upload` commands.\n\nWe can specify a mode using the `--pipeline` option. This is available for both, `embark run` and `embark build` commands:\n\n```\n$ embark build --pipeline development\n```\n\n## Compiling Smart Contracts only\n\nIf we're building a [Smart Contract only application](http://localhost:4000/docs/create_project.html#Creating-%E2%80%9Ccontracts-only%E2%80%9D-apps), or we're simply not interested in building the entire application and deploying it, but just want to compile our Smart Contracts, we can use the `build` command's `--contracts` option:\n\n```\n$ embark build --contracts\n```\n\n## Understanding the build pipeline\n\nEmbark uses [webpack](https://webpack.js.org/) to bundle and postprocess all kinds of assets of our decentralized application. This also includes things like:\n\n* ES2015+ syntax using Babel\n* Importing of CSS, SCSS, PNG, SVG & Fonts in JavaScript\n* Support for React & JSX\n* Automatic support for older browsers via Babel's preset-env (by default, Embark uses a browser list setting of `['last 1 version', 'not dead', '> 0.2%']`\n* Sourcemaps generation (when in development mode)\n* Minification and tree shaking (when in production mode)\n\n{% notification danger 'Deprecation warning:' %}\nSince Embark version 4.0.0 it's possible (and recommended) to use Embark in combination with other front-end tooling, such as Angular CLI, Vue CLI or Create React App, making Embark's own build pipeline obsolete.\n\nWhen using Embark with any other existing front-end tooling, please turn off Embark's internal build pipeline by setting the following configuration option in `config/pipeline.js`:\n\n
\nenabled: false\n
\n{% endnotification %}\n\n\n\n### Customizing the build process\n\nSometimes we run into scenarios where our setup is so specific that the build process for our application needs further customization. For those cases, where Embark's built-in build pipeline isn't enough, it enables us to \"eject\" the internally used `webpack.config.js` file, so we can change it to our needs and fully bypass Embark's internal build process.\n\nEjecting the internally used config file is as simple as using Embark's `eject-build-config` command like this:\n\n```\n$ embark eject-build-config\n```\n\n{% notification info 'On --eject-webpack option' %}\nIn older versions of Embark, the same could be achieved using the `--eject-webpack` option. This option still works, but is now considered deprecated and will be removed in future versions of Embark.\n{% endnotification %}\n\n{% notification danger 'Deprecation warning:' %}\nAs mentioned earlier in this guide, we recommend using existing front-end tooling for building and optimizing your application's front-end code. This command will be deprecated in future versions of Embark.\n{% endnotification %}\n\n","date":"2020-01-17T19:00:03.900Z","updated":"2020-01-17T19:00:03.900Z","path":"docs/pipeline_and_webpack.html","comments":1,"_id":"ck5ijm3rs001h7heg90dngw8a","content":"

As discussed in Running Apps, Embark takes care of quite a few things developing applications, including compiling Smart Contracts, JavaScript and other assets. In this guide we’ll learn how to take full advantage of Embark’s flexibility to build our Smart Contracts or even replace the entire build pipeline for our application’s assets.

\n

Building your app

Embark’s build command enables us to build our decentralized application and deploy it accordingly. Similar to embark run, it compiles our Smart Contracts, deploys them to a blockchain network that our app is connected to, processes our app’s assets and uploads them to the configured decentralized storage (e.g. IPFS).

\n

By default, embark build will use the production mode to build our application.

\n
$ embark build
\n

Specifying a mode using --pipeline

Embark comes with two modes for building our application:

\n
    \n
  • development - This mode is for development purposes and produces sourcemaps as well as unoptimized client-side code. Whenever we use embark run or embark console, this mode is used by default. Since this mode skips code optimizations, it’s also the faster mode.
  • \n
  • production - Unsurprisingly, this mode is used to create production artifacts of our application. It produces optimized code and therefore, takes longer to build. However, client-side code will be highly optimized, thus smaller in file size. This mode is the default for embark build and embark upload commands.
  • \n
\n

We can specify a mode using the --pipeline option. This is available for both, embark run and embark build commands:

\n
$ embark build --pipeline development
\n\n

Compiling Smart Contracts only

If we’re building a Smart Contract only application, or we’re simply not interested in building the entire application and deploying it, but just want to compile our Smart Contracts, we can use the build command’s --contracts option:

\n
$ embark build --contracts
\n\n

Understanding the build pipeline

Embark uses webpack to bundle and postprocess all kinds of assets of our decentralized application. This also includes things like:

\n
    \n
  • ES2015+ syntax using Babel
  • \n
  • Importing of CSS, SCSS, PNG, SVG & Fonts in JavaScript
  • \n
  • Support for React & JSX
  • \n
  • Automatic support for older browsers via Babel’s preset-env (by default, Embark uses a browser list setting of ['last 1 version', 'not dead', '> 0.2%']
  • \n
  • Sourcemaps generation (when in development mode)
  • \n
  • Minification and tree shaking (when in production mode)
  • \n
\n
\n

Deprecation warning:

\n

Since Embark version 4.0.0 it’s possible (and recommended) to use Embark in combination with other front-end tooling, such as Angular CLI, Vue CLI or Create React App, making Embark’s own build pipeline obsolete.

\n

When using Embark with any other existing front-end tooling, please turn off Embark’s internal build pipeline by setting the following configuration option in config/pipeline.js:

\n
\nenabled: false\n

\n
\n\n\n\n\n\n

Customizing the build process

Sometimes we run into scenarios where our setup is so specific that the build process for our application needs further customization. For those cases, where Embark’s built-in build pipeline isn’t enough, it enables us to “eject” the internally used webpack.config.js file, so we can change it to our needs and fully bypass Embark’s internal build process.

\n

Ejecting the internally used config file is as simple as using Embark’s eject-build-config command like this:

\n
$ embark eject-build-config
\n\n
\n

On --eject-webpack option

\n

In older versions of Embark, the same could be achieved using the --eject-webpack option. This option still works, but is now considered deprecated and will be removed in future versions of Embark.

\n

\n
\n\n\n\n
\n

Deprecation warning:

\n

As mentioned earlier in this guide, we recommend using existing front-end tooling for building and optimizing your application’s front-end code. This command will be deprecated in future versions of Embark.

\n

\n
\n\n\n\n","site":{"data":{"authors":{"iuri_matias":{"name":"Iuri Matias","twitter":"iurimatias","image":"https://pbs.twimg.com/profile_images/928272512181563392/iDJdvy2k_400x400.jpg"},"pascal_precht":{"name":"Pascal Precht","twitter":"pascalprecht","image":"https://pbs.twimg.com/profile_images/993785060733194241/p3oAIMDP_400x400.jpg"},"anthony_laibe":{"name":"Anthony Laibe","twitter":"a_laibe","image":"https://pbs.twimg.com/profile_images/257742900/13168239_400x400.jpg"},"jonathan_rainville":{"name":"Jonathan Rainville","twitter":"ShyolGhul","image":"https://pbs.twimg.com/profile_images/993873866878570496/-aE4byjj_400x400.jpg"},"andre_medeiros":{"name":"Andre Medeiros","twitter":"superdealloc","image":"https://pbs.twimg.com/profile_images/965722487735701504/m58KNgWN_400x400.jpg"},"eric_mastro":{"name":"Eric Mastro","twitter":"ericmastro","image":"https://avatars1.githubusercontent.com/u/5089238?s=460&v=4"},"michael_bradley":{"name":"Michael Bradley","image":"https://avatars3.githubusercontent.com/u/194260?s=460&v=4"},"richard_ramos":{"name":"Richard Ramos","twitter":"richardramos_me","image":"https://pbs.twimg.com/profile_images/1063160577973866496/aM313uHG_400x400.jpg"},"jonny_zerah":{"name":"Jonny Zerah","twitter":"jonnyzerah","image":"https://pbs.twimg.com/profile_images/1043774340490248192/gI9aGy17_400x400.jpg"},"robin_percy":{"name":"Robin Percy","twitter":"rbin","image":"https://avatars1.githubusercontent.com/u/29288325?s=400&v=4"}},"categories":{"tutorials":"Tutorials","announcements":"Announcements"},"languages":{"en":"English"},"plugins":[{"name":"embark-bamboo","description":"plugins_page.plugins.bamboo.desc","link":"https://www.npmjs.com/package/embark-bamboo","thumbnail":"bamboo.png","tags":["language","smart-contracts"]},{"name":"embark-solc","description":"plugins_page.plugins.solc.desc","link":"https://www.npmjs.com/package/embark-solc","thumbnail":"solidity.png","tags":["solidity","language","smart-contracts"]},{"name":"embark-solium","description":"plugins_page.plugins.solium.desc","link":"https://www.npmjs.com/package/embark-solium","thumbnail":"solium.png","tags":["linter","solidity","solium"]},{"name":"embark-etherscan-verifier","description":"plugins_page.plugins.verifier.desc","link":"https://www.npmjs.com/package/embark-etherscan-verifier","tags":["solidity","etherscan","smart-contracts"]},{"name":"embark-status","description":"plugins_page.plugins.status.desc","link":"https://www.npmjs.com/package/embark-status-plugin","thumbnail":"status.png","tags":["status","mobile"]},{"name":"embark-remix","description":"plugins_page.plugins.remix.desc","link":"https://www.npmjs.com/package/embark-remix","thumbnail":"remix.png","tags":["remix","debugger"]},{"name":"embark-slither","description":"plugins_page.plugins.slither.desc","link":"https://www.npmjs.com/package/embark-slither","tags":["solidity"]},{"name":"embark-snark","description":"plugins_page.plugins.snark.desc","link":"https://www.npmjs.com/package/embark-snark","tags":["snark"]},{"name":"embark-fortune","description":"plugins_page.plugins.fortune.desc","link":"https://www.npmjs.com/package/embark-fortune","thumbnail":"fortune.jpg","tags":["fun"]},{"name":"embark-pug","description":"plugins_page.plugins.pug.desc","link":"https://www.npmjs.com/package/embark-pug","legacy":true,"thumbnail":"pug.png","tags":["pug","jade","templates"]},{"name":"embark-haml","description":"plugins_page.plugins.haml.desc","link":"https://www.npmjs.com/package/embark-haml","legacy":true,"thumbnail":"haml.png","tags":["haml","templates"]},{"name":"embark-mythx","description":"plugins_page.plugins.mythx.desc","link":"https://www.npmjs.com/package/embark-mythx","thumbnail":"mythx.png","tags":["mythx","smart-contracts"]}],"menu":{"docs":"/docs/","plugins":"/plugins/","chat":"/chat/","blog":"/news/"},"sidebar":{"docs":{"getting_started":{"overview":"overview.html","installation":"installation.html","faq":"faq.html"},"general_usage":{"creating_project":"create_project.html","structure":"structure.html","running_apps":"running_apps.html","dashboard":"dashboard.html","using_the_console":"using_the_console.html","environments":"environments.html","configuration":"configuration.html","pipeline_and_webpack":"pipeline_and_webpack.html","javascript_usage":"javascript_usage.html"},"smart_contracts":{"contracts_configuration":"contracts_configuration.html","contracts_deployment":"contracts_deployment.html","contracts_imports":"contracts_imports.html","contracts_testing":"contracts_testing.html","contracts_javascript":"contracts_javascript.html"},"blockchain_node":{"blockchain_configuration":"blockchain_configuration.html","blockchain_accounts_configuration":"blockchain_accounts_configuration.html"},"storage":{"storage_configuration":"storage_configuration.html","storage_deployment":"storage_deployment.html","storage_javascript":"storage_javascript.html"},"messages":{"messages_configuration":"messages_configuration.html","messages_javascript":"messages_javascript.html"},"naming":{"naming_configuration":"naming_configuration.html","naming_javascript":"naming_javascript.html"},"plugins":{"installing_a_plugin":"installing_plugins.html","creating_a_plugin":"creating_plugins.html","plugin_reference":"plugin_reference.html"},"cockpit":{"cockpit_introduction":"cockpit_introduction.html","cockpit_dashboard":"cockpit_dashboard.html","cockpit_deployment":"cockpit_deployment.html","cockpit_explorer":"cockpit_explorer.html","cockpit_editor":"cockpit_editor.html","cockpit_debugger":"cockpit_debugger.html"},"reference":{"embark_commands":"embark_commands.html"},"miscellaneous":{"migrating_from_3":"migrating_from_3.x.html","troubleshooting":"troubleshooting.html","contributing":"contributing.html"}}},"templates":[{"name":"Vyper Template","description":"Template to demonstrate the use of the Vyper contracts","install":"embark new AppName --template vyper","thumbnail":"vyper.png","link":"https://github.com/embarklabs/embark-vyper-template","tags":["vyper","contracts"]},{"name":"Embark Demo React Template","description":"A React Application showcasing Embark's functionality","install":"embark demo","thumbnail":"react.png","link":"https://embark.embarklabs.io/docs/create_project.html#Creating-a-Demo-Project","tags":["react","contracts","whisper","ipfs"]},{"name":"Typescript Template","description":"Template with Typescript support pre-configured","thumbnail":"typescript.png","install":"embark new AppName --template typescript","link":"https://github.com/embarklabs/embark-typescript-template","tags":["typescript","frontend"]},{"name":"Vue.js Template","description":"Ready to use Template for using Embark with vue.js","thumbnail":"vuejs.png","install":"embark new AppName --template vue","link":"https://github.com/embarklabs/embark-vue-template","tags":["vue.js","frontend"]},{"name":"ethvtx Template","description":"Demo app for ethvtx, an Ethereum-Ready & Framework-Agnostic Redux configuration","thumbnail":"vortex.png","install":"embark new AppName --template Horyus/ethvtx_embark","link":"https://github.com/Horyus/ethvtx_embark","tags":["react"]},{"name":"Bamboo Template","description":"Template to demonstrate use of the Bamboo contracts","install":"embark new AppName --template bamboo","thumbnail":"bamboo.png","link":"https://github.com/embarklabs/embark-bamboo-template","tags":["bamboo","contracts"]},{"name":"Solidity Gas Golfing","description":"Boilerplate and tests for the first Solidity Gas Golfing Contest","thumbnail":"sggc.png","install":"embark new AppName --template embarklabs/sggc","link":"https://github.com/embarklabs/sggc","tags":["solidity","tests","fun"]}],"tutorials":[{"name":"How to create a Token Factory with Ethereum — Part 1","description":"Create and Deploy a Token with Ethereum","link":"/tutorials/token_factory_1.html","tags":["token","ethereum"]},{"name":"How to create a Token Factory with Ethereum — Part 2","description":"Create a DApp that can deploy Tokens on the fly","link":"/tutorials/token_factory_2.html","tags":["token","ethereum","client-side-deployment"]},{"name":"How to deploy to a testnet with Infura","description":"Deploy and interact with your Dapp on a testnet with the use of Infura","link":"/tutorials/infura_guide.html","tags":["ethereum","deployment","testnet"]}],"versions":{"latest":{"label":"stable (v4)","url":"https://embark.embarklabs.io/docs"},"3.2":{"label":"v3.2","url":"https://5ca4e0fdb29712000adde37f--embark-site-versions.netlify.com/docs/"}}}},"excerpt":"","more":"

As discussed in Running Apps, Embark takes care of quite a few things developing applications, including compiling Smart Contracts, JavaScript and other assets. In this guide we’ll learn how to take full advantage of Embark’s flexibility to build our Smart Contracts or even replace the entire build pipeline for our application’s assets.

\n

Building your app

Embark’s build command enables us to build our decentralized application and deploy it accordingly. Similar to embark run, it compiles our Smart Contracts, deploys them to a blockchain network that our app is connected to, processes our app’s assets and uploads them to the configured decentralized storage (e.g. IPFS).

\n

By default, embark build will use the production mode to build our application.

\n
$ embark build
\n

Specifying a mode using --pipeline

Embark comes with two modes for building our application:

\n
    \n
  • development - This mode is for development purposes and produces sourcemaps as well as unoptimized client-side code. Whenever we use embark run or embark console, this mode is used by default. Since this mode skips code optimizations, it’s also the faster mode.
  • \n
  • production - Unsurprisingly, this mode is used to create production artifacts of our application. It produces optimized code and therefore, takes longer to build. However, client-side code will be highly optimized, thus smaller in file size. This mode is the default for embark build and embark upload commands.
  • \n
\n

We can specify a mode using the --pipeline option. This is available for both, embark run and embark build commands:

\n
$ embark build --pipeline development
\n\n

Compiling Smart Contracts only

If we’re building a Smart Contract only application, or we’re simply not interested in building the entire application and deploying it, but just want to compile our Smart Contracts, we can use the build command’s --contracts option:

\n
$ embark build --contracts
\n\n

Understanding the build pipeline

Embark uses webpack to bundle and postprocess all kinds of assets of our decentralized application. This also includes things like:

\n
    \n
  • ES2015+ syntax using Babel
  • \n
  • Importing of CSS, SCSS, PNG, SVG & Fonts in JavaScript
  • \n
  • Support for React & JSX
  • \n
  • Automatic support for older browsers via Babel’s preset-env (by default, Embark uses a browser list setting of ['last 1 version', 'not dead', '> 0.2%']
  • \n
  • Sourcemaps generation (when in development mode)
  • \n
  • Minification and tree shaking (when in production mode)
  • \n
\n
\n

Deprecation warning:

\n

Since Embark version 4.0.0 it’s possible (and recommended) to use Embark in combination with other front-end tooling, such as Angular CLI, Vue CLI or Create React App, making Embark’s own build pipeline obsolete.

\n

When using Embark with any other existing front-end tooling, please turn off Embark’s internal build pipeline by setting the following configuration option in config/pipeline.js:

\n
\nenabled: false\n

\n
\n\n\n\n\n\n

Customizing the build process

Sometimes we run into scenarios where our setup is so specific that the build process for our application needs further customization. For those cases, where Embark’s built-in build pipeline isn’t enough, it enables us to “eject” the internally used webpack.config.js file, so we can change it to our needs and fully bypass Embark’s internal build process.

\n

Ejecting the internally used config file is as simple as using Embark’s eject-build-config command like this:

\n
$ embark eject-build-config
\n\n
\n

On --eject-webpack option

\n

In older versions of Embark, the same could be achieved using the --eject-webpack option. This option still works, but is now considered deprecated and will be removed in future versions of Embark.

\n

\n
\n\n\n\n
\n

Deprecation warning:

\n

As mentioned earlier in this guide, we recommend using existing front-end tooling for building and optimizing your application’s front-end code. This command will be deprecated in future versions of Embark.

\n

\n
\n\n\n\n"},{"title":"Quick Start","tagline":"Build your first DApp with Embark","_content":"\n# Welcome to the Quick Start!\n\nIn this guide we'll explore how easy it is to quickly get up and running with Embark to build our first decentralized application. This is the perfect place to start if you haven't used Embark before.\n\nTogether, we're going to:\n\n{% checklist 'Install Embark' 'Create an app' 'Run and deploy the app' %}\n\nHopefully, after that you'll be motivated to explore the rest of Embark's [documentation](/docs/overview.html). If you run into any problems along your journey, check out [our Gitter channel](https://gitter.im/embark-framework/Lobby) as well. We are there to help.\n\nLet's get started!\n\n## Installing Embark\n\nFirst things first, we'll have to install Embark on our local machines. This is easily done buy using a package manager of your choice. The following command installs the Embark CLI as a global command using npm:\n\n```\n$ npm install -g embark\n```\n\nOnce that is done, `embark` should be available as a global command.\n\n{% notification info 'Prerequisites' %}\nIn order to actually start a blockchain client or other processes, there are some\nmore tools that need to be installed. Head over to our [installation guide](/docs/installation.html) to learn more.\n{% endnotification %}\n\n## Creating your first app\n\nIn order to get results as quickly as possible, Embark comes with a `demo` command that scaffolds and sets up a complete application for us to play with. Open up a terminal of your choice and run:\n\n```\n$ embark demo\n$ cd embark_demo\n```\n\nThis will create a demo application. Feel free to look around to get familiar with the project's structure, but don't worry. We'll take a closer look at it later in one of our [dedicated guides](structure.html).\n\n## Running your app\n\nThe fastest way to get your app running is to use Embark's `run` command. It takes care of a lot of things, such as spinning up an Ethereum and IPFS node, or keeping an eye on file changes to recompile your code. There's other ways to [run your app](running_apps.html), in case you need more control over different processes, but let's not get ahead of ourselves.\n\n```\n$ embark run\n```\n\nOnce executed, we'll notice that Embark opens up a dashboard view inside our terminal. This is the place where we monitor running processes such as compilation of our sources as well as deployments. As everything in Embark, the dashboard usage is configurable. If we prefer Embark to just output logs of whatever it's doing, this can be easily done by running the same command with the `--nodashboard` option.\n\nNotice that the dashboard comes with sections for **Contracts**, **Environment**, **Status**, **Available Services**, **Logs** and **Console**. While most of them are self explanatory, we'll take a closer look at those in the [dashboard guide](dashboard.html).\n\n![Dashboard](/assets/images/embark-dashboard.png)\n\nFor now, let's focus on what has happened in the meantime. Embark has compiled and deployed the Smart Contracts that come with the demo application to a custom blockchain on your local machine. It has also compiled the web app that's part of the demo and deployed that to a local web server, which is listening on `http://localhost:8000`. In fact, Embark has probably already opened a browser window for you. \n\nIf not, give it a try yourself and open [localhost:8000](http://localhost:8000) in your browser of choice!\n\n## Getting help\n\n**Congratulations!** You've just created your first decentralized application. Now it's a good time to explore what else Embark has to offer. To get started, type `help` into the running console to get a list of commands you can run inside the dashboard.\n\nAlso, make sure to check out the other guides and let us know if you miss anything! If you run into any problems, the [guide on troubleshooting](troubleshooting.html) is here to help.\n\n\n","source":"docs/quick_start.md","raw":"title: Quick Start\ntagline: 'Build your first DApp with Embark'\n---\n\n# Welcome to the Quick Start!\n\nIn this guide we'll explore how easy it is to quickly get up and running with Embark to build our first decentralized application. This is the perfect place to start if you haven't used Embark before.\n\nTogether, we're going to:\n\n{% checklist 'Install Embark' 'Create an app' 'Run and deploy the app' %}\n\nHopefully, after that you'll be motivated to explore the rest of Embark's [documentation](/docs/overview.html). If you run into any problems along your journey, check out [our Gitter channel](https://gitter.im/embark-framework/Lobby) as well. We are there to help.\n\nLet's get started!\n\n## Installing Embark\n\nFirst things first, we'll have to install Embark on our local machines. This is easily done buy using a package manager of your choice. The following command installs the Embark CLI as a global command using npm:\n\n```\n$ npm install -g embark\n```\n\nOnce that is done, `embark` should be available as a global command.\n\n{% notification info 'Prerequisites' %}\nIn order to actually start a blockchain client or other processes, there are some\nmore tools that need to be installed. Head over to our [installation guide](/docs/installation.html) to learn more.\n{% endnotification %}\n\n## Creating your first app\n\nIn order to get results as quickly as possible, Embark comes with a `demo` command that scaffolds and sets up a complete application for us to play with. Open up a terminal of your choice and run:\n\n```\n$ embark demo\n$ cd embark_demo\n```\n\nThis will create a demo application. Feel free to look around to get familiar with the project's structure, but don't worry. We'll take a closer look at it later in one of our [dedicated guides](structure.html).\n\n## Running your app\n\nThe fastest way to get your app running is to use Embark's `run` command. It takes care of a lot of things, such as spinning up an Ethereum and IPFS node, or keeping an eye on file changes to recompile your code. There's other ways to [run your app](running_apps.html), in case you need more control over different processes, but let's not get ahead of ourselves.\n\n```\n$ embark run\n```\n\nOnce executed, we'll notice that Embark opens up a dashboard view inside our terminal. This is the place where we monitor running processes such as compilation of our sources as well as deployments. As everything in Embark, the dashboard usage is configurable. If we prefer Embark to just output logs of whatever it's doing, this can be easily done by running the same command with the `--nodashboard` option.\n\nNotice that the dashboard comes with sections for **Contracts**, **Environment**, **Status**, **Available Services**, **Logs** and **Console**. While most of them are self explanatory, we'll take a closer look at those in the [dashboard guide](dashboard.html).\n\n![Dashboard](/assets/images/embark-dashboard.png)\n\nFor now, let's focus on what has happened in the meantime. Embark has compiled and deployed the Smart Contracts that come with the demo application to a custom blockchain on your local machine. It has also compiled the web app that's part of the demo and deployed that to a local web server, which is listening on `http://localhost:8000`. In fact, Embark has probably already opened a browser window for you. \n\nIf not, give it a try yourself and open [localhost:8000](http://localhost:8000) in your browser of choice!\n\n## Getting help\n\n**Congratulations!** You've just created your first decentralized application. Now it's a good time to explore what else Embark has to offer. To get started, type `help` into the running console to get a list of commands you can run inside the dashboard.\n\nAlso, make sure to check out the other guides and let us know if you miss anything! If you run into any problems, the [guide on troubleshooting](troubleshooting.html) is here to help.\n\n\n","date":"2020-01-17T19:00:03.900Z","updated":"2020-01-17T19:00:03.900Z","path":"docs/quick_start.html","comments":1,"layout":"page","_id":"ck5ijm3rt001i7heg76eaeohv","content":"

Welcome to the Quick Start!

In this guide we’ll explore how easy it is to quickly get up and running with Embark to build our first decentralized application. This is the perfect place to start if you haven’t used Embark before.

\n

Together, we’re going to:

\n
\n
    \n \n
  • \n \n \n \n Install Embark\n
  • \n \n
  • \n \n \n \n Create an app\n
  • \n \n
  • \n \n \n \n Run and deploy the app\n
  • \n \n
\n
\n\n\n\n

Hopefully, after that you’ll be motivated to explore the rest of Embark’s documentation. If you run into any problems along your journey, check out our Gitter channel as well. We are there to help.

\n

Let’s get started!

\n

Installing Embark

First things first, we’ll have to install Embark on our local machines. This is easily done buy using a package manager of your choice. The following command installs the Embark CLI as a global command using npm:

\n
$ npm install -g embark
\n\n

Once that is done, embark should be available as a global command.

\n
\n

Prerequisites

\n

In order to actually start a blockchain client or other processes, there are some
more tools that need to be installed. Head over to our installation guide to learn more.

\n

\n
\n\n\n\n

Creating your first app

In order to get results as quickly as possible, Embark comes with a demo command that scaffolds and sets up a complete application for us to play with. Open up a terminal of your choice and run:

\n
$ embark demo
$ cd embark_demo
\n\n

This will create a demo application. Feel free to look around to get familiar with the project’s structure, but don’t worry. We’ll take a closer look at it later in one of our dedicated guides.

\n

Running your app

The fastest way to get your app running is to use Embark’s run command. It takes care of a lot of things, such as spinning up an Ethereum and IPFS node, or keeping an eye on file changes to recompile your code. There’s other ways to run your app, in case you need more control over different processes, but let’s not get ahead of ourselves.

\n
$ embark run
\n\n

Once executed, we’ll notice that Embark opens up a dashboard view inside our terminal. This is the place where we monitor running processes such as compilation of our sources as well as deployments. As everything in Embark, the dashboard usage is configurable. If we prefer Embark to just output logs of whatever it’s doing, this can be easily done by running the same command with the --nodashboard option.

\n

Notice that the dashboard comes with sections for Contracts, Environment, Status, Available Services, Logs and Console. While most of them are self explanatory, we’ll take a closer look at those in the dashboard guide.

\n

\"Dashboard\"

\n

For now, let’s focus on what has happened in the meantime. Embark has compiled and deployed the Smart Contracts that come with the demo application to a custom blockchain on your local machine. It has also compiled the web app that’s part of the demo and deployed that to a local web server, which is listening on http://localhost:8000. In fact, Embark has probably already opened a browser window for you.

\n

If not, give it a try yourself and open localhost:8000 in your browser of choice!

\n

Getting help

Congratulations! You’ve just created your first decentralized application. Now it’s a good time to explore what else Embark has to offer. To get started, type help into the running console to get a list of commands you can run inside the dashboard.

\n

Also, make sure to check out the other guides and let us know if you miss anything! If you run into any problems, the guide on troubleshooting is here to help.

\n\n","site":{"data":{"authors":{"iuri_matias":{"name":"Iuri Matias","twitter":"iurimatias","image":"https://pbs.twimg.com/profile_images/928272512181563392/iDJdvy2k_400x400.jpg"},"pascal_precht":{"name":"Pascal Precht","twitter":"pascalprecht","image":"https://pbs.twimg.com/profile_images/993785060733194241/p3oAIMDP_400x400.jpg"},"anthony_laibe":{"name":"Anthony Laibe","twitter":"a_laibe","image":"https://pbs.twimg.com/profile_images/257742900/13168239_400x400.jpg"},"jonathan_rainville":{"name":"Jonathan Rainville","twitter":"ShyolGhul","image":"https://pbs.twimg.com/profile_images/993873866878570496/-aE4byjj_400x400.jpg"},"andre_medeiros":{"name":"Andre Medeiros","twitter":"superdealloc","image":"https://pbs.twimg.com/profile_images/965722487735701504/m58KNgWN_400x400.jpg"},"eric_mastro":{"name":"Eric Mastro","twitter":"ericmastro","image":"https://avatars1.githubusercontent.com/u/5089238?s=460&v=4"},"michael_bradley":{"name":"Michael Bradley","image":"https://avatars3.githubusercontent.com/u/194260?s=460&v=4"},"richard_ramos":{"name":"Richard Ramos","twitter":"richardramos_me","image":"https://pbs.twimg.com/profile_images/1063160577973866496/aM313uHG_400x400.jpg"},"jonny_zerah":{"name":"Jonny Zerah","twitter":"jonnyzerah","image":"https://pbs.twimg.com/profile_images/1043774340490248192/gI9aGy17_400x400.jpg"},"robin_percy":{"name":"Robin Percy","twitter":"rbin","image":"https://avatars1.githubusercontent.com/u/29288325?s=400&v=4"}},"categories":{"tutorials":"Tutorials","announcements":"Announcements"},"languages":{"en":"English"},"plugins":[{"name":"embark-bamboo","description":"plugins_page.plugins.bamboo.desc","link":"https://www.npmjs.com/package/embark-bamboo","thumbnail":"bamboo.png","tags":["language","smart-contracts"]},{"name":"embark-solc","description":"plugins_page.plugins.solc.desc","link":"https://www.npmjs.com/package/embark-solc","thumbnail":"solidity.png","tags":["solidity","language","smart-contracts"]},{"name":"embark-solium","description":"plugins_page.plugins.solium.desc","link":"https://www.npmjs.com/package/embark-solium","thumbnail":"solium.png","tags":["linter","solidity","solium"]},{"name":"embark-etherscan-verifier","description":"plugins_page.plugins.verifier.desc","link":"https://www.npmjs.com/package/embark-etherscan-verifier","tags":["solidity","etherscan","smart-contracts"]},{"name":"embark-status","description":"plugins_page.plugins.status.desc","link":"https://www.npmjs.com/package/embark-status-plugin","thumbnail":"status.png","tags":["status","mobile"]},{"name":"embark-remix","description":"plugins_page.plugins.remix.desc","link":"https://www.npmjs.com/package/embark-remix","thumbnail":"remix.png","tags":["remix","debugger"]},{"name":"embark-slither","description":"plugins_page.plugins.slither.desc","link":"https://www.npmjs.com/package/embark-slither","tags":["solidity"]},{"name":"embark-snark","description":"plugins_page.plugins.snark.desc","link":"https://www.npmjs.com/package/embark-snark","tags":["snark"]},{"name":"embark-fortune","description":"plugins_page.plugins.fortune.desc","link":"https://www.npmjs.com/package/embark-fortune","thumbnail":"fortune.jpg","tags":["fun"]},{"name":"embark-pug","description":"plugins_page.plugins.pug.desc","link":"https://www.npmjs.com/package/embark-pug","legacy":true,"thumbnail":"pug.png","tags":["pug","jade","templates"]},{"name":"embark-haml","description":"plugins_page.plugins.haml.desc","link":"https://www.npmjs.com/package/embark-haml","legacy":true,"thumbnail":"haml.png","tags":["haml","templates"]},{"name":"embark-mythx","description":"plugins_page.plugins.mythx.desc","link":"https://www.npmjs.com/package/embark-mythx","thumbnail":"mythx.png","tags":["mythx","smart-contracts"]}],"menu":{"docs":"/docs/","plugins":"/plugins/","chat":"/chat/","blog":"/news/"},"sidebar":{"docs":{"getting_started":{"overview":"overview.html","installation":"installation.html","faq":"faq.html"},"general_usage":{"creating_project":"create_project.html","structure":"structure.html","running_apps":"running_apps.html","dashboard":"dashboard.html","using_the_console":"using_the_console.html","environments":"environments.html","configuration":"configuration.html","pipeline_and_webpack":"pipeline_and_webpack.html","javascript_usage":"javascript_usage.html"},"smart_contracts":{"contracts_configuration":"contracts_configuration.html","contracts_deployment":"contracts_deployment.html","contracts_imports":"contracts_imports.html","contracts_testing":"contracts_testing.html","contracts_javascript":"contracts_javascript.html"},"blockchain_node":{"blockchain_configuration":"blockchain_configuration.html","blockchain_accounts_configuration":"blockchain_accounts_configuration.html"},"storage":{"storage_configuration":"storage_configuration.html","storage_deployment":"storage_deployment.html","storage_javascript":"storage_javascript.html"},"messages":{"messages_configuration":"messages_configuration.html","messages_javascript":"messages_javascript.html"},"naming":{"naming_configuration":"naming_configuration.html","naming_javascript":"naming_javascript.html"},"plugins":{"installing_a_plugin":"installing_plugins.html","creating_a_plugin":"creating_plugins.html","plugin_reference":"plugin_reference.html"},"cockpit":{"cockpit_introduction":"cockpit_introduction.html","cockpit_dashboard":"cockpit_dashboard.html","cockpit_deployment":"cockpit_deployment.html","cockpit_explorer":"cockpit_explorer.html","cockpit_editor":"cockpit_editor.html","cockpit_debugger":"cockpit_debugger.html"},"reference":{"embark_commands":"embark_commands.html"},"miscellaneous":{"migrating_from_3":"migrating_from_3.x.html","troubleshooting":"troubleshooting.html","contributing":"contributing.html"}}},"templates":[{"name":"Vyper Template","description":"Template to demonstrate the use of the Vyper contracts","install":"embark new AppName --template vyper","thumbnail":"vyper.png","link":"https://github.com/embarklabs/embark-vyper-template","tags":["vyper","contracts"]},{"name":"Embark Demo React Template","description":"A React Application showcasing Embark's functionality","install":"embark demo","thumbnail":"react.png","link":"https://embark.embarklabs.io/docs/create_project.html#Creating-a-Demo-Project","tags":["react","contracts","whisper","ipfs"]},{"name":"Typescript Template","description":"Template with Typescript support pre-configured","thumbnail":"typescript.png","install":"embark new AppName --template typescript","link":"https://github.com/embarklabs/embark-typescript-template","tags":["typescript","frontend"]},{"name":"Vue.js Template","description":"Ready to use Template for using Embark with vue.js","thumbnail":"vuejs.png","install":"embark new AppName --template vue","link":"https://github.com/embarklabs/embark-vue-template","tags":["vue.js","frontend"]},{"name":"ethvtx Template","description":"Demo app for ethvtx, an Ethereum-Ready & Framework-Agnostic Redux configuration","thumbnail":"vortex.png","install":"embark new AppName --template Horyus/ethvtx_embark","link":"https://github.com/Horyus/ethvtx_embark","tags":["react"]},{"name":"Bamboo Template","description":"Template to demonstrate use of the Bamboo contracts","install":"embark new AppName --template bamboo","thumbnail":"bamboo.png","link":"https://github.com/embarklabs/embark-bamboo-template","tags":["bamboo","contracts"]},{"name":"Solidity Gas Golfing","description":"Boilerplate and tests for the first Solidity Gas Golfing Contest","thumbnail":"sggc.png","install":"embark new AppName --template embarklabs/sggc","link":"https://github.com/embarklabs/sggc","tags":["solidity","tests","fun"]}],"tutorials":[{"name":"How to create a Token Factory with Ethereum — Part 1","description":"Create and Deploy a Token with Ethereum","link":"/tutorials/token_factory_1.html","tags":["token","ethereum"]},{"name":"How to create a Token Factory with Ethereum — Part 2","description":"Create a DApp that can deploy Tokens on the fly","link":"/tutorials/token_factory_2.html","tags":["token","ethereum","client-side-deployment"]},{"name":"How to deploy to a testnet with Infura","description":"Deploy and interact with your Dapp on a testnet with the use of Infura","link":"/tutorials/infura_guide.html","tags":["ethereum","deployment","testnet"]}],"versions":{"latest":{"label":"stable (v4)","url":"https://embark.embarklabs.io/docs"},"3.2":{"label":"v3.2","url":"https://5ca4e0fdb29712000adde37f--embark-site-versions.netlify.com/docs/"}}}},"excerpt":"","more":"

Welcome to the Quick Start!

In this guide we’ll explore how easy it is to quickly get up and running with Embark to build our first decentralized application. This is the perfect place to start if you haven’t used Embark before.

\n

Together, we’re going to:

\n
\n
    \n \n
  • \n \n \n \n Install Embark\n
  • \n \n
  • \n \n \n \n Create an app\n
  • \n \n
  • \n \n \n \n Run and deploy the app\n
  • \n \n
\n
\n\n\n\n

Hopefully, after that you’ll be motivated to explore the rest of Embark’s documentation. If you run into any problems along your journey, check out our Gitter channel as well. We are there to help.

\n

Let’s get started!

\n

Installing Embark

First things first, we’ll have to install Embark on our local machines. This is easily done buy using a package manager of your choice. The following command installs the Embark CLI as a global command using npm:

\n
$ npm install -g embark
\n\n

Once that is done, embark should be available as a global command.

\n
\n

Prerequisites

\n

In order to actually start a blockchain client or other processes, there are some
more tools that need to be installed. Head over to our installation guide to learn more.

\n

\n
\n\n\n\n

Creating your first app

In order to get results as quickly as possible, Embark comes with a demo command that scaffolds and sets up a complete application for us to play with. Open up a terminal of your choice and run:

\n
$ embark demo
$ cd embark_demo
\n\n

This will create a demo application. Feel free to look around to get familiar with the project’s structure, but don’t worry. We’ll take a closer look at it later in one of our dedicated guides.

\n

Running your app

The fastest way to get your app running is to use Embark’s run command. It takes care of a lot of things, such as spinning up an Ethereum and IPFS node, or keeping an eye on file changes to recompile your code. There’s other ways to run your app, in case you need more control over different processes, but let’s not get ahead of ourselves.

\n
$ embark run
\n\n

Once executed, we’ll notice that Embark opens up a dashboard view inside our terminal. This is the place where we monitor running processes such as compilation of our sources as well as deployments. As everything in Embark, the dashboard usage is configurable. If we prefer Embark to just output logs of whatever it’s doing, this can be easily done by running the same command with the --nodashboard option.

\n

Notice that the dashboard comes with sections for Contracts, Environment, Status, Available Services, Logs and Console. While most of them are self explanatory, we’ll take a closer look at those in the dashboard guide.

\n

\"Dashboard\"

\n

For now, let’s focus on what has happened in the meantime. Embark has compiled and deployed the Smart Contracts that come with the demo application to a custom blockchain on your local machine. It has also compiled the web app that’s part of the demo and deployed that to a local web server, which is listening on http://localhost:8000. In fact, Embark has probably already opened a browser window for you.

\n

If not, give it a try yourself and open localhost:8000 in your browser of choice!

\n

Getting help

Congratulations! You’ve just created your first decentralized application. Now it’s a good time to explore what else Embark has to offer. To get started, type help into the running console to get a list of commands you can run inside the dashboard.

\n

Also, make sure to check out the other guides and let us know if you miss anything! If you run into any problems, the guide on troubleshooting is here to help.

\n\n"},{"title":"Running apps","layout":"docs","_content":"\nWhile running Embark applications is pretty straight forward, there are some additional options we can take advantage of to change how our application is run. Whether we want Embark to automatically open a browser, open its dashboard or even make our app connect to different blockchains. This guide explores how this is done.\n\n## Using the `run` command\n\nIf you've read the [quickstart](quick_start.html) you're already aware that running an application is done by simply executing `embark run` within your project:\n\n```\n$ embark run\n```\n\nBy default, this will make Embark do a couple of things:\n\n- It initializes Embark\n- It starts the dashboard\n- It loads plugins\n- It spins up a blockchain and IPFS client, a web server and other necessary services\n- It compiles and deploys your app\n- It monitors running processes and recompiles and redeploys your app if needed\n- It starts [Cockpit](/docs/cockpit_introduction.html)\n\nMost of the time, using the `run` command is all what we need to work on our Embark project, but as mentioned above, we can take a bit more control over running our application.\n\n## Running an app without the dashboard\n\nWhile the dashboard gives us a great overview of all the processes and services that Embark manages for us, it's not required to start it every single time along with compiling and deploying our app. If we don't need the dashboard, we can prevent Embark from starting it by using the `--nodashboard` option:\n\n```\n$ embark run --nodashboard\n```\n\nWhen running the command with `--nodashboard`, Embark will fallback to only use standard log outputs, which are the same that we get in the **Logs** panel within the dashboard.\n\n## Running an app without opening a browser\n\nIn order to get up and running as fast as possible, Embark also takes care of opening a new browser window that connects to the web server to load our application's client. While this is quite convenient, sometimes we don't need a browser window to work on our app. This is the case when we're for example only interested in developing Smart Contracts, without creating a front-end.\n\nIf we don't want Embark to open a browser for us, all we have to do is using the `--nobrowser` option like this:\n\n\n```\n$ embark run --nobrowser\n```\n\n\n## Running an app without starting a web server\n\nIf we aren't interested in Embark starting a web server in the first place, we can easily turn it off by using the `--noserver` option:\n\n```\n$ embark run --noserver\n```\n\n## Running apps in different modes\n\nEmbark comes with different \"modes\" when building applications. `embark run` uses the `development` mode by default. However, this can be overwritten using the `--pipeline` option. The following command run our application in `production` mode.\n\n```\n$ embark run --pipeline production\n```\n\nFor more information about modes, head over to our guide on [building apps](pipeline_and_webpack.html).\n\n## Switching environments\n\nEmbark allows for configuring different environments to run our app against. This can be useful if we want to deploy our app to test networks or even private networks. In order to run our application in a specified environment, we first have to add a dedicated configuration to our project's `blockchain.js` file. \n\nDepending on how you initialized your application, it may have already multiple environments configured. Here's what a sample test network environment could look like:\n\n```\n// config/blockchain.js\n\nmodules.exports = {\n ...\n testnet: {\n networkType: \"testnet\",\n syncMode: \"light\",\n account: {\n password: \"config/testnet/password\"\n }\n },\n ...\n}\n```\n\nFor more information on configuring your Embark application, head over to the [general configuration guide](configuration.html).\n\nRunning an application in a different environment is just a matter of specifying the environment's name as part of the run command:\n\n```\n$ embark run [environment]\n```\n\nSo in case we want to run our app against the test network environment described above, this could be achieved by running:\n\n```\n$ embark run testnet\n```\n\n## Starting a blockchain separately\n\nSometimes we might want to have more control over the different processes involved when running our application with Embark. One of those things is to spin up a blockchain first and then have `embark run` connect to it. This enables us to stop and restart the blockchain process, without stopping Embark from doing its work.\n\nEmbark comes with a `blockchain` command that does exactly that:\n\n```\n$ embark blockchain\n```\n\nWhen this is executed before Embark is run within a project, the run command will skip spinning up a blockchain node itself and connect to the existing process. Similar to the `run` command, the `blockchain` command also allows to specify an environment:\n\n```\n$ embark blockchain testnet\n```\n\nBy default Embark blockchain will mine a minimum amount of ether and will only mine when new transactions come in.\n\n## Using the blockchain simulator\n\nAnother feature of Embark is to start a **simulated** blockchain. This can be useful for testing purposes as there's no need to wait for transactions to be mined. You might have heard of [Ganache CLI](https://truffleframework.com/docs/ganache/quickstart), which is a great project that implements such a simulated blockchain.\n\nEmbark integrates perfectly with this existing tool chain. To start a simulated blockchain, all we have do is to use the `simulator` command:\n\n```\n$ embark simulator\n```\n\n## Resetting apps\n\nSometimes we want to develop and test behaviours that are related to the deployment of our application. For example, we might want to use some of Embark's powerful [deployment hooks](/docs/contracts_configuration.html#Deployment-hooks) to initialize one of our Smart Contracts based on the deployment of another Smart Contract.\n\nTo test this, we'll have to redeploy our Smart Contracts. However once a Smart Contract is deployed, Embark keeps track of it and won't try to redeploy the same Smart Contract again.\n\nOne way to deal with this is to use the [deployment tracking](/docs/contracts_configuration.html#Deployment-tracking) configuration. Another way is to use Embark's `reset` command which will remove some files and data that Embark stores in the project's `.embark` folder.\n\nWe can reset our project by running the following command:\n\n```\n$ embark reset\n```\n\nIt's possible to configure what files Embark is going to remove when doing a reset. Check out [this guide](/docs/configuration.html#Configuring-Embark’s-reset-command) to learn more.\n","source":"docs/running_apps.md","raw":"title: Running apps\nlayout: docs\n---\n\nWhile running Embark applications is pretty straight forward, there are some additional options we can take advantage of to change how our application is run. Whether we want Embark to automatically open a browser, open its dashboard or even make our app connect to different blockchains. This guide explores how this is done.\n\n## Using the `run` command\n\nIf you've read the [quickstart](quick_start.html) you're already aware that running an application is done by simply executing `embark run` within your project:\n\n```\n$ embark run\n```\n\nBy default, this will make Embark do a couple of things:\n\n- It initializes Embark\n- It starts the dashboard\n- It loads plugins\n- It spins up a blockchain and IPFS client, a web server and other necessary services\n- It compiles and deploys your app\n- It monitors running processes and recompiles and redeploys your app if needed\n- It starts [Cockpit](/docs/cockpit_introduction.html)\n\nMost of the time, using the `run` command is all what we need to work on our Embark project, but as mentioned above, we can take a bit more control over running our application.\n\n## Running an app without the dashboard\n\nWhile the dashboard gives us a great overview of all the processes and services that Embark manages for us, it's not required to start it every single time along with compiling and deploying our app. If we don't need the dashboard, we can prevent Embark from starting it by using the `--nodashboard` option:\n\n```\n$ embark run --nodashboard\n```\n\nWhen running the command with `--nodashboard`, Embark will fallback to only use standard log outputs, which are the same that we get in the **Logs** panel within the dashboard.\n\n## Running an app without opening a browser\n\nIn order to get up and running as fast as possible, Embark also takes care of opening a new browser window that connects to the web server to load our application's client. While this is quite convenient, sometimes we don't need a browser window to work on our app. This is the case when we're for example only interested in developing Smart Contracts, without creating a front-end.\n\nIf we don't want Embark to open a browser for us, all we have to do is using the `--nobrowser` option like this:\n\n\n```\n$ embark run --nobrowser\n```\n\n\n## Running an app without starting a web server\n\nIf we aren't interested in Embark starting a web server in the first place, we can easily turn it off by using the `--noserver` option:\n\n```\n$ embark run --noserver\n```\n\n## Running apps in different modes\n\nEmbark comes with different \"modes\" when building applications. `embark run` uses the `development` mode by default. However, this can be overwritten using the `--pipeline` option. The following command run our application in `production` mode.\n\n```\n$ embark run --pipeline production\n```\n\nFor more information about modes, head over to our guide on [building apps](pipeline_and_webpack.html).\n\n## Switching environments\n\nEmbark allows for configuring different environments to run our app against. This can be useful if we want to deploy our app to test networks or even private networks. In order to run our application in a specified environment, we first have to add a dedicated configuration to our project's `blockchain.js` file. \n\nDepending on how you initialized your application, it may have already multiple environments configured. Here's what a sample test network environment could look like:\n\n```\n// config/blockchain.js\n\nmodules.exports = {\n ...\n testnet: {\n networkType: \"testnet\",\n syncMode: \"light\",\n account: {\n password: \"config/testnet/password\"\n }\n },\n ...\n}\n```\n\nFor more information on configuring your Embark application, head over to the [general configuration guide](configuration.html).\n\nRunning an application in a different environment is just a matter of specifying the environment's name as part of the run command:\n\n```\n$ embark run [environment]\n```\n\nSo in case we want to run our app against the test network environment described above, this could be achieved by running:\n\n```\n$ embark run testnet\n```\n\n## Starting a blockchain separately\n\nSometimes we might want to have more control over the different processes involved when running our application with Embark. One of those things is to spin up a blockchain first and then have `embark run` connect to it. This enables us to stop and restart the blockchain process, without stopping Embark from doing its work.\n\nEmbark comes with a `blockchain` command that does exactly that:\n\n```\n$ embark blockchain\n```\n\nWhen this is executed before Embark is run within a project, the run command will skip spinning up a blockchain node itself and connect to the existing process. Similar to the `run` command, the `blockchain` command also allows to specify an environment:\n\n```\n$ embark blockchain testnet\n```\n\nBy default Embark blockchain will mine a minimum amount of ether and will only mine when new transactions come in.\n\n## Using the blockchain simulator\n\nAnother feature of Embark is to start a **simulated** blockchain. This can be useful for testing purposes as there's no need to wait for transactions to be mined. You might have heard of [Ganache CLI](https://truffleframework.com/docs/ganache/quickstart), which is a great project that implements such a simulated blockchain.\n\nEmbark integrates perfectly with this existing tool chain. To start a simulated blockchain, all we have do is to use the `simulator` command:\n\n```\n$ embark simulator\n```\n\n## Resetting apps\n\nSometimes we want to develop and test behaviours that are related to the deployment of our application. For example, we might want to use some of Embark's powerful [deployment hooks](/docs/contracts_configuration.html#Deployment-hooks) to initialize one of our Smart Contracts based on the deployment of another Smart Contract.\n\nTo test this, we'll have to redeploy our Smart Contracts. However once a Smart Contract is deployed, Embark keeps track of it and won't try to redeploy the same Smart Contract again.\n\nOne way to deal with this is to use the [deployment tracking](/docs/contracts_configuration.html#Deployment-tracking) configuration. Another way is to use Embark's `reset` command which will remove some files and data that Embark stores in the project's `.embark` folder.\n\nWe can reset our project by running the following command:\n\n```\n$ embark reset\n```\n\nIt's possible to configure what files Embark is going to remove when doing a reset. Check out [this guide](/docs/configuration.html#Configuring-Embark’s-reset-command) to learn more.\n","date":"2020-01-17T19:00:03.900Z","updated":"2020-01-17T19:00:03.900Z","path":"docs/running_apps.html","comments":1,"_id":"ck5ijm3rt001j7heg41pw16p3","content":"

While running Embark applications is pretty straight forward, there are some additional options we can take advantage of to change how our application is run. Whether we want Embark to automatically open a browser, open its dashboard or even make our app connect to different blockchains. This guide explores how this is done.

\n

Using the run command

If you’ve read the quickstart you’re already aware that running an application is done by simply executing embark run within your project:

\n
$ embark run
\n\n

By default, this will make Embark do a couple of things:

\n
    \n
  • It initializes Embark
  • \n
  • It starts the dashboard
  • \n
  • It loads plugins
  • \n
  • It spins up a blockchain and IPFS client, a web server and other necessary services
  • \n
  • It compiles and deploys your app
  • \n
  • It monitors running processes and recompiles and redeploys your app if needed
  • \n
  • It starts Cockpit
  • \n
\n

Most of the time, using the run command is all what we need to work on our Embark project, but as mentioned above, we can take a bit more control over running our application.

\n

Running an app without the dashboard

While the dashboard gives us a great overview of all the processes and services that Embark manages for us, it’s not required to start it every single time along with compiling and deploying our app. If we don’t need the dashboard, we can prevent Embark from starting it by using the --nodashboard option:

\n
$ embark run --nodashboard
\n\n

When running the command with --nodashboard, Embark will fallback to only use standard log outputs, which are the same that we get in the Logs panel within the dashboard.

\n

Running an app without opening a browser

In order to get up and running as fast as possible, Embark also takes care of opening a new browser window that connects to the web server to load our application’s client. While this is quite convenient, sometimes we don’t need a browser window to work on our app. This is the case when we’re for example only interested in developing Smart Contracts, without creating a front-end.

\n

If we don’t want Embark to open a browser for us, all we have to do is using the --nobrowser option like this:

\n
$ embark run --nobrowser
\n\n\n

Running an app without starting a web server

If we aren’t interested in Embark starting a web server in the first place, we can easily turn it off by using the --noserver option:

\n
$ embark run --noserver
\n\n

Running apps in different modes

Embark comes with different “modes” when building applications. embark run uses the development mode by default. However, this can be overwritten using the --pipeline option. The following command run our application in production mode.

\n
$ embark run --pipeline production
\n\n

For more information about modes, head over to our guide on building apps.

\n

Switching environments

Embark allows for configuring different environments to run our app against. This can be useful if we want to deploy our app to test networks or even private networks. In order to run our application in a specified environment, we first have to add a dedicated configuration to our project’s blockchain.js file.

\n

Depending on how you initialized your application, it may have already multiple environments configured. Here’s what a sample test network environment could look like:

\n
// config/blockchain.js

modules.exports = {
...
testnet: {
networkType: "testnet",
syncMode: "light",
account: {
password: "config/testnet/password"
}
},
...
}
\n\n

For more information on configuring your Embark application, head over to the general configuration guide.

\n

Running an application in a different environment is just a matter of specifying the environment’s name as part of the run command:

\n
$ embark run [environment]
\n\n

So in case we want to run our app against the test network environment described above, this could be achieved by running:

\n
$ embark run testnet
\n\n

Starting a blockchain separately

Sometimes we might want to have more control over the different processes involved when running our application with Embark. One of those things is to spin up a blockchain first and then have embark run connect to it. This enables us to stop and restart the blockchain process, without stopping Embark from doing its work.

\n

Embark comes with a blockchain command that does exactly that:

\n
$ embark blockchain
\n\n

When this is executed before Embark is run within a project, the run command will skip spinning up a blockchain node itself and connect to the existing process. Similar to the run command, the blockchain command also allows to specify an environment:

\n
$ embark blockchain testnet
\n\n

By default Embark blockchain will mine a minimum amount of ether and will only mine when new transactions come in.

\n

Using the blockchain simulator

Another feature of Embark is to start a simulated blockchain. This can be useful for testing purposes as there’s no need to wait for transactions to be mined. You might have heard of Ganache CLI, which is a great project that implements such a simulated blockchain.

\n

Embark integrates perfectly with this existing tool chain. To start a simulated blockchain, all we have do is to use the simulator command:

\n
$ embark simulator
\n\n

Resetting apps

Sometimes we want to develop and test behaviours that are related to the deployment of our application. For example, we might want to use some of Embark’s powerful deployment hooks to initialize one of our Smart Contracts based on the deployment of another Smart Contract.

\n

To test this, we’ll have to redeploy our Smart Contracts. However once a Smart Contract is deployed, Embark keeps track of it and won’t try to redeploy the same Smart Contract again.

\n

One way to deal with this is to use the deployment tracking configuration. Another way is to use Embark’s reset command which will remove some files and data that Embark stores in the project’s .embark folder.

\n

We can reset our project by running the following command:

\n
$ embark reset
\n\n

It’s possible to configure what files Embark is going to remove when doing a reset. Check out this guide to learn more.

\n","site":{"data":{"authors":{"iuri_matias":{"name":"Iuri Matias","twitter":"iurimatias","image":"https://pbs.twimg.com/profile_images/928272512181563392/iDJdvy2k_400x400.jpg"},"pascal_precht":{"name":"Pascal Precht","twitter":"pascalprecht","image":"https://pbs.twimg.com/profile_images/993785060733194241/p3oAIMDP_400x400.jpg"},"anthony_laibe":{"name":"Anthony Laibe","twitter":"a_laibe","image":"https://pbs.twimg.com/profile_images/257742900/13168239_400x400.jpg"},"jonathan_rainville":{"name":"Jonathan Rainville","twitter":"ShyolGhul","image":"https://pbs.twimg.com/profile_images/993873866878570496/-aE4byjj_400x400.jpg"},"andre_medeiros":{"name":"Andre Medeiros","twitter":"superdealloc","image":"https://pbs.twimg.com/profile_images/965722487735701504/m58KNgWN_400x400.jpg"},"eric_mastro":{"name":"Eric Mastro","twitter":"ericmastro","image":"https://avatars1.githubusercontent.com/u/5089238?s=460&v=4"},"michael_bradley":{"name":"Michael Bradley","image":"https://avatars3.githubusercontent.com/u/194260?s=460&v=4"},"richard_ramos":{"name":"Richard Ramos","twitter":"richardramos_me","image":"https://pbs.twimg.com/profile_images/1063160577973866496/aM313uHG_400x400.jpg"},"jonny_zerah":{"name":"Jonny Zerah","twitter":"jonnyzerah","image":"https://pbs.twimg.com/profile_images/1043774340490248192/gI9aGy17_400x400.jpg"},"robin_percy":{"name":"Robin Percy","twitter":"rbin","image":"https://avatars1.githubusercontent.com/u/29288325?s=400&v=4"}},"categories":{"tutorials":"Tutorials","announcements":"Announcements"},"languages":{"en":"English"},"plugins":[{"name":"embark-bamboo","description":"plugins_page.plugins.bamboo.desc","link":"https://www.npmjs.com/package/embark-bamboo","thumbnail":"bamboo.png","tags":["language","smart-contracts"]},{"name":"embark-solc","description":"plugins_page.plugins.solc.desc","link":"https://www.npmjs.com/package/embark-solc","thumbnail":"solidity.png","tags":["solidity","language","smart-contracts"]},{"name":"embark-solium","description":"plugins_page.plugins.solium.desc","link":"https://www.npmjs.com/package/embark-solium","thumbnail":"solium.png","tags":["linter","solidity","solium"]},{"name":"embark-etherscan-verifier","description":"plugins_page.plugins.verifier.desc","link":"https://www.npmjs.com/package/embark-etherscan-verifier","tags":["solidity","etherscan","smart-contracts"]},{"name":"embark-status","description":"plugins_page.plugins.status.desc","link":"https://www.npmjs.com/package/embark-status-plugin","thumbnail":"status.png","tags":["status","mobile"]},{"name":"embark-remix","description":"plugins_page.plugins.remix.desc","link":"https://www.npmjs.com/package/embark-remix","thumbnail":"remix.png","tags":["remix","debugger"]},{"name":"embark-slither","description":"plugins_page.plugins.slither.desc","link":"https://www.npmjs.com/package/embark-slither","tags":["solidity"]},{"name":"embark-snark","description":"plugins_page.plugins.snark.desc","link":"https://www.npmjs.com/package/embark-snark","tags":["snark"]},{"name":"embark-fortune","description":"plugins_page.plugins.fortune.desc","link":"https://www.npmjs.com/package/embark-fortune","thumbnail":"fortune.jpg","tags":["fun"]},{"name":"embark-pug","description":"plugins_page.plugins.pug.desc","link":"https://www.npmjs.com/package/embark-pug","legacy":true,"thumbnail":"pug.png","tags":["pug","jade","templates"]},{"name":"embark-haml","description":"plugins_page.plugins.haml.desc","link":"https://www.npmjs.com/package/embark-haml","legacy":true,"thumbnail":"haml.png","tags":["haml","templates"]},{"name":"embark-mythx","description":"plugins_page.plugins.mythx.desc","link":"https://www.npmjs.com/package/embark-mythx","thumbnail":"mythx.png","tags":["mythx","smart-contracts"]}],"menu":{"docs":"/docs/","plugins":"/plugins/","chat":"/chat/","blog":"/news/"},"sidebar":{"docs":{"getting_started":{"overview":"overview.html","installation":"installation.html","faq":"faq.html"},"general_usage":{"creating_project":"create_project.html","structure":"structure.html","running_apps":"running_apps.html","dashboard":"dashboard.html","using_the_console":"using_the_console.html","environments":"environments.html","configuration":"configuration.html","pipeline_and_webpack":"pipeline_and_webpack.html","javascript_usage":"javascript_usage.html"},"smart_contracts":{"contracts_configuration":"contracts_configuration.html","contracts_deployment":"contracts_deployment.html","contracts_imports":"contracts_imports.html","contracts_testing":"contracts_testing.html","contracts_javascript":"contracts_javascript.html"},"blockchain_node":{"blockchain_configuration":"blockchain_configuration.html","blockchain_accounts_configuration":"blockchain_accounts_configuration.html"},"storage":{"storage_configuration":"storage_configuration.html","storage_deployment":"storage_deployment.html","storage_javascript":"storage_javascript.html"},"messages":{"messages_configuration":"messages_configuration.html","messages_javascript":"messages_javascript.html"},"naming":{"naming_configuration":"naming_configuration.html","naming_javascript":"naming_javascript.html"},"plugins":{"installing_a_plugin":"installing_plugins.html","creating_a_plugin":"creating_plugins.html","plugin_reference":"plugin_reference.html"},"cockpit":{"cockpit_introduction":"cockpit_introduction.html","cockpit_dashboard":"cockpit_dashboard.html","cockpit_deployment":"cockpit_deployment.html","cockpit_explorer":"cockpit_explorer.html","cockpit_editor":"cockpit_editor.html","cockpit_debugger":"cockpit_debugger.html"},"reference":{"embark_commands":"embark_commands.html"},"miscellaneous":{"migrating_from_3":"migrating_from_3.x.html","troubleshooting":"troubleshooting.html","contributing":"contributing.html"}}},"templates":[{"name":"Vyper Template","description":"Template to demonstrate the use of the Vyper contracts","install":"embark new AppName --template vyper","thumbnail":"vyper.png","link":"https://github.com/embarklabs/embark-vyper-template","tags":["vyper","contracts"]},{"name":"Embark Demo React Template","description":"A React Application showcasing Embark's functionality","install":"embark demo","thumbnail":"react.png","link":"https://embark.embarklabs.io/docs/create_project.html#Creating-a-Demo-Project","tags":["react","contracts","whisper","ipfs"]},{"name":"Typescript Template","description":"Template with Typescript support pre-configured","thumbnail":"typescript.png","install":"embark new AppName --template typescript","link":"https://github.com/embarklabs/embark-typescript-template","tags":["typescript","frontend"]},{"name":"Vue.js Template","description":"Ready to use Template for using Embark with vue.js","thumbnail":"vuejs.png","install":"embark new AppName --template vue","link":"https://github.com/embarklabs/embark-vue-template","tags":["vue.js","frontend"]},{"name":"ethvtx Template","description":"Demo app for ethvtx, an Ethereum-Ready & Framework-Agnostic Redux configuration","thumbnail":"vortex.png","install":"embark new AppName --template Horyus/ethvtx_embark","link":"https://github.com/Horyus/ethvtx_embark","tags":["react"]},{"name":"Bamboo Template","description":"Template to demonstrate use of the Bamboo contracts","install":"embark new AppName --template bamboo","thumbnail":"bamboo.png","link":"https://github.com/embarklabs/embark-bamboo-template","tags":["bamboo","contracts"]},{"name":"Solidity Gas Golfing","description":"Boilerplate and tests for the first Solidity Gas Golfing Contest","thumbnail":"sggc.png","install":"embark new AppName --template embarklabs/sggc","link":"https://github.com/embarklabs/sggc","tags":["solidity","tests","fun"]}],"tutorials":[{"name":"How to create a Token Factory with Ethereum — Part 1","description":"Create and Deploy a Token with Ethereum","link":"/tutorials/token_factory_1.html","tags":["token","ethereum"]},{"name":"How to create a Token Factory with Ethereum — Part 2","description":"Create a DApp that can deploy Tokens on the fly","link":"/tutorials/token_factory_2.html","tags":["token","ethereum","client-side-deployment"]},{"name":"How to deploy to a testnet with Infura","description":"Deploy and interact with your Dapp on a testnet with the use of Infura","link":"/tutorials/infura_guide.html","tags":["ethereum","deployment","testnet"]}],"versions":{"latest":{"label":"stable (v4)","url":"https://embark.embarklabs.io/docs"},"3.2":{"label":"v3.2","url":"https://5ca4e0fdb29712000adde37f--embark-site-versions.netlify.com/docs/"}}}},"excerpt":"","more":"

While running Embark applications is pretty straight forward, there are some additional options we can take advantage of to change how our application is run. Whether we want Embark to automatically open a browser, open its dashboard or even make our app connect to different blockchains. This guide explores how this is done.

\n

Using the run command

If you’ve read the quickstart you’re already aware that running an application is done by simply executing embark run within your project:

\n
$ embark run
\n\n

By default, this will make Embark do a couple of things:

\n
    \n
  • It initializes Embark
  • \n
  • It starts the dashboard
  • \n
  • It loads plugins
  • \n
  • It spins up a blockchain and IPFS client, a web server and other necessary services
  • \n
  • It compiles and deploys your app
  • \n
  • It monitors running processes and recompiles and redeploys your app if needed
  • \n
  • It starts Cockpit
  • \n
\n

Most of the time, using the run command is all what we need to work on our Embark project, but as mentioned above, we can take a bit more control over running our application.

\n

Running an app without the dashboard

While the dashboard gives us a great overview of all the processes and services that Embark manages for us, it’s not required to start it every single time along with compiling and deploying our app. If we don’t need the dashboard, we can prevent Embark from starting it by using the --nodashboard option:

\n
$ embark run --nodashboard
\n\n

When running the command with --nodashboard, Embark will fallback to only use standard log outputs, which are the same that we get in the Logs panel within the dashboard.

\n

Running an app without opening a browser

In order to get up and running as fast as possible, Embark also takes care of opening a new browser window that connects to the web server to load our application’s client. While this is quite convenient, sometimes we don’t need a browser window to work on our app. This is the case when we’re for example only interested in developing Smart Contracts, without creating a front-end.

\n

If we don’t want Embark to open a browser for us, all we have to do is using the --nobrowser option like this:

\n
$ embark run --nobrowser
\n\n\n

Running an app without starting a web server

If we aren’t interested in Embark starting a web server in the first place, we can easily turn it off by using the --noserver option:

\n
$ embark run --noserver
\n\n

Running apps in different modes

Embark comes with different “modes” when building applications. embark run uses the development mode by default. However, this can be overwritten using the --pipeline option. The following command run our application in production mode.

\n
$ embark run --pipeline production
\n\n

For more information about modes, head over to our guide on building apps.

\n

Switching environments

Embark allows for configuring different environments to run our app against. This can be useful if we want to deploy our app to test networks or even private networks. In order to run our application in a specified environment, we first have to add a dedicated configuration to our project’s blockchain.js file.

\n

Depending on how you initialized your application, it may have already multiple environments configured. Here’s what a sample test network environment could look like:

\n
// config/blockchain.js

modules.exports = {
...
testnet: {
networkType: "testnet",
syncMode: "light",
account: {
password: "config/testnet/password"
}
},
...
}
\n\n

For more information on configuring your Embark application, head over to the general configuration guide.

\n

Running an application in a different environment is just a matter of specifying the environment’s name as part of the run command:

\n
$ embark run [environment]
\n\n

So in case we want to run our app against the test network environment described above, this could be achieved by running:

\n
$ embark run testnet
\n\n

Starting a blockchain separately

Sometimes we might want to have more control over the different processes involved when running our application with Embark. One of those things is to spin up a blockchain first and then have embark run connect to it. This enables us to stop and restart the blockchain process, without stopping Embark from doing its work.

\n

Embark comes with a blockchain command that does exactly that:

\n
$ embark blockchain
\n\n

When this is executed before Embark is run within a project, the run command will skip spinning up a blockchain node itself and connect to the existing process. Similar to the run command, the blockchain command also allows to specify an environment:

\n
$ embark blockchain testnet
\n\n

By default Embark blockchain will mine a minimum amount of ether and will only mine when new transactions come in.

\n

Using the blockchain simulator

Another feature of Embark is to start a simulated blockchain. This can be useful for testing purposes as there’s no need to wait for transactions to be mined. You might have heard of Ganache CLI, which is a great project that implements such a simulated blockchain.

\n

Embark integrates perfectly with this existing tool chain. To start a simulated blockchain, all we have do is to use the simulator command:

\n
$ embark simulator
\n\n

Resetting apps

Sometimes we want to develop and test behaviours that are related to the deployment of our application. For example, we might want to use some of Embark’s powerful deployment hooks to initialize one of our Smart Contracts based on the deployment of another Smart Contract.

\n

To test this, we’ll have to redeploy our Smart Contracts. However once a Smart Contract is deployed, Embark keeps track of it and won’t try to redeploy the same Smart Contract again.

\n

One way to deal with this is to use the deployment tracking configuration. Another way is to use Embark’s reset command which will remove some files and data that Embark stores in the project’s .embark folder.

\n

We can reset our project by running the following command:

\n
$ embark reset
\n\n

It’s possible to configure what files Embark is going to remove when doing a reset. Check out this guide to learn more.

\n"},{"title":"Sending and Receiving messages","layout":"docs","_content":"\n### listening to messages\n\n
EmbarkJS.Messages.listenTo({topic: [\"topic1\", \"topic2\"]}).then(function(message) {\n  console.log(\"received: \" + message);\n})\n
\n\n### sending messages\n\nYou can send plain text\n\n
EmbarkJS.Messages.sendMessage({topic: \"sometopic\", data: 'hello world'})\n
\n\nOr an object\n\n
EmbarkJS.Messages.sendMessage({topic: \"sometopic\", data: {msg: 'hello world'}})\n
\n\nNote: array of topics are considered an AND. In Whisper you can use another array for OR combinations of several topics e.g ``[\"topic1\", [\"topic2\", \"topic3\"]]`` => ``topic1 AND (topic2 OR topic 3)``\n\n### Setup\n\nBy default Embark will automatically initialize EmbarkJS with the provider configured at `config/communication.js`. However if you are using EmbarkJS directly or wish to change the provider configuration on the fly you can do:\n\n
EmbarkJS.Messages.setProvider('whisper')\n
\n\n\n","source":"docs/sending_and_receiving_messages.md","raw":"title: Sending and Receiving messages\nlayout: docs\n---\n\n### listening to messages\n\n
EmbarkJS.Messages.listenTo({topic: [\"topic1\", \"topic2\"]}).then(function(message) {\n  console.log(\"received: \" + message);\n})\n
\n\n### sending messages\n\nYou can send plain text\n\n
EmbarkJS.Messages.sendMessage({topic: \"sometopic\", data: 'hello world'})\n
\n\nOr an object\n\n
EmbarkJS.Messages.sendMessage({topic: \"sometopic\", data: {msg: 'hello world'}})\n
\n\nNote: array of topics are considered an AND. In Whisper you can use another array for OR combinations of several topics e.g ``[\"topic1\", [\"topic2\", \"topic3\"]]`` => ``topic1 AND (topic2 OR topic 3)``\n\n### Setup\n\nBy default Embark will automatically initialize EmbarkJS with the provider configured at `config/communication.js`. However if you are using EmbarkJS directly or wish to change the provider configuration on the fly you can do:\n\n
EmbarkJS.Messages.setProvider('whisper')\n
\n\n\n","date":"2020-01-17T19:00:03.900Z","updated":"2020-01-17T19:00:03.900Z","path":"docs/sending_and_receiving_messages.html","comments":1,"_id":"ck5ijm3ru001k7heg3fkc3809","content":"

listening to messages

EmbarkJS.Messages.listenTo({topic: [\"topic1\", \"topic2\"]}).then(function(message) {\n  console.log(\"received: \" + message);\n})\n
\n\n

sending messages

You can send plain text

\n
EmbarkJS.Messages.sendMessage({topic: \"sometopic\", data: 'hello world'})\n
\n\n

Or an object

\n
EmbarkJS.Messages.sendMessage({topic: \"sometopic\", data: {msg: 'hello world'}})\n
\n\n

Note: array of topics are considered an AND. In Whisper you can use another array for OR combinations of several topics e.g ["topic1", ["topic2", "topic3"]] => topic1 AND (topic2 OR topic 3)

\n

Setup

By default Embark will automatically initialize EmbarkJS with the provider configured at config/communication.js. However if you are using EmbarkJS directly or wish to change the provider configuration on the fly you can do:

\n
EmbarkJS.Messages.setProvider('whisper')\n
\n\n\n","site":{"data":{"authors":{"iuri_matias":{"name":"Iuri Matias","twitter":"iurimatias","image":"https://pbs.twimg.com/profile_images/928272512181563392/iDJdvy2k_400x400.jpg"},"pascal_precht":{"name":"Pascal Precht","twitter":"pascalprecht","image":"https://pbs.twimg.com/profile_images/993785060733194241/p3oAIMDP_400x400.jpg"},"anthony_laibe":{"name":"Anthony Laibe","twitter":"a_laibe","image":"https://pbs.twimg.com/profile_images/257742900/13168239_400x400.jpg"},"jonathan_rainville":{"name":"Jonathan Rainville","twitter":"ShyolGhul","image":"https://pbs.twimg.com/profile_images/993873866878570496/-aE4byjj_400x400.jpg"},"andre_medeiros":{"name":"Andre Medeiros","twitter":"superdealloc","image":"https://pbs.twimg.com/profile_images/965722487735701504/m58KNgWN_400x400.jpg"},"eric_mastro":{"name":"Eric Mastro","twitter":"ericmastro","image":"https://avatars1.githubusercontent.com/u/5089238?s=460&v=4"},"michael_bradley":{"name":"Michael Bradley","image":"https://avatars3.githubusercontent.com/u/194260?s=460&v=4"},"richard_ramos":{"name":"Richard Ramos","twitter":"richardramos_me","image":"https://pbs.twimg.com/profile_images/1063160577973866496/aM313uHG_400x400.jpg"},"jonny_zerah":{"name":"Jonny Zerah","twitter":"jonnyzerah","image":"https://pbs.twimg.com/profile_images/1043774340490248192/gI9aGy17_400x400.jpg"},"robin_percy":{"name":"Robin Percy","twitter":"rbin","image":"https://avatars1.githubusercontent.com/u/29288325?s=400&v=4"}},"categories":{"tutorials":"Tutorials","announcements":"Announcements"},"languages":{"en":"English"},"plugins":[{"name":"embark-bamboo","description":"plugins_page.plugins.bamboo.desc","link":"https://www.npmjs.com/package/embark-bamboo","thumbnail":"bamboo.png","tags":["language","smart-contracts"]},{"name":"embark-solc","description":"plugins_page.plugins.solc.desc","link":"https://www.npmjs.com/package/embark-solc","thumbnail":"solidity.png","tags":["solidity","language","smart-contracts"]},{"name":"embark-solium","description":"plugins_page.plugins.solium.desc","link":"https://www.npmjs.com/package/embark-solium","thumbnail":"solium.png","tags":["linter","solidity","solium"]},{"name":"embark-etherscan-verifier","description":"plugins_page.plugins.verifier.desc","link":"https://www.npmjs.com/package/embark-etherscan-verifier","tags":["solidity","etherscan","smart-contracts"]},{"name":"embark-status","description":"plugins_page.plugins.status.desc","link":"https://www.npmjs.com/package/embark-status-plugin","thumbnail":"status.png","tags":["status","mobile"]},{"name":"embark-remix","description":"plugins_page.plugins.remix.desc","link":"https://www.npmjs.com/package/embark-remix","thumbnail":"remix.png","tags":["remix","debugger"]},{"name":"embark-slither","description":"plugins_page.plugins.slither.desc","link":"https://www.npmjs.com/package/embark-slither","tags":["solidity"]},{"name":"embark-snark","description":"plugins_page.plugins.snark.desc","link":"https://www.npmjs.com/package/embark-snark","tags":["snark"]},{"name":"embark-fortune","description":"plugins_page.plugins.fortune.desc","link":"https://www.npmjs.com/package/embark-fortune","thumbnail":"fortune.jpg","tags":["fun"]},{"name":"embark-pug","description":"plugins_page.plugins.pug.desc","link":"https://www.npmjs.com/package/embark-pug","legacy":true,"thumbnail":"pug.png","tags":["pug","jade","templates"]},{"name":"embark-haml","description":"plugins_page.plugins.haml.desc","link":"https://www.npmjs.com/package/embark-haml","legacy":true,"thumbnail":"haml.png","tags":["haml","templates"]},{"name":"embark-mythx","description":"plugins_page.plugins.mythx.desc","link":"https://www.npmjs.com/package/embark-mythx","thumbnail":"mythx.png","tags":["mythx","smart-contracts"]}],"menu":{"docs":"/docs/","plugins":"/plugins/","chat":"/chat/","blog":"/news/"},"sidebar":{"docs":{"getting_started":{"overview":"overview.html","installation":"installation.html","faq":"faq.html"},"general_usage":{"creating_project":"create_project.html","structure":"structure.html","running_apps":"running_apps.html","dashboard":"dashboard.html","using_the_console":"using_the_console.html","environments":"environments.html","configuration":"configuration.html","pipeline_and_webpack":"pipeline_and_webpack.html","javascript_usage":"javascript_usage.html"},"smart_contracts":{"contracts_configuration":"contracts_configuration.html","contracts_deployment":"contracts_deployment.html","contracts_imports":"contracts_imports.html","contracts_testing":"contracts_testing.html","contracts_javascript":"contracts_javascript.html"},"blockchain_node":{"blockchain_configuration":"blockchain_configuration.html","blockchain_accounts_configuration":"blockchain_accounts_configuration.html"},"storage":{"storage_configuration":"storage_configuration.html","storage_deployment":"storage_deployment.html","storage_javascript":"storage_javascript.html"},"messages":{"messages_configuration":"messages_configuration.html","messages_javascript":"messages_javascript.html"},"naming":{"naming_configuration":"naming_configuration.html","naming_javascript":"naming_javascript.html"},"plugins":{"installing_a_plugin":"installing_plugins.html","creating_a_plugin":"creating_plugins.html","plugin_reference":"plugin_reference.html"},"cockpit":{"cockpit_introduction":"cockpit_introduction.html","cockpit_dashboard":"cockpit_dashboard.html","cockpit_deployment":"cockpit_deployment.html","cockpit_explorer":"cockpit_explorer.html","cockpit_editor":"cockpit_editor.html","cockpit_debugger":"cockpit_debugger.html"},"reference":{"embark_commands":"embark_commands.html"},"miscellaneous":{"migrating_from_3":"migrating_from_3.x.html","troubleshooting":"troubleshooting.html","contributing":"contributing.html"}}},"templates":[{"name":"Vyper Template","description":"Template to demonstrate the use of the Vyper contracts","install":"embark new AppName --template vyper","thumbnail":"vyper.png","link":"https://github.com/embarklabs/embark-vyper-template","tags":["vyper","contracts"]},{"name":"Embark Demo React Template","description":"A React Application showcasing Embark's functionality","install":"embark demo","thumbnail":"react.png","link":"https://embark.embarklabs.io/docs/create_project.html#Creating-a-Demo-Project","tags":["react","contracts","whisper","ipfs"]},{"name":"Typescript Template","description":"Template with Typescript support pre-configured","thumbnail":"typescript.png","install":"embark new AppName --template typescript","link":"https://github.com/embarklabs/embark-typescript-template","tags":["typescript","frontend"]},{"name":"Vue.js Template","description":"Ready to use Template for using Embark with vue.js","thumbnail":"vuejs.png","install":"embark new AppName --template vue","link":"https://github.com/embarklabs/embark-vue-template","tags":["vue.js","frontend"]},{"name":"ethvtx Template","description":"Demo app for ethvtx, an Ethereum-Ready & Framework-Agnostic Redux configuration","thumbnail":"vortex.png","install":"embark new AppName --template Horyus/ethvtx_embark","link":"https://github.com/Horyus/ethvtx_embark","tags":["react"]},{"name":"Bamboo Template","description":"Template to demonstrate use of the Bamboo contracts","install":"embark new AppName --template bamboo","thumbnail":"bamboo.png","link":"https://github.com/embarklabs/embark-bamboo-template","tags":["bamboo","contracts"]},{"name":"Solidity Gas Golfing","description":"Boilerplate and tests for the first Solidity Gas Golfing Contest","thumbnail":"sggc.png","install":"embark new AppName --template embarklabs/sggc","link":"https://github.com/embarklabs/sggc","tags":["solidity","tests","fun"]}],"tutorials":[{"name":"How to create a Token Factory with Ethereum — Part 1","description":"Create and Deploy a Token with Ethereum","link":"/tutorials/token_factory_1.html","tags":["token","ethereum"]},{"name":"How to create a Token Factory with Ethereum — Part 2","description":"Create a DApp that can deploy Tokens on the fly","link":"/tutorials/token_factory_2.html","tags":["token","ethereum","client-side-deployment"]},{"name":"How to deploy to a testnet with Infura","description":"Deploy and interact with your Dapp on a testnet with the use of Infura","link":"/tutorials/infura_guide.html","tags":["ethereum","deployment","testnet"]}],"versions":{"latest":{"label":"stable (v4)","url":"https://embark.embarklabs.io/docs"},"3.2":{"label":"v3.2","url":"https://5ca4e0fdb29712000adde37f--embark-site-versions.netlify.com/docs/"}}}},"excerpt":"","more":"

listening to messages

EmbarkJS.Messages.listenTo({topic: [\"topic1\", \"topic2\"]}).then(function(message) {\n  console.log(\"received: \" + message);\n})\n
\n\n

sending messages

You can send plain text

\n
EmbarkJS.Messages.sendMessage({topic: \"sometopic\", data: 'hello world'})\n
\n\n

Or an object

\n
EmbarkJS.Messages.sendMessage({topic: \"sometopic\", data: {msg: 'hello world'}})\n
\n\n

Note: array of topics are considered an AND. In Whisper you can use another array for OR combinations of several topics e.g ["topic1", ["topic2", "topic3"]] => topic1 AND (topic2 OR topic 3)

\n

Setup

By default Embark will automatically initialize EmbarkJS with the provider configured at config/communication.js. However if you are using EmbarkJS directly or wish to change the provider configuration on the fly you can do:

\n
EmbarkJS.Messages.setProvider('whisper')\n
\n\n\n"},{"title":"Smart Contract Objects","layout":"docs","_content":"### Interacting with contracts in Javascript\n\nEmbark will automatically take care of deployment for you and set all needed JS bindings. For example, the contract below:\n\n```\n// app/contracts/simple_storage.sol\n\ncontract SimpleStorage {\n uint public storedData;\n\n function SimpleStorage(uint initialValue) {\n storedData = initialValue;\n }\n\n function set(uint x) {\n storedData = x;\n }\n function get() constant returns (uint retVal) {\n return storedData;\n }\n}\n```\n\nWill automatically be available in Javascript as:\n\n```\n// app/js/index.js\n\nimport SimpleStorage from 'Embark/contracts/SimpleStorage';\n\nSimpleStorage.methods.set(100).send();\nSimpleStorage.methods.get().call().then(function(value) { console.log(value) });\nSimpleStorage.methods.storedData().call().then(function(value) { console.log(value) });\n```\n\nThe syntax used is web3.js 1.2.1\n","source":"docs/smart_contract_objects.md","raw":"title: Smart Contract Objects\nlayout: docs\n---\n### Interacting with contracts in Javascript\n\nEmbark will automatically take care of deployment for you and set all needed JS bindings. For example, the contract below:\n\n```\n// app/contracts/simple_storage.sol\n\ncontract SimpleStorage {\n uint public storedData;\n\n function SimpleStorage(uint initialValue) {\n storedData = initialValue;\n }\n\n function set(uint x) {\n storedData = x;\n }\n function get() constant returns (uint retVal) {\n return storedData;\n }\n}\n```\n\nWill automatically be available in Javascript as:\n\n```\n// app/js/index.js\n\nimport SimpleStorage from 'Embark/contracts/SimpleStorage';\n\nSimpleStorage.methods.set(100).send();\nSimpleStorage.methods.get().call().then(function(value) { console.log(value) });\nSimpleStorage.methods.storedData().call().then(function(value) { console.log(value) });\n```\n\nThe syntax used is web3.js 1.2.1\n","date":"2020-01-17T19:00:03.900Z","updated":"2020-01-17T19:00:03.900Z","path":"docs/smart_contract_objects.html","comments":1,"_id":"ck5ijm3rv001l7heg41h7gzra","content":"

Interacting with contracts in Javascript

Embark will automatically take care of deployment for you and set all needed JS bindings. For example, the contract below:

\n
// app/contracts/simple_storage.sol

contract SimpleStorage {
uint public storedData;

function SimpleStorage(uint initialValue) {
storedData = initialValue;
}

function set(uint x) {
storedData = x;
}
function get() constant returns (uint retVal) {
return storedData;
}
}
\n\n

Will automatically be available in Javascript as:

\n
// app/js/index.js

import SimpleStorage from 'Embark/contracts/SimpleStorage';

SimpleStorage.methods.set(100).send();
SimpleStorage.methods.get().call().then(function(value) { console.log(value) });
SimpleStorage.methods.storedData().call().then(function(value) { console.log(value) });
\n\n

The syntax used is web3.js 1.2.1

\n","site":{"data":{"authors":{"iuri_matias":{"name":"Iuri Matias","twitter":"iurimatias","image":"https://pbs.twimg.com/profile_images/928272512181563392/iDJdvy2k_400x400.jpg"},"pascal_precht":{"name":"Pascal Precht","twitter":"pascalprecht","image":"https://pbs.twimg.com/profile_images/993785060733194241/p3oAIMDP_400x400.jpg"},"anthony_laibe":{"name":"Anthony Laibe","twitter":"a_laibe","image":"https://pbs.twimg.com/profile_images/257742900/13168239_400x400.jpg"},"jonathan_rainville":{"name":"Jonathan Rainville","twitter":"ShyolGhul","image":"https://pbs.twimg.com/profile_images/993873866878570496/-aE4byjj_400x400.jpg"},"andre_medeiros":{"name":"Andre Medeiros","twitter":"superdealloc","image":"https://pbs.twimg.com/profile_images/965722487735701504/m58KNgWN_400x400.jpg"},"eric_mastro":{"name":"Eric Mastro","twitter":"ericmastro","image":"https://avatars1.githubusercontent.com/u/5089238?s=460&v=4"},"michael_bradley":{"name":"Michael Bradley","image":"https://avatars3.githubusercontent.com/u/194260?s=460&v=4"},"richard_ramos":{"name":"Richard Ramos","twitter":"richardramos_me","image":"https://pbs.twimg.com/profile_images/1063160577973866496/aM313uHG_400x400.jpg"},"jonny_zerah":{"name":"Jonny Zerah","twitter":"jonnyzerah","image":"https://pbs.twimg.com/profile_images/1043774340490248192/gI9aGy17_400x400.jpg"},"robin_percy":{"name":"Robin Percy","twitter":"rbin","image":"https://avatars1.githubusercontent.com/u/29288325?s=400&v=4"}},"categories":{"tutorials":"Tutorials","announcements":"Announcements"},"languages":{"en":"English"},"plugins":[{"name":"embark-bamboo","description":"plugins_page.plugins.bamboo.desc","link":"https://www.npmjs.com/package/embark-bamboo","thumbnail":"bamboo.png","tags":["language","smart-contracts"]},{"name":"embark-solc","description":"plugins_page.plugins.solc.desc","link":"https://www.npmjs.com/package/embark-solc","thumbnail":"solidity.png","tags":["solidity","language","smart-contracts"]},{"name":"embark-solium","description":"plugins_page.plugins.solium.desc","link":"https://www.npmjs.com/package/embark-solium","thumbnail":"solium.png","tags":["linter","solidity","solium"]},{"name":"embark-etherscan-verifier","description":"plugins_page.plugins.verifier.desc","link":"https://www.npmjs.com/package/embark-etherscan-verifier","tags":["solidity","etherscan","smart-contracts"]},{"name":"embark-status","description":"plugins_page.plugins.status.desc","link":"https://www.npmjs.com/package/embark-status-plugin","thumbnail":"status.png","tags":["status","mobile"]},{"name":"embark-remix","description":"plugins_page.plugins.remix.desc","link":"https://www.npmjs.com/package/embark-remix","thumbnail":"remix.png","tags":["remix","debugger"]},{"name":"embark-slither","description":"plugins_page.plugins.slither.desc","link":"https://www.npmjs.com/package/embark-slither","tags":["solidity"]},{"name":"embark-snark","description":"plugins_page.plugins.snark.desc","link":"https://www.npmjs.com/package/embark-snark","tags":["snark"]},{"name":"embark-fortune","description":"plugins_page.plugins.fortune.desc","link":"https://www.npmjs.com/package/embark-fortune","thumbnail":"fortune.jpg","tags":["fun"]},{"name":"embark-pug","description":"plugins_page.plugins.pug.desc","link":"https://www.npmjs.com/package/embark-pug","legacy":true,"thumbnail":"pug.png","tags":["pug","jade","templates"]},{"name":"embark-haml","description":"plugins_page.plugins.haml.desc","link":"https://www.npmjs.com/package/embark-haml","legacy":true,"thumbnail":"haml.png","tags":["haml","templates"]},{"name":"embark-mythx","description":"plugins_page.plugins.mythx.desc","link":"https://www.npmjs.com/package/embark-mythx","thumbnail":"mythx.png","tags":["mythx","smart-contracts"]}],"menu":{"docs":"/docs/","plugins":"/plugins/","chat":"/chat/","blog":"/news/"},"sidebar":{"docs":{"getting_started":{"overview":"overview.html","installation":"installation.html","faq":"faq.html"},"general_usage":{"creating_project":"create_project.html","structure":"structure.html","running_apps":"running_apps.html","dashboard":"dashboard.html","using_the_console":"using_the_console.html","environments":"environments.html","configuration":"configuration.html","pipeline_and_webpack":"pipeline_and_webpack.html","javascript_usage":"javascript_usage.html"},"smart_contracts":{"contracts_configuration":"contracts_configuration.html","contracts_deployment":"contracts_deployment.html","contracts_imports":"contracts_imports.html","contracts_testing":"contracts_testing.html","contracts_javascript":"contracts_javascript.html"},"blockchain_node":{"blockchain_configuration":"blockchain_configuration.html","blockchain_accounts_configuration":"blockchain_accounts_configuration.html"},"storage":{"storage_configuration":"storage_configuration.html","storage_deployment":"storage_deployment.html","storage_javascript":"storage_javascript.html"},"messages":{"messages_configuration":"messages_configuration.html","messages_javascript":"messages_javascript.html"},"naming":{"naming_configuration":"naming_configuration.html","naming_javascript":"naming_javascript.html"},"plugins":{"installing_a_plugin":"installing_plugins.html","creating_a_plugin":"creating_plugins.html","plugin_reference":"plugin_reference.html"},"cockpit":{"cockpit_introduction":"cockpit_introduction.html","cockpit_dashboard":"cockpit_dashboard.html","cockpit_deployment":"cockpit_deployment.html","cockpit_explorer":"cockpit_explorer.html","cockpit_editor":"cockpit_editor.html","cockpit_debugger":"cockpit_debugger.html"},"reference":{"embark_commands":"embark_commands.html"},"miscellaneous":{"migrating_from_3":"migrating_from_3.x.html","troubleshooting":"troubleshooting.html","contributing":"contributing.html"}}},"templates":[{"name":"Vyper Template","description":"Template to demonstrate the use of the Vyper contracts","install":"embark new AppName --template vyper","thumbnail":"vyper.png","link":"https://github.com/embarklabs/embark-vyper-template","tags":["vyper","contracts"]},{"name":"Embark Demo React Template","description":"A React Application showcasing Embark's functionality","install":"embark demo","thumbnail":"react.png","link":"https://embark.embarklabs.io/docs/create_project.html#Creating-a-Demo-Project","tags":["react","contracts","whisper","ipfs"]},{"name":"Typescript Template","description":"Template with Typescript support pre-configured","thumbnail":"typescript.png","install":"embark new AppName --template typescript","link":"https://github.com/embarklabs/embark-typescript-template","tags":["typescript","frontend"]},{"name":"Vue.js Template","description":"Ready to use Template for using Embark with vue.js","thumbnail":"vuejs.png","install":"embark new AppName --template vue","link":"https://github.com/embarklabs/embark-vue-template","tags":["vue.js","frontend"]},{"name":"ethvtx Template","description":"Demo app for ethvtx, an Ethereum-Ready & Framework-Agnostic Redux configuration","thumbnail":"vortex.png","install":"embark new AppName --template Horyus/ethvtx_embark","link":"https://github.com/Horyus/ethvtx_embark","tags":["react"]},{"name":"Bamboo Template","description":"Template to demonstrate use of the Bamboo contracts","install":"embark new AppName --template bamboo","thumbnail":"bamboo.png","link":"https://github.com/embarklabs/embark-bamboo-template","tags":["bamboo","contracts"]},{"name":"Solidity Gas Golfing","description":"Boilerplate and tests for the first Solidity Gas Golfing Contest","thumbnail":"sggc.png","install":"embark new AppName --template embarklabs/sggc","link":"https://github.com/embarklabs/sggc","tags":["solidity","tests","fun"]}],"tutorials":[{"name":"How to create a Token Factory with Ethereum — Part 1","description":"Create and Deploy a Token with Ethereum","link":"/tutorials/token_factory_1.html","tags":["token","ethereum"]},{"name":"How to create a Token Factory with Ethereum — Part 2","description":"Create a DApp that can deploy Tokens on the fly","link":"/tutorials/token_factory_2.html","tags":["token","ethereum","client-side-deployment"]},{"name":"How to deploy to a testnet with Infura","description":"Deploy and interact with your Dapp on a testnet with the use of Infura","link":"/tutorials/infura_guide.html","tags":["ethereum","deployment","testnet"]}],"versions":{"latest":{"label":"stable (v4)","url":"https://embark.embarklabs.io/docs"},"3.2":{"label":"v3.2","url":"https://5ca4e0fdb29712000adde37f--embark-site-versions.netlify.com/docs/"}}}},"excerpt":"","more":"

Interacting with contracts in Javascript

Embark will automatically take care of deployment for you and set all needed JS bindings. For example, the contract below:

\n
// app/contracts/simple_storage.sol

contract SimpleStorage {
uint public storedData;

function SimpleStorage(uint initialValue) {
storedData = initialValue;
}

function set(uint x) {
storedData = x;
}
function get() constant returns (uint retVal) {
return storedData;
}
}
\n\n

Will automatically be available in Javascript as:

\n
// app/js/index.js

import SimpleStorage from 'Embark/contracts/SimpleStorage';

SimpleStorage.methods.set(100).send();
SimpleStorage.methods.get().call().then(function(value) { console.log(value) });
SimpleStorage.methods.storedData().call().then(function(value) { console.log(value) });
\n\n

The syntax used is web3.js 1.2.1

\n"},{"title":"Solidity Documentation","_content":"\nThe documentation for Solidity can be found [here](https://solidity.readthedocs.io/)\n\n","source":"docs/solidity.md","raw":"title: Solidity Documentation\n---\n\nThe documentation for Solidity can be found [here](https://solidity.readthedocs.io/)\n\n","date":"2020-01-17T19:00:03.900Z","updated":"2020-01-17T19:00:03.900Z","path":"docs/solidity.html","comments":1,"layout":"page","_id":"ck5ijm3rv001m7hegeg1e1h1s","content":"

The documentation for Solidity can be found here

\n","site":{"data":{"authors":{"iuri_matias":{"name":"Iuri Matias","twitter":"iurimatias","image":"https://pbs.twimg.com/profile_images/928272512181563392/iDJdvy2k_400x400.jpg"},"pascal_precht":{"name":"Pascal Precht","twitter":"pascalprecht","image":"https://pbs.twimg.com/profile_images/993785060733194241/p3oAIMDP_400x400.jpg"},"anthony_laibe":{"name":"Anthony Laibe","twitter":"a_laibe","image":"https://pbs.twimg.com/profile_images/257742900/13168239_400x400.jpg"},"jonathan_rainville":{"name":"Jonathan Rainville","twitter":"ShyolGhul","image":"https://pbs.twimg.com/profile_images/993873866878570496/-aE4byjj_400x400.jpg"},"andre_medeiros":{"name":"Andre Medeiros","twitter":"superdealloc","image":"https://pbs.twimg.com/profile_images/965722487735701504/m58KNgWN_400x400.jpg"},"eric_mastro":{"name":"Eric Mastro","twitter":"ericmastro","image":"https://avatars1.githubusercontent.com/u/5089238?s=460&v=4"},"michael_bradley":{"name":"Michael Bradley","image":"https://avatars3.githubusercontent.com/u/194260?s=460&v=4"},"richard_ramos":{"name":"Richard Ramos","twitter":"richardramos_me","image":"https://pbs.twimg.com/profile_images/1063160577973866496/aM313uHG_400x400.jpg"},"jonny_zerah":{"name":"Jonny Zerah","twitter":"jonnyzerah","image":"https://pbs.twimg.com/profile_images/1043774340490248192/gI9aGy17_400x400.jpg"},"robin_percy":{"name":"Robin Percy","twitter":"rbin","image":"https://avatars1.githubusercontent.com/u/29288325?s=400&v=4"}},"categories":{"tutorials":"Tutorials","announcements":"Announcements"},"languages":{"en":"English"},"plugins":[{"name":"embark-bamboo","description":"plugins_page.plugins.bamboo.desc","link":"https://www.npmjs.com/package/embark-bamboo","thumbnail":"bamboo.png","tags":["language","smart-contracts"]},{"name":"embark-solc","description":"plugins_page.plugins.solc.desc","link":"https://www.npmjs.com/package/embark-solc","thumbnail":"solidity.png","tags":["solidity","language","smart-contracts"]},{"name":"embark-solium","description":"plugins_page.plugins.solium.desc","link":"https://www.npmjs.com/package/embark-solium","thumbnail":"solium.png","tags":["linter","solidity","solium"]},{"name":"embark-etherscan-verifier","description":"plugins_page.plugins.verifier.desc","link":"https://www.npmjs.com/package/embark-etherscan-verifier","tags":["solidity","etherscan","smart-contracts"]},{"name":"embark-status","description":"plugins_page.plugins.status.desc","link":"https://www.npmjs.com/package/embark-status-plugin","thumbnail":"status.png","tags":["status","mobile"]},{"name":"embark-remix","description":"plugins_page.plugins.remix.desc","link":"https://www.npmjs.com/package/embark-remix","thumbnail":"remix.png","tags":["remix","debugger"]},{"name":"embark-slither","description":"plugins_page.plugins.slither.desc","link":"https://www.npmjs.com/package/embark-slither","tags":["solidity"]},{"name":"embark-snark","description":"plugins_page.plugins.snark.desc","link":"https://www.npmjs.com/package/embark-snark","tags":["snark"]},{"name":"embark-fortune","description":"plugins_page.plugins.fortune.desc","link":"https://www.npmjs.com/package/embark-fortune","thumbnail":"fortune.jpg","tags":["fun"]},{"name":"embark-pug","description":"plugins_page.plugins.pug.desc","link":"https://www.npmjs.com/package/embark-pug","legacy":true,"thumbnail":"pug.png","tags":["pug","jade","templates"]},{"name":"embark-haml","description":"plugins_page.plugins.haml.desc","link":"https://www.npmjs.com/package/embark-haml","legacy":true,"thumbnail":"haml.png","tags":["haml","templates"]},{"name":"embark-mythx","description":"plugins_page.plugins.mythx.desc","link":"https://www.npmjs.com/package/embark-mythx","thumbnail":"mythx.png","tags":["mythx","smart-contracts"]}],"menu":{"docs":"/docs/","plugins":"/plugins/","chat":"/chat/","blog":"/news/"},"sidebar":{"docs":{"getting_started":{"overview":"overview.html","installation":"installation.html","faq":"faq.html"},"general_usage":{"creating_project":"create_project.html","structure":"structure.html","running_apps":"running_apps.html","dashboard":"dashboard.html","using_the_console":"using_the_console.html","environments":"environments.html","configuration":"configuration.html","pipeline_and_webpack":"pipeline_and_webpack.html","javascript_usage":"javascript_usage.html"},"smart_contracts":{"contracts_configuration":"contracts_configuration.html","contracts_deployment":"contracts_deployment.html","contracts_imports":"contracts_imports.html","contracts_testing":"contracts_testing.html","contracts_javascript":"contracts_javascript.html"},"blockchain_node":{"blockchain_configuration":"blockchain_configuration.html","blockchain_accounts_configuration":"blockchain_accounts_configuration.html"},"storage":{"storage_configuration":"storage_configuration.html","storage_deployment":"storage_deployment.html","storage_javascript":"storage_javascript.html"},"messages":{"messages_configuration":"messages_configuration.html","messages_javascript":"messages_javascript.html"},"naming":{"naming_configuration":"naming_configuration.html","naming_javascript":"naming_javascript.html"},"plugins":{"installing_a_plugin":"installing_plugins.html","creating_a_plugin":"creating_plugins.html","plugin_reference":"plugin_reference.html"},"cockpit":{"cockpit_introduction":"cockpit_introduction.html","cockpit_dashboard":"cockpit_dashboard.html","cockpit_deployment":"cockpit_deployment.html","cockpit_explorer":"cockpit_explorer.html","cockpit_editor":"cockpit_editor.html","cockpit_debugger":"cockpit_debugger.html"},"reference":{"embark_commands":"embark_commands.html"},"miscellaneous":{"migrating_from_3":"migrating_from_3.x.html","troubleshooting":"troubleshooting.html","contributing":"contributing.html"}}},"templates":[{"name":"Vyper Template","description":"Template to demonstrate the use of the Vyper contracts","install":"embark new AppName --template vyper","thumbnail":"vyper.png","link":"https://github.com/embarklabs/embark-vyper-template","tags":["vyper","contracts"]},{"name":"Embark Demo React Template","description":"A React Application showcasing Embark's functionality","install":"embark demo","thumbnail":"react.png","link":"https://embark.embarklabs.io/docs/create_project.html#Creating-a-Demo-Project","tags":["react","contracts","whisper","ipfs"]},{"name":"Typescript Template","description":"Template with Typescript support pre-configured","thumbnail":"typescript.png","install":"embark new AppName --template typescript","link":"https://github.com/embarklabs/embark-typescript-template","tags":["typescript","frontend"]},{"name":"Vue.js Template","description":"Ready to use Template for using Embark with vue.js","thumbnail":"vuejs.png","install":"embark new AppName --template vue","link":"https://github.com/embarklabs/embark-vue-template","tags":["vue.js","frontend"]},{"name":"ethvtx Template","description":"Demo app for ethvtx, an Ethereum-Ready & Framework-Agnostic Redux configuration","thumbnail":"vortex.png","install":"embark new AppName --template Horyus/ethvtx_embark","link":"https://github.com/Horyus/ethvtx_embark","tags":["react"]},{"name":"Bamboo Template","description":"Template to demonstrate use of the Bamboo contracts","install":"embark new AppName --template bamboo","thumbnail":"bamboo.png","link":"https://github.com/embarklabs/embark-bamboo-template","tags":["bamboo","contracts"]},{"name":"Solidity Gas Golfing","description":"Boilerplate and tests for the first Solidity Gas Golfing Contest","thumbnail":"sggc.png","install":"embark new AppName --template embarklabs/sggc","link":"https://github.com/embarklabs/sggc","tags":["solidity","tests","fun"]}],"tutorials":[{"name":"How to create a Token Factory with Ethereum — Part 1","description":"Create and Deploy a Token with Ethereum","link":"/tutorials/token_factory_1.html","tags":["token","ethereum"]},{"name":"How to create a Token Factory with Ethereum — Part 2","description":"Create a DApp that can deploy Tokens on the fly","link":"/tutorials/token_factory_2.html","tags":["token","ethereum","client-side-deployment"]},{"name":"How to deploy to a testnet with Infura","description":"Deploy and interact with your Dapp on a testnet with the use of Infura","link":"/tutorials/infura_guide.html","tags":["ethereum","deployment","testnet"]}],"versions":{"latest":{"label":"stable (v4)","url":"https://embark.embarklabs.io/docs"},"3.2":{"label":"v3.2","url":"https://5ca4e0fdb29712000adde37f--embark-site-versions.netlify.com/docs/"}}}},"excerpt":"","more":"

The documentation for Solidity can be found here

\n"},{"title":"Configuring decentralized storages","layout":"docs","_content":"\nWith Embark, we easily connect to decentralized storage solutions such as IPFS and Swarm. This enables us to upload, storing and download data and assets for our decentralized applications. Let's take a closer look at how to make use of this.\n\n## Configuration basics\n\nEmbark will check our preferred storage configuration in the file `config/storage.js`, unless [configured differently](/docs/configuration.html) in our application's `embark.json` file. This file contains the preferred configuration for each environment, with `default` being the configuration that applies to every environment. If [environments in Embark](/docs/environments.html) are new to you, check out the dedicated guide first and come back.\n\nEach of these configuration options can be individually overridden on a per environment basis.\n\n```\nmodule.exports = {\n \"default\": {\n \"enabled\": true,\n \"ipfs_bin\": \"ipfs\",\n \"available_providers\": [\"ipfs\", \"swarm\"],\n \"upload\":{\n \"provider\": \"ipfs\",\n \"host\": \"localhost\",\n \"port\": 5001,\n \"getUrl\": \"http://localhost:8080/ipfs\"\n },\n \"dappConnection\":[\n {\"provider\": \"swarm\", \"host\": \"localhost\", \"port\": 8500, \"getUrl\": \"http://localhost:8500/bzz:/\"},\n {\"provider\": \"ipfs\", \"host\": \"localhost\", \"port\": 5001, \"getUrl\": \"http://localhost:8080/ipfs/\"}\n ]\n },\n \"development\": {\n \"enabled\": true,\n \"provider\": \"ipfs\",\n \"host\": \"localhost\",\n \"port\": 5001\n }\n}\n```\n\nThe available options are:\n\nOption | Type: `default` | Value\n--- | --- | ---\n`enabled` | boolean: `true` | Enables or completely disables storage support\n`ipfs_bin` | string: `ipfs` | Name or desired path to the ipfs binary\n`available_providers` | array: `[\"ipfs\", \"swarm\"]` | List of storages to be supported on the dapp. This will affect what's available with the EmbarkJS library on the dapp.\n`upload` | | The upload element specifies storage provider settings used for uploading your dapp. A swarm node will be automatically launched in a child process using these settings.\n`upload.provider` | string: `ipfs` | Desired provider to use when uploading dapp.\n`upload.protocol` | string: `http` | Storage provider protocol for upload, ie `http` or `https`\n`upload.host` | string: `localhost` | Host value used to interact with the storage provider for upload, i.e. `localhost` or `swarm-gateways.net`\n`upload.port` | integer: `5001` | Port value used to interact with the storage provider for upload, i.e. `5001` (IPFS local node) or `8500` (Swarm local node) or `80`\n`upload.getUrl` | string: `http://localhost:8080/ipfs/` | Only for IPFS. This sets the file/document retrieval URL, which is different than the host/port combination used to interact with the IPFS API.\n`dappConnection` | | List of storage providers to attempt connection to in the dapp. Each provider process will be launched in a child process. Each connection listed will be tried in order on the dapp, until one is avaialable. Can also specify `$BZZ` to attempt to connect to an injected swarm object.\n`dappConnection.provider` | string: `ipfs` | Desired provider to use for dapp storage.\n`dappConnection.protocol` | string: `http` | Storage provider protocol used in the dapp, i.e. `http` or `https`\n`dappConnection.host` | string | Host value used to interact with the storage provider in the dapp, i.e. `localhost` or `swarm-gateways.net`\n`dappConnection.port` | integer | Port value used to interact with the storage provider in the dapp, i.e. `5001` (IPFS local node) or `8500` (Swarm local node) or `80`. Can specify `false` if a port should not be included in the connection URL (i.e. for a public gateway like `http://swarm-gateways.net`).\n`dappConnection.getUrl` | string | Only for IPFS. This sets the file/document retrieval URL, which is different than the host/port combination used to interact with the IPFS API.\n\n## Using a local node\n\nEither for IPFS or Swarm, Embark will default to use a local node for development purposes. Note that we still need to set up the right port according to the storage platform we use. By default, IPFS runs on port `5001` and Swarm runs on `8500`.\n\nWe can start a local storage node ourselves or now we can let Embark start the node for us. Letting Embark do the job lets us focus on developing faster while doing it ourselves might give us more flexibility. Obviously, we still need to have IPFS or Swarm installed locally for it to work.\n\n**Important configurations for swarm**:\n\n```\n{\n \"development\": {\n \"provider\": \"swarm\",\n \"account\": {\n \"address\": \"YOUR_ACCOUNT_ADDRESS\",\n \"password\": \"PATH/TO/PASSWORD/FILE\"\n },\n \"swarmPath\": \"PATH/TO/SWARM/EXECUTABLE\"\n }\n}\n```\n\n## Using a public gateway\n\nEmbark can connect to a public gateway when using any of the available storage options. To use a public gateway, instead of running a local node, for IPFS or Swarm, use the following `config/storage.js` options:\n\n### IPFS\n```\n\"development\": {\n \"enabled\": true,\n \"upload\":{\n \"provider\": \"ipfs\",\n \"host\": \"ipfs.infura.io\",\n \"port\": 80,\n \"protocol\": \"https\",\n \"getUrl\": \"https://ipfs.infura.io/ipfs/\"\n }\n}\n```\n\n### Swarm\n\n```\n\"development\": {\n \"enabled\": true,\n \"upload\": {\n \"provider\": \"swarm\",\n \"host\": \"localhost\",\n \"port\": 8500\n }\n}\n```\n\n## Troubleshooting\n\nIf you are running your own processes for IPFS or Swarm, the CORS needs to be set to the domain of your application, to the geth domain, and to the domain of the storage used inside the application.\n\nIf you are using the built in webserver, the CORS would need to be set to `http://localhost:8000`, however if you are using `embark upload`, the domain of the decentralised storage host should be included in CORS.\n\nDepending on your `upload` settings in `storage.js`, this could be `http://localhost:8080` or `http://ipfs.infura.io` for IPFS or it could be `http://localhost:8500` or `http://swarm-gateways.net` for Swarm.\n\nOf course, if you are hosting your DApp on a different domain (i.e. not `localhost`, then that would need to be included in CORS as well. Examples of how to include multiple domains for each are below:\n\n```\nipfs config --json API.HTTPHeaders.Access-Control-Allow-Origin \"[\\\"http://localhost:8000\\\", \\\"http://localhost:8500\\\", \\\"http://localhost:8545\\\", \\\"ws://localhost:8546\\\"]\"\n```\nNOTE: `http://localhost:8545` and `ws://localhost:8546` are for geth.\n\n```\nswarm --bzzaccount=fedda09fd9218d1ea4fd41ad44694fa4ccba1878 --datadir=~/.bzz-data/ --password=config/development/password --corsdomain=http://localhost:8000,http://localhost:8080,http://localhost:8545,ws://localhost:8546 --ens-api=''\n```\n","source":"docs/storage_configuration.md","raw":"title: Configuring decentralized storages\nlayout: docs\n---\n\nWith Embark, we easily connect to decentralized storage solutions such as IPFS and Swarm. This enables us to upload, storing and download data and assets for our decentralized applications. Let's take a closer look at how to make use of this.\n\n## Configuration basics\n\nEmbark will check our preferred storage configuration in the file `config/storage.js`, unless [configured differently](/docs/configuration.html) in our application's `embark.json` file. This file contains the preferred configuration for each environment, with `default` being the configuration that applies to every environment. If [environments in Embark](/docs/environments.html) are new to you, check out the dedicated guide first and come back.\n\nEach of these configuration options can be individually overridden on a per environment basis.\n\n```\nmodule.exports = {\n \"default\": {\n \"enabled\": true,\n \"ipfs_bin\": \"ipfs\",\n \"available_providers\": [\"ipfs\", \"swarm\"],\n \"upload\":{\n \"provider\": \"ipfs\",\n \"host\": \"localhost\",\n \"port\": 5001,\n \"getUrl\": \"http://localhost:8080/ipfs\"\n },\n \"dappConnection\":[\n {\"provider\": \"swarm\", \"host\": \"localhost\", \"port\": 8500, \"getUrl\": \"http://localhost:8500/bzz:/\"},\n {\"provider\": \"ipfs\", \"host\": \"localhost\", \"port\": 5001, \"getUrl\": \"http://localhost:8080/ipfs/\"}\n ]\n },\n \"development\": {\n \"enabled\": true,\n \"provider\": \"ipfs\",\n \"host\": \"localhost\",\n \"port\": 5001\n }\n}\n```\n\nThe available options are:\n\nOption | Type: `default` | Value\n--- | --- | ---\n`enabled` | boolean: `true` | Enables or completely disables storage support\n`ipfs_bin` | string: `ipfs` | Name or desired path to the ipfs binary\n`available_providers` | array: `[\"ipfs\", \"swarm\"]` | List of storages to be supported on the dapp. This will affect what's available with the EmbarkJS library on the dapp.\n`upload` | | The upload element specifies storage provider settings used for uploading your dapp. A swarm node will be automatically launched in a child process using these settings.\n`upload.provider` | string: `ipfs` | Desired provider to use when uploading dapp.\n`upload.protocol` | string: `http` | Storage provider protocol for upload, ie `http` or `https`\n`upload.host` | string: `localhost` | Host value used to interact with the storage provider for upload, i.e. `localhost` or `swarm-gateways.net`\n`upload.port` | integer: `5001` | Port value used to interact with the storage provider for upload, i.e. `5001` (IPFS local node) or `8500` (Swarm local node) or `80`\n`upload.getUrl` | string: `http://localhost:8080/ipfs/` | Only for IPFS. This sets the file/document retrieval URL, which is different than the host/port combination used to interact with the IPFS API.\n`dappConnection` | | List of storage providers to attempt connection to in the dapp. Each provider process will be launched in a child process. Each connection listed will be tried in order on the dapp, until one is avaialable. Can also specify `$BZZ` to attempt to connect to an injected swarm object.\n`dappConnection.provider` | string: `ipfs` | Desired provider to use for dapp storage.\n`dappConnection.protocol` | string: `http` | Storage provider protocol used in the dapp, i.e. `http` or `https`\n`dappConnection.host` | string | Host value used to interact with the storage provider in the dapp, i.e. `localhost` or `swarm-gateways.net`\n`dappConnection.port` | integer | Port value used to interact with the storage provider in the dapp, i.e. `5001` (IPFS local node) or `8500` (Swarm local node) or `80`. Can specify `false` if a port should not be included in the connection URL (i.e. for a public gateway like `http://swarm-gateways.net`).\n`dappConnection.getUrl` | string | Only for IPFS. This sets the file/document retrieval URL, which is different than the host/port combination used to interact with the IPFS API.\n\n## Using a local node\n\nEither for IPFS or Swarm, Embark will default to use a local node for development purposes. Note that we still need to set up the right port according to the storage platform we use. By default, IPFS runs on port `5001` and Swarm runs on `8500`.\n\nWe can start a local storage node ourselves or now we can let Embark start the node for us. Letting Embark do the job lets us focus on developing faster while doing it ourselves might give us more flexibility. Obviously, we still need to have IPFS or Swarm installed locally for it to work.\n\n**Important configurations for swarm**:\n\n```\n{\n \"development\": {\n \"provider\": \"swarm\",\n \"account\": {\n \"address\": \"YOUR_ACCOUNT_ADDRESS\",\n \"password\": \"PATH/TO/PASSWORD/FILE\"\n },\n \"swarmPath\": \"PATH/TO/SWARM/EXECUTABLE\"\n }\n}\n```\n\n## Using a public gateway\n\nEmbark can connect to a public gateway when using any of the available storage options. To use a public gateway, instead of running a local node, for IPFS or Swarm, use the following `config/storage.js` options:\n\n### IPFS\n```\n\"development\": {\n \"enabled\": true,\n \"upload\":{\n \"provider\": \"ipfs\",\n \"host\": \"ipfs.infura.io\",\n \"port\": 80,\n \"protocol\": \"https\",\n \"getUrl\": \"https://ipfs.infura.io/ipfs/\"\n }\n}\n```\n\n### Swarm\n\n```\n\"development\": {\n \"enabled\": true,\n \"upload\": {\n \"provider\": \"swarm\",\n \"host\": \"localhost\",\n \"port\": 8500\n }\n}\n```\n\n## Troubleshooting\n\nIf you are running your own processes for IPFS or Swarm, the CORS needs to be set to the domain of your application, to the geth domain, and to the domain of the storage used inside the application.\n\nIf you are using the built in webserver, the CORS would need to be set to `http://localhost:8000`, however if you are using `embark upload`, the domain of the decentralised storage host should be included in CORS.\n\nDepending on your `upload` settings in `storage.js`, this could be `http://localhost:8080` or `http://ipfs.infura.io` for IPFS or it could be `http://localhost:8500` or `http://swarm-gateways.net` for Swarm.\n\nOf course, if you are hosting your DApp on a different domain (i.e. not `localhost`, then that would need to be included in CORS as well. Examples of how to include multiple domains for each are below:\n\n```\nipfs config --json API.HTTPHeaders.Access-Control-Allow-Origin \"[\\\"http://localhost:8000\\\", \\\"http://localhost:8500\\\", \\\"http://localhost:8545\\\", \\\"ws://localhost:8546\\\"]\"\n```\nNOTE: `http://localhost:8545` and `ws://localhost:8546` are for geth.\n\n```\nswarm --bzzaccount=fedda09fd9218d1ea4fd41ad44694fa4ccba1878 --datadir=~/.bzz-data/ --password=config/development/password --corsdomain=http://localhost:8000,http://localhost:8080,http://localhost:8545,ws://localhost:8546 --ens-api=''\n```\n","date":"2020-01-17T19:00:03.900Z","updated":"2020-01-17T19:00:03.900Z","path":"docs/storage_configuration.html","comments":1,"_id":"ck5ijm3rw001n7heghk4sbt8r","content":"

With Embark, we easily connect to decentralized storage solutions such as IPFS and Swarm. This enables us to upload, storing and download data and assets for our decentralized applications. Let’s take a closer look at how to make use of this.

\n

Configuration basics

Embark will check our preferred storage configuration in the file config/storage.js, unless configured differently in our application’s embark.json file. This file contains the preferred configuration for each environment, with default being the configuration that applies to every environment. If environments in Embark are new to you, check out the dedicated guide first and come back.

\n

Each of these configuration options can be individually overridden on a per environment basis.

\n
module.exports = {
"default": {
"enabled": true,
"ipfs_bin": "ipfs",
"available_providers": ["ipfs", "swarm"],
"upload":{
"provider": "ipfs",
"host": "localhost",
"port": 5001,
"getUrl": "http://localhost:8080/ipfs"
},
"dappConnection":[
{"provider": "swarm", "host": "localhost", "port": 8500, "getUrl": "http://localhost:8500/bzz:/"},
{"provider": "ipfs", "host": "localhost", "port": 5001, "getUrl": "http://localhost:8080/ipfs/"}
]
},
"development": {
"enabled": true,
"provider": "ipfs",
"host": "localhost",
"port": 5001
}
}
\n\n

The available options are:

\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
OptionType: defaultValue
enabledboolean: trueEnables or completely disables storage support
ipfs_binstring: ipfsName or desired path to the ipfs binary
available_providersarray: ["ipfs", "swarm"]List of storages to be supported on the dapp. This will affect what’s available with the EmbarkJS library on the dapp.
uploadThe upload element specifies storage provider settings used for uploading your dapp. A swarm node will be automatically launched in a child process using these settings.
upload.providerstring: ipfsDesired provider to use when uploading dapp.
upload.protocolstring: httpStorage provider protocol for upload, ie http or https
upload.hoststring: localhostHost value used to interact with the storage provider for upload, i.e. localhost or swarm-gateways.net
upload.portinteger: 5001Port value used to interact with the storage provider for upload, i.e. 5001 (IPFS local node) or 8500 (Swarm local node) or 80
upload.getUrlstring: http://localhost:8080/ipfs/Only for IPFS. This sets the file/document retrieval URL, which is different than the host/port combination used to interact with the IPFS API.
dappConnectionList of storage providers to attempt connection to in the dapp. Each provider process will be launched in a child process. Each connection listed will be tried in order on the dapp, until one is avaialable. Can also specify $BZZ to attempt to connect to an injected swarm object.
dappConnection.providerstring: ipfsDesired provider to use for dapp storage.
dappConnection.protocolstring: httpStorage provider protocol used in the dapp, i.e. http or https
dappConnection.hoststringHost value used to interact with the storage provider in the dapp, i.e. localhost or swarm-gateways.net
dappConnection.portintegerPort value used to interact with the storage provider in the dapp, i.e. 5001 (IPFS local node) or 8500 (Swarm local node) or 80. Can specify false if a port should not be included in the connection URL (i.e. for a public gateway like http://swarm-gateways.net).
dappConnection.getUrlstringOnly for IPFS. This sets the file/document retrieval URL, which is different than the host/port combination used to interact with the IPFS API.
\n

Using a local node

Either for IPFS or Swarm, Embark will default to use a local node for development purposes. Note that we still need to set up the right port according to the storage platform we use. By default, IPFS runs on port 5001 and Swarm runs on 8500.

\n

We can start a local storage node ourselves or now we can let Embark start the node for us. Letting Embark do the job lets us focus on developing faster while doing it ourselves might give us more flexibility. Obviously, we still need to have IPFS or Swarm installed locally for it to work.

\n

Important configurations for swarm:

\n
{
"development": {
"provider": "swarm",
"account": {
"address": "YOUR_ACCOUNT_ADDRESS",
"password": "PATH/TO/PASSWORD/FILE"
},
"swarmPath": "PATH/TO/SWARM/EXECUTABLE"
}
}
\n\n

Using a public gateway

Embark can connect to a public gateway when using any of the available storage options. To use a public gateway, instead of running a local node, for IPFS or Swarm, use the following config/storage.js options:

\n

IPFS

"development": {
"enabled": true,
"upload":{
"provider": "ipfs",
"host": "ipfs.infura.io",
"port": 80,
"protocol": "https",
"getUrl": "https://ipfs.infura.io/ipfs/"
}
}
\n\n

Swarm

"development": {
"enabled": true,
"upload": {
"provider": "swarm",
"host": "localhost",
"port": 8500
}
}
\n\n

Troubleshooting

If you are running your own processes for IPFS or Swarm, the CORS needs to be set to the domain of your application, to the geth domain, and to the domain of the storage used inside the application.

\n

If you are using the built in webserver, the CORS would need to be set to http://localhost:8000, however if you are using embark upload, the domain of the decentralised storage host should be included in CORS.

\n

Depending on your upload settings in storage.js, this could be http://localhost:8080 or http://ipfs.infura.io for IPFS or it could be http://localhost:8500 or http://swarm-gateways.net for Swarm.

\n

Of course, if you are hosting your DApp on a different domain (i.e. not localhost, then that would need to be included in CORS as well. Examples of how to include multiple domains for each are below:

\n
ipfs config --json API.HTTPHeaders.Access-Control-Allow-Origin "[\\"http://localhost:8000\\", \\"http://localhost:8500\\", \\"http://localhost:8545\\", \\"ws://localhost:8546\\"]"
\n

NOTE: http://localhost:8545 and ws://localhost:8546 are for geth.

\n
swarm --bzzaccount=fedda09fd9218d1ea4fd41ad44694fa4ccba1878 --datadir=~/.bzz-data/ --password=config/development/password --corsdomain=http://localhost:8000,http://localhost:8080,http://localhost:8545,ws://localhost:8546 --ens-api=''
\n","site":{"data":{"authors":{"iuri_matias":{"name":"Iuri Matias","twitter":"iurimatias","image":"https://pbs.twimg.com/profile_images/928272512181563392/iDJdvy2k_400x400.jpg"},"pascal_precht":{"name":"Pascal Precht","twitter":"pascalprecht","image":"https://pbs.twimg.com/profile_images/993785060733194241/p3oAIMDP_400x400.jpg"},"anthony_laibe":{"name":"Anthony Laibe","twitter":"a_laibe","image":"https://pbs.twimg.com/profile_images/257742900/13168239_400x400.jpg"},"jonathan_rainville":{"name":"Jonathan Rainville","twitter":"ShyolGhul","image":"https://pbs.twimg.com/profile_images/993873866878570496/-aE4byjj_400x400.jpg"},"andre_medeiros":{"name":"Andre Medeiros","twitter":"superdealloc","image":"https://pbs.twimg.com/profile_images/965722487735701504/m58KNgWN_400x400.jpg"},"eric_mastro":{"name":"Eric Mastro","twitter":"ericmastro","image":"https://avatars1.githubusercontent.com/u/5089238?s=460&v=4"},"michael_bradley":{"name":"Michael Bradley","image":"https://avatars3.githubusercontent.com/u/194260?s=460&v=4"},"richard_ramos":{"name":"Richard Ramos","twitter":"richardramos_me","image":"https://pbs.twimg.com/profile_images/1063160577973866496/aM313uHG_400x400.jpg"},"jonny_zerah":{"name":"Jonny Zerah","twitter":"jonnyzerah","image":"https://pbs.twimg.com/profile_images/1043774340490248192/gI9aGy17_400x400.jpg"},"robin_percy":{"name":"Robin Percy","twitter":"rbin","image":"https://avatars1.githubusercontent.com/u/29288325?s=400&v=4"}},"categories":{"tutorials":"Tutorials","announcements":"Announcements"},"languages":{"en":"English"},"plugins":[{"name":"embark-bamboo","description":"plugins_page.plugins.bamboo.desc","link":"https://www.npmjs.com/package/embark-bamboo","thumbnail":"bamboo.png","tags":["language","smart-contracts"]},{"name":"embark-solc","description":"plugins_page.plugins.solc.desc","link":"https://www.npmjs.com/package/embark-solc","thumbnail":"solidity.png","tags":["solidity","language","smart-contracts"]},{"name":"embark-solium","description":"plugins_page.plugins.solium.desc","link":"https://www.npmjs.com/package/embark-solium","thumbnail":"solium.png","tags":["linter","solidity","solium"]},{"name":"embark-etherscan-verifier","description":"plugins_page.plugins.verifier.desc","link":"https://www.npmjs.com/package/embark-etherscan-verifier","tags":["solidity","etherscan","smart-contracts"]},{"name":"embark-status","description":"plugins_page.plugins.status.desc","link":"https://www.npmjs.com/package/embark-status-plugin","thumbnail":"status.png","tags":["status","mobile"]},{"name":"embark-remix","description":"plugins_page.plugins.remix.desc","link":"https://www.npmjs.com/package/embark-remix","thumbnail":"remix.png","tags":["remix","debugger"]},{"name":"embark-slither","description":"plugins_page.plugins.slither.desc","link":"https://www.npmjs.com/package/embark-slither","tags":["solidity"]},{"name":"embark-snark","description":"plugins_page.plugins.snark.desc","link":"https://www.npmjs.com/package/embark-snark","tags":["snark"]},{"name":"embark-fortune","description":"plugins_page.plugins.fortune.desc","link":"https://www.npmjs.com/package/embark-fortune","thumbnail":"fortune.jpg","tags":["fun"]},{"name":"embark-pug","description":"plugins_page.plugins.pug.desc","link":"https://www.npmjs.com/package/embark-pug","legacy":true,"thumbnail":"pug.png","tags":["pug","jade","templates"]},{"name":"embark-haml","description":"plugins_page.plugins.haml.desc","link":"https://www.npmjs.com/package/embark-haml","legacy":true,"thumbnail":"haml.png","tags":["haml","templates"]},{"name":"embark-mythx","description":"plugins_page.plugins.mythx.desc","link":"https://www.npmjs.com/package/embark-mythx","thumbnail":"mythx.png","tags":["mythx","smart-contracts"]}],"menu":{"docs":"/docs/","plugins":"/plugins/","chat":"/chat/","blog":"/news/"},"sidebar":{"docs":{"getting_started":{"overview":"overview.html","installation":"installation.html","faq":"faq.html"},"general_usage":{"creating_project":"create_project.html","structure":"structure.html","running_apps":"running_apps.html","dashboard":"dashboard.html","using_the_console":"using_the_console.html","environments":"environments.html","configuration":"configuration.html","pipeline_and_webpack":"pipeline_and_webpack.html","javascript_usage":"javascript_usage.html"},"smart_contracts":{"contracts_configuration":"contracts_configuration.html","contracts_deployment":"contracts_deployment.html","contracts_imports":"contracts_imports.html","contracts_testing":"contracts_testing.html","contracts_javascript":"contracts_javascript.html"},"blockchain_node":{"blockchain_configuration":"blockchain_configuration.html","blockchain_accounts_configuration":"blockchain_accounts_configuration.html"},"storage":{"storage_configuration":"storage_configuration.html","storage_deployment":"storage_deployment.html","storage_javascript":"storage_javascript.html"},"messages":{"messages_configuration":"messages_configuration.html","messages_javascript":"messages_javascript.html"},"naming":{"naming_configuration":"naming_configuration.html","naming_javascript":"naming_javascript.html"},"plugins":{"installing_a_plugin":"installing_plugins.html","creating_a_plugin":"creating_plugins.html","plugin_reference":"plugin_reference.html"},"cockpit":{"cockpit_introduction":"cockpit_introduction.html","cockpit_dashboard":"cockpit_dashboard.html","cockpit_deployment":"cockpit_deployment.html","cockpit_explorer":"cockpit_explorer.html","cockpit_editor":"cockpit_editor.html","cockpit_debugger":"cockpit_debugger.html"},"reference":{"embark_commands":"embark_commands.html"},"miscellaneous":{"migrating_from_3":"migrating_from_3.x.html","troubleshooting":"troubleshooting.html","contributing":"contributing.html"}}},"templates":[{"name":"Vyper Template","description":"Template to demonstrate the use of the Vyper contracts","install":"embark new AppName --template vyper","thumbnail":"vyper.png","link":"https://github.com/embarklabs/embark-vyper-template","tags":["vyper","contracts"]},{"name":"Embark Demo React Template","description":"A React Application showcasing Embark's functionality","install":"embark demo","thumbnail":"react.png","link":"https://embark.embarklabs.io/docs/create_project.html#Creating-a-Demo-Project","tags":["react","contracts","whisper","ipfs"]},{"name":"Typescript Template","description":"Template with Typescript support pre-configured","thumbnail":"typescript.png","install":"embark new AppName --template typescript","link":"https://github.com/embarklabs/embark-typescript-template","tags":["typescript","frontend"]},{"name":"Vue.js Template","description":"Ready to use Template for using Embark with vue.js","thumbnail":"vuejs.png","install":"embark new AppName --template vue","link":"https://github.com/embarklabs/embark-vue-template","tags":["vue.js","frontend"]},{"name":"ethvtx Template","description":"Demo app for ethvtx, an Ethereum-Ready & Framework-Agnostic Redux configuration","thumbnail":"vortex.png","install":"embark new AppName --template Horyus/ethvtx_embark","link":"https://github.com/Horyus/ethvtx_embark","tags":["react"]},{"name":"Bamboo Template","description":"Template to demonstrate use of the Bamboo contracts","install":"embark new AppName --template bamboo","thumbnail":"bamboo.png","link":"https://github.com/embarklabs/embark-bamboo-template","tags":["bamboo","contracts"]},{"name":"Solidity Gas Golfing","description":"Boilerplate and tests for the first Solidity Gas Golfing Contest","thumbnail":"sggc.png","install":"embark new AppName --template embarklabs/sggc","link":"https://github.com/embarklabs/sggc","tags":["solidity","tests","fun"]}],"tutorials":[{"name":"How to create a Token Factory with Ethereum — Part 1","description":"Create and Deploy a Token with Ethereum","link":"/tutorials/token_factory_1.html","tags":["token","ethereum"]},{"name":"How to create a Token Factory with Ethereum — Part 2","description":"Create a DApp that can deploy Tokens on the fly","link":"/tutorials/token_factory_2.html","tags":["token","ethereum","client-side-deployment"]},{"name":"How to deploy to a testnet with Infura","description":"Deploy and interact with your Dapp on a testnet with the use of Infura","link":"/tutorials/infura_guide.html","tags":["ethereum","deployment","testnet"]}],"versions":{"latest":{"label":"stable (v4)","url":"https://embark.embarklabs.io/docs"},"3.2":{"label":"v3.2","url":"https://5ca4e0fdb29712000adde37f--embark-site-versions.netlify.com/docs/"}}}},"excerpt":"","more":"

With Embark, we easily connect to decentralized storage solutions such as IPFS and Swarm. This enables us to upload, storing and download data and assets for our decentralized applications. Let’s take a closer look at how to make use of this.

\n

Configuration basics

Embark will check our preferred storage configuration in the file config/storage.js, unless configured differently in our application’s embark.json file. This file contains the preferred configuration for each environment, with default being the configuration that applies to every environment. If environments in Embark are new to you, check out the dedicated guide first and come back.

\n

Each of these configuration options can be individually overridden on a per environment basis.

\n
module.exports = {
"default": {
"enabled": true,
"ipfs_bin": "ipfs",
"available_providers": ["ipfs", "swarm"],
"upload":{
"provider": "ipfs",
"host": "localhost",
"port": 5001,
"getUrl": "http://localhost:8080/ipfs"
},
"dappConnection":[
{"provider": "swarm", "host": "localhost", "port": 8500, "getUrl": "http://localhost:8500/bzz:/"},
{"provider": "ipfs", "host": "localhost", "port": 5001, "getUrl": "http://localhost:8080/ipfs/"}
]
},
"development": {
"enabled": true,
"provider": "ipfs",
"host": "localhost",
"port": 5001
}
}
\n\n

The available options are:

\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
OptionType: defaultValue
enabledboolean: trueEnables or completely disables storage support
ipfs_binstring: ipfsName or desired path to the ipfs binary
available_providersarray: ["ipfs", "swarm"]List of storages to be supported on the dapp. This will affect what’s available with the EmbarkJS library on the dapp.
uploadThe upload element specifies storage provider settings used for uploading your dapp. A swarm node will be automatically launched in a child process using these settings.
upload.providerstring: ipfsDesired provider to use when uploading dapp.
upload.protocolstring: httpStorage provider protocol for upload, ie http or https
upload.hoststring: localhostHost value used to interact with the storage provider for upload, i.e. localhost or swarm-gateways.net
upload.portinteger: 5001Port value used to interact with the storage provider for upload, i.e. 5001 (IPFS local node) or 8500 (Swarm local node) or 80
upload.getUrlstring: http://localhost:8080/ipfs/Only for IPFS. This sets the file/document retrieval URL, which is different than the host/port combination used to interact with the IPFS API.
dappConnectionList of storage providers to attempt connection to in the dapp. Each provider process will be launched in a child process. Each connection listed will be tried in order on the dapp, until one is avaialable. Can also specify $BZZ to attempt to connect to an injected swarm object.
dappConnection.providerstring: ipfsDesired provider to use for dapp storage.
dappConnection.protocolstring: httpStorage provider protocol used in the dapp, i.e. http or https
dappConnection.hoststringHost value used to interact with the storage provider in the dapp, i.e. localhost or swarm-gateways.net
dappConnection.portintegerPort value used to interact with the storage provider in the dapp, i.e. 5001 (IPFS local node) or 8500 (Swarm local node) or 80. Can specify false if a port should not be included in the connection URL (i.e. for a public gateway like http://swarm-gateways.net).
dappConnection.getUrlstringOnly for IPFS. This sets the file/document retrieval URL, which is different than the host/port combination used to interact with the IPFS API.
\n

Using a local node

Either for IPFS or Swarm, Embark will default to use a local node for development purposes. Note that we still need to set up the right port according to the storage platform we use. By default, IPFS runs on port 5001 and Swarm runs on 8500.

\n

We can start a local storage node ourselves or now we can let Embark start the node for us. Letting Embark do the job lets us focus on developing faster while doing it ourselves might give us more flexibility. Obviously, we still need to have IPFS or Swarm installed locally for it to work.

\n

Important configurations for swarm:

\n
{
"development": {
"provider": "swarm",
"account": {
"address": "YOUR_ACCOUNT_ADDRESS",
"password": "PATH/TO/PASSWORD/FILE"
},
"swarmPath": "PATH/TO/SWARM/EXECUTABLE"
}
}
\n\n

Using a public gateway

Embark can connect to a public gateway when using any of the available storage options. To use a public gateway, instead of running a local node, for IPFS or Swarm, use the following config/storage.js options:

\n

IPFS

"development": {
"enabled": true,
"upload":{
"provider": "ipfs",
"host": "ipfs.infura.io",
"port": 80,
"protocol": "https",
"getUrl": "https://ipfs.infura.io/ipfs/"
}
}
\n\n

Swarm

"development": {
"enabled": true,
"upload": {
"provider": "swarm",
"host": "localhost",
"port": 8500
}
}
\n\n

Troubleshooting

If you are running your own processes for IPFS or Swarm, the CORS needs to be set to the domain of your application, to the geth domain, and to the domain of the storage used inside the application.

\n

If you are using the built in webserver, the CORS would need to be set to http://localhost:8000, however if you are using embark upload, the domain of the decentralised storage host should be included in CORS.

\n

Depending on your upload settings in storage.js, this could be http://localhost:8080 or http://ipfs.infura.io for IPFS or it could be http://localhost:8500 or http://swarm-gateways.net for Swarm.

\n

Of course, if you are hosting your DApp on a different domain (i.e. not localhost, then that would need to be included in CORS as well. Examples of how to include multiple domains for each are below:

\n
ipfs config --json API.HTTPHeaders.Access-Control-Allow-Origin "[\\"http://localhost:8000\\", \\"http://localhost:8500\\", \\"http://localhost:8545\\", \\"ws://localhost:8546\\"]"
\n

NOTE: http://localhost:8545 and ws://localhost:8546 are for geth.

\n
swarm --bzzaccount=fedda09fd9218d1ea4fd41ad44694fa4ccba1878 --datadir=~/.bzz-data/ --password=config/development/password --corsdomain=http://localhost:8000,http://localhost:8080,http://localhost:8545,ws://localhost:8546 --ens-api=''
\n"},{"title":"Deploying Apps","layout":"docs","_content":"\nTo build truly decentralized applications, we probably want to upload and host our application's assets on a decentralized storage network as well. In this guide we'll explore how to upload data to IPFS and Swarm using Embark.\n\n## Deploying using the `upload` command\n\nTo upload our application to IPFS or Swarm, we first need to ensure we have correctly set up our [storage configuration](/docs/storage_configuration.html). \n\nOnce that is done we can use Embark's `upload` command to take the assets located in the configured `buildDir` (read [here](/docs/configuration.html) for more information) and upload it to the configured storage network.\n\n```\n$ embark upload\n```\n\nSimilar to other available services that Embark supports, we can upload our data to different environments. The follow command uploads data using the `livenet` environment configuration:\n\n```\n$ embark upload livenet\n```\n\n## Associating an ENS domain\n\n\nWe can associate our uploaded data to an ENS domain by using the `--ens` option. This will take the storage hash and upload it to an ENS domain.\n\nFor example, the following command will upload our application to IPFS or Swarm and connect it with the `embark.eth` domain:\n\n```\n$ embark upload --ens=embark.etk\n```\n\n{% notification info 'Important:' %}\nYou need to be the owner of the given domain for this to work. Head over to [ens.domains](https://ens.domains/) for more information.\n{% endnotification %}\n\n\n","source":"docs/storage_deployment.md","raw":"title: Deploying Apps\nlayout: docs\n---\n\nTo build truly decentralized applications, we probably want to upload and host our application's assets on a decentralized storage network as well. In this guide we'll explore how to upload data to IPFS and Swarm using Embark.\n\n## Deploying using the `upload` command\n\nTo upload our application to IPFS or Swarm, we first need to ensure we have correctly set up our [storage configuration](/docs/storage_configuration.html). \n\nOnce that is done we can use Embark's `upload` command to take the assets located in the configured `buildDir` (read [here](/docs/configuration.html) for more information) and upload it to the configured storage network.\n\n```\n$ embark upload\n```\n\nSimilar to other available services that Embark supports, we can upload our data to different environments. The follow command uploads data using the `livenet` environment configuration:\n\n```\n$ embark upload livenet\n```\n\n## Associating an ENS domain\n\n\nWe can associate our uploaded data to an ENS domain by using the `--ens` option. This will take the storage hash and upload it to an ENS domain.\n\nFor example, the following command will upload our application to IPFS or Swarm and connect it with the `embark.eth` domain:\n\n```\n$ embark upload --ens=embark.etk\n```\n\n{% notification info 'Important:' %}\nYou need to be the owner of the given domain for this to work. Head over to [ens.domains](https://ens.domains/) for more information.\n{% endnotification %}\n\n\n","date":"2020-01-17T19:00:03.900Z","updated":"2020-01-17T19:00:03.900Z","path":"docs/storage_deployment.html","comments":1,"_id":"ck5ijm3rx001o7heg6dhubmwp","content":"

To build truly decentralized applications, we probably want to upload and host our application’s assets on a decentralized storage network as well. In this guide we’ll explore how to upload data to IPFS and Swarm using Embark.

\n

Deploying using the upload command

To upload our application to IPFS or Swarm, we first need to ensure we have correctly set up our storage configuration.

\n

Once that is done we can use Embark’s upload command to take the assets located in the configured buildDir (read here for more information) and upload it to the configured storage network.

\n
$ embark upload
\n\n

Similar to other available services that Embark supports, we can upload our data to different environments. The follow command uploads data using the livenet environment configuration:

\n
$ embark upload livenet
\n\n

Associating an ENS domain

We can associate our uploaded data to an ENS domain by using the --ens option. This will take the storage hash and upload it to an ENS domain.

\n

For example, the following command will upload our application to IPFS or Swarm and connect it with the embark.eth domain:

\n
$ embark upload --ens=embark.etk
\n\n
\n

Important:

\n

You need to be the owner of the given domain for this to work. Head over to ens.domains for more information.

\n

\n
\n\n\n\n\n","site":{"data":{"authors":{"iuri_matias":{"name":"Iuri Matias","twitter":"iurimatias","image":"https://pbs.twimg.com/profile_images/928272512181563392/iDJdvy2k_400x400.jpg"},"pascal_precht":{"name":"Pascal Precht","twitter":"pascalprecht","image":"https://pbs.twimg.com/profile_images/993785060733194241/p3oAIMDP_400x400.jpg"},"anthony_laibe":{"name":"Anthony Laibe","twitter":"a_laibe","image":"https://pbs.twimg.com/profile_images/257742900/13168239_400x400.jpg"},"jonathan_rainville":{"name":"Jonathan Rainville","twitter":"ShyolGhul","image":"https://pbs.twimg.com/profile_images/993873866878570496/-aE4byjj_400x400.jpg"},"andre_medeiros":{"name":"Andre Medeiros","twitter":"superdealloc","image":"https://pbs.twimg.com/profile_images/965722487735701504/m58KNgWN_400x400.jpg"},"eric_mastro":{"name":"Eric Mastro","twitter":"ericmastro","image":"https://avatars1.githubusercontent.com/u/5089238?s=460&v=4"},"michael_bradley":{"name":"Michael Bradley","image":"https://avatars3.githubusercontent.com/u/194260?s=460&v=4"},"richard_ramos":{"name":"Richard Ramos","twitter":"richardramos_me","image":"https://pbs.twimg.com/profile_images/1063160577973866496/aM313uHG_400x400.jpg"},"jonny_zerah":{"name":"Jonny Zerah","twitter":"jonnyzerah","image":"https://pbs.twimg.com/profile_images/1043774340490248192/gI9aGy17_400x400.jpg"},"robin_percy":{"name":"Robin Percy","twitter":"rbin","image":"https://avatars1.githubusercontent.com/u/29288325?s=400&v=4"}},"categories":{"tutorials":"Tutorials","announcements":"Announcements"},"languages":{"en":"English"},"plugins":[{"name":"embark-bamboo","description":"plugins_page.plugins.bamboo.desc","link":"https://www.npmjs.com/package/embark-bamboo","thumbnail":"bamboo.png","tags":["language","smart-contracts"]},{"name":"embark-solc","description":"plugins_page.plugins.solc.desc","link":"https://www.npmjs.com/package/embark-solc","thumbnail":"solidity.png","tags":["solidity","language","smart-contracts"]},{"name":"embark-solium","description":"plugins_page.plugins.solium.desc","link":"https://www.npmjs.com/package/embark-solium","thumbnail":"solium.png","tags":["linter","solidity","solium"]},{"name":"embark-etherscan-verifier","description":"plugins_page.plugins.verifier.desc","link":"https://www.npmjs.com/package/embark-etherscan-verifier","tags":["solidity","etherscan","smart-contracts"]},{"name":"embark-status","description":"plugins_page.plugins.status.desc","link":"https://www.npmjs.com/package/embark-status-plugin","thumbnail":"status.png","tags":["status","mobile"]},{"name":"embark-remix","description":"plugins_page.plugins.remix.desc","link":"https://www.npmjs.com/package/embark-remix","thumbnail":"remix.png","tags":["remix","debugger"]},{"name":"embark-slither","description":"plugins_page.plugins.slither.desc","link":"https://www.npmjs.com/package/embark-slither","tags":["solidity"]},{"name":"embark-snark","description":"plugins_page.plugins.snark.desc","link":"https://www.npmjs.com/package/embark-snark","tags":["snark"]},{"name":"embark-fortune","description":"plugins_page.plugins.fortune.desc","link":"https://www.npmjs.com/package/embark-fortune","thumbnail":"fortune.jpg","tags":["fun"]},{"name":"embark-pug","description":"plugins_page.plugins.pug.desc","link":"https://www.npmjs.com/package/embark-pug","legacy":true,"thumbnail":"pug.png","tags":["pug","jade","templates"]},{"name":"embark-haml","description":"plugins_page.plugins.haml.desc","link":"https://www.npmjs.com/package/embark-haml","legacy":true,"thumbnail":"haml.png","tags":["haml","templates"]},{"name":"embark-mythx","description":"plugins_page.plugins.mythx.desc","link":"https://www.npmjs.com/package/embark-mythx","thumbnail":"mythx.png","tags":["mythx","smart-contracts"]}],"menu":{"docs":"/docs/","plugins":"/plugins/","chat":"/chat/","blog":"/news/"},"sidebar":{"docs":{"getting_started":{"overview":"overview.html","installation":"installation.html","faq":"faq.html"},"general_usage":{"creating_project":"create_project.html","structure":"structure.html","running_apps":"running_apps.html","dashboard":"dashboard.html","using_the_console":"using_the_console.html","environments":"environments.html","configuration":"configuration.html","pipeline_and_webpack":"pipeline_and_webpack.html","javascript_usage":"javascript_usage.html"},"smart_contracts":{"contracts_configuration":"contracts_configuration.html","contracts_deployment":"contracts_deployment.html","contracts_imports":"contracts_imports.html","contracts_testing":"contracts_testing.html","contracts_javascript":"contracts_javascript.html"},"blockchain_node":{"blockchain_configuration":"blockchain_configuration.html","blockchain_accounts_configuration":"blockchain_accounts_configuration.html"},"storage":{"storage_configuration":"storage_configuration.html","storage_deployment":"storage_deployment.html","storage_javascript":"storage_javascript.html"},"messages":{"messages_configuration":"messages_configuration.html","messages_javascript":"messages_javascript.html"},"naming":{"naming_configuration":"naming_configuration.html","naming_javascript":"naming_javascript.html"},"plugins":{"installing_a_plugin":"installing_plugins.html","creating_a_plugin":"creating_plugins.html","plugin_reference":"plugin_reference.html"},"cockpit":{"cockpit_introduction":"cockpit_introduction.html","cockpit_dashboard":"cockpit_dashboard.html","cockpit_deployment":"cockpit_deployment.html","cockpit_explorer":"cockpit_explorer.html","cockpit_editor":"cockpit_editor.html","cockpit_debugger":"cockpit_debugger.html"},"reference":{"embark_commands":"embark_commands.html"},"miscellaneous":{"migrating_from_3":"migrating_from_3.x.html","troubleshooting":"troubleshooting.html","contributing":"contributing.html"}}},"templates":[{"name":"Vyper Template","description":"Template to demonstrate the use of the Vyper contracts","install":"embark new AppName --template vyper","thumbnail":"vyper.png","link":"https://github.com/embarklabs/embark-vyper-template","tags":["vyper","contracts"]},{"name":"Embark Demo React Template","description":"A React Application showcasing Embark's functionality","install":"embark demo","thumbnail":"react.png","link":"https://embark.embarklabs.io/docs/create_project.html#Creating-a-Demo-Project","tags":["react","contracts","whisper","ipfs"]},{"name":"Typescript Template","description":"Template with Typescript support pre-configured","thumbnail":"typescript.png","install":"embark new AppName --template typescript","link":"https://github.com/embarklabs/embark-typescript-template","tags":["typescript","frontend"]},{"name":"Vue.js Template","description":"Ready to use Template for using Embark with vue.js","thumbnail":"vuejs.png","install":"embark new AppName --template vue","link":"https://github.com/embarklabs/embark-vue-template","tags":["vue.js","frontend"]},{"name":"ethvtx Template","description":"Demo app for ethvtx, an Ethereum-Ready & Framework-Agnostic Redux configuration","thumbnail":"vortex.png","install":"embark new AppName --template Horyus/ethvtx_embark","link":"https://github.com/Horyus/ethvtx_embark","tags":["react"]},{"name":"Bamboo Template","description":"Template to demonstrate use of the Bamboo contracts","install":"embark new AppName --template bamboo","thumbnail":"bamboo.png","link":"https://github.com/embarklabs/embark-bamboo-template","tags":["bamboo","contracts"]},{"name":"Solidity Gas Golfing","description":"Boilerplate and tests for the first Solidity Gas Golfing Contest","thumbnail":"sggc.png","install":"embark new AppName --template embarklabs/sggc","link":"https://github.com/embarklabs/sggc","tags":["solidity","tests","fun"]}],"tutorials":[{"name":"How to create a Token Factory with Ethereum — Part 1","description":"Create and Deploy a Token with Ethereum","link":"/tutorials/token_factory_1.html","tags":["token","ethereum"]},{"name":"How to create a Token Factory with Ethereum — Part 2","description":"Create a DApp that can deploy Tokens on the fly","link":"/tutorials/token_factory_2.html","tags":["token","ethereum","client-side-deployment"]},{"name":"How to deploy to a testnet with Infura","description":"Deploy and interact with your Dapp on a testnet with the use of Infura","link":"/tutorials/infura_guide.html","tags":["ethereum","deployment","testnet"]}],"versions":{"latest":{"label":"stable (v4)","url":"https://embark.embarklabs.io/docs"},"3.2":{"label":"v3.2","url":"https://5ca4e0fdb29712000adde37f--embark-site-versions.netlify.com/docs/"}}}},"excerpt":"","more":"

To build truly decentralized applications, we probably want to upload and host our application’s assets on a decentralized storage network as well. In this guide we’ll explore how to upload data to IPFS and Swarm using Embark.

\n

Deploying using the upload command

To upload our application to IPFS or Swarm, we first need to ensure we have correctly set up our storage configuration.

\n

Once that is done we can use Embark’s upload command to take the assets located in the configured buildDir (read here for more information) and upload it to the configured storage network.

\n
$ embark upload
\n\n

Similar to other available services that Embark supports, we can upload our data to different environments. The follow command uploads data using the livenet environment configuration:

\n
$ embark upload livenet
\n\n

Associating an ENS domain

We can associate our uploaded data to an ENS domain by using the --ens option. This will take the storage hash and upload it to an ENS domain.

\n

For example, the following command will upload our application to IPFS or Swarm and connect it with the embark.eth domain:

\n
$ embark upload --ens=embark.etk
\n\n
\n

Important:

\n

You need to be the owner of the given domain for this to work. Head over to ens.domains for more information.

\n

\n
\n\n\n\n\n"},{"title":"Storage APIs in JavaScript","layout":"docs","_content":"\nAs mentioned in our guide on [Using EmbarkJS](/docs/javascript_usage.html), Embark's companion JavaScript library EmbarkJS comes with APIs specifically designed to make working with decentralized Storages a breeze. Let's a have closer look at what `EmbarkJS.Storage` has to offer.\n\n## Setting up EmbarkJS\n\nBy default Embark will automatically initialize EmbarkJS with the provider configured at `config/storage.js`. However if we are using EmbarkJS directly or wish to change the provider configuration at run time, we can do so using the `setProvider()` method:\n\n```\nEmbarkJS.Storage.setProvider('swarm', options);\n```\n\nOptions are optional and if provided, will override the values in `storage.js`. Here's what a manual configuration could look like:\n\n```\nEmbarkJS.Storage.setProvider('ipfs', {\n server: 'localhost',\n port: '5001'\n});\n\n// OR\n\nEmbarkJS.Storage.setProvider('swarm', {\n server: 'swarm-gateways.net',\n port: '80'\n});\n```\n\n## Saving text data\n\nString data can be easily uploaded to the configured storage using `EmbarkJS.Storage.saveText()`. This method takes any string and returns a Promise that resolves with a storage hash that can then be used to retrieve the data:\n\n```\nEmbarkJS.Storage\n .saveText(\"hello world\").then(hash => {\n ...\n });\n```\n\n## Retrieving text data\n\nIf we happen to have a storage hash, we can use to to retrieve the data that's associated to it using `EmbarkJS.Storage.get()` as shown below. Just like `saveText()` this method returns a Promise and resolves with the data the hash points to:\n\n```\nEmbarkJS.Storage.get(hash).then(content => {\n ...\n});\n```\n\n## Upload binary data\n\nWe can upload files as binary data using EmbarkJS as well. All we need is a reference to a DOM object of type `input[type=file]` and pass it the `uploadFile()` method. So assuming we had an input that looked something like this:\n\n```\n\n```\n\nWe can upload its data like this: \n```\nconst input = document.querySelector('input[type=file\"]');\n\nEmbarkJS.Storage.uploadFile(input).then(hash => {\n ... \n})\n```\n\nSimilar to `saveText()` and `get()`, this method returns a Promise and can be used with JavaScript's `async/await` syntec as well.\n\n## Display data using URLs\n\nTo display any uploaded data in the browser, we can request a fully qualified URL using `EmbarkJS.Storage.getUrl()` and a dedicated storage hash:\n\n```\nEmbarkJS.Storage.getUrl(hash).then(url => {\n ...\n});\n```\n\n## Checking for storage provider availability\n\nWe can check whether our configured storage provider is available or not using `isAvailable()`. This method resolves with either `true` or `false` depending on whether the service is available:\n\n```\nEmbarkJS.Storage.isAvailable().then(isAvailable => { \n ...\n});\n```\n\n## IPNS registration\n\nWe can register IPFS hashes using IPNS using the `register()` method has shown below:\n\n```\nEmbarkJS.Storage.register(some_hash).then(name => {\n console.log('Registred: ', name);\n});\n```\n\n{% notification info 'Note on registering hashes:' %}\nRegistering a hash with IPFS can take a bit of time, so keep that in mind when relying on these APIs.\n{% endnotification %}\n\nAnd of course, we can resolve hashes to their IPFS paths as well, using the `resolve()` method:\n\n```Javascript\nEmbarkJS.Storage.resolve(some_hash).then(name => {\n console.log('Resolved ', name);\n});\n```\n\n","source":"docs/storage_javascript.md","raw":"title: Storage APIs in JavaScript\nlayout: docs\n---\n\nAs mentioned in our guide on [Using EmbarkJS](/docs/javascript_usage.html), Embark's companion JavaScript library EmbarkJS comes with APIs specifically designed to make working with decentralized Storages a breeze. Let's a have closer look at what `EmbarkJS.Storage` has to offer.\n\n## Setting up EmbarkJS\n\nBy default Embark will automatically initialize EmbarkJS with the provider configured at `config/storage.js`. However if we are using EmbarkJS directly or wish to change the provider configuration at run time, we can do so using the `setProvider()` method:\n\n```\nEmbarkJS.Storage.setProvider('swarm', options);\n```\n\nOptions are optional and if provided, will override the values in `storage.js`. Here's what a manual configuration could look like:\n\n```\nEmbarkJS.Storage.setProvider('ipfs', {\n server: 'localhost',\n port: '5001'\n});\n\n// OR\n\nEmbarkJS.Storage.setProvider('swarm', {\n server: 'swarm-gateways.net',\n port: '80'\n});\n```\n\n## Saving text data\n\nString data can be easily uploaded to the configured storage using `EmbarkJS.Storage.saveText()`. This method takes any string and returns a Promise that resolves with a storage hash that can then be used to retrieve the data:\n\n```\nEmbarkJS.Storage\n .saveText(\"hello world\").then(hash => {\n ...\n });\n```\n\n## Retrieving text data\n\nIf we happen to have a storage hash, we can use to to retrieve the data that's associated to it using `EmbarkJS.Storage.get()` as shown below. Just like `saveText()` this method returns a Promise and resolves with the data the hash points to:\n\n```\nEmbarkJS.Storage.get(hash).then(content => {\n ...\n});\n```\n\n## Upload binary data\n\nWe can upload files as binary data using EmbarkJS as well. All we need is a reference to a DOM object of type `input[type=file]` and pass it the `uploadFile()` method. So assuming we had an input that looked something like this:\n\n```\n\n```\n\nWe can upload its data like this: \n```\nconst input = document.querySelector('input[type=file\"]');\n\nEmbarkJS.Storage.uploadFile(input).then(hash => {\n ... \n})\n```\n\nSimilar to `saveText()` and `get()`, this method returns a Promise and can be used with JavaScript's `async/await` syntec as well.\n\n## Display data using URLs\n\nTo display any uploaded data in the browser, we can request a fully qualified URL using `EmbarkJS.Storage.getUrl()` and a dedicated storage hash:\n\n```\nEmbarkJS.Storage.getUrl(hash).then(url => {\n ...\n});\n```\n\n## Checking for storage provider availability\n\nWe can check whether our configured storage provider is available or not using `isAvailable()`. This method resolves with either `true` or `false` depending on whether the service is available:\n\n```\nEmbarkJS.Storage.isAvailable().then(isAvailable => { \n ...\n});\n```\n\n## IPNS registration\n\nWe can register IPFS hashes using IPNS using the `register()` method has shown below:\n\n```\nEmbarkJS.Storage.register(some_hash).then(name => {\n console.log('Registred: ', name);\n});\n```\n\n{% notification info 'Note on registering hashes:' %}\nRegistering a hash with IPFS can take a bit of time, so keep that in mind when relying on these APIs.\n{% endnotification %}\n\nAnd of course, we can resolve hashes to their IPFS paths as well, using the `resolve()` method:\n\n```Javascript\nEmbarkJS.Storage.resolve(some_hash).then(name => {\n console.log('Resolved ', name);\n});\n```\n\n","date":"2020-01-17T19:00:03.900Z","updated":"2020-01-17T19:00:03.900Z","path":"docs/storage_javascript.html","comments":1,"_id":"ck5ijm3rx001p7hegalb842ji","content":"

As mentioned in our guide on Using EmbarkJS, Embark’s companion JavaScript library EmbarkJS comes with APIs specifically designed to make working with decentralized Storages a breeze. Let’s a have closer look at what EmbarkJS.Storage has to offer.

\n

Setting up EmbarkJS

By default Embark will automatically initialize EmbarkJS with the provider configured at config/storage.js. However if we are using EmbarkJS directly or wish to change the provider configuration at run time, we can do so using the setProvider() method:

\n
EmbarkJS.Storage.setProvider('swarm', options);
\n\n

Options are optional and if provided, will override the values in storage.js. Here’s what a manual configuration could look like:

\n
EmbarkJS.Storage.setProvider('ipfs', {
server: 'localhost',
port: '5001'
});

// OR

EmbarkJS.Storage.setProvider('swarm', {
server: 'swarm-gateways.net',
port: '80'
});
\n\n

Saving text data

String data can be easily uploaded to the configured storage using EmbarkJS.Storage.saveText(). This method takes any string and returns a Promise that resolves with a storage hash that can then be used to retrieve the data:

\n
EmbarkJS.Storage
.saveText("hello world").then(hash => {
...
});
\n\n

Retrieving text data

If we happen to have a storage hash, we can use to to retrieve the data that’s associated to it using EmbarkJS.Storage.get() as shown below. Just like saveText() this method returns a Promise and resolves with the data the hash points to:

\n
EmbarkJS.Storage.get(hash).then(content =>  {
...
});
\n\n

Upload binary data

We can upload files as binary data using EmbarkJS as well. All we need is a reference to a DOM object of type input[type=file] and pass it the uploadFile() method. So assuming we had an input that looked something like this:

\n
<input type="file">
\n\n

We can upload its data like this:

\n
const input = document.querySelector('input[type=file"]');

EmbarkJS.Storage.uploadFile(input).then(hash => {
...
})
\n\n

Similar to saveText() and get(), this method returns a Promise and can be used with JavaScript’s async/await syntec as well.

\n

Display data using URLs

To display any uploaded data in the browser, we can request a fully qualified URL using EmbarkJS.Storage.getUrl() and a dedicated storage hash:

\n
EmbarkJS.Storage.getUrl(hash).then(url => {
...
});
\n\n

Checking for storage provider availability

We can check whether our configured storage provider is available or not using isAvailable(). This method resolves with either true or false depending on whether the service is available:

\n
EmbarkJS.Storage.isAvailable().then(isAvailable => { 
...
});
\n\n

IPNS registration

We can register IPFS hashes using IPNS using the register() method has shown below:

\n
EmbarkJS.Storage.register(some_hash).then(name => {
console.log('Registred: ', name);
});
\n\n
\n

Note on registering hashes:

\n

Registering a hash with IPFS can take a bit of time, so keep that in mind when relying on these APIs.

\n

\n
\n\n\n\n

And of course, we can resolve hashes to their IPFS paths as well, using the resolve() method:

\n
EmbarkJS.Storage.resolve(some_hash).then(name => {
console.log('Resolved ', name);
});
\n\n","site":{"data":{"authors":{"iuri_matias":{"name":"Iuri Matias","twitter":"iurimatias","image":"https://pbs.twimg.com/profile_images/928272512181563392/iDJdvy2k_400x400.jpg"},"pascal_precht":{"name":"Pascal Precht","twitter":"pascalprecht","image":"https://pbs.twimg.com/profile_images/993785060733194241/p3oAIMDP_400x400.jpg"},"anthony_laibe":{"name":"Anthony Laibe","twitter":"a_laibe","image":"https://pbs.twimg.com/profile_images/257742900/13168239_400x400.jpg"},"jonathan_rainville":{"name":"Jonathan Rainville","twitter":"ShyolGhul","image":"https://pbs.twimg.com/profile_images/993873866878570496/-aE4byjj_400x400.jpg"},"andre_medeiros":{"name":"Andre Medeiros","twitter":"superdealloc","image":"https://pbs.twimg.com/profile_images/965722487735701504/m58KNgWN_400x400.jpg"},"eric_mastro":{"name":"Eric Mastro","twitter":"ericmastro","image":"https://avatars1.githubusercontent.com/u/5089238?s=460&v=4"},"michael_bradley":{"name":"Michael Bradley","image":"https://avatars3.githubusercontent.com/u/194260?s=460&v=4"},"richard_ramos":{"name":"Richard Ramos","twitter":"richardramos_me","image":"https://pbs.twimg.com/profile_images/1063160577973866496/aM313uHG_400x400.jpg"},"jonny_zerah":{"name":"Jonny Zerah","twitter":"jonnyzerah","image":"https://pbs.twimg.com/profile_images/1043774340490248192/gI9aGy17_400x400.jpg"},"robin_percy":{"name":"Robin Percy","twitter":"rbin","image":"https://avatars1.githubusercontent.com/u/29288325?s=400&v=4"}},"categories":{"tutorials":"Tutorials","announcements":"Announcements"},"languages":{"en":"English"},"plugins":[{"name":"embark-bamboo","description":"plugins_page.plugins.bamboo.desc","link":"https://www.npmjs.com/package/embark-bamboo","thumbnail":"bamboo.png","tags":["language","smart-contracts"]},{"name":"embark-solc","description":"plugins_page.plugins.solc.desc","link":"https://www.npmjs.com/package/embark-solc","thumbnail":"solidity.png","tags":["solidity","language","smart-contracts"]},{"name":"embark-solium","description":"plugins_page.plugins.solium.desc","link":"https://www.npmjs.com/package/embark-solium","thumbnail":"solium.png","tags":["linter","solidity","solium"]},{"name":"embark-etherscan-verifier","description":"plugins_page.plugins.verifier.desc","link":"https://www.npmjs.com/package/embark-etherscan-verifier","tags":["solidity","etherscan","smart-contracts"]},{"name":"embark-status","description":"plugins_page.plugins.status.desc","link":"https://www.npmjs.com/package/embark-status-plugin","thumbnail":"status.png","tags":["status","mobile"]},{"name":"embark-remix","description":"plugins_page.plugins.remix.desc","link":"https://www.npmjs.com/package/embark-remix","thumbnail":"remix.png","tags":["remix","debugger"]},{"name":"embark-slither","description":"plugins_page.plugins.slither.desc","link":"https://www.npmjs.com/package/embark-slither","tags":["solidity"]},{"name":"embark-snark","description":"plugins_page.plugins.snark.desc","link":"https://www.npmjs.com/package/embark-snark","tags":["snark"]},{"name":"embark-fortune","description":"plugins_page.plugins.fortune.desc","link":"https://www.npmjs.com/package/embark-fortune","thumbnail":"fortune.jpg","tags":["fun"]},{"name":"embark-pug","description":"plugins_page.plugins.pug.desc","link":"https://www.npmjs.com/package/embark-pug","legacy":true,"thumbnail":"pug.png","tags":["pug","jade","templates"]},{"name":"embark-haml","description":"plugins_page.plugins.haml.desc","link":"https://www.npmjs.com/package/embark-haml","legacy":true,"thumbnail":"haml.png","tags":["haml","templates"]},{"name":"embark-mythx","description":"plugins_page.plugins.mythx.desc","link":"https://www.npmjs.com/package/embark-mythx","thumbnail":"mythx.png","tags":["mythx","smart-contracts"]}],"menu":{"docs":"/docs/","plugins":"/plugins/","chat":"/chat/","blog":"/news/"},"sidebar":{"docs":{"getting_started":{"overview":"overview.html","installation":"installation.html","faq":"faq.html"},"general_usage":{"creating_project":"create_project.html","structure":"structure.html","running_apps":"running_apps.html","dashboard":"dashboard.html","using_the_console":"using_the_console.html","environments":"environments.html","configuration":"configuration.html","pipeline_and_webpack":"pipeline_and_webpack.html","javascript_usage":"javascript_usage.html"},"smart_contracts":{"contracts_configuration":"contracts_configuration.html","contracts_deployment":"contracts_deployment.html","contracts_imports":"contracts_imports.html","contracts_testing":"contracts_testing.html","contracts_javascript":"contracts_javascript.html"},"blockchain_node":{"blockchain_configuration":"blockchain_configuration.html","blockchain_accounts_configuration":"blockchain_accounts_configuration.html"},"storage":{"storage_configuration":"storage_configuration.html","storage_deployment":"storage_deployment.html","storage_javascript":"storage_javascript.html"},"messages":{"messages_configuration":"messages_configuration.html","messages_javascript":"messages_javascript.html"},"naming":{"naming_configuration":"naming_configuration.html","naming_javascript":"naming_javascript.html"},"plugins":{"installing_a_plugin":"installing_plugins.html","creating_a_plugin":"creating_plugins.html","plugin_reference":"plugin_reference.html"},"cockpit":{"cockpit_introduction":"cockpit_introduction.html","cockpit_dashboard":"cockpit_dashboard.html","cockpit_deployment":"cockpit_deployment.html","cockpit_explorer":"cockpit_explorer.html","cockpit_editor":"cockpit_editor.html","cockpit_debugger":"cockpit_debugger.html"},"reference":{"embark_commands":"embark_commands.html"},"miscellaneous":{"migrating_from_3":"migrating_from_3.x.html","troubleshooting":"troubleshooting.html","contributing":"contributing.html"}}},"templates":[{"name":"Vyper Template","description":"Template to demonstrate the use of the Vyper contracts","install":"embark new AppName --template vyper","thumbnail":"vyper.png","link":"https://github.com/embarklabs/embark-vyper-template","tags":["vyper","contracts"]},{"name":"Embark Demo React Template","description":"A React Application showcasing Embark's functionality","install":"embark demo","thumbnail":"react.png","link":"https://embark.embarklabs.io/docs/create_project.html#Creating-a-Demo-Project","tags":["react","contracts","whisper","ipfs"]},{"name":"Typescript Template","description":"Template with Typescript support pre-configured","thumbnail":"typescript.png","install":"embark new AppName --template typescript","link":"https://github.com/embarklabs/embark-typescript-template","tags":["typescript","frontend"]},{"name":"Vue.js Template","description":"Ready to use Template for using Embark with vue.js","thumbnail":"vuejs.png","install":"embark new AppName --template vue","link":"https://github.com/embarklabs/embark-vue-template","tags":["vue.js","frontend"]},{"name":"ethvtx Template","description":"Demo app for ethvtx, an Ethereum-Ready & Framework-Agnostic Redux configuration","thumbnail":"vortex.png","install":"embark new AppName --template Horyus/ethvtx_embark","link":"https://github.com/Horyus/ethvtx_embark","tags":["react"]},{"name":"Bamboo Template","description":"Template to demonstrate use of the Bamboo contracts","install":"embark new AppName --template bamboo","thumbnail":"bamboo.png","link":"https://github.com/embarklabs/embark-bamboo-template","tags":["bamboo","contracts"]},{"name":"Solidity Gas Golfing","description":"Boilerplate and tests for the first Solidity Gas Golfing Contest","thumbnail":"sggc.png","install":"embark new AppName --template embarklabs/sggc","link":"https://github.com/embarklabs/sggc","tags":["solidity","tests","fun"]}],"tutorials":[{"name":"How to create a Token Factory with Ethereum — Part 1","description":"Create and Deploy a Token with Ethereum","link":"/tutorials/token_factory_1.html","tags":["token","ethereum"]},{"name":"How to create a Token Factory with Ethereum — Part 2","description":"Create a DApp that can deploy Tokens on the fly","link":"/tutorials/token_factory_2.html","tags":["token","ethereum","client-side-deployment"]},{"name":"How to deploy to a testnet with Infura","description":"Deploy and interact with your Dapp on a testnet with the use of Infura","link":"/tutorials/infura_guide.html","tags":["ethereum","deployment","testnet"]}],"versions":{"latest":{"label":"stable (v4)","url":"https://embark.embarklabs.io/docs"},"3.2":{"label":"v3.2","url":"https://5ca4e0fdb29712000adde37f--embark-site-versions.netlify.com/docs/"}}}},"excerpt":"","more":"

As mentioned in our guide on Using EmbarkJS, Embark’s companion JavaScript library EmbarkJS comes with APIs specifically designed to make working with decentralized Storages a breeze. Let’s a have closer look at what EmbarkJS.Storage has to offer.

\n

Setting up EmbarkJS

By default Embark will automatically initialize EmbarkJS with the provider configured at config/storage.js. However if we are using EmbarkJS directly or wish to change the provider configuration at run time, we can do so using the setProvider() method:

\n
EmbarkJS.Storage.setProvider('swarm', options);
\n\n

Options are optional and if provided, will override the values in storage.js. Here’s what a manual configuration could look like:

\n
EmbarkJS.Storage.setProvider('ipfs', {
server: 'localhost',
port: '5001'
});

// OR

EmbarkJS.Storage.setProvider('swarm', {
server: 'swarm-gateways.net',
port: '80'
});
\n\n

Saving text data

String data can be easily uploaded to the configured storage using EmbarkJS.Storage.saveText(). This method takes any string and returns a Promise that resolves with a storage hash that can then be used to retrieve the data:

\n
EmbarkJS.Storage
.saveText("hello world").then(hash => {
...
});
\n\n

Retrieving text data

If we happen to have a storage hash, we can use to to retrieve the data that’s associated to it using EmbarkJS.Storage.get() as shown below. Just like saveText() this method returns a Promise and resolves with the data the hash points to:

\n
EmbarkJS.Storage.get(hash).then(content =>  {
...
});
\n\n

Upload binary data

We can upload files as binary data using EmbarkJS as well. All we need is a reference to a DOM object of type input[type=file] and pass it the uploadFile() method. So assuming we had an input that looked something like this:

\n
<input type="file">
\n\n

We can upload its data like this:

\n
const input = document.querySelector('input[type=file"]');

EmbarkJS.Storage.uploadFile(input).then(hash => {
...
})
\n\n

Similar to saveText() and get(), this method returns a Promise and can be used with JavaScript’s async/await syntec as well.

\n

Display data using URLs

To display any uploaded data in the browser, we can request a fully qualified URL using EmbarkJS.Storage.getUrl() and a dedicated storage hash:

\n
EmbarkJS.Storage.getUrl(hash).then(url => {
...
});
\n\n

Checking for storage provider availability

We can check whether our configured storage provider is available or not using isAvailable(). This method resolves with either true or false depending on whether the service is available:

\n
EmbarkJS.Storage.isAvailable().then(isAvailable => { 
...
});
\n\n

IPNS registration

We can register IPFS hashes using IPNS using the register() method has shown below:

\n
EmbarkJS.Storage.register(some_hash).then(name => {
console.log('Registred: ', name);
});
\n\n
\n

Note on registering hashes:

\n

Registering a hash with IPFS can take a bit of time, so keep that in mind when relying on these APIs.

\n

\n
\n\n\n\n

And of course, we can resolve hashes to their IPFS paths as well, using the resolve() method:

\n
EmbarkJS.Storage.resolve(some_hash).then(name => {
console.log('Resolved ', name);
});
\n\n"},{"title":"Application Structure","layout":"docs","_content":"\nOnce a [project is initialized](/docs/create_project.html), it's a good time to take a look at the resulting project structure, to get a better idea of what's going on. In this guide we'll explore an Embark project's structure and learn where to find different file types and configurations.\n\n**For Smart Contract developers**: This [guide covers](#Smart-Contracts-only-template-structure) projects that have been created with the [`--contracts-only` option](create_project.html#Creating-“contracts-only”-apps) as well.\n\n{% notification info 'Project structure with other tools' %}\nSince Embark version 4.0.0, it's possible (and recommended) to use Embark along with existing front-end tooling. This could be tools such as [Angular CLI](https://cli.angular.io), [Vue CLI](https://cli.vuejs.org) or [Create React App](https://github.com/facebook/create-react-app).\n\nWhen using Embark in combination with any of these or similar tools, the application structure will likely look different as each of these tools comes with an opinion and preference on how an application should be structured.\n{% endnotification %}\n\n## Overview\n\nAn Embark project's structure is pretty straight forward. It contains a `config`, a `test`, an `app`, a `contracts` and a `dist` folder for their dedicated purposes. Most of them are self explanatory, but let's take a look at the overall file tree.\n\n``` plain\n├── app/\n├── contracts/\n├── config\n| ├── blockchain.js\n| └── contracts.js\n| └── storage.js\n| └── communication.js\n| └── webserver.js\n└── test/\n└── dist/\n└── chains.json\n└── embark.json\n```\n\n### app/\n\nThis is where the frontend of our decentralized application lives. It doesn't matter whether we prefer using one of the amazing frameworks out there, like Angular or Vue, or if we like writing vanilla JavaScript. Embark will build our application with all the source files it can find inside `app`.\n\n### contracts/\n\nSmart Contracts go here. Embark will automatically compile, deploy & track our Smart Contracts from this directory. While Embark is running, it'll detect changes made to any Smart Contract and re-deploy it and its dependencies if necessary.\n\n### config/\n\nThere are many different components inside a decentralized application that can be configured. Embark offers different configuration files for each of those components and gives us full control over how the different parts are behaving. The configuration files for the different components of the stack can be found here.\n\n* **blockchain.js**\nThis file contains the configuration used for Embark to run a blockchain node with an Ethereum client such as go-ethereum, Parity, or a simulator like Ganache.\n\n* **contracts.js**\nThis file contains the configuration for Smart Contracts, including their arguments and relationships between them, such as dependencies. Here we can also specify where to deploy our Smart Contracts and how the application should attempt to connect to a node. Please see [Configuring Contracts](contracts_configuration.html) for more details.\n\n* **storage.js**\nThis file lets us configure what storage component to use (e.g IPFS), including what node to connect to, to upload and retrieve data through the application. Head over to our guide on [configuring decentralized storage](storage_configuration.html) for details configuring a decentralized storage system for our application.\n\n* **communication.js**\nSimilar to the other configuration files, this file can be used to configure what communication component should be used (e.g Whisper) and what node it should connect to. Check out our guide [message configuration](messages_configuration.html) to learn more about the available configuration options.\n\n* **webserver.js**\nThis file contains the configuration for the webserver that Embark starts when developing our application. Configuration options are the host, port and other useful options, such as whether a browser window should be opened on start up or not.\n\n### test/\n\nEmbark lets us write tests for our Smart Contracts in JavaScript as well as [Solidity](https://github.com/ethereum/remix/tree/master/remix-tests). All of our tests are located here. To learn more about testing with Embark head over to our [guide on testing](contracts_testing.html).\n\n### dist/\n\nThe build output of our application will be put here. Everything inside this folder can be considered a production ready build artifact. This folder also gets uploaded to a decentralized storage using `embark upload`.\n\n### chains.json\n\nThis file is used to keep track of the deployed contracts in each chain. This is a super useful feature as it lets Embark figure out all by itself if and when a Smart Contract needs to be (re)deployed. See chains file documentation for more information\n\n### embark.json\n\nIn order to provide as much flexibility for our users as possible, Embark comes with an `embark.json` file that lets us configure our own directory structure. This file is also used to specify Embark plugins and other configurations. More information on how to use this configuration file, can be found in [configuring embark.json](configuration.html).\n\n## Smart Contracts only template structure\n\nWhen creating a project using the `--contracts-only` option, the resulting structure is a little bit simpler. Let's take quick look:\n\n```\n├── contracts/\n└── test/\n└── dist/\n├── contracts.js\n└── chains.json\n└── embark.json\n```\n\nMost components or services that our application could take advantage of are disabled with the exception of Smart Contracts support, but we can still re-enable them in the `embark.json` configuration file if needed. Notice that this time, the `contracts.js` config file is in the root of the project's directory. This is because in the `embark.json` config file,`contracts` points to a path in the same folder.\n\n```\n...\n\"config\": {\n \"contracts\": \"contracts.js\",\n \"blockchain\": false,\n \"storage\": false,\n \"communication\": false,\n \"webserver\": false\n},\n...\n```\nAs mentioned earlier, other services like storage and blockchain support can be easily re-enabled by changing them to path values as well.\n\nAwesome, now that we have a better understanding of what a project in Embark looks like, let's head over to the next guide and explore the different ways of running an application with Embark!\n","source":"docs/structure.md","raw":"title: Application Structure\nlayout: docs\n---\n\nOnce a [project is initialized](/docs/create_project.html), it's a good time to take a look at the resulting project structure, to get a better idea of what's going on. In this guide we'll explore an Embark project's structure and learn where to find different file types and configurations.\n\n**For Smart Contract developers**: This [guide covers](#Smart-Contracts-only-template-structure) projects that have been created with the [`--contracts-only` option](create_project.html#Creating-“contracts-only”-apps) as well.\n\n{% notification info 'Project structure with other tools' %}\nSince Embark version 4.0.0, it's possible (and recommended) to use Embark along with existing front-end tooling. This could be tools such as [Angular CLI](https://cli.angular.io), [Vue CLI](https://cli.vuejs.org) or [Create React App](https://github.com/facebook/create-react-app).\n\nWhen using Embark in combination with any of these or similar tools, the application structure will likely look different as each of these tools comes with an opinion and preference on how an application should be structured.\n{% endnotification %}\n\n## Overview\n\nAn Embark project's structure is pretty straight forward. It contains a `config`, a `test`, an `app`, a `contracts` and a `dist` folder for their dedicated purposes. Most of them are self explanatory, but let's take a look at the overall file tree.\n\n``` plain\n├── app/\n├── contracts/\n├── config\n| ├── blockchain.js\n| └── contracts.js\n| └── storage.js\n| └── communication.js\n| └── webserver.js\n└── test/\n└── dist/\n└── chains.json\n└── embark.json\n```\n\n### app/\n\nThis is where the frontend of our decentralized application lives. It doesn't matter whether we prefer using one of the amazing frameworks out there, like Angular or Vue, or if we like writing vanilla JavaScript. Embark will build our application with all the source files it can find inside `app`.\n\n### contracts/\n\nSmart Contracts go here. Embark will automatically compile, deploy & track our Smart Contracts from this directory. While Embark is running, it'll detect changes made to any Smart Contract and re-deploy it and its dependencies if necessary.\n\n### config/\n\nThere are many different components inside a decentralized application that can be configured. Embark offers different configuration files for each of those components and gives us full control over how the different parts are behaving. The configuration files for the different components of the stack can be found here.\n\n* **blockchain.js**\nThis file contains the configuration used for Embark to run a blockchain node with an Ethereum client such as go-ethereum, Parity, or a simulator like Ganache.\n\n* **contracts.js**\nThis file contains the configuration for Smart Contracts, including their arguments and relationships between them, such as dependencies. Here we can also specify where to deploy our Smart Contracts and how the application should attempt to connect to a node. Please see [Configuring Contracts](contracts_configuration.html) for more details.\n\n* **storage.js**\nThis file lets us configure what storage component to use (e.g IPFS), including what node to connect to, to upload and retrieve data through the application. Head over to our guide on [configuring decentralized storage](storage_configuration.html) for details configuring a decentralized storage system for our application.\n\n* **communication.js**\nSimilar to the other configuration files, this file can be used to configure what communication component should be used (e.g Whisper) and what node it should connect to. Check out our guide [message configuration](messages_configuration.html) to learn more about the available configuration options.\n\n* **webserver.js**\nThis file contains the configuration for the webserver that Embark starts when developing our application. Configuration options are the host, port and other useful options, such as whether a browser window should be opened on start up or not.\n\n### test/\n\nEmbark lets us write tests for our Smart Contracts in JavaScript as well as [Solidity](https://github.com/ethereum/remix/tree/master/remix-tests). All of our tests are located here. To learn more about testing with Embark head over to our [guide on testing](contracts_testing.html).\n\n### dist/\n\nThe build output of our application will be put here. Everything inside this folder can be considered a production ready build artifact. This folder also gets uploaded to a decentralized storage using `embark upload`.\n\n### chains.json\n\nThis file is used to keep track of the deployed contracts in each chain. This is a super useful feature as it lets Embark figure out all by itself if and when a Smart Contract needs to be (re)deployed. See chains file documentation for more information\n\n### embark.json\n\nIn order to provide as much flexibility for our users as possible, Embark comes with an `embark.json` file that lets us configure our own directory structure. This file is also used to specify Embark plugins and other configurations. More information on how to use this configuration file, can be found in [configuring embark.json](configuration.html).\n\n## Smart Contracts only template structure\n\nWhen creating a project using the `--contracts-only` option, the resulting structure is a little bit simpler. Let's take quick look:\n\n```\n├── contracts/\n└── test/\n└── dist/\n├── contracts.js\n└── chains.json\n└── embark.json\n```\n\nMost components or services that our application could take advantage of are disabled with the exception of Smart Contracts support, but we can still re-enable them in the `embark.json` configuration file if needed. Notice that this time, the `contracts.js` config file is in the root of the project's directory. This is because in the `embark.json` config file,`contracts` points to a path in the same folder.\n\n```\n...\n\"config\": {\n \"contracts\": \"contracts.js\",\n \"blockchain\": false,\n \"storage\": false,\n \"communication\": false,\n \"webserver\": false\n},\n...\n```\nAs mentioned earlier, other services like storage and blockchain support can be easily re-enabled by changing them to path values as well.\n\nAwesome, now that we have a better understanding of what a project in Embark looks like, let's head over to the next guide and explore the different ways of running an application with Embark!\n","date":"2020-01-17T19:00:03.900Z","updated":"2020-01-17T19:00:03.900Z","path":"docs/structure.html","comments":1,"_id":"ck5ijm3ry001q7heghat16oa6","content":"

Once a project is initialized, it’s a good time to take a look at the resulting project structure, to get a better idea of what’s going on. In this guide we’ll explore an Embark project’s structure and learn where to find different file types and configurations.

\n

For Smart Contract developers: This guide covers projects that have been created with the --contracts-only option as well.

\n
\n

Project structure with other tools

\n

Since Embark version 4.0.0, it’s possible (and recommended) to use Embark along with existing front-end tooling. This could be tools such as Angular CLI, Vue CLI or Create React App.

\n

When using Embark in combination with any of these or similar tools, the application structure will likely look different as each of these tools comes with an opinion and preference on how an application should be structured.

\n

\n
\n\n\n\n

Overview

An Embark project’s structure is pretty straight forward. It contains a config, a test, an app, a contracts and a dist folder for their dedicated purposes. Most of them are self explanatory, but let’s take a look at the overall file tree.

\n
├── app/
├── contracts/
├── config
| ├── blockchain.js
| └── contracts.js
| └── storage.js
| └── communication.js
| └── webserver.js
└── test/
└── dist/
└── chains.json
└── embark.json
\n\n

app/

This is where the frontend of our decentralized application lives. It doesn’t matter whether we prefer using one of the amazing frameworks out there, like Angular or Vue, or if we like writing vanilla JavaScript. Embark will build our application with all the source files it can find inside app.

\n

contracts/

Smart Contracts go here. Embark will automatically compile, deploy & track our Smart Contracts from this directory. While Embark is running, it’ll detect changes made to any Smart Contract and re-deploy it and its dependencies if necessary.

\n

config/

There are many different components inside a decentralized application that can be configured. Embark offers different configuration files for each of those components and gives us full control over how the different parts are behaving. The configuration files for the different components of the stack can be found here.

\n
    \n
  • blockchain.js
    This file contains the configuration used for Embark to run a blockchain node with an Ethereum client such as go-ethereum, Parity, or a simulator like Ganache.

    \n
  • \n
  • contracts.js
    This file contains the configuration for Smart Contracts, including their arguments and relationships between them, such as dependencies. Here we can also specify where to deploy our Smart Contracts and how the application should attempt to connect to a node. Please see Configuring Contracts for more details.

    \n
  • \n
  • storage.js
    This file lets us configure what storage component to use (e.g IPFS), including what node to connect to, to upload and retrieve data through the application. Head over to our guide on configuring decentralized storage for details configuring a decentralized storage system for our application.

    \n
  • \n
  • communication.js
    Similar to the other configuration files, this file can be used to configure what communication component should be used (e.g Whisper) and what node it should connect to. Check out our guide message configuration to learn more about the available configuration options.

    \n
  • \n
  • webserver.js
    This file contains the configuration for the webserver that Embark starts when developing our application. Configuration options are the host, port and other useful options, such as whether a browser window should be opened on start up or not.

    \n
  • \n
\n

test/

Embark lets us write tests for our Smart Contracts in JavaScript as well as Solidity. All of our tests are located here. To learn more about testing with Embark head over to our guide on testing.

\n

dist/

The build output of our application will be put here. Everything inside this folder can be considered a production ready build artifact. This folder also gets uploaded to a decentralized storage using embark upload.

\n

chains.json

This file is used to keep track of the deployed contracts in each chain. This is a super useful feature as it lets Embark figure out all by itself if and when a Smart Contract needs to be (re)deployed. See chains file documentation for more information

\n

embark.json

In order to provide as much flexibility for our users as possible, Embark comes with an embark.json file that lets us configure our own directory structure. This file is also used to specify Embark plugins and other configurations. More information on how to use this configuration file, can be found in configuring embark.json.

\n

Smart Contracts only template structure

When creating a project using the --contracts-only option, the resulting structure is a little bit simpler. Let’s take quick look:

\n
├── contracts/
└── test/
└── dist/
├── contracts.js
└── chains.json
└── embark.json
\n\n

Most components or services that our application could take advantage of are disabled with the exception of Smart Contracts support, but we can still re-enable them in the embark.json configuration file if needed. Notice that this time, the contracts.js config file is in the root of the project’s directory. This is because in the embark.json config file,contracts points to a path in the same folder.

\n
...
"config": {
"contracts": "contracts.js",
"blockchain": false,
"storage": false,
"communication": false,
"webserver": false
},
...
\n

As mentioned earlier, other services like storage and blockchain support can be easily re-enabled by changing them to path values as well.

\n

Awesome, now that we have a better understanding of what a project in Embark looks like, let’s head over to the next guide and explore the different ways of running an application with Embark!

\n","site":{"data":{"authors":{"iuri_matias":{"name":"Iuri Matias","twitter":"iurimatias","image":"https://pbs.twimg.com/profile_images/928272512181563392/iDJdvy2k_400x400.jpg"},"pascal_precht":{"name":"Pascal Precht","twitter":"pascalprecht","image":"https://pbs.twimg.com/profile_images/993785060733194241/p3oAIMDP_400x400.jpg"},"anthony_laibe":{"name":"Anthony Laibe","twitter":"a_laibe","image":"https://pbs.twimg.com/profile_images/257742900/13168239_400x400.jpg"},"jonathan_rainville":{"name":"Jonathan Rainville","twitter":"ShyolGhul","image":"https://pbs.twimg.com/profile_images/993873866878570496/-aE4byjj_400x400.jpg"},"andre_medeiros":{"name":"Andre Medeiros","twitter":"superdealloc","image":"https://pbs.twimg.com/profile_images/965722487735701504/m58KNgWN_400x400.jpg"},"eric_mastro":{"name":"Eric Mastro","twitter":"ericmastro","image":"https://avatars1.githubusercontent.com/u/5089238?s=460&v=4"},"michael_bradley":{"name":"Michael Bradley","image":"https://avatars3.githubusercontent.com/u/194260?s=460&v=4"},"richard_ramos":{"name":"Richard Ramos","twitter":"richardramos_me","image":"https://pbs.twimg.com/profile_images/1063160577973866496/aM313uHG_400x400.jpg"},"jonny_zerah":{"name":"Jonny Zerah","twitter":"jonnyzerah","image":"https://pbs.twimg.com/profile_images/1043774340490248192/gI9aGy17_400x400.jpg"},"robin_percy":{"name":"Robin Percy","twitter":"rbin","image":"https://avatars1.githubusercontent.com/u/29288325?s=400&v=4"}},"categories":{"tutorials":"Tutorials","announcements":"Announcements"},"languages":{"en":"English"},"plugins":[{"name":"embark-bamboo","description":"plugins_page.plugins.bamboo.desc","link":"https://www.npmjs.com/package/embark-bamboo","thumbnail":"bamboo.png","tags":["language","smart-contracts"]},{"name":"embark-solc","description":"plugins_page.plugins.solc.desc","link":"https://www.npmjs.com/package/embark-solc","thumbnail":"solidity.png","tags":["solidity","language","smart-contracts"]},{"name":"embark-solium","description":"plugins_page.plugins.solium.desc","link":"https://www.npmjs.com/package/embark-solium","thumbnail":"solium.png","tags":["linter","solidity","solium"]},{"name":"embark-etherscan-verifier","description":"plugins_page.plugins.verifier.desc","link":"https://www.npmjs.com/package/embark-etherscan-verifier","tags":["solidity","etherscan","smart-contracts"]},{"name":"embark-status","description":"plugins_page.plugins.status.desc","link":"https://www.npmjs.com/package/embark-status-plugin","thumbnail":"status.png","tags":["status","mobile"]},{"name":"embark-remix","description":"plugins_page.plugins.remix.desc","link":"https://www.npmjs.com/package/embark-remix","thumbnail":"remix.png","tags":["remix","debugger"]},{"name":"embark-slither","description":"plugins_page.plugins.slither.desc","link":"https://www.npmjs.com/package/embark-slither","tags":["solidity"]},{"name":"embark-snark","description":"plugins_page.plugins.snark.desc","link":"https://www.npmjs.com/package/embark-snark","tags":["snark"]},{"name":"embark-fortune","description":"plugins_page.plugins.fortune.desc","link":"https://www.npmjs.com/package/embark-fortune","thumbnail":"fortune.jpg","tags":["fun"]},{"name":"embark-pug","description":"plugins_page.plugins.pug.desc","link":"https://www.npmjs.com/package/embark-pug","legacy":true,"thumbnail":"pug.png","tags":["pug","jade","templates"]},{"name":"embark-haml","description":"plugins_page.plugins.haml.desc","link":"https://www.npmjs.com/package/embark-haml","legacy":true,"thumbnail":"haml.png","tags":["haml","templates"]},{"name":"embark-mythx","description":"plugins_page.plugins.mythx.desc","link":"https://www.npmjs.com/package/embark-mythx","thumbnail":"mythx.png","tags":["mythx","smart-contracts"]}],"menu":{"docs":"/docs/","plugins":"/plugins/","chat":"/chat/","blog":"/news/"},"sidebar":{"docs":{"getting_started":{"overview":"overview.html","installation":"installation.html","faq":"faq.html"},"general_usage":{"creating_project":"create_project.html","structure":"structure.html","running_apps":"running_apps.html","dashboard":"dashboard.html","using_the_console":"using_the_console.html","environments":"environments.html","configuration":"configuration.html","pipeline_and_webpack":"pipeline_and_webpack.html","javascript_usage":"javascript_usage.html"},"smart_contracts":{"contracts_configuration":"contracts_configuration.html","contracts_deployment":"contracts_deployment.html","contracts_imports":"contracts_imports.html","contracts_testing":"contracts_testing.html","contracts_javascript":"contracts_javascript.html"},"blockchain_node":{"blockchain_configuration":"blockchain_configuration.html","blockchain_accounts_configuration":"blockchain_accounts_configuration.html"},"storage":{"storage_configuration":"storage_configuration.html","storage_deployment":"storage_deployment.html","storage_javascript":"storage_javascript.html"},"messages":{"messages_configuration":"messages_configuration.html","messages_javascript":"messages_javascript.html"},"naming":{"naming_configuration":"naming_configuration.html","naming_javascript":"naming_javascript.html"},"plugins":{"installing_a_plugin":"installing_plugins.html","creating_a_plugin":"creating_plugins.html","plugin_reference":"plugin_reference.html"},"cockpit":{"cockpit_introduction":"cockpit_introduction.html","cockpit_dashboard":"cockpit_dashboard.html","cockpit_deployment":"cockpit_deployment.html","cockpit_explorer":"cockpit_explorer.html","cockpit_editor":"cockpit_editor.html","cockpit_debugger":"cockpit_debugger.html"},"reference":{"embark_commands":"embark_commands.html"},"miscellaneous":{"migrating_from_3":"migrating_from_3.x.html","troubleshooting":"troubleshooting.html","contributing":"contributing.html"}}},"templates":[{"name":"Vyper Template","description":"Template to demonstrate the use of the Vyper contracts","install":"embark new AppName --template vyper","thumbnail":"vyper.png","link":"https://github.com/embarklabs/embark-vyper-template","tags":["vyper","contracts"]},{"name":"Embark Demo React Template","description":"A React Application showcasing Embark's functionality","install":"embark demo","thumbnail":"react.png","link":"https://embark.embarklabs.io/docs/create_project.html#Creating-a-Demo-Project","tags":["react","contracts","whisper","ipfs"]},{"name":"Typescript Template","description":"Template with Typescript support pre-configured","thumbnail":"typescript.png","install":"embark new AppName --template typescript","link":"https://github.com/embarklabs/embark-typescript-template","tags":["typescript","frontend"]},{"name":"Vue.js Template","description":"Ready to use Template for using Embark with vue.js","thumbnail":"vuejs.png","install":"embark new AppName --template vue","link":"https://github.com/embarklabs/embark-vue-template","tags":["vue.js","frontend"]},{"name":"ethvtx Template","description":"Demo app for ethvtx, an Ethereum-Ready & Framework-Agnostic Redux configuration","thumbnail":"vortex.png","install":"embark new AppName --template Horyus/ethvtx_embark","link":"https://github.com/Horyus/ethvtx_embark","tags":["react"]},{"name":"Bamboo Template","description":"Template to demonstrate use of the Bamboo contracts","install":"embark new AppName --template bamboo","thumbnail":"bamboo.png","link":"https://github.com/embarklabs/embark-bamboo-template","tags":["bamboo","contracts"]},{"name":"Solidity Gas Golfing","description":"Boilerplate and tests for the first Solidity Gas Golfing Contest","thumbnail":"sggc.png","install":"embark new AppName --template embarklabs/sggc","link":"https://github.com/embarklabs/sggc","tags":["solidity","tests","fun"]}],"tutorials":[{"name":"How to create a Token Factory with Ethereum — Part 1","description":"Create and Deploy a Token with Ethereum","link":"/tutorials/token_factory_1.html","tags":["token","ethereum"]},{"name":"How to create a Token Factory with Ethereum — Part 2","description":"Create a DApp that can deploy Tokens on the fly","link":"/tutorials/token_factory_2.html","tags":["token","ethereum","client-side-deployment"]},{"name":"How to deploy to a testnet with Infura","description":"Deploy and interact with your Dapp on a testnet with the use of Infura","link":"/tutorials/infura_guide.html","tags":["ethereum","deployment","testnet"]}],"versions":{"latest":{"label":"stable (v4)","url":"https://embark.embarklabs.io/docs"},"3.2":{"label":"v3.2","url":"https://5ca4e0fdb29712000adde37f--embark-site-versions.netlify.com/docs/"}}}},"excerpt":"","more":"

Once a project is initialized, it’s a good time to take a look at the resulting project structure, to get a better idea of what’s going on. In this guide we’ll explore an Embark project’s structure and learn where to find different file types and configurations.

\n

For Smart Contract developers: This guide covers projects that have been created with the --contracts-only option as well.

\n
\n

Project structure with other tools

\n

Since Embark version 4.0.0, it’s possible (and recommended) to use Embark along with existing front-end tooling. This could be tools such as Angular CLI, Vue CLI or Create React App.

\n

When using Embark in combination with any of these or similar tools, the application structure will likely look different as each of these tools comes with an opinion and preference on how an application should be structured.

\n

\n
\n\n\n\n

Overview

An Embark project’s structure is pretty straight forward. It contains a config, a test, an app, a contracts and a dist folder for their dedicated purposes. Most of them are self explanatory, but let’s take a look at the overall file tree.

\n
├── app/
├── contracts/
├── config
| ├── blockchain.js
| └── contracts.js
| └── storage.js
| └── communication.js
| └── webserver.js
└── test/
└── dist/
└── chains.json
└── embark.json
\n\n

app/

This is where the frontend of our decentralized application lives. It doesn’t matter whether we prefer using one of the amazing frameworks out there, like Angular or Vue, or if we like writing vanilla JavaScript. Embark will build our application with all the source files it can find inside app.

\n

contracts/

Smart Contracts go here. Embark will automatically compile, deploy & track our Smart Contracts from this directory. While Embark is running, it’ll detect changes made to any Smart Contract and re-deploy it and its dependencies if necessary.

\n

config/

There are many different components inside a decentralized application that can be configured. Embark offers different configuration files for each of those components and gives us full control over how the different parts are behaving. The configuration files for the different components of the stack can be found here.

\n
    \n
  • blockchain.js
    This file contains the configuration used for Embark to run a blockchain node with an Ethereum client such as go-ethereum, Parity, or a simulator like Ganache.

    \n
  • \n
  • contracts.js
    This file contains the configuration for Smart Contracts, including their arguments and relationships between them, such as dependencies. Here we can also specify where to deploy our Smart Contracts and how the application should attempt to connect to a node. Please see Configuring Contracts for more details.

    \n
  • \n
  • storage.js
    This file lets us configure what storage component to use (e.g IPFS), including what node to connect to, to upload and retrieve data through the application. Head over to our guide on configuring decentralized storage for details configuring a decentralized storage system for our application.

    \n
  • \n
  • communication.js
    Similar to the other configuration files, this file can be used to configure what communication component should be used (e.g Whisper) and what node it should connect to. Check out our guide message configuration to learn more about the available configuration options.

    \n
  • \n
  • webserver.js
    This file contains the configuration for the webserver that Embark starts when developing our application. Configuration options are the host, port and other useful options, such as whether a browser window should be opened on start up or not.

    \n
  • \n
\n

test/

Embark lets us write tests for our Smart Contracts in JavaScript as well as Solidity. All of our tests are located here. To learn more about testing with Embark head over to our guide on testing.

\n

dist/

The build output of our application will be put here. Everything inside this folder can be considered a production ready build artifact. This folder also gets uploaded to a decentralized storage using embark upload.

\n

chains.json

This file is used to keep track of the deployed contracts in each chain. This is a super useful feature as it lets Embark figure out all by itself if and when a Smart Contract needs to be (re)deployed. See chains file documentation for more information

\n

embark.json

In order to provide as much flexibility for our users as possible, Embark comes with an embark.json file that lets us configure our own directory structure. This file is also used to specify Embark plugins and other configurations. More information on how to use this configuration file, can be found in configuring embark.json.

\n

Smart Contracts only template structure

When creating a project using the --contracts-only option, the resulting structure is a little bit simpler. Let’s take quick look:

\n
├── contracts/
└── test/
└── dist/
├── contracts.js
└── chains.json
└── embark.json
\n\n

Most components or services that our application could take advantage of are disabled with the exception of Smart Contracts support, but we can still re-enable them in the embark.json configuration file if needed. Notice that this time, the contracts.js config file is in the root of the project’s directory. This is because in the embark.json config file,contracts points to a path in the same folder.

\n
...
"config": {
"contracts": "contracts.js",
"blockchain": false,
"storage": false,
"communication": false,
"webserver": false
},
...
\n

As mentioned earlier, other services like storage and blockchain support can be easily re-enabled by changing them to path values as well.

\n

Awesome, now that we have a better understanding of what a project in Embark looks like, let’s head over to the next guide and explore the different ways of running an application with Embark!

\n"},{"title":"Using the Cockpit Debugger","layout":"docs","_content":"\nCockpit comes with a very powerful integrated debugger similar to the one provided by the [Remix](https://remix.ethereum.org/) browser IDE. Having an integrated debugger experience right at our finger tips makes us more productive when building decentralized applications and improves our developer experience.\n\nIn this guide we'll take a look at how to use the debugger.\n\n## Entering the Debugger\n\nFirst things first, we need to know where to find the debugger and how to enter it. In Cockpit, basically any transaction that is a Smart Contract call can be debugged.\n\nTherefore, there are different entry points to the debugger. Most of the UI components that represent transaction come with a \"Debug\" button. Clicking that button takes us to Cockpit's [Code Editor](/docs/cockpit_editor.html) in its debugging mode.\n\nProbably the most straight forward way to do that is entering the [Explorer](/docs/cockpit_explorer.html) and simply select any transaction that is a Smart Contract call.\n\n![Cockpit Enter Debugger](/assets/images/cockpit_enter_debugger.gif)\n\n## Debugger View\n\nOnce we enter the debugger mode inside the Code Editor we'll see that Cockpit provides us with several controls to and variable scopes to debug transactions. The controls are very similar to controls in other debugger tools (such as the browser devtools). \n\n![Cockpit Debugger Controls](/assets/images/cockpit_debugger_controls.png)\n\nFrom left to right, the controls are:\n\n- **Jump to previous breakpoint** - Jumps to the previous available breakpoint within the current function\n- **Jump to next breakpoint** - Jumps to the next available breakpoint within the current function\n- **Step over previous function call** - Executes the previous function without stepping into it\n- **Step over next function call** - Executes the next function without stepping into it\n- **Step into previous function call** - Steps into the previous function call and sets temporary breakpoint\n- **Step into next function call** - Steps into the next function call and sets temporary breakpoint\n\nWhen using any of these controls, the breakpoint indicator in the source of the Smart Contract, as well as the variables in the Scopes view will update as well. \n\n![Cockpit Using Debugger](/assets/images/cockpit_using_debugger.gif)\n\n## Debugger variables\n\nAs we're using the debugger and step through function calls, Cockpit updates and outputs relevant variables within the scope of the function we're debugging. This is a very useful feature as we can see in real-time which variables contain which value.\n\nThe debugger provides variables in the following scopes:\n\n- **contract** - These are variable members of the Smart Contract instance itself.\n- **globals** - These are global variables available in the current scope of the function that is being debugged. This includes useful values such as the current `block` as well as `msg`.\n- **locals** - These are parameter variables scoped to the function that is being debugged.\n","source":"docs/cockpit_debugger.md","raw":"title: Using the Cockpit Debugger\nlayout: docs\n---\n\nCockpit comes with a very powerful integrated debugger similar to the one provided by the [Remix](https://remix.ethereum.org/) browser IDE. Having an integrated debugger experience right at our finger tips makes us more productive when building decentralized applications and improves our developer experience.\n\nIn this guide we'll take a look at how to use the debugger.\n\n## Entering the Debugger\n\nFirst things first, we need to know where to find the debugger and how to enter it. In Cockpit, basically any transaction that is a Smart Contract call can be debugged.\n\nTherefore, there are different entry points to the debugger. Most of the UI components that represent transaction come with a \"Debug\" button. Clicking that button takes us to Cockpit's [Code Editor](/docs/cockpit_editor.html) in its debugging mode.\n\nProbably the most straight forward way to do that is entering the [Explorer](/docs/cockpit_explorer.html) and simply select any transaction that is a Smart Contract call.\n\n![Cockpit Enter Debugger](/assets/images/cockpit_enter_debugger.gif)\n\n## Debugger View\n\nOnce we enter the debugger mode inside the Code Editor we'll see that Cockpit provides us with several controls to and variable scopes to debug transactions. The controls are very similar to controls in other debugger tools (such as the browser devtools). \n\n![Cockpit Debugger Controls](/assets/images/cockpit_debugger_controls.png)\n\nFrom left to right, the controls are:\n\n- **Jump to previous breakpoint** - Jumps to the previous available breakpoint within the current function\n- **Jump to next breakpoint** - Jumps to the next available breakpoint within the current function\n- **Step over previous function call** - Executes the previous function without stepping into it\n- **Step over next function call** - Executes the next function without stepping into it\n- **Step into previous function call** - Steps into the previous function call and sets temporary breakpoint\n- **Step into next function call** - Steps into the next function call and sets temporary breakpoint\n\nWhen using any of these controls, the breakpoint indicator in the source of the Smart Contract, as well as the variables in the Scopes view will update as well. \n\n![Cockpit Using Debugger](/assets/images/cockpit_using_debugger.gif)\n\n## Debugger variables\n\nAs we're using the debugger and step through function calls, Cockpit updates and outputs relevant variables within the scope of the function we're debugging. This is a very useful feature as we can see in real-time which variables contain which value.\n\nThe debugger provides variables in the following scopes:\n\n- **contract** - These are variable members of the Smart Contract instance itself.\n- **globals** - These are global variables available in the current scope of the function that is being debugged. This includes useful values such as the current `block` as well as `msg`.\n- **locals** - These are parameter variables scoped to the function that is being debugged.\n","date":"2020-01-17T19:00:03.896Z","updated":"2020-01-17T19:00:03.896Z","path":"docs/cockpit_debugger.html","comments":1,"_id":"ck5ijm3ry001r7hegh8osc273","content":"

Cockpit comes with a very powerful integrated debugger similar to the one provided by the Remix browser IDE. Having an integrated debugger experience right at our finger tips makes us more productive when building decentralized applications and improves our developer experience.

\n

In this guide we’ll take a look at how to use the debugger.

\n

Entering the Debugger

First things first, we need to know where to find the debugger and how to enter it. In Cockpit, basically any transaction that is a Smart Contract call can be debugged.

\n

Therefore, there are different entry points to the debugger. Most of the UI components that represent transaction come with a “Debug” button. Clicking that button takes us to Cockpit’s Code Editor in its debugging mode.

\n

Probably the most straight forward way to do that is entering the Explorer and simply select any transaction that is a Smart Contract call.

\n

\"Cockpit

\n

Debugger View

Once we enter the debugger mode inside the Code Editor we’ll see that Cockpit provides us with several controls to and variable scopes to debug transactions. The controls are very similar to controls in other debugger tools (such as the browser devtools).

\n

\"Cockpit

\n

From left to right, the controls are:

\n
    \n
  • Jump to previous breakpoint - Jumps to the previous available breakpoint within the current function
  • \n
  • Jump to next breakpoint - Jumps to the next available breakpoint within the current function
  • \n
  • Step over previous function call - Executes the previous function without stepping into it
  • \n
  • Step over next function call - Executes the next function without stepping into it
  • \n
  • Step into previous function call - Steps into the previous function call and sets temporary breakpoint
  • \n
  • Step into next function call - Steps into the next function call and sets temporary breakpoint
  • \n
\n

When using any of these controls, the breakpoint indicator in the source of the Smart Contract, as well as the variables in the Scopes view will update as well.

\n

\"Cockpit

\n

Debugger variables

As we’re using the debugger and step through function calls, Cockpit updates and outputs relevant variables within the scope of the function we’re debugging. This is a very useful feature as we can see in real-time which variables contain which value.

\n

The debugger provides variables in the following scopes:

\n
    \n
  • contract - These are variable members of the Smart Contract instance itself.
  • \n
  • globals - These are global variables available in the current scope of the function that is being debugged. This includes useful values such as the current block as well as msg.
  • \n
  • locals - These are parameter variables scoped to the function that is being debugged.
  • \n
\n","site":{"data":{"authors":{"iuri_matias":{"name":"Iuri Matias","twitter":"iurimatias","image":"https://pbs.twimg.com/profile_images/928272512181563392/iDJdvy2k_400x400.jpg"},"pascal_precht":{"name":"Pascal Precht","twitter":"pascalprecht","image":"https://pbs.twimg.com/profile_images/993785060733194241/p3oAIMDP_400x400.jpg"},"anthony_laibe":{"name":"Anthony Laibe","twitter":"a_laibe","image":"https://pbs.twimg.com/profile_images/257742900/13168239_400x400.jpg"},"jonathan_rainville":{"name":"Jonathan Rainville","twitter":"ShyolGhul","image":"https://pbs.twimg.com/profile_images/993873866878570496/-aE4byjj_400x400.jpg"},"andre_medeiros":{"name":"Andre Medeiros","twitter":"superdealloc","image":"https://pbs.twimg.com/profile_images/965722487735701504/m58KNgWN_400x400.jpg"},"eric_mastro":{"name":"Eric Mastro","twitter":"ericmastro","image":"https://avatars1.githubusercontent.com/u/5089238?s=460&v=4"},"michael_bradley":{"name":"Michael Bradley","image":"https://avatars3.githubusercontent.com/u/194260?s=460&v=4"},"richard_ramos":{"name":"Richard Ramos","twitter":"richardramos_me","image":"https://pbs.twimg.com/profile_images/1063160577973866496/aM313uHG_400x400.jpg"},"jonny_zerah":{"name":"Jonny Zerah","twitter":"jonnyzerah","image":"https://pbs.twimg.com/profile_images/1043774340490248192/gI9aGy17_400x400.jpg"},"robin_percy":{"name":"Robin Percy","twitter":"rbin","image":"https://avatars1.githubusercontent.com/u/29288325?s=400&v=4"}},"categories":{"tutorials":"Tutorials","announcements":"Announcements"},"languages":{"en":"English"},"plugins":[{"name":"embark-bamboo","description":"plugins_page.plugins.bamboo.desc","link":"https://www.npmjs.com/package/embark-bamboo","thumbnail":"bamboo.png","tags":["language","smart-contracts"]},{"name":"embark-solc","description":"plugins_page.plugins.solc.desc","link":"https://www.npmjs.com/package/embark-solc","thumbnail":"solidity.png","tags":["solidity","language","smart-contracts"]},{"name":"embark-solium","description":"plugins_page.plugins.solium.desc","link":"https://www.npmjs.com/package/embark-solium","thumbnail":"solium.png","tags":["linter","solidity","solium"]},{"name":"embark-etherscan-verifier","description":"plugins_page.plugins.verifier.desc","link":"https://www.npmjs.com/package/embark-etherscan-verifier","tags":["solidity","etherscan","smart-contracts"]},{"name":"embark-status","description":"plugins_page.plugins.status.desc","link":"https://www.npmjs.com/package/embark-status-plugin","thumbnail":"status.png","tags":["status","mobile"]},{"name":"embark-remix","description":"plugins_page.plugins.remix.desc","link":"https://www.npmjs.com/package/embark-remix","thumbnail":"remix.png","tags":["remix","debugger"]},{"name":"embark-slither","description":"plugins_page.plugins.slither.desc","link":"https://www.npmjs.com/package/embark-slither","tags":["solidity"]},{"name":"embark-snark","description":"plugins_page.plugins.snark.desc","link":"https://www.npmjs.com/package/embark-snark","tags":["snark"]},{"name":"embark-fortune","description":"plugins_page.plugins.fortune.desc","link":"https://www.npmjs.com/package/embark-fortune","thumbnail":"fortune.jpg","tags":["fun"]},{"name":"embark-pug","description":"plugins_page.plugins.pug.desc","link":"https://www.npmjs.com/package/embark-pug","legacy":true,"thumbnail":"pug.png","tags":["pug","jade","templates"]},{"name":"embark-haml","description":"plugins_page.plugins.haml.desc","link":"https://www.npmjs.com/package/embark-haml","legacy":true,"thumbnail":"haml.png","tags":["haml","templates"]},{"name":"embark-mythx","description":"plugins_page.plugins.mythx.desc","link":"https://www.npmjs.com/package/embark-mythx","thumbnail":"mythx.png","tags":["mythx","smart-contracts"]}],"menu":{"docs":"/docs/","plugins":"/plugins/","chat":"/chat/","blog":"/news/"},"sidebar":{"docs":{"getting_started":{"overview":"overview.html","installation":"installation.html","faq":"faq.html"},"general_usage":{"creating_project":"create_project.html","structure":"structure.html","running_apps":"running_apps.html","dashboard":"dashboard.html","using_the_console":"using_the_console.html","environments":"environments.html","configuration":"configuration.html","pipeline_and_webpack":"pipeline_and_webpack.html","javascript_usage":"javascript_usage.html"},"smart_contracts":{"contracts_configuration":"contracts_configuration.html","contracts_deployment":"contracts_deployment.html","contracts_imports":"contracts_imports.html","contracts_testing":"contracts_testing.html","contracts_javascript":"contracts_javascript.html"},"blockchain_node":{"blockchain_configuration":"blockchain_configuration.html","blockchain_accounts_configuration":"blockchain_accounts_configuration.html"},"storage":{"storage_configuration":"storage_configuration.html","storage_deployment":"storage_deployment.html","storage_javascript":"storage_javascript.html"},"messages":{"messages_configuration":"messages_configuration.html","messages_javascript":"messages_javascript.html"},"naming":{"naming_configuration":"naming_configuration.html","naming_javascript":"naming_javascript.html"},"plugins":{"installing_a_plugin":"installing_plugins.html","creating_a_plugin":"creating_plugins.html","plugin_reference":"plugin_reference.html"},"cockpit":{"cockpit_introduction":"cockpit_introduction.html","cockpit_dashboard":"cockpit_dashboard.html","cockpit_deployment":"cockpit_deployment.html","cockpit_explorer":"cockpit_explorer.html","cockpit_editor":"cockpit_editor.html","cockpit_debugger":"cockpit_debugger.html"},"reference":{"embark_commands":"embark_commands.html"},"miscellaneous":{"migrating_from_3":"migrating_from_3.x.html","troubleshooting":"troubleshooting.html","contributing":"contributing.html"}}},"templates":[{"name":"Vyper Template","description":"Template to demonstrate the use of the Vyper contracts","install":"embark new AppName --template vyper","thumbnail":"vyper.png","link":"https://github.com/embarklabs/embark-vyper-template","tags":["vyper","contracts"]},{"name":"Embark Demo React Template","description":"A React Application showcasing Embark's functionality","install":"embark demo","thumbnail":"react.png","link":"https://embark.embarklabs.io/docs/create_project.html#Creating-a-Demo-Project","tags":["react","contracts","whisper","ipfs"]},{"name":"Typescript Template","description":"Template with Typescript support pre-configured","thumbnail":"typescript.png","install":"embark new AppName --template typescript","link":"https://github.com/embarklabs/embark-typescript-template","tags":["typescript","frontend"]},{"name":"Vue.js Template","description":"Ready to use Template for using Embark with vue.js","thumbnail":"vuejs.png","install":"embark new AppName --template vue","link":"https://github.com/embarklabs/embark-vue-template","tags":["vue.js","frontend"]},{"name":"ethvtx Template","description":"Demo app for ethvtx, an Ethereum-Ready & Framework-Agnostic Redux configuration","thumbnail":"vortex.png","install":"embark new AppName --template Horyus/ethvtx_embark","link":"https://github.com/Horyus/ethvtx_embark","tags":["react"]},{"name":"Bamboo Template","description":"Template to demonstrate use of the Bamboo contracts","install":"embark new AppName --template bamboo","thumbnail":"bamboo.png","link":"https://github.com/embarklabs/embark-bamboo-template","tags":["bamboo","contracts"]},{"name":"Solidity Gas Golfing","description":"Boilerplate and tests for the first Solidity Gas Golfing Contest","thumbnail":"sggc.png","install":"embark new AppName --template embarklabs/sggc","link":"https://github.com/embarklabs/sggc","tags":["solidity","tests","fun"]}],"tutorials":[{"name":"How to create a Token Factory with Ethereum — Part 1","description":"Create and Deploy a Token with Ethereum","link":"/tutorials/token_factory_1.html","tags":["token","ethereum"]},{"name":"How to create a Token Factory with Ethereum — Part 2","description":"Create a DApp that can deploy Tokens on the fly","link":"/tutorials/token_factory_2.html","tags":["token","ethereum","client-side-deployment"]},{"name":"How to deploy to a testnet with Infura","description":"Deploy and interact with your Dapp on a testnet with the use of Infura","link":"/tutorials/infura_guide.html","tags":["ethereum","deployment","testnet"]}],"versions":{"latest":{"label":"stable (v4)","url":"https://embark.embarklabs.io/docs"},"3.2":{"label":"v3.2","url":"https://5ca4e0fdb29712000adde37f--embark-site-versions.netlify.com/docs/"}}}},"excerpt":"","more":"

Cockpit comes with a very powerful integrated debugger similar to the one provided by the Remix browser IDE. Having an integrated debugger experience right at our finger tips makes us more productive when building decentralized applications and improves our developer experience.

\n

In this guide we’ll take a look at how to use the debugger.

\n

Entering the Debugger

First things first, we need to know where to find the debugger and how to enter it. In Cockpit, basically any transaction that is a Smart Contract call can be debugged.

\n

Therefore, there are different entry points to the debugger. Most of the UI components that represent transaction come with a “Debug” button. Clicking that button takes us to Cockpit’s Code Editor in its debugging mode.

\n

Probably the most straight forward way to do that is entering the Explorer and simply select any transaction that is a Smart Contract call.

\n

\"Cockpit

\n

Debugger View

Once we enter the debugger mode inside the Code Editor we’ll see that Cockpit provides us with several controls to and variable scopes to debug transactions. The controls are very similar to controls in other debugger tools (such as the browser devtools).

\n

\"Cockpit

\n

From left to right, the controls are:

\n
    \n
  • Jump to previous breakpoint - Jumps to the previous available breakpoint within the current function
  • \n
  • Jump to next breakpoint - Jumps to the next available breakpoint within the current function
  • \n
  • Step over previous function call - Executes the previous function without stepping into it
  • \n
  • Step over next function call - Executes the next function without stepping into it
  • \n
  • Step into previous function call - Steps into the previous function call and sets temporary breakpoint
  • \n
  • Step into next function call - Steps into the next function call and sets temporary breakpoint
  • \n
\n

When using any of these controls, the breakpoint indicator in the source of the Smart Contract, as well as the variables in the Scopes view will update as well.

\n

\"Cockpit

\n

Debugger variables

As we’re using the debugger and step through function calls, Cockpit updates and outputs relevant variables within the scope of the function we’re debugging. This is a very useful feature as we can see in real-time which variables contain which value.

\n

The debugger provides variables in the following scopes:

\n
    \n
  • contract - These are variable members of the Smart Contract instance itself.
  • \n
  • globals - These are global variables available in the current scope of the function that is being debugged. This includes useful values such as the current block as well as msg.
  • \n
  • locals - These are parameter variables scoped to the function that is being debugged.
  • \n
\n"},{"title":"Troubleshooting","layout":"docs","_content":"In case you're experiencing problems with using Embark, here is a list of solutions to some frequently encountered issues. If this page doesn't help you solve your problem, try doing a search on [GitHub](https://github.com/embarklabs/embark/issues).\n\n## node-gyp problems\nnode-gyp can cause problems, because it requires a C++ compiler.\n\nIf you do have problems caused by it, first follow the installation steps for your OS [here](https://github.com/nodejs/node-gyp#installation).\n\nIf you still have problems and are on Windows, try the following:\n- run `npm config set msvs_version 2015` before `npm install`\n- Repair Windows Build tools that the node-gyp doc made you install. If it tells you to remove a conflicting version do it. After the repair succeeded, reboot.\n\n## EACCES / npm ERR Permission denied\n\nIssues typically occur if NodeJS and/or Embark are installed using `sudo`, avoid using it possible. There are [several options](https://docs.npmjs.com/getting-started/fixing-npm-permissions) to fix this. We recommend installing node using [NVM](https://github.com/creationix/nvm/blob/master/README.md)\n\n## Assuming Contract to be an interface\n\nThis warning happens when Embark can't deploy one of your Smart Contracts because the compiler did not return a bytecode.\n\nHere are some of the reasons:\n- If it inherits from an interface, it must have all the functions implemented\n- The contract's constructor must be `public`\n","source":"docs/troubleshooting.md","raw":"title: Troubleshooting\nlayout: docs\n---\nIn case you're experiencing problems with using Embark, here is a list of solutions to some frequently encountered issues. If this page doesn't help you solve your problem, try doing a search on [GitHub](https://github.com/embarklabs/embark/issues).\n\n## node-gyp problems\nnode-gyp can cause problems, because it requires a C++ compiler.\n\nIf you do have problems caused by it, first follow the installation steps for your OS [here](https://github.com/nodejs/node-gyp#installation).\n\nIf you still have problems and are on Windows, try the following:\n- run `npm config set msvs_version 2015` before `npm install`\n- Repair Windows Build tools that the node-gyp doc made you install. If it tells you to remove a conflicting version do it. After the repair succeeded, reboot.\n\n## EACCES / npm ERR Permission denied\n\nIssues typically occur if NodeJS and/or Embark are installed using `sudo`, avoid using it possible. There are [several options](https://docs.npmjs.com/getting-started/fixing-npm-permissions) to fix this. We recommend installing node using [NVM](https://github.com/creationix/nvm/blob/master/README.md)\n\n## Assuming Contract to be an interface\n\nThis warning happens when Embark can't deploy one of your Smart Contracts because the compiler did not return a bytecode.\n\nHere are some of the reasons:\n- If it inherits from an interface, it must have all the functions implemented\n- The contract's constructor must be `public`\n","date":"2020-01-19T20:56:53.015Z","updated":"2020-01-19T20:56:53.015Z","path":"docs/troubleshooting.html","_id":"ck5ijm3rz001s7hegffe14sf7","comments":1,"content":"

In case you’re experiencing problems with using Embark, here is a list of solutions to some frequently encountered issues. If this page doesn’t help you solve your problem, try doing a search on GitHub.

\n

node-gyp problems

node-gyp can cause problems, because it requires a C++ compiler.

\n

If you do have problems caused by it, first follow the installation steps for your OS here.

\n

If you still have problems and are on Windows, try the following:

\n
    \n
  • run npm config set msvs_version 2015 before npm install
  • \n
  • Repair Windows Build tools that the node-gyp doc made you install. If it tells you to remove a conflicting version do it. After the repair succeeded, reboot.
  • \n
\n

EACCES / npm ERR Permission denied

Issues typically occur if NodeJS and/or Embark are installed using sudo, avoid using it possible. There are several options to fix this. We recommend installing node using NVM

\n

Assuming Contract to be an interface

This warning happens when Embark can’t deploy one of your Smart Contracts because the compiler did not return a bytecode.

\n

Here are some of the reasons:

\n
    \n
  • If it inherits from an interface, it must have all the functions implemented
  • \n
  • The contract’s constructor must be public
  • \n
\n","site":{"data":{"authors":{"iuri_matias":{"name":"Iuri Matias","twitter":"iurimatias","image":"https://pbs.twimg.com/profile_images/928272512181563392/iDJdvy2k_400x400.jpg"},"pascal_precht":{"name":"Pascal Precht","twitter":"pascalprecht","image":"https://pbs.twimg.com/profile_images/993785060733194241/p3oAIMDP_400x400.jpg"},"anthony_laibe":{"name":"Anthony Laibe","twitter":"a_laibe","image":"https://pbs.twimg.com/profile_images/257742900/13168239_400x400.jpg"},"jonathan_rainville":{"name":"Jonathan Rainville","twitter":"ShyolGhul","image":"https://pbs.twimg.com/profile_images/993873866878570496/-aE4byjj_400x400.jpg"},"andre_medeiros":{"name":"Andre Medeiros","twitter":"superdealloc","image":"https://pbs.twimg.com/profile_images/965722487735701504/m58KNgWN_400x400.jpg"},"eric_mastro":{"name":"Eric Mastro","twitter":"ericmastro","image":"https://avatars1.githubusercontent.com/u/5089238?s=460&v=4"},"michael_bradley":{"name":"Michael Bradley","image":"https://avatars3.githubusercontent.com/u/194260?s=460&v=4"},"richard_ramos":{"name":"Richard Ramos","twitter":"richardramos_me","image":"https://pbs.twimg.com/profile_images/1063160577973866496/aM313uHG_400x400.jpg"},"jonny_zerah":{"name":"Jonny Zerah","twitter":"jonnyzerah","image":"https://pbs.twimg.com/profile_images/1043774340490248192/gI9aGy17_400x400.jpg"},"robin_percy":{"name":"Robin Percy","twitter":"rbin","image":"https://avatars1.githubusercontent.com/u/29288325?s=400&v=4"}},"categories":{"tutorials":"Tutorials","announcements":"Announcements"},"languages":{"en":"English"},"plugins":[{"name":"embark-bamboo","description":"plugins_page.plugins.bamboo.desc","link":"https://www.npmjs.com/package/embark-bamboo","thumbnail":"bamboo.png","tags":["language","smart-contracts"]},{"name":"embark-solc","description":"plugins_page.plugins.solc.desc","link":"https://www.npmjs.com/package/embark-solc","thumbnail":"solidity.png","tags":["solidity","language","smart-contracts"]},{"name":"embark-solium","description":"plugins_page.plugins.solium.desc","link":"https://www.npmjs.com/package/embark-solium","thumbnail":"solium.png","tags":["linter","solidity","solium"]},{"name":"embark-etherscan-verifier","description":"plugins_page.plugins.verifier.desc","link":"https://www.npmjs.com/package/embark-etherscan-verifier","tags":["solidity","etherscan","smart-contracts"]},{"name":"embark-status","description":"plugins_page.plugins.status.desc","link":"https://www.npmjs.com/package/embark-status-plugin","thumbnail":"status.png","tags":["status","mobile"]},{"name":"embark-remix","description":"plugins_page.plugins.remix.desc","link":"https://www.npmjs.com/package/embark-remix","thumbnail":"remix.png","tags":["remix","debugger"]},{"name":"embark-slither","description":"plugins_page.plugins.slither.desc","link":"https://www.npmjs.com/package/embark-slither","tags":["solidity"]},{"name":"embark-snark","description":"plugins_page.plugins.snark.desc","link":"https://www.npmjs.com/package/embark-snark","tags":["snark"]},{"name":"embark-fortune","description":"plugins_page.plugins.fortune.desc","link":"https://www.npmjs.com/package/embark-fortune","thumbnail":"fortune.jpg","tags":["fun"]},{"name":"embark-pug","description":"plugins_page.plugins.pug.desc","link":"https://www.npmjs.com/package/embark-pug","legacy":true,"thumbnail":"pug.png","tags":["pug","jade","templates"]},{"name":"embark-haml","description":"plugins_page.plugins.haml.desc","link":"https://www.npmjs.com/package/embark-haml","legacy":true,"thumbnail":"haml.png","tags":["haml","templates"]},{"name":"embark-mythx","description":"plugins_page.plugins.mythx.desc","link":"https://www.npmjs.com/package/embark-mythx","thumbnail":"mythx.png","tags":["mythx","smart-contracts"]}],"menu":{"docs":"/docs/","plugins":"/plugins/","chat":"/chat/","blog":"/news/"},"sidebar":{"docs":{"getting_started":{"overview":"overview.html","installation":"installation.html","faq":"faq.html"},"general_usage":{"creating_project":"create_project.html","structure":"structure.html","running_apps":"running_apps.html","dashboard":"dashboard.html","using_the_console":"using_the_console.html","environments":"environments.html","configuration":"configuration.html","pipeline_and_webpack":"pipeline_and_webpack.html","javascript_usage":"javascript_usage.html"},"smart_contracts":{"contracts_configuration":"contracts_configuration.html","contracts_deployment":"contracts_deployment.html","contracts_imports":"contracts_imports.html","contracts_testing":"contracts_testing.html","contracts_javascript":"contracts_javascript.html"},"blockchain_node":{"blockchain_configuration":"blockchain_configuration.html","blockchain_accounts_configuration":"blockchain_accounts_configuration.html"},"storage":{"storage_configuration":"storage_configuration.html","storage_deployment":"storage_deployment.html","storage_javascript":"storage_javascript.html"},"messages":{"messages_configuration":"messages_configuration.html","messages_javascript":"messages_javascript.html"},"naming":{"naming_configuration":"naming_configuration.html","naming_javascript":"naming_javascript.html"},"plugins":{"installing_a_plugin":"installing_plugins.html","creating_a_plugin":"creating_plugins.html","plugin_reference":"plugin_reference.html"},"cockpit":{"cockpit_introduction":"cockpit_introduction.html","cockpit_dashboard":"cockpit_dashboard.html","cockpit_deployment":"cockpit_deployment.html","cockpit_explorer":"cockpit_explorer.html","cockpit_editor":"cockpit_editor.html","cockpit_debugger":"cockpit_debugger.html"},"reference":{"embark_commands":"embark_commands.html"},"miscellaneous":{"migrating_from_3":"migrating_from_3.x.html","troubleshooting":"troubleshooting.html","contributing":"contributing.html"}}},"templates":[{"name":"Vyper Template","description":"Template to demonstrate the use of the Vyper contracts","install":"embark new AppName --template vyper","thumbnail":"vyper.png","link":"https://github.com/embarklabs/embark-vyper-template","tags":["vyper","contracts"]},{"name":"Embark Demo React Template","description":"A React Application showcasing Embark's functionality","install":"embark demo","thumbnail":"react.png","link":"https://embark.embarklabs.io/docs/create_project.html#Creating-a-Demo-Project","tags":["react","contracts","whisper","ipfs"]},{"name":"Typescript Template","description":"Template with Typescript support pre-configured","thumbnail":"typescript.png","install":"embark new AppName --template typescript","link":"https://github.com/embarklabs/embark-typescript-template","tags":["typescript","frontend"]},{"name":"Vue.js Template","description":"Ready to use Template for using Embark with vue.js","thumbnail":"vuejs.png","install":"embark new AppName --template vue","link":"https://github.com/embarklabs/embark-vue-template","tags":["vue.js","frontend"]},{"name":"ethvtx Template","description":"Demo app for ethvtx, an Ethereum-Ready & Framework-Agnostic Redux configuration","thumbnail":"vortex.png","install":"embark new AppName --template Horyus/ethvtx_embark","link":"https://github.com/Horyus/ethvtx_embark","tags":["react"]},{"name":"Bamboo Template","description":"Template to demonstrate use of the Bamboo contracts","install":"embark new AppName --template bamboo","thumbnail":"bamboo.png","link":"https://github.com/embarklabs/embark-bamboo-template","tags":["bamboo","contracts"]},{"name":"Solidity Gas Golfing","description":"Boilerplate and tests for the first Solidity Gas Golfing Contest","thumbnail":"sggc.png","install":"embark new AppName --template embarklabs/sggc","link":"https://github.com/embarklabs/sggc","tags":["solidity","tests","fun"]}],"tutorials":[{"name":"How to create a Token Factory with Ethereum — Part 1","description":"Create and Deploy a Token with Ethereum","link":"/tutorials/token_factory_1.html","tags":["token","ethereum"]},{"name":"How to create a Token Factory with Ethereum — Part 2","description":"Create a DApp that can deploy Tokens on the fly","link":"/tutorials/token_factory_2.html","tags":["token","ethereum","client-side-deployment"]},{"name":"How to deploy to a testnet with Infura","description":"Deploy and interact with your Dapp on a testnet with the use of Infura","link":"/tutorials/infura_guide.html","tags":["ethereum","deployment","testnet"]}],"versions":{"latest":{"label":"stable (v4)","url":"https://embark.embarklabs.io/docs"},"3.2":{"label":"v3.2","url":"https://5ca4e0fdb29712000adde37f--embark-site-versions.netlify.com/docs/"}}}},"excerpt":"","more":"

In case you’re experiencing problems with using Embark, here is a list of solutions to some frequently encountered issues. If this page doesn’t help you solve your problem, try doing a search on GitHub.

\n

node-gyp problems

node-gyp can cause problems, because it requires a C++ compiler.

\n

If you do have problems caused by it, first follow the installation steps for your OS here.

\n

If you still have problems and are on Windows, try the following:

\n
    \n
  • run npm config set msvs_version 2015 before npm install
  • \n
  • Repair Windows Build tools that the node-gyp doc made you install. If it tells you to remove a conflicting version do it. After the repair succeeded, reboot.
  • \n
\n

EACCES / npm ERR Permission denied

Issues typically occur if NodeJS and/or Embark are installed using sudo, avoid using it possible. There are several options to fix this. We recommend installing node using NVM

\n

Assuming Contract to be an interface

This warning happens when Embark can’t deploy one of your Smart Contracts because the compiler did not return a bytecode.

\n

Here are some of the reasons:

\n
    \n
  • If it inherits from an interface, it must have all the functions implemented
  • \n
  • The contract’s constructor must be public
  • \n
\n"},{"title":"Using Storages","layout":"docs","_content":"\n### Save Text/Data\n\n
EmbarkJS.Storage.saveText(\"hello world\")\n  .then(function(hash) {})\n  .catch(function(err) {\n      if(err){\n        console.log(\"IPFS saveText Error => \" + err.message);\n      }\n  });\n
\n\n### Retrieve Text/Data\n\n
EmbarkJS.Storage.get(hash)\n  .then(function(content) {})\n  .catch(function(err) {\n      if(err){\n        console.log(\"IPFS get Error => \" + err.message);\n      }\n  });\n
\n\n### Upload a file\n\n
<input type="file">\n
\n
\n
var input = $(\"input[type=file\"]);\nEmbarkJS.Storage.uploadFile(input)\n  .then(function(hash) {})\n  .catch(function(err) {\n      if(err){\n        console.log(\"IPFS uploadFile Error => \" + err.message);\n      }\n  });\n
\n\n### Display a file\n\n
EmbarkJS.Storage.getUrl(hash);\n
\n\n### Check for storage provider availability\nThis will return true if the storage provider (IPFS or Swarm) is available and running. \n\n
EmbarkJS.Storage.isAvailable()\n  .then(isAvailable => { alert(`The storage provider is: ${isAvailable ? 'available' : 'not available'}`) })\n  .catch(function(err) {\n      if(err){\n        console.log(\"Error getting storage provider availability => \" + err.message);\n      }\n  });\n
\n\n### Setup\n\nBy default Embark will automatically initialize EmbarkJS with the provider configured at `config/storage.js`. However if you are using EmbarkJS directly or wish to change the provider configuration on the fly you can do:\n\n
EmbarkJS.Storage.setProvider('swarm', options);\n
\n\nOptions are optional and if provided, will override the values in `storage.js`. \n\nFor example,\n
EmbarkJS.Storage.setProvider('ipfs', {server: 'localhost', port: '5001'});\n// OR\nEmbarkJS.Storage.setProvider('swarm', {server: 'swarm-gateways.net', port: '80'});\n
\n\n### IPNS registration\n\nYou can register your IPFS hash using IPNS.\n\n*It can take up to a minute to register.\n\n#### IPNS - Register\n\n```Javascript\nEmbarkJS.Storage.register('IPFS_hash', (err, name) => {\n if(err){\n console.log(\"Error registering\", err.message);\n return;\n }\n console.log('Registred to the following hash:', name);\n});\n```\n\n#### IPNS - Resolve\n\n```Javascript\nEmbarkJS.Storage.resolve('IPNS_hash', (err, path) => {\n if(err){\n console.log(\"Error resolving\", err.message);\n return;\n }\n console.log('Resolved to the following IPFS path:', name);\n});\n```\n\n","source":"docs/using_storages.md","raw":"title: Using Storages\nlayout: docs\n---\n\n### Save Text/Data\n\n
EmbarkJS.Storage.saveText(\"hello world\")\n  .then(function(hash) {})\n  .catch(function(err) {\n      if(err){\n        console.log(\"IPFS saveText Error => \" + err.message);\n      }\n  });\n
\n\n### Retrieve Text/Data\n\n
EmbarkJS.Storage.get(hash)\n  .then(function(content) {})\n  .catch(function(err) {\n      if(err){\n        console.log(\"IPFS get Error => \" + err.message);\n      }\n  });\n
\n\n### Upload a file\n\n
<input type="file">\n
\n
\n
var input = $(\"input[type=file\"]);\nEmbarkJS.Storage.uploadFile(input)\n  .then(function(hash) {})\n  .catch(function(err) {\n      if(err){\n        console.log(\"IPFS uploadFile Error => \" + err.message);\n      }\n  });\n
\n\n### Display a file\n\n
EmbarkJS.Storage.getUrl(hash);\n
\n\n### Check for storage provider availability\nThis will return true if the storage provider (IPFS or Swarm) is available and running. \n\n
EmbarkJS.Storage.isAvailable()\n  .then(isAvailable => { alert(`The storage provider is: ${isAvailable ? 'available' : 'not available'}`) })\n  .catch(function(err) {\n      if(err){\n        console.log(\"Error getting storage provider availability => \" + err.message);\n      }\n  });\n
\n\n### Setup\n\nBy default Embark will automatically initialize EmbarkJS with the provider configured at `config/storage.js`. However if you are using EmbarkJS directly or wish to change the provider configuration on the fly you can do:\n\n
EmbarkJS.Storage.setProvider('swarm', options);\n
\n\nOptions are optional and if provided, will override the values in `storage.js`. \n\nFor example,\n
EmbarkJS.Storage.setProvider('ipfs', {server: 'localhost', port: '5001'});\n// OR\nEmbarkJS.Storage.setProvider('swarm', {server: 'swarm-gateways.net', port: '80'});\n
\n\n### IPNS registration\n\nYou can register your IPFS hash using IPNS.\n\n*It can take up to a minute to register.\n\n#### IPNS - Register\n\n```Javascript\nEmbarkJS.Storage.register('IPFS_hash', (err, name) => {\n if(err){\n console.log(\"Error registering\", err.message);\n return;\n }\n console.log('Registred to the following hash:', name);\n});\n```\n\n#### IPNS - Resolve\n\n```Javascript\nEmbarkJS.Storage.resolve('IPNS_hash', (err, path) => {\n if(err){\n console.log(\"Error resolving\", err.message);\n return;\n }\n console.log('Resolved to the following IPFS path:', name);\n});\n```\n\n","date":"2020-01-17T19:00:03.900Z","updated":"2020-01-17T19:00:03.900Z","path":"docs/using_storages.html","comments":1,"_id":"ck5ijm3s0001t7heghjkv38tk","content":"

Save Text/Data

EmbarkJS.Storage.saveText(\"hello world\")\n  .then(function(hash) {})\n  .catch(function(err) {\n      if(err){\n        console.log(\"IPFS saveText Error => \" + err.message);\n      }\n  });\n
\n\n

Retrieve Text/Data

EmbarkJS.Storage.get(hash)\n  .then(function(content) {})\n  .catch(function(err) {\n      if(err){\n        console.log(\"IPFS get Error => \" + err.message);\n      }\n  });\n
\n\n

Upload a file

<input type="file">\n
\n
\n
var input = $(\"input[type=file\"]);\nEmbarkJS.Storage.uploadFile(input)\n  .then(function(hash) {})\n  .catch(function(err) {\n      if(err){\n        console.log(\"IPFS uploadFile Error => \" + err.message);\n      }\n  });\n
\n\n

Display a file

EmbarkJS.Storage.getUrl(hash);\n
\n\n

Check for storage provider availability

This will return true if the storage provider (IPFS or Swarm) is available and running.

\n
EmbarkJS.Storage.isAvailable()\n  .then(isAvailable => { alert(`The storage provider is: ${isAvailable ? 'available' : 'not available'}`) })\n  .catch(function(err) {\n      if(err){\n        console.log(\"Error getting storage provider availability => \" + err.message);\n      }\n  });\n
\n\n

Setup

By default Embark will automatically initialize EmbarkJS with the provider configured at config/storage.js. However if you are using EmbarkJS directly or wish to change the provider configuration on the fly you can do:

\n
EmbarkJS.Storage.setProvider('swarm', options);\n
\n\n

Options are optional and if provided, will override the values in storage.js.

\n

For example,

\n
EmbarkJS.Storage.setProvider('ipfs', {server: 'localhost', port: '5001'});\n// OR\nEmbarkJS.Storage.setProvider('swarm', {server: 'swarm-gateways.net', port: '80'});\n
\n\n

IPNS registration

You can register your IPFS hash using IPNS.

\n

*It can take up to a minute to register.

\n

IPNS - Register

EmbarkJS.Storage.register('IPFS_hash', (err, name) => {
if(err){
console.log(\"Error registering\", err.message);
return;
}
console.log('Registred to the following hash:', name);
});
\n\n

IPNS - Resolve

EmbarkJS.Storage.resolve('IPNS_hash', (err, path) => {
if(err){
console.log(\"Error resolving\", err.message);
return;
}
console.log('Resolved to the following IPFS path:', name);
});
\n\n","site":{"data":{"authors":{"iuri_matias":{"name":"Iuri Matias","twitter":"iurimatias","image":"https://pbs.twimg.com/profile_images/928272512181563392/iDJdvy2k_400x400.jpg"},"pascal_precht":{"name":"Pascal Precht","twitter":"pascalprecht","image":"https://pbs.twimg.com/profile_images/993785060733194241/p3oAIMDP_400x400.jpg"},"anthony_laibe":{"name":"Anthony Laibe","twitter":"a_laibe","image":"https://pbs.twimg.com/profile_images/257742900/13168239_400x400.jpg"},"jonathan_rainville":{"name":"Jonathan Rainville","twitter":"ShyolGhul","image":"https://pbs.twimg.com/profile_images/993873866878570496/-aE4byjj_400x400.jpg"},"andre_medeiros":{"name":"Andre Medeiros","twitter":"superdealloc","image":"https://pbs.twimg.com/profile_images/965722487735701504/m58KNgWN_400x400.jpg"},"eric_mastro":{"name":"Eric Mastro","twitter":"ericmastro","image":"https://avatars1.githubusercontent.com/u/5089238?s=460&v=4"},"michael_bradley":{"name":"Michael Bradley","image":"https://avatars3.githubusercontent.com/u/194260?s=460&v=4"},"richard_ramos":{"name":"Richard Ramos","twitter":"richardramos_me","image":"https://pbs.twimg.com/profile_images/1063160577973866496/aM313uHG_400x400.jpg"},"jonny_zerah":{"name":"Jonny Zerah","twitter":"jonnyzerah","image":"https://pbs.twimg.com/profile_images/1043774340490248192/gI9aGy17_400x400.jpg"},"robin_percy":{"name":"Robin Percy","twitter":"rbin","image":"https://avatars1.githubusercontent.com/u/29288325?s=400&v=4"}},"categories":{"tutorials":"Tutorials","announcements":"Announcements"},"languages":{"en":"English"},"plugins":[{"name":"embark-bamboo","description":"plugins_page.plugins.bamboo.desc","link":"https://www.npmjs.com/package/embark-bamboo","thumbnail":"bamboo.png","tags":["language","smart-contracts"]},{"name":"embark-solc","description":"plugins_page.plugins.solc.desc","link":"https://www.npmjs.com/package/embark-solc","thumbnail":"solidity.png","tags":["solidity","language","smart-contracts"]},{"name":"embark-solium","description":"plugins_page.plugins.solium.desc","link":"https://www.npmjs.com/package/embark-solium","thumbnail":"solium.png","tags":["linter","solidity","solium"]},{"name":"embark-etherscan-verifier","description":"plugins_page.plugins.verifier.desc","link":"https://www.npmjs.com/package/embark-etherscan-verifier","tags":["solidity","etherscan","smart-contracts"]},{"name":"embark-status","description":"plugins_page.plugins.status.desc","link":"https://www.npmjs.com/package/embark-status-plugin","thumbnail":"status.png","tags":["status","mobile"]},{"name":"embark-remix","description":"plugins_page.plugins.remix.desc","link":"https://www.npmjs.com/package/embark-remix","thumbnail":"remix.png","tags":["remix","debugger"]},{"name":"embark-slither","description":"plugins_page.plugins.slither.desc","link":"https://www.npmjs.com/package/embark-slither","tags":["solidity"]},{"name":"embark-snark","description":"plugins_page.plugins.snark.desc","link":"https://www.npmjs.com/package/embark-snark","tags":["snark"]},{"name":"embark-fortune","description":"plugins_page.plugins.fortune.desc","link":"https://www.npmjs.com/package/embark-fortune","thumbnail":"fortune.jpg","tags":["fun"]},{"name":"embark-pug","description":"plugins_page.plugins.pug.desc","link":"https://www.npmjs.com/package/embark-pug","legacy":true,"thumbnail":"pug.png","tags":["pug","jade","templates"]},{"name":"embark-haml","description":"plugins_page.plugins.haml.desc","link":"https://www.npmjs.com/package/embark-haml","legacy":true,"thumbnail":"haml.png","tags":["haml","templates"]},{"name":"embark-mythx","description":"plugins_page.plugins.mythx.desc","link":"https://www.npmjs.com/package/embark-mythx","thumbnail":"mythx.png","tags":["mythx","smart-contracts"]}],"menu":{"docs":"/docs/","plugins":"/plugins/","chat":"/chat/","blog":"/news/"},"sidebar":{"docs":{"getting_started":{"overview":"overview.html","installation":"installation.html","faq":"faq.html"},"general_usage":{"creating_project":"create_project.html","structure":"structure.html","running_apps":"running_apps.html","dashboard":"dashboard.html","using_the_console":"using_the_console.html","environments":"environments.html","configuration":"configuration.html","pipeline_and_webpack":"pipeline_and_webpack.html","javascript_usage":"javascript_usage.html"},"smart_contracts":{"contracts_configuration":"contracts_configuration.html","contracts_deployment":"contracts_deployment.html","contracts_imports":"contracts_imports.html","contracts_testing":"contracts_testing.html","contracts_javascript":"contracts_javascript.html"},"blockchain_node":{"blockchain_configuration":"blockchain_configuration.html","blockchain_accounts_configuration":"blockchain_accounts_configuration.html"},"storage":{"storage_configuration":"storage_configuration.html","storage_deployment":"storage_deployment.html","storage_javascript":"storage_javascript.html"},"messages":{"messages_configuration":"messages_configuration.html","messages_javascript":"messages_javascript.html"},"naming":{"naming_configuration":"naming_configuration.html","naming_javascript":"naming_javascript.html"},"plugins":{"installing_a_plugin":"installing_plugins.html","creating_a_plugin":"creating_plugins.html","plugin_reference":"plugin_reference.html"},"cockpit":{"cockpit_introduction":"cockpit_introduction.html","cockpit_dashboard":"cockpit_dashboard.html","cockpit_deployment":"cockpit_deployment.html","cockpit_explorer":"cockpit_explorer.html","cockpit_editor":"cockpit_editor.html","cockpit_debugger":"cockpit_debugger.html"},"reference":{"embark_commands":"embark_commands.html"},"miscellaneous":{"migrating_from_3":"migrating_from_3.x.html","troubleshooting":"troubleshooting.html","contributing":"contributing.html"}}},"templates":[{"name":"Vyper Template","description":"Template to demonstrate the use of the Vyper contracts","install":"embark new AppName --template vyper","thumbnail":"vyper.png","link":"https://github.com/embarklabs/embark-vyper-template","tags":["vyper","contracts"]},{"name":"Embark Demo React Template","description":"A React Application showcasing Embark's functionality","install":"embark demo","thumbnail":"react.png","link":"https://embark.embarklabs.io/docs/create_project.html#Creating-a-Demo-Project","tags":["react","contracts","whisper","ipfs"]},{"name":"Typescript Template","description":"Template with Typescript support pre-configured","thumbnail":"typescript.png","install":"embark new AppName --template typescript","link":"https://github.com/embarklabs/embark-typescript-template","tags":["typescript","frontend"]},{"name":"Vue.js Template","description":"Ready to use Template for using Embark with vue.js","thumbnail":"vuejs.png","install":"embark new AppName --template vue","link":"https://github.com/embarklabs/embark-vue-template","tags":["vue.js","frontend"]},{"name":"ethvtx Template","description":"Demo app for ethvtx, an Ethereum-Ready & Framework-Agnostic Redux configuration","thumbnail":"vortex.png","install":"embark new AppName --template Horyus/ethvtx_embark","link":"https://github.com/Horyus/ethvtx_embark","tags":["react"]},{"name":"Bamboo Template","description":"Template to demonstrate use of the Bamboo contracts","install":"embark new AppName --template bamboo","thumbnail":"bamboo.png","link":"https://github.com/embarklabs/embark-bamboo-template","tags":["bamboo","contracts"]},{"name":"Solidity Gas Golfing","description":"Boilerplate and tests for the first Solidity Gas Golfing Contest","thumbnail":"sggc.png","install":"embark new AppName --template embarklabs/sggc","link":"https://github.com/embarklabs/sggc","tags":["solidity","tests","fun"]}],"tutorials":[{"name":"How to create a Token Factory with Ethereum — Part 1","description":"Create and Deploy a Token with Ethereum","link":"/tutorials/token_factory_1.html","tags":["token","ethereum"]},{"name":"How to create a Token Factory with Ethereum — Part 2","description":"Create a DApp that can deploy Tokens on the fly","link":"/tutorials/token_factory_2.html","tags":["token","ethereum","client-side-deployment"]},{"name":"How to deploy to a testnet with Infura","description":"Deploy and interact with your Dapp on a testnet with the use of Infura","link":"/tutorials/infura_guide.html","tags":["ethereum","deployment","testnet"]}],"versions":{"latest":{"label":"stable (v4)","url":"https://embark.embarklabs.io/docs"},"3.2":{"label":"v3.2","url":"https://5ca4e0fdb29712000adde37f--embark-site-versions.netlify.com/docs/"}}}},"excerpt":"","more":"

Save Text/Data

EmbarkJS.Storage.saveText(\"hello world\")\n  .then(function(hash) {})\n  .catch(function(err) {\n      if(err){\n        console.log(\"IPFS saveText Error => \" + err.message);\n      }\n  });\n
\n\n

Retrieve Text/Data

EmbarkJS.Storage.get(hash)\n  .then(function(content) {})\n  .catch(function(err) {\n      if(err){\n        console.log(\"IPFS get Error => \" + err.message);\n      }\n  });\n
\n\n

Upload a file

<input type="file">\n
\n
\n
var input = $(\"input[type=file\"]);\nEmbarkJS.Storage.uploadFile(input)\n  .then(function(hash) {})\n  .catch(function(err) {\n      if(err){\n        console.log(\"IPFS uploadFile Error => \" + err.message);\n      }\n  });\n
\n\n

Display a file

EmbarkJS.Storage.getUrl(hash);\n
\n\n

Check for storage provider availability

This will return true if the storage provider (IPFS or Swarm) is available and running.

\n
EmbarkJS.Storage.isAvailable()\n  .then(isAvailable => { alert(`The storage provider is: ${isAvailable ? 'available' : 'not available'}`) })\n  .catch(function(err) {\n      if(err){\n        console.log(\"Error getting storage provider availability => \" + err.message);\n      }\n  });\n
\n\n

Setup

By default Embark will automatically initialize EmbarkJS with the provider configured at config/storage.js. However if you are using EmbarkJS directly or wish to change the provider configuration on the fly you can do:

\n
EmbarkJS.Storage.setProvider('swarm', options);\n
\n\n

Options are optional and if provided, will override the values in storage.js.

\n

For example,

\n
EmbarkJS.Storage.setProvider('ipfs', {server: 'localhost', port: '5001'});\n// OR\nEmbarkJS.Storage.setProvider('swarm', {server: 'swarm-gateways.net', port: '80'});\n
\n\n

IPNS registration

You can register your IPFS hash using IPNS.

\n

*It can take up to a minute to register.

\n

IPNS - Register

EmbarkJS.Storage.register('IPFS_hash', (err, name) => {
if(err){
console.log(\"Error registering\", err.message);
return;
}
console.log('Registred to the following hash:', name);
});
\n\n

IPNS - Resolve

EmbarkJS.Storage.resolve('IPNS_hash', (err, path) => {
if(err){
console.log(\"Error resolving\", err.message);
return;
}
console.log('Resolved to the following IPFS path:', name);
});
\n\n"},{"title":"Using the Interactive Console","layout":"docs","_content":"\nAnother powerful feature of Embark is its interactive console. It helps you debugging your application and lets you talk to your already deployed Smart Contracts. In this guide we'll take a closer look at how to work with it.\n\n## Starting the console\n\nStarting Embark's interactive console is just a matter of running\n\n```\n$ embark console\n```\n\nVery similar to `embark run`, Embark will compile and deploy your application, however, it won't spin up a webserver for your application. After that, you'll see a prompt sitting IDLE, waiting for you to enter commands.\n\n```\nEmbark (development) > _\n```\n\nThe console will surface the environment we're running Embark in at the moment. If we don't specify an environment, Embark will default to `development`, as discussed in our [guide on environments](/docs/environments.html).\n\nFrom now on, we can keep entering commands and have them processed by Embark until we're done with whatever we're aiming to do.\n\nLet's take a look at a few them!\n\n## The `help` command\n\nProbably one of the most important commands is the console's `help` command. This will give us some useful information about what we can and what we can not do inside the interactive console.\n\nEnter the following command and see for yourself:\n\n```\nEmbark (development) > help\n```\n\nThis is a good time to read a bit through the available commands and familiarize yourself with them.\n\n## Enabling and disabling process logs\n\nBy default, Embark will log output from all processes into the console. Since this can get quite verbose sometimes, we can disable logging for certain processes using the `log` command.\n\nSimply specify the process and turn it `on` or `off`:\n\n```\nEmbark (development) > log ipfs off\n```\n\n## Accessing Smart Contract instances\n\nOne thing that the console’s help doesn't tell us, is that each and every of our deployed Smart Contracts is available as descriptive JavaScript object. Simply enter the name of your Smart Contract and Embark will output its structure, properties and methods:\n\n```\nEmbark (development) > SimpleStorage\n```\n\nThis turns out to be very useful when inspecting available methods and properties on already deployed Smart Contracts. Notice that not only your own Smart Contract's are available within the interactive console, but also 3rd-party Smart Contracts that [have been configured](/docs/contracts_configuration.html#Referencing-already-deployed-Smart-Contracts) accordingly.\n\n## Calling asynchronous APIs\n\nThe interactive console comes with its own JavaScript execution context, meaning we can actually run JavaScript code from inside the console.\n\nThis applies to synchronous as well as asynchronous APIs, which is very common when dealing with Smart Contract instances. There is different ways to use asynchronous APIs in JavaScript. Smart Contract instances tend to use `Promise`-based APIs, making them a great fit for JavaScript's `async/await` syntax.\n\n`await` is an ES2015 keyword that is very useful when dealing with asynchronous APIs. It let's us wait for a Promise to resolve and simply returns the result.\n\nIn both the dashboard's console and the standalone console, you can use `await` for `Promise`-based calls:\n\n```\nEmbark (development) > await SimpleStorage.methods.get().call()\n```\n\nThis works with other objects as well. The following example outputs available accounts emitted by the `web3` object:\n\n```\nEmbark (development) > await web3.eth.getAccounts()\n```\n\n## Installing plugins\n\nWe can also install Embark plugins using the interactive console. This can be done using the `plugin` command.\n\n```\nEmbark (development) > plugin install embark-status\n```\n\nThis will install and load the plugin, without the need to restart Embark.\n\n## Retrieving authentication tokens for Cockpit\n\nWhen using [Cockpit](/docs/cockpit_introduction.html), Embark's companion web interface, it's necessary to authenticate through the web browser with the Embark process we want Cockpit to connect to. Embark and Cockpit use an authentication token based system for that. All we have to do is entering a valid token in the authentication mask, or append it as a query parameter to Cockpit.\n\nTo get a valid token, use the `token` command, which will output the token and copy it to your clipboard:\n\n```\nEmbark (development) > token\n```\n\n## Registering custom commands\n\nIt's possible to extend Embark's interactive console to include custom commands. Head over to our [Plugin guide](/docs/plugin_reference.html#registerConsoleCommand-options) which discusses this in more detail!\n\n## Dashboard or interactive console?\n\nIn our section on [using the dashboard](/docs/dashboard.html) we've slightly mentioned that Embark's dashboard comes with a console as well and you might wonder, why there's a separate command to start an interactive console in standalone mode.\n\nThis is a very valid question, so here are a few scenarios where you might want to prefer running the interactive console over the dashboard:\n\n- You want to copy & paste output from Embark (this doesn't work well within the dashboard)\n- You already have an existing Embark instance running and want to connect to it using the interactive console\n\nAs the last point suggests, running `embark console` when Embark is already running on your machine, it'll connect to that existing process,\nletting you interact with an already deployed application.\n\n","source":"docs/using_the_console.md","raw":"title: Using the Interactive Console\nlayout: docs\n---\n\nAnother powerful feature of Embark is its interactive console. It helps you debugging your application and lets you talk to your already deployed Smart Contracts. In this guide we'll take a closer look at how to work with it.\n\n## Starting the console\n\nStarting Embark's interactive console is just a matter of running\n\n```\n$ embark console\n```\n\nVery similar to `embark run`, Embark will compile and deploy your application, however, it won't spin up a webserver for your application. After that, you'll see a prompt sitting IDLE, waiting for you to enter commands.\n\n```\nEmbark (development) > _\n```\n\nThe console will surface the environment we're running Embark in at the moment. If we don't specify an environment, Embark will default to `development`, as discussed in our [guide on environments](/docs/environments.html).\n\nFrom now on, we can keep entering commands and have them processed by Embark until we're done with whatever we're aiming to do.\n\nLet's take a look at a few them!\n\n## The `help` command\n\nProbably one of the most important commands is the console's `help` command. This will give us some useful information about what we can and what we can not do inside the interactive console.\n\nEnter the following command and see for yourself:\n\n```\nEmbark (development) > help\n```\n\nThis is a good time to read a bit through the available commands and familiarize yourself with them.\n\n## Enabling and disabling process logs\n\nBy default, Embark will log output from all processes into the console. Since this can get quite verbose sometimes, we can disable logging for certain processes using the `log` command.\n\nSimply specify the process and turn it `on` or `off`:\n\n```\nEmbark (development) > log ipfs off\n```\n\n## Accessing Smart Contract instances\n\nOne thing that the console’s help doesn't tell us, is that each and every of our deployed Smart Contracts is available as descriptive JavaScript object. Simply enter the name of your Smart Contract and Embark will output its structure, properties and methods:\n\n```\nEmbark (development) > SimpleStorage\n```\n\nThis turns out to be very useful when inspecting available methods and properties on already deployed Smart Contracts. Notice that not only your own Smart Contract's are available within the interactive console, but also 3rd-party Smart Contracts that [have been configured](/docs/contracts_configuration.html#Referencing-already-deployed-Smart-Contracts) accordingly.\n\n## Calling asynchronous APIs\n\nThe interactive console comes with its own JavaScript execution context, meaning we can actually run JavaScript code from inside the console.\n\nThis applies to synchronous as well as asynchronous APIs, which is very common when dealing with Smart Contract instances. There is different ways to use asynchronous APIs in JavaScript. Smart Contract instances tend to use `Promise`-based APIs, making them a great fit for JavaScript's `async/await` syntax.\n\n`await` is an ES2015 keyword that is very useful when dealing with asynchronous APIs. It let's us wait for a Promise to resolve and simply returns the result.\n\nIn both the dashboard's console and the standalone console, you can use `await` for `Promise`-based calls:\n\n```\nEmbark (development) > await SimpleStorage.methods.get().call()\n```\n\nThis works with other objects as well. The following example outputs available accounts emitted by the `web3` object:\n\n```\nEmbark (development) > await web3.eth.getAccounts()\n```\n\n## Installing plugins\n\nWe can also install Embark plugins using the interactive console. This can be done using the `plugin` command.\n\n```\nEmbark (development) > plugin install embark-status\n```\n\nThis will install and load the plugin, without the need to restart Embark.\n\n## Retrieving authentication tokens for Cockpit\n\nWhen using [Cockpit](/docs/cockpit_introduction.html), Embark's companion web interface, it's necessary to authenticate through the web browser with the Embark process we want Cockpit to connect to. Embark and Cockpit use an authentication token based system for that. All we have to do is entering a valid token in the authentication mask, or append it as a query parameter to Cockpit.\n\nTo get a valid token, use the `token` command, which will output the token and copy it to your clipboard:\n\n```\nEmbark (development) > token\n```\n\n## Registering custom commands\n\nIt's possible to extend Embark's interactive console to include custom commands. Head over to our [Plugin guide](/docs/plugin_reference.html#registerConsoleCommand-options) which discusses this in more detail!\n\n## Dashboard or interactive console?\n\nIn our section on [using the dashboard](/docs/dashboard.html) we've slightly mentioned that Embark's dashboard comes with a console as well and you might wonder, why there's a separate command to start an interactive console in standalone mode.\n\nThis is a very valid question, so here are a few scenarios where you might want to prefer running the interactive console over the dashboard:\n\n- You want to copy & paste output from Embark (this doesn't work well within the dashboard)\n- You already have an existing Embark instance running and want to connect to it using the interactive console\n\nAs the last point suggests, running `embark console` when Embark is already running on your machine, it'll connect to that existing process,\nletting you interact with an already deployed application.\n\n","date":"2020-01-17T19:00:03.900Z","updated":"2020-01-17T19:00:03.900Z","path":"docs/using_the_console.html","comments":1,"_id":"ck5ijm3s0001u7heg86nh4d80","content":"

Another powerful feature of Embark is its interactive console. It helps you debugging your application and lets you talk to your already deployed Smart Contracts. In this guide we’ll take a closer look at how to work with it.

\n

Starting the console

Starting Embark’s interactive console is just a matter of running

\n
$ embark console
\n\n

Very similar to embark run, Embark will compile and deploy your application, however, it won’t spin up a webserver for your application. After that, you’ll see a prompt sitting IDLE, waiting for you to enter commands.

\n
Embark (development) > _
\n\n

The console will surface the environment we’re running Embark in at the moment. If we don’t specify an environment, Embark will default to development, as discussed in our guide on environments.

\n

From now on, we can keep entering commands and have them processed by Embark until we’re done with whatever we’re aiming to do.

\n

Let’s take a look at a few them!

\n

The help command

Probably one of the most important commands is the console’s help command. This will give us some useful information about what we can and what we can not do inside the interactive console.

\n

Enter the following command and see for yourself:

\n
Embark (development) > help<ENTER>
\n\n

This is a good time to read a bit through the available commands and familiarize yourself with them.

\n

Enabling and disabling process logs

By default, Embark will log output from all processes into the console. Since this can get quite verbose sometimes, we can disable logging for certain processes using the log command.

\n

Simply specify the process and turn it on or off:

\n
Embark (development) > log ipfs off
\n\n

Accessing Smart Contract instances

One thing that the console’s help doesn’t tell us, is that each and every of our deployed Smart Contracts is available as descriptive JavaScript object. Simply enter the name of your Smart Contract and Embark will output its structure, properties and methods:

\n
Embark (development) > SimpleStorage<ENTER>
\n\n

This turns out to be very useful when inspecting available methods and properties on already deployed Smart Contracts. Notice that not only your own Smart Contract’s are available within the interactive console, but also 3rd-party Smart Contracts that have been configured accordingly.

\n

Calling asynchronous APIs

The interactive console comes with its own JavaScript execution context, meaning we can actually run JavaScript code from inside the console.

\n

This applies to synchronous as well as asynchronous APIs, which is very common when dealing with Smart Contract instances. There is different ways to use asynchronous APIs in JavaScript. Smart Contract instances tend to use Promise-based APIs, making them a great fit for JavaScript’s async/await syntax.

\n

await is an ES2015 keyword that is very useful when dealing with asynchronous APIs. It let’s us wait for a Promise to resolve and simply returns the result.

\n

In both the dashboard’s console and the standalone console, you can use await for Promise-based calls:

\n
Embark (development) > await SimpleStorage.methods.get().call()<ENTER>
\n\n

This works with other objects as well. The following example outputs available accounts emitted by the web3 object:

\n
Embark (development) > await web3.eth.getAccounts()<ENTER>
\n\n

Installing plugins

We can also install Embark plugins using the interactive console. This can be done using the plugin command.

\n
Embark (development) > plugin install embark-status
\n\n

This will install and load the plugin, without the need to restart Embark.

\n

Retrieving authentication tokens for Cockpit

When using Cockpit, Embark’s companion web interface, it’s necessary to authenticate through the web browser with the Embark process we want Cockpit to connect to. Embark and Cockpit use an authentication token based system for that. All we have to do is entering a valid token in the authentication mask, or append it as a query parameter to Cockpit.

\n

To get a valid token, use the token command, which will output the token and copy it to your clipboard:

\n
Embark (development) > token<ENTER>
\n\n

Registering custom commands

It’s possible to extend Embark’s interactive console to include custom commands. Head over to our Plugin guide which discusses this in more detail!

\n

Dashboard or interactive console?

In our section on using the dashboard we’ve slightly mentioned that Embark’s dashboard comes with a console as well and you might wonder, why there’s a separate command to start an interactive console in standalone mode.

\n

This is a very valid question, so here are a few scenarios where you might want to prefer running the interactive console over the dashboard:

\n
    \n
  • You want to copy & paste output from Embark (this doesn’t work well within the dashboard)
  • \n
  • You already have an existing Embark instance running and want to connect to it using the interactive console
  • \n
\n

As the last point suggests, running embark console when Embark is already running on your machine, it’ll connect to that existing process,
letting you interact with an already deployed application.

\n","site":{"data":{"authors":{"iuri_matias":{"name":"Iuri Matias","twitter":"iurimatias","image":"https://pbs.twimg.com/profile_images/928272512181563392/iDJdvy2k_400x400.jpg"},"pascal_precht":{"name":"Pascal Precht","twitter":"pascalprecht","image":"https://pbs.twimg.com/profile_images/993785060733194241/p3oAIMDP_400x400.jpg"},"anthony_laibe":{"name":"Anthony Laibe","twitter":"a_laibe","image":"https://pbs.twimg.com/profile_images/257742900/13168239_400x400.jpg"},"jonathan_rainville":{"name":"Jonathan Rainville","twitter":"ShyolGhul","image":"https://pbs.twimg.com/profile_images/993873866878570496/-aE4byjj_400x400.jpg"},"andre_medeiros":{"name":"Andre Medeiros","twitter":"superdealloc","image":"https://pbs.twimg.com/profile_images/965722487735701504/m58KNgWN_400x400.jpg"},"eric_mastro":{"name":"Eric Mastro","twitter":"ericmastro","image":"https://avatars1.githubusercontent.com/u/5089238?s=460&v=4"},"michael_bradley":{"name":"Michael Bradley","image":"https://avatars3.githubusercontent.com/u/194260?s=460&v=4"},"richard_ramos":{"name":"Richard Ramos","twitter":"richardramos_me","image":"https://pbs.twimg.com/profile_images/1063160577973866496/aM313uHG_400x400.jpg"},"jonny_zerah":{"name":"Jonny Zerah","twitter":"jonnyzerah","image":"https://pbs.twimg.com/profile_images/1043774340490248192/gI9aGy17_400x400.jpg"},"robin_percy":{"name":"Robin Percy","twitter":"rbin","image":"https://avatars1.githubusercontent.com/u/29288325?s=400&v=4"}},"categories":{"tutorials":"Tutorials","announcements":"Announcements"},"languages":{"en":"English"},"plugins":[{"name":"embark-bamboo","description":"plugins_page.plugins.bamboo.desc","link":"https://www.npmjs.com/package/embark-bamboo","thumbnail":"bamboo.png","tags":["language","smart-contracts"]},{"name":"embark-solc","description":"plugins_page.plugins.solc.desc","link":"https://www.npmjs.com/package/embark-solc","thumbnail":"solidity.png","tags":["solidity","language","smart-contracts"]},{"name":"embark-solium","description":"plugins_page.plugins.solium.desc","link":"https://www.npmjs.com/package/embark-solium","thumbnail":"solium.png","tags":["linter","solidity","solium"]},{"name":"embark-etherscan-verifier","description":"plugins_page.plugins.verifier.desc","link":"https://www.npmjs.com/package/embark-etherscan-verifier","tags":["solidity","etherscan","smart-contracts"]},{"name":"embark-status","description":"plugins_page.plugins.status.desc","link":"https://www.npmjs.com/package/embark-status-plugin","thumbnail":"status.png","tags":["status","mobile"]},{"name":"embark-remix","description":"plugins_page.plugins.remix.desc","link":"https://www.npmjs.com/package/embark-remix","thumbnail":"remix.png","tags":["remix","debugger"]},{"name":"embark-slither","description":"plugins_page.plugins.slither.desc","link":"https://www.npmjs.com/package/embark-slither","tags":["solidity"]},{"name":"embark-snark","description":"plugins_page.plugins.snark.desc","link":"https://www.npmjs.com/package/embark-snark","tags":["snark"]},{"name":"embark-fortune","description":"plugins_page.plugins.fortune.desc","link":"https://www.npmjs.com/package/embark-fortune","thumbnail":"fortune.jpg","tags":["fun"]},{"name":"embark-pug","description":"plugins_page.plugins.pug.desc","link":"https://www.npmjs.com/package/embark-pug","legacy":true,"thumbnail":"pug.png","tags":["pug","jade","templates"]},{"name":"embark-haml","description":"plugins_page.plugins.haml.desc","link":"https://www.npmjs.com/package/embark-haml","legacy":true,"thumbnail":"haml.png","tags":["haml","templates"]},{"name":"embark-mythx","description":"plugins_page.plugins.mythx.desc","link":"https://www.npmjs.com/package/embark-mythx","thumbnail":"mythx.png","tags":["mythx","smart-contracts"]}],"menu":{"docs":"/docs/","plugins":"/plugins/","chat":"/chat/","blog":"/news/"},"sidebar":{"docs":{"getting_started":{"overview":"overview.html","installation":"installation.html","faq":"faq.html"},"general_usage":{"creating_project":"create_project.html","structure":"structure.html","running_apps":"running_apps.html","dashboard":"dashboard.html","using_the_console":"using_the_console.html","environments":"environments.html","configuration":"configuration.html","pipeline_and_webpack":"pipeline_and_webpack.html","javascript_usage":"javascript_usage.html"},"smart_contracts":{"contracts_configuration":"contracts_configuration.html","contracts_deployment":"contracts_deployment.html","contracts_imports":"contracts_imports.html","contracts_testing":"contracts_testing.html","contracts_javascript":"contracts_javascript.html"},"blockchain_node":{"blockchain_configuration":"blockchain_configuration.html","blockchain_accounts_configuration":"blockchain_accounts_configuration.html"},"storage":{"storage_configuration":"storage_configuration.html","storage_deployment":"storage_deployment.html","storage_javascript":"storage_javascript.html"},"messages":{"messages_configuration":"messages_configuration.html","messages_javascript":"messages_javascript.html"},"naming":{"naming_configuration":"naming_configuration.html","naming_javascript":"naming_javascript.html"},"plugins":{"installing_a_plugin":"installing_plugins.html","creating_a_plugin":"creating_plugins.html","plugin_reference":"plugin_reference.html"},"cockpit":{"cockpit_introduction":"cockpit_introduction.html","cockpit_dashboard":"cockpit_dashboard.html","cockpit_deployment":"cockpit_deployment.html","cockpit_explorer":"cockpit_explorer.html","cockpit_editor":"cockpit_editor.html","cockpit_debugger":"cockpit_debugger.html"},"reference":{"embark_commands":"embark_commands.html"},"miscellaneous":{"migrating_from_3":"migrating_from_3.x.html","troubleshooting":"troubleshooting.html","contributing":"contributing.html"}}},"templates":[{"name":"Vyper Template","description":"Template to demonstrate the use of the Vyper contracts","install":"embark new AppName --template vyper","thumbnail":"vyper.png","link":"https://github.com/embarklabs/embark-vyper-template","tags":["vyper","contracts"]},{"name":"Embark Demo React Template","description":"A React Application showcasing Embark's functionality","install":"embark demo","thumbnail":"react.png","link":"https://embark.embarklabs.io/docs/create_project.html#Creating-a-Demo-Project","tags":["react","contracts","whisper","ipfs"]},{"name":"Typescript Template","description":"Template with Typescript support pre-configured","thumbnail":"typescript.png","install":"embark new AppName --template typescript","link":"https://github.com/embarklabs/embark-typescript-template","tags":["typescript","frontend"]},{"name":"Vue.js Template","description":"Ready to use Template for using Embark with vue.js","thumbnail":"vuejs.png","install":"embark new AppName --template vue","link":"https://github.com/embarklabs/embark-vue-template","tags":["vue.js","frontend"]},{"name":"ethvtx Template","description":"Demo app for ethvtx, an Ethereum-Ready & Framework-Agnostic Redux configuration","thumbnail":"vortex.png","install":"embark new AppName --template Horyus/ethvtx_embark","link":"https://github.com/Horyus/ethvtx_embark","tags":["react"]},{"name":"Bamboo Template","description":"Template to demonstrate use of the Bamboo contracts","install":"embark new AppName --template bamboo","thumbnail":"bamboo.png","link":"https://github.com/embarklabs/embark-bamboo-template","tags":["bamboo","contracts"]},{"name":"Solidity Gas Golfing","description":"Boilerplate and tests for the first Solidity Gas Golfing Contest","thumbnail":"sggc.png","install":"embark new AppName --template embarklabs/sggc","link":"https://github.com/embarklabs/sggc","tags":["solidity","tests","fun"]}],"tutorials":[{"name":"How to create a Token Factory with Ethereum — Part 1","description":"Create and Deploy a Token with Ethereum","link":"/tutorials/token_factory_1.html","tags":["token","ethereum"]},{"name":"How to create a Token Factory with Ethereum — Part 2","description":"Create a DApp that can deploy Tokens on the fly","link":"/tutorials/token_factory_2.html","tags":["token","ethereum","client-side-deployment"]},{"name":"How to deploy to a testnet with Infura","description":"Deploy and interact with your Dapp on a testnet with the use of Infura","link":"/tutorials/infura_guide.html","tags":["ethereum","deployment","testnet"]}],"versions":{"latest":{"label":"stable (v4)","url":"https://embark.embarklabs.io/docs"},"3.2":{"label":"v3.2","url":"https://5ca4e0fdb29712000adde37f--embark-site-versions.netlify.com/docs/"}}}},"excerpt":"","more":"

Another powerful feature of Embark is its interactive console. It helps you debugging your application and lets you talk to your already deployed Smart Contracts. In this guide we’ll take a closer look at how to work with it.

\n

Starting the console

Starting Embark’s interactive console is just a matter of running

\n
$ embark console
\n\n

Very similar to embark run, Embark will compile and deploy your application, however, it won’t spin up a webserver for your application. After that, you’ll see a prompt sitting IDLE, waiting for you to enter commands.

\n
Embark (development) > _
\n\n

The console will surface the environment we’re running Embark in at the moment. If we don’t specify an environment, Embark will default to development, as discussed in our guide on environments.

\n

From now on, we can keep entering commands and have them processed by Embark until we’re done with whatever we’re aiming to do.

\n

Let’s take a look at a few them!

\n

The help command

Probably one of the most important commands is the console’s help command. This will give us some useful information about what we can and what we can not do inside the interactive console.

\n

Enter the following command and see for yourself:

\n
Embark (development) > help<ENTER>
\n\n

This is a good time to read a bit through the available commands and familiarize yourself with them.

\n

Enabling and disabling process logs

By default, Embark will log output from all processes into the console. Since this can get quite verbose sometimes, we can disable logging for certain processes using the log command.

\n

Simply specify the process and turn it on or off:

\n
Embark (development) > log ipfs off
\n\n

Accessing Smart Contract instances

One thing that the console’s help doesn’t tell us, is that each and every of our deployed Smart Contracts is available as descriptive JavaScript object. Simply enter the name of your Smart Contract and Embark will output its structure, properties and methods:

\n
Embark (development) > SimpleStorage<ENTER>
\n\n

This turns out to be very useful when inspecting available methods and properties on already deployed Smart Contracts. Notice that not only your own Smart Contract’s are available within the interactive console, but also 3rd-party Smart Contracts that have been configured accordingly.

\n

Calling asynchronous APIs

The interactive console comes with its own JavaScript execution context, meaning we can actually run JavaScript code from inside the console.

\n

This applies to synchronous as well as asynchronous APIs, which is very common when dealing with Smart Contract instances. There is different ways to use asynchronous APIs in JavaScript. Smart Contract instances tend to use Promise-based APIs, making them a great fit for JavaScript’s async/await syntax.

\n

await is an ES2015 keyword that is very useful when dealing with asynchronous APIs. It let’s us wait for a Promise to resolve and simply returns the result.

\n

In both the dashboard’s console and the standalone console, you can use await for Promise-based calls:

\n
Embark (development) > await SimpleStorage.methods.get().call()<ENTER>
\n\n

This works with other objects as well. The following example outputs available accounts emitted by the web3 object:

\n
Embark (development) > await web3.eth.getAccounts()<ENTER>
\n\n

Installing plugins

We can also install Embark plugins using the interactive console. This can be done using the plugin command.

\n
Embark (development) > plugin install embark-status
\n\n

This will install and load the plugin, without the need to restart Embark.

\n

Retrieving authentication tokens for Cockpit

When using Cockpit, Embark’s companion web interface, it’s necessary to authenticate through the web browser with the Embark process we want Cockpit to connect to. Embark and Cockpit use an authentication token based system for that. All we have to do is entering a valid token in the authentication mask, or append it as a query parameter to Cockpit.

\n

To get a valid token, use the token command, which will output the token and copy it to your clipboard:

\n
Embark (development) > token<ENTER>
\n\n

Registering custom commands

It’s possible to extend Embark’s interactive console to include custom commands. Head over to our Plugin guide which discusses this in more detail!

\n

Dashboard or interactive console?

In our section on using the dashboard we’ve slightly mentioned that Embark’s dashboard comes with a console as well and you might wonder, why there’s a separate command to start an interactive console in standalone mode.

\n

This is a very valid question, so here are a few scenarios where you might want to prefer running the interactive console over the dashboard:

\n
    \n
  • You want to copy & paste output from Embark (this doesn’t work well within the dashboard)
  • \n
  • You already have an existing Embark instance running and want to connect to it using the interactive console
  • \n
\n

As the last point suggests, running embark console when Embark is already running on your machine, it’ll connect to that existing process,
letting you interact with an already deployed application.

\n"},{"title":"Vyper","_content":"\nAs of Embark 3.0, Vyper is supported out of the box. You only need to [install the compiler](https://vyper.readthedocs.io/en/latest/installing-vyper.html) yourself.\n\nEmbark's Vyper support means that any files with the extension `.vy` in the contracts directory will be deployed with the file name as the contract name, so, for instance, `contracts/Crowdfunding.vy` will be deployed as `Crowdfunding`.\n\nTo see Vyper in action, generate a new demo project by running:\n\n
$ embark demo
\n\nInside the demo's root directory, remove `contracts/simple_storage.sol` and replace it with this file instead:\n\n
# contracts/SimpleStorage.vy\nstoredData: public(uint256)\n\n@public\ndef __init__(initialValue: uint256):\n  self.storedData = initialValue\n\n@public\n@payable\ndef set(x: uint256):\n  self.storedData = x\n\n@public\ndef get() -> uint256:\n  return self.storedData\n
\n\nThis has exactly the same logic as its Solidity counterpart, so the tests will still pass:\n\n
$ embark test
\n\nThe full documentation for Vyper can be found [here](https://vyper.readthedocs.io/en/latest/vyper-by-example.html)\n","source":"docs/vyper.md","raw":"title: Vyper\n---\n\nAs of Embark 3.0, Vyper is supported out of the box. You only need to [install the compiler](https://vyper.readthedocs.io/en/latest/installing-vyper.html) yourself.\n\nEmbark's Vyper support means that any files with the extension `.vy` in the contracts directory will be deployed with the file name as the contract name, so, for instance, `contracts/Crowdfunding.vy` will be deployed as `Crowdfunding`.\n\nTo see Vyper in action, generate a new demo project by running:\n\n
$ embark demo
\n\nInside the demo's root directory, remove `contracts/simple_storage.sol` and replace it with this file instead:\n\n
# contracts/SimpleStorage.vy\nstoredData: public(uint256)\n\n@public\ndef __init__(initialValue: uint256):\n  self.storedData = initialValue\n\n@public\n@payable\ndef set(x: uint256):\n  self.storedData = x\n\n@public\ndef get() -> uint256:\n  return self.storedData\n
\n\nThis has exactly the same logic as its Solidity counterpart, so the tests will still pass:\n\n
$ embark test
\n\nThe full documentation for Vyper can be found [here](https://vyper.readthedocs.io/en/latest/vyper-by-example.html)\n","date":"2020-01-17T19:00:03.900Z","updated":"2020-01-17T19:00:03.900Z","path":"docs/vyper.html","comments":1,"layout":"page","_id":"ck5ijm3s1001v7heg068n1gik","content":"

As of Embark 3.0, Vyper is supported out of the box. You only need to install the compiler yourself.

\n

Embark’s Vyper support means that any files with the extension .vy in the contracts directory will be deployed with the file name as the contract name, so, for instance, contracts/Crowdfunding.vy will be deployed as Crowdfunding.

\n

To see Vyper in action, generate a new demo project by running:

\n
$ embark demo
\n\n

Inside the demo’s root directory, remove contracts/simple_storage.sol and replace it with this file instead:

\n
# contracts/SimpleStorage.vy\nstoredData: public(uint256)\n\n@public\ndef __init__(initialValue: uint256):\n  self.storedData = initialValue\n\n@public\n@payable\ndef set(x: uint256):\n  self.storedData = x\n\n@public\ndef get() -> uint256:\n  return self.storedData\n
\n\n

This has exactly the same logic as its Solidity counterpart, so the tests will still pass:

\n
$ embark test
\n\n

The full documentation for Vyper can be found here

\n","site":{"data":{"authors":{"iuri_matias":{"name":"Iuri Matias","twitter":"iurimatias","image":"https://pbs.twimg.com/profile_images/928272512181563392/iDJdvy2k_400x400.jpg"},"pascal_precht":{"name":"Pascal Precht","twitter":"pascalprecht","image":"https://pbs.twimg.com/profile_images/993785060733194241/p3oAIMDP_400x400.jpg"},"anthony_laibe":{"name":"Anthony Laibe","twitter":"a_laibe","image":"https://pbs.twimg.com/profile_images/257742900/13168239_400x400.jpg"},"jonathan_rainville":{"name":"Jonathan Rainville","twitter":"ShyolGhul","image":"https://pbs.twimg.com/profile_images/993873866878570496/-aE4byjj_400x400.jpg"},"andre_medeiros":{"name":"Andre Medeiros","twitter":"superdealloc","image":"https://pbs.twimg.com/profile_images/965722487735701504/m58KNgWN_400x400.jpg"},"eric_mastro":{"name":"Eric Mastro","twitter":"ericmastro","image":"https://avatars1.githubusercontent.com/u/5089238?s=460&v=4"},"michael_bradley":{"name":"Michael Bradley","image":"https://avatars3.githubusercontent.com/u/194260?s=460&v=4"},"richard_ramos":{"name":"Richard Ramos","twitter":"richardramos_me","image":"https://pbs.twimg.com/profile_images/1063160577973866496/aM313uHG_400x400.jpg"},"jonny_zerah":{"name":"Jonny Zerah","twitter":"jonnyzerah","image":"https://pbs.twimg.com/profile_images/1043774340490248192/gI9aGy17_400x400.jpg"},"robin_percy":{"name":"Robin Percy","twitter":"rbin","image":"https://avatars1.githubusercontent.com/u/29288325?s=400&v=4"}},"categories":{"tutorials":"Tutorials","announcements":"Announcements"},"languages":{"en":"English"},"plugins":[{"name":"embark-bamboo","description":"plugins_page.plugins.bamboo.desc","link":"https://www.npmjs.com/package/embark-bamboo","thumbnail":"bamboo.png","tags":["language","smart-contracts"]},{"name":"embark-solc","description":"plugins_page.plugins.solc.desc","link":"https://www.npmjs.com/package/embark-solc","thumbnail":"solidity.png","tags":["solidity","language","smart-contracts"]},{"name":"embark-solium","description":"plugins_page.plugins.solium.desc","link":"https://www.npmjs.com/package/embark-solium","thumbnail":"solium.png","tags":["linter","solidity","solium"]},{"name":"embark-etherscan-verifier","description":"plugins_page.plugins.verifier.desc","link":"https://www.npmjs.com/package/embark-etherscan-verifier","tags":["solidity","etherscan","smart-contracts"]},{"name":"embark-status","description":"plugins_page.plugins.status.desc","link":"https://www.npmjs.com/package/embark-status-plugin","thumbnail":"status.png","tags":["status","mobile"]},{"name":"embark-remix","description":"plugins_page.plugins.remix.desc","link":"https://www.npmjs.com/package/embark-remix","thumbnail":"remix.png","tags":["remix","debugger"]},{"name":"embark-slither","description":"plugins_page.plugins.slither.desc","link":"https://www.npmjs.com/package/embark-slither","tags":["solidity"]},{"name":"embark-snark","description":"plugins_page.plugins.snark.desc","link":"https://www.npmjs.com/package/embark-snark","tags":["snark"]},{"name":"embark-fortune","description":"plugins_page.plugins.fortune.desc","link":"https://www.npmjs.com/package/embark-fortune","thumbnail":"fortune.jpg","tags":["fun"]},{"name":"embark-pug","description":"plugins_page.plugins.pug.desc","link":"https://www.npmjs.com/package/embark-pug","legacy":true,"thumbnail":"pug.png","tags":["pug","jade","templates"]},{"name":"embark-haml","description":"plugins_page.plugins.haml.desc","link":"https://www.npmjs.com/package/embark-haml","legacy":true,"thumbnail":"haml.png","tags":["haml","templates"]},{"name":"embark-mythx","description":"plugins_page.plugins.mythx.desc","link":"https://www.npmjs.com/package/embark-mythx","thumbnail":"mythx.png","tags":["mythx","smart-contracts"]}],"menu":{"docs":"/docs/","plugins":"/plugins/","chat":"/chat/","blog":"/news/"},"sidebar":{"docs":{"getting_started":{"overview":"overview.html","installation":"installation.html","faq":"faq.html"},"general_usage":{"creating_project":"create_project.html","structure":"structure.html","running_apps":"running_apps.html","dashboard":"dashboard.html","using_the_console":"using_the_console.html","environments":"environments.html","configuration":"configuration.html","pipeline_and_webpack":"pipeline_and_webpack.html","javascript_usage":"javascript_usage.html"},"smart_contracts":{"contracts_configuration":"contracts_configuration.html","contracts_deployment":"contracts_deployment.html","contracts_imports":"contracts_imports.html","contracts_testing":"contracts_testing.html","contracts_javascript":"contracts_javascript.html"},"blockchain_node":{"blockchain_configuration":"blockchain_configuration.html","blockchain_accounts_configuration":"blockchain_accounts_configuration.html"},"storage":{"storage_configuration":"storage_configuration.html","storage_deployment":"storage_deployment.html","storage_javascript":"storage_javascript.html"},"messages":{"messages_configuration":"messages_configuration.html","messages_javascript":"messages_javascript.html"},"naming":{"naming_configuration":"naming_configuration.html","naming_javascript":"naming_javascript.html"},"plugins":{"installing_a_plugin":"installing_plugins.html","creating_a_plugin":"creating_plugins.html","plugin_reference":"plugin_reference.html"},"cockpit":{"cockpit_introduction":"cockpit_introduction.html","cockpit_dashboard":"cockpit_dashboard.html","cockpit_deployment":"cockpit_deployment.html","cockpit_explorer":"cockpit_explorer.html","cockpit_editor":"cockpit_editor.html","cockpit_debugger":"cockpit_debugger.html"},"reference":{"embark_commands":"embark_commands.html"},"miscellaneous":{"migrating_from_3":"migrating_from_3.x.html","troubleshooting":"troubleshooting.html","contributing":"contributing.html"}}},"templates":[{"name":"Vyper Template","description":"Template to demonstrate the use of the Vyper contracts","install":"embark new AppName --template vyper","thumbnail":"vyper.png","link":"https://github.com/embarklabs/embark-vyper-template","tags":["vyper","contracts"]},{"name":"Embark Demo React Template","description":"A React Application showcasing Embark's functionality","install":"embark demo","thumbnail":"react.png","link":"https://embark.embarklabs.io/docs/create_project.html#Creating-a-Demo-Project","tags":["react","contracts","whisper","ipfs"]},{"name":"Typescript Template","description":"Template with Typescript support pre-configured","thumbnail":"typescript.png","install":"embark new AppName --template typescript","link":"https://github.com/embarklabs/embark-typescript-template","tags":["typescript","frontend"]},{"name":"Vue.js Template","description":"Ready to use Template for using Embark with vue.js","thumbnail":"vuejs.png","install":"embark new AppName --template vue","link":"https://github.com/embarklabs/embark-vue-template","tags":["vue.js","frontend"]},{"name":"ethvtx Template","description":"Demo app for ethvtx, an Ethereum-Ready & Framework-Agnostic Redux configuration","thumbnail":"vortex.png","install":"embark new AppName --template Horyus/ethvtx_embark","link":"https://github.com/Horyus/ethvtx_embark","tags":["react"]},{"name":"Bamboo Template","description":"Template to demonstrate use of the Bamboo contracts","install":"embark new AppName --template bamboo","thumbnail":"bamboo.png","link":"https://github.com/embarklabs/embark-bamboo-template","tags":["bamboo","contracts"]},{"name":"Solidity Gas Golfing","description":"Boilerplate and tests for the first Solidity Gas Golfing Contest","thumbnail":"sggc.png","install":"embark new AppName --template embarklabs/sggc","link":"https://github.com/embarklabs/sggc","tags":["solidity","tests","fun"]}],"tutorials":[{"name":"How to create a Token Factory with Ethereum — Part 1","description":"Create and Deploy a Token with Ethereum","link":"/tutorials/token_factory_1.html","tags":["token","ethereum"]},{"name":"How to create a Token Factory with Ethereum — Part 2","description":"Create a DApp that can deploy Tokens on the fly","link":"/tutorials/token_factory_2.html","tags":["token","ethereum","client-side-deployment"]},{"name":"How to deploy to a testnet with Infura","description":"Deploy and interact with your Dapp on a testnet with the use of Infura","link":"/tutorials/infura_guide.html","tags":["ethereum","deployment","testnet"]}],"versions":{"latest":{"label":"stable (v4)","url":"https://embark.embarklabs.io/docs"},"3.2":{"label":"v3.2","url":"https://5ca4e0fdb29712000adde37f--embark-site-versions.netlify.com/docs/"}}}},"excerpt":"","more":"

As of Embark 3.0, Vyper is supported out of the box. You only need to install the compiler yourself.

\n

Embark’s Vyper support means that any files with the extension .vy in the contracts directory will be deployed with the file name as the contract name, so, for instance, contracts/Crowdfunding.vy will be deployed as Crowdfunding.

\n

To see Vyper in action, generate a new demo project by running:

\n
$ embark demo
\n\n

Inside the demo’s root directory, remove contracts/simple_storage.sol and replace it with this file instead:

\n
# contracts/SimpleStorage.vy\nstoredData: public(uint256)\n\n@public\ndef __init__(initialValue: uint256):\n  self.storedData = initialValue\n\n@public\n@payable\ndef set(x: uint256):\n  self.storedData = x\n\n@public\ndef get() -> uint256:\n  return self.storedData\n
\n\n

This has exactly the same logic as its Solidity counterpart, so the tests will still pass:

\n
$ embark test
\n\n

The full documentation for Vyper can be found here

\n"},{"title":"Web3.js Documentation","_content":"\nThe documentation for Web3.js can be found [here](https://web3js.readthedocs.io/en/v1.2.1/)\n","source":"docs/web3js.md","raw":"title: Web3.js Documentation\n---\n\nThe documentation for Web3.js can be found [here](https://web3js.readthedocs.io/en/v1.2.1/)\n","date":"2020-01-17T19:00:03.900Z","updated":"2020-01-17T19:00:03.900Z","path":"docs/web3js.html","comments":1,"layout":"page","_id":"ck5ijm3s1001w7heg18r26xcv","content":"

The documentation for Web3.js can be found here

\n","site":{"data":{"authors":{"iuri_matias":{"name":"Iuri Matias","twitter":"iurimatias","image":"https://pbs.twimg.com/profile_images/928272512181563392/iDJdvy2k_400x400.jpg"},"pascal_precht":{"name":"Pascal Precht","twitter":"pascalprecht","image":"https://pbs.twimg.com/profile_images/993785060733194241/p3oAIMDP_400x400.jpg"},"anthony_laibe":{"name":"Anthony Laibe","twitter":"a_laibe","image":"https://pbs.twimg.com/profile_images/257742900/13168239_400x400.jpg"},"jonathan_rainville":{"name":"Jonathan Rainville","twitter":"ShyolGhul","image":"https://pbs.twimg.com/profile_images/993873866878570496/-aE4byjj_400x400.jpg"},"andre_medeiros":{"name":"Andre Medeiros","twitter":"superdealloc","image":"https://pbs.twimg.com/profile_images/965722487735701504/m58KNgWN_400x400.jpg"},"eric_mastro":{"name":"Eric Mastro","twitter":"ericmastro","image":"https://avatars1.githubusercontent.com/u/5089238?s=460&v=4"},"michael_bradley":{"name":"Michael Bradley","image":"https://avatars3.githubusercontent.com/u/194260?s=460&v=4"},"richard_ramos":{"name":"Richard Ramos","twitter":"richardramos_me","image":"https://pbs.twimg.com/profile_images/1063160577973866496/aM313uHG_400x400.jpg"},"jonny_zerah":{"name":"Jonny Zerah","twitter":"jonnyzerah","image":"https://pbs.twimg.com/profile_images/1043774340490248192/gI9aGy17_400x400.jpg"},"robin_percy":{"name":"Robin Percy","twitter":"rbin","image":"https://avatars1.githubusercontent.com/u/29288325?s=400&v=4"}},"categories":{"tutorials":"Tutorials","announcements":"Announcements"},"languages":{"en":"English"},"plugins":[{"name":"embark-bamboo","description":"plugins_page.plugins.bamboo.desc","link":"https://www.npmjs.com/package/embark-bamboo","thumbnail":"bamboo.png","tags":["language","smart-contracts"]},{"name":"embark-solc","description":"plugins_page.plugins.solc.desc","link":"https://www.npmjs.com/package/embark-solc","thumbnail":"solidity.png","tags":["solidity","language","smart-contracts"]},{"name":"embark-solium","description":"plugins_page.plugins.solium.desc","link":"https://www.npmjs.com/package/embark-solium","thumbnail":"solium.png","tags":["linter","solidity","solium"]},{"name":"embark-etherscan-verifier","description":"plugins_page.plugins.verifier.desc","link":"https://www.npmjs.com/package/embark-etherscan-verifier","tags":["solidity","etherscan","smart-contracts"]},{"name":"embark-status","description":"plugins_page.plugins.status.desc","link":"https://www.npmjs.com/package/embark-status-plugin","thumbnail":"status.png","tags":["status","mobile"]},{"name":"embark-remix","description":"plugins_page.plugins.remix.desc","link":"https://www.npmjs.com/package/embark-remix","thumbnail":"remix.png","tags":["remix","debugger"]},{"name":"embark-slither","description":"plugins_page.plugins.slither.desc","link":"https://www.npmjs.com/package/embark-slither","tags":["solidity"]},{"name":"embark-snark","description":"plugins_page.plugins.snark.desc","link":"https://www.npmjs.com/package/embark-snark","tags":["snark"]},{"name":"embark-fortune","description":"plugins_page.plugins.fortune.desc","link":"https://www.npmjs.com/package/embark-fortune","thumbnail":"fortune.jpg","tags":["fun"]},{"name":"embark-pug","description":"plugins_page.plugins.pug.desc","link":"https://www.npmjs.com/package/embark-pug","legacy":true,"thumbnail":"pug.png","tags":["pug","jade","templates"]},{"name":"embark-haml","description":"plugins_page.plugins.haml.desc","link":"https://www.npmjs.com/package/embark-haml","legacy":true,"thumbnail":"haml.png","tags":["haml","templates"]},{"name":"embark-mythx","description":"plugins_page.plugins.mythx.desc","link":"https://www.npmjs.com/package/embark-mythx","thumbnail":"mythx.png","tags":["mythx","smart-contracts"]}],"menu":{"docs":"/docs/","plugins":"/plugins/","chat":"/chat/","blog":"/news/"},"sidebar":{"docs":{"getting_started":{"overview":"overview.html","installation":"installation.html","faq":"faq.html"},"general_usage":{"creating_project":"create_project.html","structure":"structure.html","running_apps":"running_apps.html","dashboard":"dashboard.html","using_the_console":"using_the_console.html","environments":"environments.html","configuration":"configuration.html","pipeline_and_webpack":"pipeline_and_webpack.html","javascript_usage":"javascript_usage.html"},"smart_contracts":{"contracts_configuration":"contracts_configuration.html","contracts_deployment":"contracts_deployment.html","contracts_imports":"contracts_imports.html","contracts_testing":"contracts_testing.html","contracts_javascript":"contracts_javascript.html"},"blockchain_node":{"blockchain_configuration":"blockchain_configuration.html","blockchain_accounts_configuration":"blockchain_accounts_configuration.html"},"storage":{"storage_configuration":"storage_configuration.html","storage_deployment":"storage_deployment.html","storage_javascript":"storage_javascript.html"},"messages":{"messages_configuration":"messages_configuration.html","messages_javascript":"messages_javascript.html"},"naming":{"naming_configuration":"naming_configuration.html","naming_javascript":"naming_javascript.html"},"plugins":{"installing_a_plugin":"installing_plugins.html","creating_a_plugin":"creating_plugins.html","plugin_reference":"plugin_reference.html"},"cockpit":{"cockpit_introduction":"cockpit_introduction.html","cockpit_dashboard":"cockpit_dashboard.html","cockpit_deployment":"cockpit_deployment.html","cockpit_explorer":"cockpit_explorer.html","cockpit_editor":"cockpit_editor.html","cockpit_debugger":"cockpit_debugger.html"},"reference":{"embark_commands":"embark_commands.html"},"miscellaneous":{"migrating_from_3":"migrating_from_3.x.html","troubleshooting":"troubleshooting.html","contributing":"contributing.html"}}},"templates":[{"name":"Vyper Template","description":"Template to demonstrate the use of the Vyper contracts","install":"embark new AppName --template vyper","thumbnail":"vyper.png","link":"https://github.com/embarklabs/embark-vyper-template","tags":["vyper","contracts"]},{"name":"Embark Demo React Template","description":"A React Application showcasing Embark's functionality","install":"embark demo","thumbnail":"react.png","link":"https://embark.embarklabs.io/docs/create_project.html#Creating-a-Demo-Project","tags":["react","contracts","whisper","ipfs"]},{"name":"Typescript Template","description":"Template with Typescript support pre-configured","thumbnail":"typescript.png","install":"embark new AppName --template typescript","link":"https://github.com/embarklabs/embark-typescript-template","tags":["typescript","frontend"]},{"name":"Vue.js Template","description":"Ready to use Template for using Embark with vue.js","thumbnail":"vuejs.png","install":"embark new AppName --template vue","link":"https://github.com/embarklabs/embark-vue-template","tags":["vue.js","frontend"]},{"name":"ethvtx Template","description":"Demo app for ethvtx, an Ethereum-Ready & Framework-Agnostic Redux configuration","thumbnail":"vortex.png","install":"embark new AppName --template Horyus/ethvtx_embark","link":"https://github.com/Horyus/ethvtx_embark","tags":["react"]},{"name":"Bamboo Template","description":"Template to demonstrate use of the Bamboo contracts","install":"embark new AppName --template bamboo","thumbnail":"bamboo.png","link":"https://github.com/embarklabs/embark-bamboo-template","tags":["bamboo","contracts"]},{"name":"Solidity Gas Golfing","description":"Boilerplate and tests for the first Solidity Gas Golfing Contest","thumbnail":"sggc.png","install":"embark new AppName --template embarklabs/sggc","link":"https://github.com/embarklabs/sggc","tags":["solidity","tests","fun"]}],"tutorials":[{"name":"How to create a Token Factory with Ethereum — Part 1","description":"Create and Deploy a Token with Ethereum","link":"/tutorials/token_factory_1.html","tags":["token","ethereum"]},{"name":"How to create a Token Factory with Ethereum — Part 2","description":"Create a DApp that can deploy Tokens on the fly","link":"/tutorials/token_factory_2.html","tags":["token","ethereum","client-side-deployment"]},{"name":"How to deploy to a testnet with Infura","description":"Deploy and interact with your Dapp on a testnet with the use of Infura","link":"/tutorials/infura_guide.html","tags":["ethereum","deployment","testnet"]}],"versions":{"latest":{"label":"stable (v4)","url":"https://embark.embarklabs.io/docs"},"3.2":{"label":"v3.2","url":"https://5ca4e0fdb29712000adde37f--embark-site-versions.netlify.com/docs/"}}}},"excerpt":"","more":"

The documentation for Web3.js can be found here

\n"},{"title":"Integrating with Webpack","_content":"\nTODO\n\n","source":"docs/webpack.md","raw":"title: Integrating with Webpack\n---\n\nTODO\n\n","date":"2020-01-17T19:00:03.900Z","updated":"2020-01-17T19:00:03.900Z","path":"docs/webpack.html","comments":1,"layout":"page","_id":"ck5ijm3s2001x7heg2sqyh4ii","content":"

TODO

\n","site":{"data":{"authors":{"iuri_matias":{"name":"Iuri Matias","twitter":"iurimatias","image":"https://pbs.twimg.com/profile_images/928272512181563392/iDJdvy2k_400x400.jpg"},"pascal_precht":{"name":"Pascal Precht","twitter":"pascalprecht","image":"https://pbs.twimg.com/profile_images/993785060733194241/p3oAIMDP_400x400.jpg"},"anthony_laibe":{"name":"Anthony Laibe","twitter":"a_laibe","image":"https://pbs.twimg.com/profile_images/257742900/13168239_400x400.jpg"},"jonathan_rainville":{"name":"Jonathan Rainville","twitter":"ShyolGhul","image":"https://pbs.twimg.com/profile_images/993873866878570496/-aE4byjj_400x400.jpg"},"andre_medeiros":{"name":"Andre Medeiros","twitter":"superdealloc","image":"https://pbs.twimg.com/profile_images/965722487735701504/m58KNgWN_400x400.jpg"},"eric_mastro":{"name":"Eric Mastro","twitter":"ericmastro","image":"https://avatars1.githubusercontent.com/u/5089238?s=460&v=4"},"michael_bradley":{"name":"Michael Bradley","image":"https://avatars3.githubusercontent.com/u/194260?s=460&v=4"},"richard_ramos":{"name":"Richard Ramos","twitter":"richardramos_me","image":"https://pbs.twimg.com/profile_images/1063160577973866496/aM313uHG_400x400.jpg"},"jonny_zerah":{"name":"Jonny Zerah","twitter":"jonnyzerah","image":"https://pbs.twimg.com/profile_images/1043774340490248192/gI9aGy17_400x400.jpg"},"robin_percy":{"name":"Robin Percy","twitter":"rbin","image":"https://avatars1.githubusercontent.com/u/29288325?s=400&v=4"}},"categories":{"tutorials":"Tutorials","announcements":"Announcements"},"languages":{"en":"English"},"plugins":[{"name":"embark-bamboo","description":"plugins_page.plugins.bamboo.desc","link":"https://www.npmjs.com/package/embark-bamboo","thumbnail":"bamboo.png","tags":["language","smart-contracts"]},{"name":"embark-solc","description":"plugins_page.plugins.solc.desc","link":"https://www.npmjs.com/package/embark-solc","thumbnail":"solidity.png","tags":["solidity","language","smart-contracts"]},{"name":"embark-solium","description":"plugins_page.plugins.solium.desc","link":"https://www.npmjs.com/package/embark-solium","thumbnail":"solium.png","tags":["linter","solidity","solium"]},{"name":"embark-etherscan-verifier","description":"plugins_page.plugins.verifier.desc","link":"https://www.npmjs.com/package/embark-etherscan-verifier","tags":["solidity","etherscan","smart-contracts"]},{"name":"embark-status","description":"plugins_page.plugins.status.desc","link":"https://www.npmjs.com/package/embark-status-plugin","thumbnail":"status.png","tags":["status","mobile"]},{"name":"embark-remix","description":"plugins_page.plugins.remix.desc","link":"https://www.npmjs.com/package/embark-remix","thumbnail":"remix.png","tags":["remix","debugger"]},{"name":"embark-slither","description":"plugins_page.plugins.slither.desc","link":"https://www.npmjs.com/package/embark-slither","tags":["solidity"]},{"name":"embark-snark","description":"plugins_page.plugins.snark.desc","link":"https://www.npmjs.com/package/embark-snark","tags":["snark"]},{"name":"embark-fortune","description":"plugins_page.plugins.fortune.desc","link":"https://www.npmjs.com/package/embark-fortune","thumbnail":"fortune.jpg","tags":["fun"]},{"name":"embark-pug","description":"plugins_page.plugins.pug.desc","link":"https://www.npmjs.com/package/embark-pug","legacy":true,"thumbnail":"pug.png","tags":["pug","jade","templates"]},{"name":"embark-haml","description":"plugins_page.plugins.haml.desc","link":"https://www.npmjs.com/package/embark-haml","legacy":true,"thumbnail":"haml.png","tags":["haml","templates"]},{"name":"embark-mythx","description":"plugins_page.plugins.mythx.desc","link":"https://www.npmjs.com/package/embark-mythx","thumbnail":"mythx.png","tags":["mythx","smart-contracts"]}],"menu":{"docs":"/docs/","plugins":"/plugins/","chat":"/chat/","blog":"/news/"},"sidebar":{"docs":{"getting_started":{"overview":"overview.html","installation":"installation.html","faq":"faq.html"},"general_usage":{"creating_project":"create_project.html","structure":"structure.html","running_apps":"running_apps.html","dashboard":"dashboard.html","using_the_console":"using_the_console.html","environments":"environments.html","configuration":"configuration.html","pipeline_and_webpack":"pipeline_and_webpack.html","javascript_usage":"javascript_usage.html"},"smart_contracts":{"contracts_configuration":"contracts_configuration.html","contracts_deployment":"contracts_deployment.html","contracts_imports":"contracts_imports.html","contracts_testing":"contracts_testing.html","contracts_javascript":"contracts_javascript.html"},"blockchain_node":{"blockchain_configuration":"blockchain_configuration.html","blockchain_accounts_configuration":"blockchain_accounts_configuration.html"},"storage":{"storage_configuration":"storage_configuration.html","storage_deployment":"storage_deployment.html","storage_javascript":"storage_javascript.html"},"messages":{"messages_configuration":"messages_configuration.html","messages_javascript":"messages_javascript.html"},"naming":{"naming_configuration":"naming_configuration.html","naming_javascript":"naming_javascript.html"},"plugins":{"installing_a_plugin":"installing_plugins.html","creating_a_plugin":"creating_plugins.html","plugin_reference":"plugin_reference.html"},"cockpit":{"cockpit_introduction":"cockpit_introduction.html","cockpit_dashboard":"cockpit_dashboard.html","cockpit_deployment":"cockpit_deployment.html","cockpit_explorer":"cockpit_explorer.html","cockpit_editor":"cockpit_editor.html","cockpit_debugger":"cockpit_debugger.html"},"reference":{"embark_commands":"embark_commands.html"},"miscellaneous":{"migrating_from_3":"migrating_from_3.x.html","troubleshooting":"troubleshooting.html","contributing":"contributing.html"}}},"templates":[{"name":"Vyper Template","description":"Template to demonstrate the use of the Vyper contracts","install":"embark new AppName --template vyper","thumbnail":"vyper.png","link":"https://github.com/embarklabs/embark-vyper-template","tags":["vyper","contracts"]},{"name":"Embark Demo React Template","description":"A React Application showcasing Embark's functionality","install":"embark demo","thumbnail":"react.png","link":"https://embark.embarklabs.io/docs/create_project.html#Creating-a-Demo-Project","tags":["react","contracts","whisper","ipfs"]},{"name":"Typescript Template","description":"Template with Typescript support pre-configured","thumbnail":"typescript.png","install":"embark new AppName --template typescript","link":"https://github.com/embarklabs/embark-typescript-template","tags":["typescript","frontend"]},{"name":"Vue.js Template","description":"Ready to use Template for using Embark with vue.js","thumbnail":"vuejs.png","install":"embark new AppName --template vue","link":"https://github.com/embarklabs/embark-vue-template","tags":["vue.js","frontend"]},{"name":"ethvtx Template","description":"Demo app for ethvtx, an Ethereum-Ready & Framework-Agnostic Redux configuration","thumbnail":"vortex.png","install":"embark new AppName --template Horyus/ethvtx_embark","link":"https://github.com/Horyus/ethvtx_embark","tags":["react"]},{"name":"Bamboo Template","description":"Template to demonstrate use of the Bamboo contracts","install":"embark new AppName --template bamboo","thumbnail":"bamboo.png","link":"https://github.com/embarklabs/embark-bamboo-template","tags":["bamboo","contracts"]},{"name":"Solidity Gas Golfing","description":"Boilerplate and tests for the first Solidity Gas Golfing Contest","thumbnail":"sggc.png","install":"embark new AppName --template embarklabs/sggc","link":"https://github.com/embarklabs/sggc","tags":["solidity","tests","fun"]}],"tutorials":[{"name":"How to create a Token Factory with Ethereum — Part 1","description":"Create and Deploy a Token with Ethereum","link":"/tutorials/token_factory_1.html","tags":["token","ethereum"]},{"name":"How to create a Token Factory with Ethereum — Part 2","description":"Create a DApp that can deploy Tokens on the fly","link":"/tutorials/token_factory_2.html","tags":["token","ethereum","client-side-deployment"]},{"name":"How to deploy to a testnet with Infura","description":"Deploy and interact with your Dapp on a testnet with the use of Infura","link":"/tutorials/infura_guide.html","tags":["ethereum","deployment","testnet"]}],"versions":{"latest":{"label":"stable (v4)","url":"https://embark.embarklabs.io/docs"},"3.2":{"label":"v3.2","url":"https://5ca4e0fdb29712000adde37f--embark-site-versions.netlify.com/docs/"}}}},"excerpt":"","more":"

TODO

\n"},{"title":"What is a DApp","_content":"\n## What is a DApp\n\nA Decentralized Application is a serverless html5 application that uses one or more decentralized technologies.\n\n","source":"docs/what_dapp.md","raw":"title: What is a DApp\n---\n\n## What is a DApp\n\nA Decentralized Application is a serverless html5 application that uses one or more decentralized technologies.\n\n","date":"2020-01-17T19:00:03.900Z","updated":"2020-01-17T19:00:03.900Z","path":"docs/what_dapp.html","comments":1,"layout":"page","_id":"ck5ijm3s2001y7hegb6i804bx","content":"

What is a DApp

A Decentralized Application is a serverless html5 application that uses one or more decentralized technologies.

\n","site":{"data":{"authors":{"iuri_matias":{"name":"Iuri Matias","twitter":"iurimatias","image":"https://pbs.twimg.com/profile_images/928272512181563392/iDJdvy2k_400x400.jpg"},"pascal_precht":{"name":"Pascal Precht","twitter":"pascalprecht","image":"https://pbs.twimg.com/profile_images/993785060733194241/p3oAIMDP_400x400.jpg"},"anthony_laibe":{"name":"Anthony Laibe","twitter":"a_laibe","image":"https://pbs.twimg.com/profile_images/257742900/13168239_400x400.jpg"},"jonathan_rainville":{"name":"Jonathan Rainville","twitter":"ShyolGhul","image":"https://pbs.twimg.com/profile_images/993873866878570496/-aE4byjj_400x400.jpg"},"andre_medeiros":{"name":"Andre Medeiros","twitter":"superdealloc","image":"https://pbs.twimg.com/profile_images/965722487735701504/m58KNgWN_400x400.jpg"},"eric_mastro":{"name":"Eric Mastro","twitter":"ericmastro","image":"https://avatars1.githubusercontent.com/u/5089238?s=460&v=4"},"michael_bradley":{"name":"Michael Bradley","image":"https://avatars3.githubusercontent.com/u/194260?s=460&v=4"},"richard_ramos":{"name":"Richard Ramos","twitter":"richardramos_me","image":"https://pbs.twimg.com/profile_images/1063160577973866496/aM313uHG_400x400.jpg"},"jonny_zerah":{"name":"Jonny Zerah","twitter":"jonnyzerah","image":"https://pbs.twimg.com/profile_images/1043774340490248192/gI9aGy17_400x400.jpg"},"robin_percy":{"name":"Robin Percy","twitter":"rbin","image":"https://avatars1.githubusercontent.com/u/29288325?s=400&v=4"}},"categories":{"tutorials":"Tutorials","announcements":"Announcements"},"languages":{"en":"English"},"plugins":[{"name":"embark-bamboo","description":"plugins_page.plugins.bamboo.desc","link":"https://www.npmjs.com/package/embark-bamboo","thumbnail":"bamboo.png","tags":["language","smart-contracts"]},{"name":"embark-solc","description":"plugins_page.plugins.solc.desc","link":"https://www.npmjs.com/package/embark-solc","thumbnail":"solidity.png","tags":["solidity","language","smart-contracts"]},{"name":"embark-solium","description":"plugins_page.plugins.solium.desc","link":"https://www.npmjs.com/package/embark-solium","thumbnail":"solium.png","tags":["linter","solidity","solium"]},{"name":"embark-etherscan-verifier","description":"plugins_page.plugins.verifier.desc","link":"https://www.npmjs.com/package/embark-etherscan-verifier","tags":["solidity","etherscan","smart-contracts"]},{"name":"embark-status","description":"plugins_page.plugins.status.desc","link":"https://www.npmjs.com/package/embark-status-plugin","thumbnail":"status.png","tags":["status","mobile"]},{"name":"embark-remix","description":"plugins_page.plugins.remix.desc","link":"https://www.npmjs.com/package/embark-remix","thumbnail":"remix.png","tags":["remix","debugger"]},{"name":"embark-slither","description":"plugins_page.plugins.slither.desc","link":"https://www.npmjs.com/package/embark-slither","tags":["solidity"]},{"name":"embark-snark","description":"plugins_page.plugins.snark.desc","link":"https://www.npmjs.com/package/embark-snark","tags":["snark"]},{"name":"embark-fortune","description":"plugins_page.plugins.fortune.desc","link":"https://www.npmjs.com/package/embark-fortune","thumbnail":"fortune.jpg","tags":["fun"]},{"name":"embark-pug","description":"plugins_page.plugins.pug.desc","link":"https://www.npmjs.com/package/embark-pug","legacy":true,"thumbnail":"pug.png","tags":["pug","jade","templates"]},{"name":"embark-haml","description":"plugins_page.plugins.haml.desc","link":"https://www.npmjs.com/package/embark-haml","legacy":true,"thumbnail":"haml.png","tags":["haml","templates"]},{"name":"embark-mythx","description":"plugins_page.plugins.mythx.desc","link":"https://www.npmjs.com/package/embark-mythx","thumbnail":"mythx.png","tags":["mythx","smart-contracts"]}],"menu":{"docs":"/docs/","plugins":"/plugins/","chat":"/chat/","blog":"/news/"},"sidebar":{"docs":{"getting_started":{"overview":"overview.html","installation":"installation.html","faq":"faq.html"},"general_usage":{"creating_project":"create_project.html","structure":"structure.html","running_apps":"running_apps.html","dashboard":"dashboard.html","using_the_console":"using_the_console.html","environments":"environments.html","configuration":"configuration.html","pipeline_and_webpack":"pipeline_and_webpack.html","javascript_usage":"javascript_usage.html"},"smart_contracts":{"contracts_configuration":"contracts_configuration.html","contracts_deployment":"contracts_deployment.html","contracts_imports":"contracts_imports.html","contracts_testing":"contracts_testing.html","contracts_javascript":"contracts_javascript.html"},"blockchain_node":{"blockchain_configuration":"blockchain_configuration.html","blockchain_accounts_configuration":"blockchain_accounts_configuration.html"},"storage":{"storage_configuration":"storage_configuration.html","storage_deployment":"storage_deployment.html","storage_javascript":"storage_javascript.html"},"messages":{"messages_configuration":"messages_configuration.html","messages_javascript":"messages_javascript.html"},"naming":{"naming_configuration":"naming_configuration.html","naming_javascript":"naming_javascript.html"},"plugins":{"installing_a_plugin":"installing_plugins.html","creating_a_plugin":"creating_plugins.html","plugin_reference":"plugin_reference.html"},"cockpit":{"cockpit_introduction":"cockpit_introduction.html","cockpit_dashboard":"cockpit_dashboard.html","cockpit_deployment":"cockpit_deployment.html","cockpit_explorer":"cockpit_explorer.html","cockpit_editor":"cockpit_editor.html","cockpit_debugger":"cockpit_debugger.html"},"reference":{"embark_commands":"embark_commands.html"},"miscellaneous":{"migrating_from_3":"migrating_from_3.x.html","troubleshooting":"troubleshooting.html","contributing":"contributing.html"}}},"templates":[{"name":"Vyper Template","description":"Template to demonstrate the use of the Vyper contracts","install":"embark new AppName --template vyper","thumbnail":"vyper.png","link":"https://github.com/embarklabs/embark-vyper-template","tags":["vyper","contracts"]},{"name":"Embark Demo React Template","description":"A React Application showcasing Embark's functionality","install":"embark demo","thumbnail":"react.png","link":"https://embark.embarklabs.io/docs/create_project.html#Creating-a-Demo-Project","tags":["react","contracts","whisper","ipfs"]},{"name":"Typescript Template","description":"Template with Typescript support pre-configured","thumbnail":"typescript.png","install":"embark new AppName --template typescript","link":"https://github.com/embarklabs/embark-typescript-template","tags":["typescript","frontend"]},{"name":"Vue.js Template","description":"Ready to use Template for using Embark with vue.js","thumbnail":"vuejs.png","install":"embark new AppName --template vue","link":"https://github.com/embarklabs/embark-vue-template","tags":["vue.js","frontend"]},{"name":"ethvtx Template","description":"Demo app for ethvtx, an Ethereum-Ready & Framework-Agnostic Redux configuration","thumbnail":"vortex.png","install":"embark new AppName --template Horyus/ethvtx_embark","link":"https://github.com/Horyus/ethvtx_embark","tags":["react"]},{"name":"Bamboo Template","description":"Template to demonstrate use of the Bamboo contracts","install":"embark new AppName --template bamboo","thumbnail":"bamboo.png","link":"https://github.com/embarklabs/embark-bamboo-template","tags":["bamboo","contracts"]},{"name":"Solidity Gas Golfing","description":"Boilerplate and tests for the first Solidity Gas Golfing Contest","thumbnail":"sggc.png","install":"embark new AppName --template embarklabs/sggc","link":"https://github.com/embarklabs/sggc","tags":["solidity","tests","fun"]}],"tutorials":[{"name":"How to create a Token Factory with Ethereum — Part 1","description":"Create and Deploy a Token with Ethereum","link":"/tutorials/token_factory_1.html","tags":["token","ethereum"]},{"name":"How to create a Token Factory with Ethereum — Part 2","description":"Create a DApp that can deploy Tokens on the fly","link":"/tutorials/token_factory_2.html","tags":["token","ethereum","client-side-deployment"]},{"name":"How to deploy to a testnet with Infura","description":"Deploy and interact with your Dapp on a testnet with the use of Infura","link":"/tutorials/infura_guide.html","tags":["ethereum","deployment","testnet"]}],"versions":{"latest":{"label":"stable (v4)","url":"https://embark.embarklabs.io/docs"},"3.2":{"label":"v3.2","url":"https://5ca4e0fdb29712000adde37f--embark-site-versions.netlify.com/docs/"}}}},"excerpt":"","more":"

What is a DApp

A Decentralized Application is a serverless html5 application that uses one or more decentralized technologies.

\n"},{"title":"Working with Name Systems","layout":"docs","_content":"\nIn order to improve the user experience of decentralized applications that deal with smart contracts or Ethereum addresses in general, it's a good practice to take advantage of the [Ethereum Name Service](https://ens.domains/) and its registered, human-readable names. Embark provides APIs to either resolve a given domain to its corresponding address, or lookup a registered name by a given address.\n\nLet's take a look at how this is done.\n\n### Resolving a Domain to an address\n\nResolving a domain to its corresponding address is done by calling `EmbarkJS.Names.resolve`, which takes the domain in question as first argument and a callback function that has access to the resolved address as a second argument:\n\n
EmbarkJS.Names.resolve('ethereum.eth', (err, result) => {\n  if (err) {\n    console.error('ENS resolve error', err);\n  }\n  console.log('ENS address', result)\n});\n
\n\nIf you prefer using Promises, Embark has got you covered! `EmbarkJS.Names.resolve` returns a promise that resolves with the corresponding address, or an error message in case the given domain doesn't resolve to an address:\n\n
EmbarkJS.Names.resolve(\"ethereum.eth\").then(address => {\n  console.log(\"the address for ethereum.eth is: \" + address);\n})\n
\n\n### Reverse resolve an ENS domain\n\nSimilar to resolving addresses, looking up domains is really just a matter of calling `EmbarkJS.Names.lookup`, which takes an address as argument. Just like `EmbarkJS.Names.resolve`, a callback can be used to get notified whether the lookup was successful or not:\n\n
EmbarkJS.Names.lookup(\"0xfb6916095ca1df60bb79ce92ce3ea74c37c5d359\", (err, name) => {\n  if (err) {\n    console.error('ENS lookup error', err);\n  }\n  console.log(\"the domain is: \" + name);\n})\n
\n\nGuess what, `EmbarkJS.Names.lookup` also returns a Promise in case you prefer using those over callbacks:\n\n
EmbarkJS.Names.lookup(\"0xfb6916095ca1df60bb79ce92ce3ea74c37c5d359\").then(name => {\n  console.log(\"the domain is: \" + name);\n})\n
\n\n### Register a sub-domain\n\nThis enables you to register some others sub-domains.\nThis is mostly for demo purposes as it is only available in development.\n\n
\n EmbarkJS.Names.registerSubDomain('newsubdomain', '0x4a17f35f0a9927fb4141aa91cbbc72c1b31598de', (err, transaction) => {\n  if (err) {\n    console.error('ENS register error', err);\n  }\n  console.log(`Successfully registered with ${transaction.gasUsed} gas`);\n});\n
\n\n","source":"docs/working_with_name_systems.md","raw":"title: Working with Name Systems\nlayout: docs\n---\n\nIn order to improve the user experience of decentralized applications that deal with smart contracts or Ethereum addresses in general, it's a good practice to take advantage of the [Ethereum Name Service](https://ens.domains/) and its registered, human-readable names. Embark provides APIs to either resolve a given domain to its corresponding address, or lookup a registered name by a given address.\n\nLet's take a look at how this is done.\n\n### Resolving a Domain to an address\n\nResolving a domain to its corresponding address is done by calling `EmbarkJS.Names.resolve`, which takes the domain in question as first argument and a callback function that has access to the resolved address as a second argument:\n\n
EmbarkJS.Names.resolve('ethereum.eth', (err, result) => {\n  if (err) {\n    console.error('ENS resolve error', err);\n  }\n  console.log('ENS address', result)\n});\n
\n\nIf you prefer using Promises, Embark has got you covered! `EmbarkJS.Names.resolve` returns a promise that resolves with the corresponding address, or an error message in case the given domain doesn't resolve to an address:\n\n
EmbarkJS.Names.resolve(\"ethereum.eth\").then(address => {\n  console.log(\"the address for ethereum.eth is: \" + address);\n})\n
\n\n### Reverse resolve an ENS domain\n\nSimilar to resolving addresses, looking up domains is really just a matter of calling `EmbarkJS.Names.lookup`, which takes an address as argument. Just like `EmbarkJS.Names.resolve`, a callback can be used to get notified whether the lookup was successful or not:\n\n
EmbarkJS.Names.lookup(\"0xfb6916095ca1df60bb79ce92ce3ea74c37c5d359\", (err, name) => {\n  if (err) {\n    console.error('ENS lookup error', err);\n  }\n  console.log(\"the domain is: \" + name);\n})\n
\n\nGuess what, `EmbarkJS.Names.lookup` also returns a Promise in case you prefer using those over callbacks:\n\n
EmbarkJS.Names.lookup(\"0xfb6916095ca1df60bb79ce92ce3ea74c37c5d359\").then(name => {\n  console.log(\"the domain is: \" + name);\n})\n
\n\n### Register a sub-domain\n\nThis enables you to register some others sub-domains.\nThis is mostly for demo purposes as it is only available in development.\n\n
\n EmbarkJS.Names.registerSubDomain('newsubdomain', '0x4a17f35f0a9927fb4141aa91cbbc72c1b31598de', (err, transaction) => {\n  if (err) {\n    console.error('ENS register error', err);\n  }\n  console.log(`Successfully registered with ${transaction.gasUsed} gas`);\n});\n
\n\n","date":"2020-01-17T19:00:03.900Z","updated":"2020-01-17T19:00:03.900Z","path":"docs/working_with_name_systems.html","comments":1,"_id":"ck5ijm3s3001z7hegefgi88bl","content":"

In order to improve the user experience of decentralized applications that deal with smart contracts or Ethereum addresses in general, it’s a good practice to take advantage of the Ethereum Name Service and its registered, human-readable names. Embark provides APIs to either resolve a given domain to its corresponding address, or lookup a registered name by a given address.

\n

Let’s take a look at how this is done.

\n

Resolving a Domain to an address

Resolving a domain to its corresponding address is done by calling EmbarkJS.Names.resolve, which takes the domain in question as first argument and a callback function that has access to the resolved address as a second argument:

\n
EmbarkJS.Names.resolve('ethereum.eth', (err, result) => {\n  if (err) {\n    console.error('ENS resolve error', err);\n  }\n  console.log('ENS address', result)\n});\n
\n\n

If you prefer using Promises, Embark has got you covered! EmbarkJS.Names.resolve returns a promise that resolves with the corresponding address, or an error message in case the given domain doesn’t resolve to an address:

\n
EmbarkJS.Names.resolve(\"ethereum.eth\").then(address => {\n  console.log(\"the address for ethereum.eth is: \" + address);\n})\n
\n\n

Reverse resolve an ENS domain

Similar to resolving addresses, looking up domains is really just a matter of calling EmbarkJS.Names.lookup, which takes an address as argument. Just like EmbarkJS.Names.resolve, a callback can be used to get notified whether the lookup was successful or not:

\n
EmbarkJS.Names.lookup(\"0xfb6916095ca1df60bb79ce92ce3ea74c37c5d359\", (err, name) => {\n  if (err) {\n    console.error('ENS lookup error', err);\n  }\n  console.log(\"the domain is: \" + name);\n})\n
\n\n

Guess what, EmbarkJS.Names.lookup also returns a Promise in case you prefer using those over callbacks:

\n
EmbarkJS.Names.lookup(\"0xfb6916095ca1df60bb79ce92ce3ea74c37c5d359\").then(name => {\n  console.log(\"the domain is: \" + name);\n})\n
\n\n

Register a sub-domain

This enables you to register some others sub-domains.
This is mostly for demo purposes as it is only available in development.

\n
\n EmbarkJS.Names.registerSubDomain('newsubdomain', '0x4a17f35f0a9927fb4141aa91cbbc72c1b31598de', (err, transaction) => {\n  if (err) {\n    console.error('ENS register error', err);\n  }\n  console.log(`Successfully registered with ${transaction.gasUsed} gas`);\n});\n
\n\n","site":{"data":{"authors":{"iuri_matias":{"name":"Iuri Matias","twitter":"iurimatias","image":"https://pbs.twimg.com/profile_images/928272512181563392/iDJdvy2k_400x400.jpg"},"pascal_precht":{"name":"Pascal Precht","twitter":"pascalprecht","image":"https://pbs.twimg.com/profile_images/993785060733194241/p3oAIMDP_400x400.jpg"},"anthony_laibe":{"name":"Anthony Laibe","twitter":"a_laibe","image":"https://pbs.twimg.com/profile_images/257742900/13168239_400x400.jpg"},"jonathan_rainville":{"name":"Jonathan Rainville","twitter":"ShyolGhul","image":"https://pbs.twimg.com/profile_images/993873866878570496/-aE4byjj_400x400.jpg"},"andre_medeiros":{"name":"Andre Medeiros","twitter":"superdealloc","image":"https://pbs.twimg.com/profile_images/965722487735701504/m58KNgWN_400x400.jpg"},"eric_mastro":{"name":"Eric Mastro","twitter":"ericmastro","image":"https://avatars1.githubusercontent.com/u/5089238?s=460&v=4"},"michael_bradley":{"name":"Michael Bradley","image":"https://avatars3.githubusercontent.com/u/194260?s=460&v=4"},"richard_ramos":{"name":"Richard Ramos","twitter":"richardramos_me","image":"https://pbs.twimg.com/profile_images/1063160577973866496/aM313uHG_400x400.jpg"},"jonny_zerah":{"name":"Jonny Zerah","twitter":"jonnyzerah","image":"https://pbs.twimg.com/profile_images/1043774340490248192/gI9aGy17_400x400.jpg"},"robin_percy":{"name":"Robin Percy","twitter":"rbin","image":"https://avatars1.githubusercontent.com/u/29288325?s=400&v=4"}},"categories":{"tutorials":"Tutorials","announcements":"Announcements"},"languages":{"en":"English"},"plugins":[{"name":"embark-bamboo","description":"plugins_page.plugins.bamboo.desc","link":"https://www.npmjs.com/package/embark-bamboo","thumbnail":"bamboo.png","tags":["language","smart-contracts"]},{"name":"embark-solc","description":"plugins_page.plugins.solc.desc","link":"https://www.npmjs.com/package/embark-solc","thumbnail":"solidity.png","tags":["solidity","language","smart-contracts"]},{"name":"embark-solium","description":"plugins_page.plugins.solium.desc","link":"https://www.npmjs.com/package/embark-solium","thumbnail":"solium.png","tags":["linter","solidity","solium"]},{"name":"embark-etherscan-verifier","description":"plugins_page.plugins.verifier.desc","link":"https://www.npmjs.com/package/embark-etherscan-verifier","tags":["solidity","etherscan","smart-contracts"]},{"name":"embark-status","description":"plugins_page.plugins.status.desc","link":"https://www.npmjs.com/package/embark-status-plugin","thumbnail":"status.png","tags":["status","mobile"]},{"name":"embark-remix","description":"plugins_page.plugins.remix.desc","link":"https://www.npmjs.com/package/embark-remix","thumbnail":"remix.png","tags":["remix","debugger"]},{"name":"embark-slither","description":"plugins_page.plugins.slither.desc","link":"https://www.npmjs.com/package/embark-slither","tags":["solidity"]},{"name":"embark-snark","description":"plugins_page.plugins.snark.desc","link":"https://www.npmjs.com/package/embark-snark","tags":["snark"]},{"name":"embark-fortune","description":"plugins_page.plugins.fortune.desc","link":"https://www.npmjs.com/package/embark-fortune","thumbnail":"fortune.jpg","tags":["fun"]},{"name":"embark-pug","description":"plugins_page.plugins.pug.desc","link":"https://www.npmjs.com/package/embark-pug","legacy":true,"thumbnail":"pug.png","tags":["pug","jade","templates"]},{"name":"embark-haml","description":"plugins_page.plugins.haml.desc","link":"https://www.npmjs.com/package/embark-haml","legacy":true,"thumbnail":"haml.png","tags":["haml","templates"]},{"name":"embark-mythx","description":"plugins_page.plugins.mythx.desc","link":"https://www.npmjs.com/package/embark-mythx","thumbnail":"mythx.png","tags":["mythx","smart-contracts"]}],"menu":{"docs":"/docs/","plugins":"/plugins/","chat":"/chat/","blog":"/news/"},"sidebar":{"docs":{"getting_started":{"overview":"overview.html","installation":"installation.html","faq":"faq.html"},"general_usage":{"creating_project":"create_project.html","structure":"structure.html","running_apps":"running_apps.html","dashboard":"dashboard.html","using_the_console":"using_the_console.html","environments":"environments.html","configuration":"configuration.html","pipeline_and_webpack":"pipeline_and_webpack.html","javascript_usage":"javascript_usage.html"},"smart_contracts":{"contracts_configuration":"contracts_configuration.html","contracts_deployment":"contracts_deployment.html","contracts_imports":"contracts_imports.html","contracts_testing":"contracts_testing.html","contracts_javascript":"contracts_javascript.html"},"blockchain_node":{"blockchain_configuration":"blockchain_configuration.html","blockchain_accounts_configuration":"blockchain_accounts_configuration.html"},"storage":{"storage_configuration":"storage_configuration.html","storage_deployment":"storage_deployment.html","storage_javascript":"storage_javascript.html"},"messages":{"messages_configuration":"messages_configuration.html","messages_javascript":"messages_javascript.html"},"naming":{"naming_configuration":"naming_configuration.html","naming_javascript":"naming_javascript.html"},"plugins":{"installing_a_plugin":"installing_plugins.html","creating_a_plugin":"creating_plugins.html","plugin_reference":"plugin_reference.html"},"cockpit":{"cockpit_introduction":"cockpit_introduction.html","cockpit_dashboard":"cockpit_dashboard.html","cockpit_deployment":"cockpit_deployment.html","cockpit_explorer":"cockpit_explorer.html","cockpit_editor":"cockpit_editor.html","cockpit_debugger":"cockpit_debugger.html"},"reference":{"embark_commands":"embark_commands.html"},"miscellaneous":{"migrating_from_3":"migrating_from_3.x.html","troubleshooting":"troubleshooting.html","contributing":"contributing.html"}}},"templates":[{"name":"Vyper Template","description":"Template to demonstrate the use of the Vyper contracts","install":"embark new AppName --template vyper","thumbnail":"vyper.png","link":"https://github.com/embarklabs/embark-vyper-template","tags":["vyper","contracts"]},{"name":"Embark Demo React Template","description":"A React Application showcasing Embark's functionality","install":"embark demo","thumbnail":"react.png","link":"https://embark.embarklabs.io/docs/create_project.html#Creating-a-Demo-Project","tags":["react","contracts","whisper","ipfs"]},{"name":"Typescript Template","description":"Template with Typescript support pre-configured","thumbnail":"typescript.png","install":"embark new AppName --template typescript","link":"https://github.com/embarklabs/embark-typescript-template","tags":["typescript","frontend"]},{"name":"Vue.js Template","description":"Ready to use Template for using Embark with vue.js","thumbnail":"vuejs.png","install":"embark new AppName --template vue","link":"https://github.com/embarklabs/embark-vue-template","tags":["vue.js","frontend"]},{"name":"ethvtx Template","description":"Demo app for ethvtx, an Ethereum-Ready & Framework-Agnostic Redux configuration","thumbnail":"vortex.png","install":"embark new AppName --template Horyus/ethvtx_embark","link":"https://github.com/Horyus/ethvtx_embark","tags":["react"]},{"name":"Bamboo Template","description":"Template to demonstrate use of the Bamboo contracts","install":"embark new AppName --template bamboo","thumbnail":"bamboo.png","link":"https://github.com/embarklabs/embark-bamboo-template","tags":["bamboo","contracts"]},{"name":"Solidity Gas Golfing","description":"Boilerplate and tests for the first Solidity Gas Golfing Contest","thumbnail":"sggc.png","install":"embark new AppName --template embarklabs/sggc","link":"https://github.com/embarklabs/sggc","tags":["solidity","tests","fun"]}],"tutorials":[{"name":"How to create a Token Factory with Ethereum — Part 1","description":"Create and Deploy a Token with Ethereum","link":"/tutorials/token_factory_1.html","tags":["token","ethereum"]},{"name":"How to create a Token Factory with Ethereum — Part 2","description":"Create a DApp that can deploy Tokens on the fly","link":"/tutorials/token_factory_2.html","tags":["token","ethereum","client-side-deployment"]},{"name":"How to deploy to a testnet with Infura","description":"Deploy and interact with your Dapp on a testnet with the use of Infura","link":"/tutorials/infura_guide.html","tags":["ethereum","deployment","testnet"]}],"versions":{"latest":{"label":"stable (v4)","url":"https://embark.embarklabs.io/docs"},"3.2":{"label":"v3.2","url":"https://5ca4e0fdb29712000adde37f--embark-site-versions.netlify.com/docs/"}}}},"excerpt":"","more":"

In order to improve the user experience of decentralized applications that deal with smart contracts or Ethereum addresses in general, it’s a good practice to take advantage of the Ethereum Name Service and its registered, human-readable names. Embark provides APIs to either resolve a given domain to its corresponding address, or lookup a registered name by a given address.

\n

Let’s take a look at how this is done.

\n

Resolving a Domain to an address

Resolving a domain to its corresponding address is done by calling EmbarkJS.Names.resolve, which takes the domain in question as first argument and a callback function that has access to the resolved address as a second argument:

\n
EmbarkJS.Names.resolve('ethereum.eth', (err, result) => {\n  if (err) {\n    console.error('ENS resolve error', err);\n  }\n  console.log('ENS address', result)\n});\n
\n\n

If you prefer using Promises, Embark has got you covered! EmbarkJS.Names.resolve returns a promise that resolves with the corresponding address, or an error message in case the given domain doesn’t resolve to an address:

\n
EmbarkJS.Names.resolve(\"ethereum.eth\").then(address => {\n  console.log(\"the address for ethereum.eth is: \" + address);\n})\n
\n\n

Reverse resolve an ENS domain

Similar to resolving addresses, looking up domains is really just a matter of calling EmbarkJS.Names.lookup, which takes an address as argument. Just like EmbarkJS.Names.resolve, a callback can be used to get notified whether the lookup was successful or not:

\n
EmbarkJS.Names.lookup(\"0xfb6916095ca1df60bb79ce92ce3ea74c37c5d359\", (err, name) => {\n  if (err) {\n    console.error('ENS lookup error', err);\n  }\n  console.log(\"the domain is: \" + name);\n})\n
\n\n

Guess what, EmbarkJS.Names.lookup also returns a Promise in case you prefer using those over callbacks:

\n
EmbarkJS.Names.lookup(\"0xfb6916095ca1df60bb79ce92ce3ea74c37c5d359\").then(name => {\n  console.log(\"the domain is: \" + name);\n})\n
\n\n

Register a sub-domain

This enables you to register some others sub-domains.
This is mostly for demo purposes as it is only available in development.

\n
\n EmbarkJS.Names.registerSubDomain('newsubdomain', '0x4a17f35f0a9927fb4141aa91cbbc72c1b31598de', (err, transaction) => {\n  if (err) {\n    console.error('ENS register error', err);\n  }\n  console.log(`Successfully registered with ${transaction.gasUsed} gas`);\n});\n
\n\n"},{"title":"blog.header.title","tagline":"blog.header.tagline","layout":"blog","_content":"","source":"news/index.md","raw":"title: blog.header.title\ntagline: blog.header.tagline\nlayout: blog\n---\n","date":"2020-01-17T19:00:03.900Z","updated":"2020-01-17T19:00:03.900Z","path":"news/index.html","comments":1,"_id":"ck5ijm3s400207heg7ovygrsl","content":"","site":{"data":{"authors":{"iuri_matias":{"name":"Iuri Matias","twitter":"iurimatias","image":"https://pbs.twimg.com/profile_images/928272512181563392/iDJdvy2k_400x400.jpg"},"pascal_precht":{"name":"Pascal Precht","twitter":"pascalprecht","image":"https://pbs.twimg.com/profile_images/993785060733194241/p3oAIMDP_400x400.jpg"},"anthony_laibe":{"name":"Anthony Laibe","twitter":"a_laibe","image":"https://pbs.twimg.com/profile_images/257742900/13168239_400x400.jpg"},"jonathan_rainville":{"name":"Jonathan Rainville","twitter":"ShyolGhul","image":"https://pbs.twimg.com/profile_images/993873866878570496/-aE4byjj_400x400.jpg"},"andre_medeiros":{"name":"Andre Medeiros","twitter":"superdealloc","image":"https://pbs.twimg.com/profile_images/965722487735701504/m58KNgWN_400x400.jpg"},"eric_mastro":{"name":"Eric Mastro","twitter":"ericmastro","image":"https://avatars1.githubusercontent.com/u/5089238?s=460&v=4"},"michael_bradley":{"name":"Michael Bradley","image":"https://avatars3.githubusercontent.com/u/194260?s=460&v=4"},"richard_ramos":{"name":"Richard Ramos","twitter":"richardramos_me","image":"https://pbs.twimg.com/profile_images/1063160577973866496/aM313uHG_400x400.jpg"},"jonny_zerah":{"name":"Jonny Zerah","twitter":"jonnyzerah","image":"https://pbs.twimg.com/profile_images/1043774340490248192/gI9aGy17_400x400.jpg"},"robin_percy":{"name":"Robin Percy","twitter":"rbin","image":"https://avatars1.githubusercontent.com/u/29288325?s=400&v=4"}},"categories":{"tutorials":"Tutorials","announcements":"Announcements"},"languages":{"en":"English"},"plugins":[{"name":"embark-bamboo","description":"plugins_page.plugins.bamboo.desc","link":"https://www.npmjs.com/package/embark-bamboo","thumbnail":"bamboo.png","tags":["language","smart-contracts"]},{"name":"embark-solc","description":"plugins_page.plugins.solc.desc","link":"https://www.npmjs.com/package/embark-solc","thumbnail":"solidity.png","tags":["solidity","language","smart-contracts"]},{"name":"embark-solium","description":"plugins_page.plugins.solium.desc","link":"https://www.npmjs.com/package/embark-solium","thumbnail":"solium.png","tags":["linter","solidity","solium"]},{"name":"embark-etherscan-verifier","description":"plugins_page.plugins.verifier.desc","link":"https://www.npmjs.com/package/embark-etherscan-verifier","tags":["solidity","etherscan","smart-contracts"]},{"name":"embark-status","description":"plugins_page.plugins.status.desc","link":"https://www.npmjs.com/package/embark-status-plugin","thumbnail":"status.png","tags":["status","mobile"]},{"name":"embark-remix","description":"plugins_page.plugins.remix.desc","link":"https://www.npmjs.com/package/embark-remix","thumbnail":"remix.png","tags":["remix","debugger"]},{"name":"embark-slither","description":"plugins_page.plugins.slither.desc","link":"https://www.npmjs.com/package/embark-slither","tags":["solidity"]},{"name":"embark-snark","description":"plugins_page.plugins.snark.desc","link":"https://www.npmjs.com/package/embark-snark","tags":["snark"]},{"name":"embark-fortune","description":"plugins_page.plugins.fortune.desc","link":"https://www.npmjs.com/package/embark-fortune","thumbnail":"fortune.jpg","tags":["fun"]},{"name":"embark-pug","description":"plugins_page.plugins.pug.desc","link":"https://www.npmjs.com/package/embark-pug","legacy":true,"thumbnail":"pug.png","tags":["pug","jade","templates"]},{"name":"embark-haml","description":"plugins_page.plugins.haml.desc","link":"https://www.npmjs.com/package/embark-haml","legacy":true,"thumbnail":"haml.png","tags":["haml","templates"]},{"name":"embark-mythx","description":"plugins_page.plugins.mythx.desc","link":"https://www.npmjs.com/package/embark-mythx","thumbnail":"mythx.png","tags":["mythx","smart-contracts"]}],"menu":{"docs":"/docs/","plugins":"/plugins/","chat":"/chat/","blog":"/news/"},"sidebar":{"docs":{"getting_started":{"overview":"overview.html","installation":"installation.html","faq":"faq.html"},"general_usage":{"creating_project":"create_project.html","structure":"structure.html","running_apps":"running_apps.html","dashboard":"dashboard.html","using_the_console":"using_the_console.html","environments":"environments.html","configuration":"configuration.html","pipeline_and_webpack":"pipeline_and_webpack.html","javascript_usage":"javascript_usage.html"},"smart_contracts":{"contracts_configuration":"contracts_configuration.html","contracts_deployment":"contracts_deployment.html","contracts_imports":"contracts_imports.html","contracts_testing":"contracts_testing.html","contracts_javascript":"contracts_javascript.html"},"blockchain_node":{"blockchain_configuration":"blockchain_configuration.html","blockchain_accounts_configuration":"blockchain_accounts_configuration.html"},"storage":{"storage_configuration":"storage_configuration.html","storage_deployment":"storage_deployment.html","storage_javascript":"storage_javascript.html"},"messages":{"messages_configuration":"messages_configuration.html","messages_javascript":"messages_javascript.html"},"naming":{"naming_configuration":"naming_configuration.html","naming_javascript":"naming_javascript.html"},"plugins":{"installing_a_plugin":"installing_plugins.html","creating_a_plugin":"creating_plugins.html","plugin_reference":"plugin_reference.html"},"cockpit":{"cockpit_introduction":"cockpit_introduction.html","cockpit_dashboard":"cockpit_dashboard.html","cockpit_deployment":"cockpit_deployment.html","cockpit_explorer":"cockpit_explorer.html","cockpit_editor":"cockpit_editor.html","cockpit_debugger":"cockpit_debugger.html"},"reference":{"embark_commands":"embark_commands.html"},"miscellaneous":{"migrating_from_3":"migrating_from_3.x.html","troubleshooting":"troubleshooting.html","contributing":"contributing.html"}}},"templates":[{"name":"Vyper Template","description":"Template to demonstrate the use of the Vyper contracts","install":"embark new AppName --template vyper","thumbnail":"vyper.png","link":"https://github.com/embarklabs/embark-vyper-template","tags":["vyper","contracts"]},{"name":"Embark Demo React Template","description":"A React Application showcasing Embark's functionality","install":"embark demo","thumbnail":"react.png","link":"https://embark.embarklabs.io/docs/create_project.html#Creating-a-Demo-Project","tags":["react","contracts","whisper","ipfs"]},{"name":"Typescript Template","description":"Template with Typescript support pre-configured","thumbnail":"typescript.png","install":"embark new AppName --template typescript","link":"https://github.com/embarklabs/embark-typescript-template","tags":["typescript","frontend"]},{"name":"Vue.js Template","description":"Ready to use Template for using Embark with vue.js","thumbnail":"vuejs.png","install":"embark new AppName --template vue","link":"https://github.com/embarklabs/embark-vue-template","tags":["vue.js","frontend"]},{"name":"ethvtx Template","description":"Demo app for ethvtx, an Ethereum-Ready & Framework-Agnostic Redux configuration","thumbnail":"vortex.png","install":"embark new AppName --template Horyus/ethvtx_embark","link":"https://github.com/Horyus/ethvtx_embark","tags":["react"]},{"name":"Bamboo Template","description":"Template to demonstrate use of the Bamboo contracts","install":"embark new AppName --template bamboo","thumbnail":"bamboo.png","link":"https://github.com/embarklabs/embark-bamboo-template","tags":["bamboo","contracts"]},{"name":"Solidity Gas Golfing","description":"Boilerplate and tests for the first Solidity Gas Golfing Contest","thumbnail":"sggc.png","install":"embark new AppName --template embarklabs/sggc","link":"https://github.com/embarklabs/sggc","tags":["solidity","tests","fun"]}],"tutorials":[{"name":"How to create a Token Factory with Ethereum — Part 1","description":"Create and Deploy a Token with Ethereum","link":"/tutorials/token_factory_1.html","tags":["token","ethereum"]},{"name":"How to create a Token Factory with Ethereum — Part 2","description":"Create a DApp that can deploy Tokens on the fly","link":"/tutorials/token_factory_2.html","tags":["token","ethereum","client-side-deployment"]},{"name":"How to deploy to a testnet with Infura","description":"Deploy and interact with your Dapp on a testnet with the use of Infura","link":"/tutorials/infura_guide.html","tags":["ethereum","deployment","testnet"]}],"versions":{"latest":{"label":"stable (v4)","url":"https://embark.embarklabs.io/docs"},"3.2":{"label":"v3.2","url":"https://5ca4e0fdb29712000adde37f--embark-site-versions.netlify.com/docs/"}}}},"excerpt":"","more":""},{"layout":"plugins","tagline":"plugins_page.header.tagline","title":"plugins_page.header.title","data":"plugins","intro":"plugins_page.intro_section.heading.referal","_content":"","source":"plugins/index.md","raw":"layout: plugins\ntagline: plugins_page.header.tagline\ntitle: plugins_page.header.title\ndata: plugins\nintro: plugins_page.intro_section.heading.referal\n---\n","date":"2020-01-17T19:00:03.900Z","updated":"2020-01-17T19:00:03.900Z","path":"plugins/index.html","comments":1,"_id":"ck5ijm3s400217heg1pdtd3jb","content":"","site":{"data":{"authors":{"iuri_matias":{"name":"Iuri Matias","twitter":"iurimatias","image":"https://pbs.twimg.com/profile_images/928272512181563392/iDJdvy2k_400x400.jpg"},"pascal_precht":{"name":"Pascal Precht","twitter":"pascalprecht","image":"https://pbs.twimg.com/profile_images/993785060733194241/p3oAIMDP_400x400.jpg"},"anthony_laibe":{"name":"Anthony Laibe","twitter":"a_laibe","image":"https://pbs.twimg.com/profile_images/257742900/13168239_400x400.jpg"},"jonathan_rainville":{"name":"Jonathan Rainville","twitter":"ShyolGhul","image":"https://pbs.twimg.com/profile_images/993873866878570496/-aE4byjj_400x400.jpg"},"andre_medeiros":{"name":"Andre Medeiros","twitter":"superdealloc","image":"https://pbs.twimg.com/profile_images/965722487735701504/m58KNgWN_400x400.jpg"},"eric_mastro":{"name":"Eric Mastro","twitter":"ericmastro","image":"https://avatars1.githubusercontent.com/u/5089238?s=460&v=4"},"michael_bradley":{"name":"Michael Bradley","image":"https://avatars3.githubusercontent.com/u/194260?s=460&v=4"},"richard_ramos":{"name":"Richard Ramos","twitter":"richardramos_me","image":"https://pbs.twimg.com/profile_images/1063160577973866496/aM313uHG_400x400.jpg"},"jonny_zerah":{"name":"Jonny Zerah","twitter":"jonnyzerah","image":"https://pbs.twimg.com/profile_images/1043774340490248192/gI9aGy17_400x400.jpg"},"robin_percy":{"name":"Robin Percy","twitter":"rbin","image":"https://avatars1.githubusercontent.com/u/29288325?s=400&v=4"}},"categories":{"tutorials":"Tutorials","announcements":"Announcements"},"languages":{"en":"English"},"plugins":[{"name":"embark-bamboo","description":"plugins_page.plugins.bamboo.desc","link":"https://www.npmjs.com/package/embark-bamboo","thumbnail":"bamboo.png","tags":["language","smart-contracts"]},{"name":"embark-solc","description":"plugins_page.plugins.solc.desc","link":"https://www.npmjs.com/package/embark-solc","thumbnail":"solidity.png","tags":["solidity","language","smart-contracts"]},{"name":"embark-solium","description":"plugins_page.plugins.solium.desc","link":"https://www.npmjs.com/package/embark-solium","thumbnail":"solium.png","tags":["linter","solidity","solium"]},{"name":"embark-etherscan-verifier","description":"plugins_page.plugins.verifier.desc","link":"https://www.npmjs.com/package/embark-etherscan-verifier","tags":["solidity","etherscan","smart-contracts"]},{"name":"embark-status","description":"plugins_page.plugins.status.desc","link":"https://www.npmjs.com/package/embark-status-plugin","thumbnail":"status.png","tags":["status","mobile"]},{"name":"embark-remix","description":"plugins_page.plugins.remix.desc","link":"https://www.npmjs.com/package/embark-remix","thumbnail":"remix.png","tags":["remix","debugger"]},{"name":"embark-slither","description":"plugins_page.plugins.slither.desc","link":"https://www.npmjs.com/package/embark-slither","tags":["solidity"]},{"name":"embark-snark","description":"plugins_page.plugins.snark.desc","link":"https://www.npmjs.com/package/embark-snark","tags":["snark"]},{"name":"embark-fortune","description":"plugins_page.plugins.fortune.desc","link":"https://www.npmjs.com/package/embark-fortune","thumbnail":"fortune.jpg","tags":["fun"]},{"name":"embark-pug","description":"plugins_page.plugins.pug.desc","link":"https://www.npmjs.com/package/embark-pug","legacy":true,"thumbnail":"pug.png","tags":["pug","jade","templates"]},{"name":"embark-haml","description":"plugins_page.plugins.haml.desc","link":"https://www.npmjs.com/package/embark-haml","legacy":true,"thumbnail":"haml.png","tags":["haml","templates"]},{"name":"embark-mythx","description":"plugins_page.plugins.mythx.desc","link":"https://www.npmjs.com/package/embark-mythx","thumbnail":"mythx.png","tags":["mythx","smart-contracts"]}],"menu":{"docs":"/docs/","plugins":"/plugins/","chat":"/chat/","blog":"/news/"},"sidebar":{"docs":{"getting_started":{"overview":"overview.html","installation":"installation.html","faq":"faq.html"},"general_usage":{"creating_project":"create_project.html","structure":"structure.html","running_apps":"running_apps.html","dashboard":"dashboard.html","using_the_console":"using_the_console.html","environments":"environments.html","configuration":"configuration.html","pipeline_and_webpack":"pipeline_and_webpack.html","javascript_usage":"javascript_usage.html"},"smart_contracts":{"contracts_configuration":"contracts_configuration.html","contracts_deployment":"contracts_deployment.html","contracts_imports":"contracts_imports.html","contracts_testing":"contracts_testing.html","contracts_javascript":"contracts_javascript.html"},"blockchain_node":{"blockchain_configuration":"blockchain_configuration.html","blockchain_accounts_configuration":"blockchain_accounts_configuration.html"},"storage":{"storage_configuration":"storage_configuration.html","storage_deployment":"storage_deployment.html","storage_javascript":"storage_javascript.html"},"messages":{"messages_configuration":"messages_configuration.html","messages_javascript":"messages_javascript.html"},"naming":{"naming_configuration":"naming_configuration.html","naming_javascript":"naming_javascript.html"},"plugins":{"installing_a_plugin":"installing_plugins.html","creating_a_plugin":"creating_plugins.html","plugin_reference":"plugin_reference.html"},"cockpit":{"cockpit_introduction":"cockpit_introduction.html","cockpit_dashboard":"cockpit_dashboard.html","cockpit_deployment":"cockpit_deployment.html","cockpit_explorer":"cockpit_explorer.html","cockpit_editor":"cockpit_editor.html","cockpit_debugger":"cockpit_debugger.html"},"reference":{"embark_commands":"embark_commands.html"},"miscellaneous":{"migrating_from_3":"migrating_from_3.x.html","troubleshooting":"troubleshooting.html","contributing":"contributing.html"}}},"templates":[{"name":"Vyper Template","description":"Template to demonstrate the use of the Vyper contracts","install":"embark new AppName --template vyper","thumbnail":"vyper.png","link":"https://github.com/embarklabs/embark-vyper-template","tags":["vyper","contracts"]},{"name":"Embark Demo React Template","description":"A React Application showcasing Embark's functionality","install":"embark demo","thumbnail":"react.png","link":"https://embark.embarklabs.io/docs/create_project.html#Creating-a-Demo-Project","tags":["react","contracts","whisper","ipfs"]},{"name":"Typescript Template","description":"Template with Typescript support pre-configured","thumbnail":"typescript.png","install":"embark new AppName --template typescript","link":"https://github.com/embarklabs/embark-typescript-template","tags":["typescript","frontend"]},{"name":"Vue.js Template","description":"Ready to use Template for using Embark with vue.js","thumbnail":"vuejs.png","install":"embark new AppName --template vue","link":"https://github.com/embarklabs/embark-vue-template","tags":["vue.js","frontend"]},{"name":"ethvtx Template","description":"Demo app for ethvtx, an Ethereum-Ready & Framework-Agnostic Redux configuration","thumbnail":"vortex.png","install":"embark new AppName --template Horyus/ethvtx_embark","link":"https://github.com/Horyus/ethvtx_embark","tags":["react"]},{"name":"Bamboo Template","description":"Template to demonstrate use of the Bamboo contracts","install":"embark new AppName --template bamboo","thumbnail":"bamboo.png","link":"https://github.com/embarklabs/embark-bamboo-template","tags":["bamboo","contracts"]},{"name":"Solidity Gas Golfing","description":"Boilerplate and tests for the first Solidity Gas Golfing Contest","thumbnail":"sggc.png","install":"embark new AppName --template embarklabs/sggc","link":"https://github.com/embarklabs/sggc","tags":["solidity","tests","fun"]}],"tutorials":[{"name":"How to create a Token Factory with Ethereum — Part 1","description":"Create and Deploy a Token with Ethereum","link":"/tutorials/token_factory_1.html","tags":["token","ethereum"]},{"name":"How to create a Token Factory with Ethereum — Part 2","description":"Create a DApp that can deploy Tokens on the fly","link":"/tutorials/token_factory_2.html","tags":["token","ethereum","client-side-deployment"]},{"name":"How to deploy to a testnet with Infura","description":"Deploy and interact with your Dapp on a testnet with the use of Infura","link":"/tutorials/infura_guide.html","tags":["ethereum","deployment","testnet"]}],"versions":{"latest":{"label":"stable (v4)","url":"https://embark.embarklabs.io/docs"},"3.2":{"label":"v3.2","url":"https://5ca4e0fdb29712000adde37f--embark-site-versions.netlify.com/docs/"}}}},"excerpt":"","more":""},{"title":"Using Infura","_content":"\nTo deploy to a test network (or even the mainnet), you usually have [to synchronize a blockchain node yourself](/docs/blockchain_configuration.html#Testnet-configuration) to be able to connect.\n\nThere is thankfully another alternative to save time and it is to use something like [Infura](https://infura.io/), that has already synchronized nodes to which you can connect to.\n\nThey offer nodes for the most popular testnets like Ropsten, Kovan and Rinkeby and also for the main network.\n\n### Registration\n\nTo start you will need to first register with Infura. Go to [https://infura.io/register](https://infura.io/register) and register.\n\nAfterwards, you will get an API KEY by email. Save this key, you will need it to configure Infura. Careful, it is private.\n\n![Screenshot](infura_guide/api-keys.png)\n\n### Account Configuration\n\nTo deploy to Infura, we need to configure Embark with an account containing funds.\n\nIn this example we will use a mnemonic.\nIt is also possible to use a private key (the documentation for the accounts functionality can be found [here](/docs/contracts.html#Using-accounts-in-a-wallet)).\n\nMake sure to read our recommendations on how to make sure your credentials stay secure [here](/docs/contracts_deployment.html#Deploying-to-Mainnet).\n\nEdit your contract configuration (usually found at `config/contracts.js`) and add a new environment, which we will name `infura`:\n\n
\n\ninfura: {\n  deployment:{\n    accounts: [\n      {\n        mnemonic: process.env.yourMnemonic\n      }\n    ]\n  }\n}\n
\n\nMake sure the account has funds in the network you are deploying to. Most testnets have faucets.\nFor example you can find a faucet for Rinkeby [here](https://faucet.rinkeby.io/).\n\n### Adding Infura\n\nNow we will add the infura endpoint to our configuration. **You should replace the key in the `host` field with your own.**\nWe will use Rinkeby for this example. You can specify the network as `.infura.io`.\n\n
\n\ninfura: {\n  deployment:{\n    accounts: [\n      {\n        mnemonic: process.env.yourMnemonic\n      }\n    ],\n    host: \"rinkeby.infura.io/YOUR_KEY\",\n    port: false,\n    protocol: 'https'\n    type: \"rpc\"\n  }\n}\n
\n\n### Deploying\n\nNow to deploy, all you need to do is run `embark run infura` and Embark will deploy using Infura!\n\n![Screenshot](infura_guide/lift-off.jpg)\n","source":"tutorials/infura_guide.md","raw":"title: Using Infura\n---\n\nTo deploy to a test network (or even the mainnet), you usually have [to synchronize a blockchain node yourself](/docs/blockchain_configuration.html#Testnet-configuration) to be able to connect.\n\nThere is thankfully another alternative to save time and it is to use something like [Infura](https://infura.io/), that has already synchronized nodes to which you can connect to.\n\nThey offer nodes for the most popular testnets like Ropsten, Kovan and Rinkeby and also for the main network.\n\n### Registration\n\nTo start you will need to first register with Infura. Go to [https://infura.io/register](https://infura.io/register) and register.\n\nAfterwards, you will get an API KEY by email. Save this key, you will need it to configure Infura. Careful, it is private.\n\n![Screenshot](infura_guide/api-keys.png)\n\n### Account Configuration\n\nTo deploy to Infura, we need to configure Embark with an account containing funds.\n\nIn this example we will use a mnemonic.\nIt is also possible to use a private key (the documentation for the accounts functionality can be found [here](/docs/contracts.html#Using-accounts-in-a-wallet)).\n\nMake sure to read our recommendations on how to make sure your credentials stay secure [here](/docs/contracts_deployment.html#Deploying-to-Mainnet).\n\nEdit your contract configuration (usually found at `config/contracts.js`) and add a new environment, which we will name `infura`:\n\n
\n\ninfura: {\n  deployment:{\n    accounts: [\n      {\n        mnemonic: process.env.yourMnemonic\n      }\n    ]\n  }\n}\n
\n\nMake sure the account has funds in the network you are deploying to. Most testnets have faucets.\nFor example you can find a faucet for Rinkeby [here](https://faucet.rinkeby.io/).\n\n### Adding Infura\n\nNow we will add the infura endpoint to our configuration. **You should replace the key in the `host` field with your own.**\nWe will use Rinkeby for this example. You can specify the network as `.infura.io`.\n\n
\n\ninfura: {\n  deployment:{\n    accounts: [\n      {\n        mnemonic: process.env.yourMnemonic\n      }\n    ],\n    host: \"rinkeby.infura.io/YOUR_KEY\",\n    port: false,\n    protocol: 'https'\n    type: \"rpc\"\n  }\n}\n
\n\n### Deploying\n\nNow to deploy, all you need to do is run `embark run infura` and Embark will deploy using Infura!\n\n![Screenshot](infura_guide/lift-off.jpg)\n","date":"2020-01-17T19:00:03.904Z","updated":"2020-01-17T19:00:03.904Z","path":"tutorials/infura_guide.html","comments":1,"layout":"page","_id":"ck5ijm3s500227hegfai76hxj","content":"

To deploy to a test network (or even the mainnet), you usually have to synchronize a blockchain node yourself to be able to connect.

\n

There is thankfully another alternative to save time and it is to use something like Infura, that has already synchronized nodes to which you can connect to.

\n

They offer nodes for the most popular testnets like Ropsten, Kovan and Rinkeby and also for the main network.

\n

Registration

To start you will need to first register with Infura. Go to https://infura.io/register and register.

\n

Afterwards, you will get an API KEY by email. Save this key, you will need it to configure Infura. Careful, it is private.

\n

\"Screenshot\"

\n

Account Configuration

To deploy to Infura, we need to configure Embark with an account containing funds.

\n

In this example we will use a mnemonic.
It is also possible to use a private key (the documentation for the accounts functionality can be found here).

\n

Make sure to read our recommendations on how to make sure your credentials stay secure here.

\n

Edit your contract configuration (usually found at config/contracts.js) and add a new environment, which we will name infura:

\n
\n\ninfura: {\n  deployment:{\n    accounts: [\n      {\n        mnemonic: process.env.yourMnemonic\n      }\n    ]\n  }\n}\n
\n\n

Make sure the account has funds in the network you are deploying to. Most testnets have faucets.
For example you can find a faucet for Rinkeby here.

\n

Adding Infura

Now we will add the infura endpoint to our configuration. You should replace the key in the host field with your own.
We will use Rinkeby for this example. You can specify the network as <network>.infura.io.

\n
\n\ninfura: {\n  deployment:{\n    accounts: [\n      {\n        mnemonic: process.env.yourMnemonic\n      }\n    ],\n    host: \"rinkeby.infura.io/YOUR_KEY\",\n    port: false,\n    protocol: 'https'\n    type: \"rpc\"\n  }\n}\n
\n\n

Deploying

Now to deploy, all you need to do is run embark run infura and Embark will deploy using Infura!

\n

\"Screenshot\"

\n","site":{"data":{"authors":{"iuri_matias":{"name":"Iuri Matias","twitter":"iurimatias","image":"https://pbs.twimg.com/profile_images/928272512181563392/iDJdvy2k_400x400.jpg"},"pascal_precht":{"name":"Pascal Precht","twitter":"pascalprecht","image":"https://pbs.twimg.com/profile_images/993785060733194241/p3oAIMDP_400x400.jpg"},"anthony_laibe":{"name":"Anthony Laibe","twitter":"a_laibe","image":"https://pbs.twimg.com/profile_images/257742900/13168239_400x400.jpg"},"jonathan_rainville":{"name":"Jonathan Rainville","twitter":"ShyolGhul","image":"https://pbs.twimg.com/profile_images/993873866878570496/-aE4byjj_400x400.jpg"},"andre_medeiros":{"name":"Andre Medeiros","twitter":"superdealloc","image":"https://pbs.twimg.com/profile_images/965722487735701504/m58KNgWN_400x400.jpg"},"eric_mastro":{"name":"Eric Mastro","twitter":"ericmastro","image":"https://avatars1.githubusercontent.com/u/5089238?s=460&v=4"},"michael_bradley":{"name":"Michael Bradley","image":"https://avatars3.githubusercontent.com/u/194260?s=460&v=4"},"richard_ramos":{"name":"Richard Ramos","twitter":"richardramos_me","image":"https://pbs.twimg.com/profile_images/1063160577973866496/aM313uHG_400x400.jpg"},"jonny_zerah":{"name":"Jonny Zerah","twitter":"jonnyzerah","image":"https://pbs.twimg.com/profile_images/1043774340490248192/gI9aGy17_400x400.jpg"},"robin_percy":{"name":"Robin Percy","twitter":"rbin","image":"https://avatars1.githubusercontent.com/u/29288325?s=400&v=4"}},"categories":{"tutorials":"Tutorials","announcements":"Announcements"},"languages":{"en":"English"},"plugins":[{"name":"embark-bamboo","description":"plugins_page.plugins.bamboo.desc","link":"https://www.npmjs.com/package/embark-bamboo","thumbnail":"bamboo.png","tags":["language","smart-contracts"]},{"name":"embark-solc","description":"plugins_page.plugins.solc.desc","link":"https://www.npmjs.com/package/embark-solc","thumbnail":"solidity.png","tags":["solidity","language","smart-contracts"]},{"name":"embark-solium","description":"plugins_page.plugins.solium.desc","link":"https://www.npmjs.com/package/embark-solium","thumbnail":"solium.png","tags":["linter","solidity","solium"]},{"name":"embark-etherscan-verifier","description":"plugins_page.plugins.verifier.desc","link":"https://www.npmjs.com/package/embark-etherscan-verifier","tags":["solidity","etherscan","smart-contracts"]},{"name":"embark-status","description":"plugins_page.plugins.status.desc","link":"https://www.npmjs.com/package/embark-status-plugin","thumbnail":"status.png","tags":["status","mobile"]},{"name":"embark-remix","description":"plugins_page.plugins.remix.desc","link":"https://www.npmjs.com/package/embark-remix","thumbnail":"remix.png","tags":["remix","debugger"]},{"name":"embark-slither","description":"plugins_page.plugins.slither.desc","link":"https://www.npmjs.com/package/embark-slither","tags":["solidity"]},{"name":"embark-snark","description":"plugins_page.plugins.snark.desc","link":"https://www.npmjs.com/package/embark-snark","tags":["snark"]},{"name":"embark-fortune","description":"plugins_page.plugins.fortune.desc","link":"https://www.npmjs.com/package/embark-fortune","thumbnail":"fortune.jpg","tags":["fun"]},{"name":"embark-pug","description":"plugins_page.plugins.pug.desc","link":"https://www.npmjs.com/package/embark-pug","legacy":true,"thumbnail":"pug.png","tags":["pug","jade","templates"]},{"name":"embark-haml","description":"plugins_page.plugins.haml.desc","link":"https://www.npmjs.com/package/embark-haml","legacy":true,"thumbnail":"haml.png","tags":["haml","templates"]},{"name":"embark-mythx","description":"plugins_page.plugins.mythx.desc","link":"https://www.npmjs.com/package/embark-mythx","thumbnail":"mythx.png","tags":["mythx","smart-contracts"]}],"menu":{"docs":"/docs/","plugins":"/plugins/","chat":"/chat/","blog":"/news/"},"sidebar":{"docs":{"getting_started":{"overview":"overview.html","installation":"installation.html","faq":"faq.html"},"general_usage":{"creating_project":"create_project.html","structure":"structure.html","running_apps":"running_apps.html","dashboard":"dashboard.html","using_the_console":"using_the_console.html","environments":"environments.html","configuration":"configuration.html","pipeline_and_webpack":"pipeline_and_webpack.html","javascript_usage":"javascript_usage.html"},"smart_contracts":{"contracts_configuration":"contracts_configuration.html","contracts_deployment":"contracts_deployment.html","contracts_imports":"contracts_imports.html","contracts_testing":"contracts_testing.html","contracts_javascript":"contracts_javascript.html"},"blockchain_node":{"blockchain_configuration":"blockchain_configuration.html","blockchain_accounts_configuration":"blockchain_accounts_configuration.html"},"storage":{"storage_configuration":"storage_configuration.html","storage_deployment":"storage_deployment.html","storage_javascript":"storage_javascript.html"},"messages":{"messages_configuration":"messages_configuration.html","messages_javascript":"messages_javascript.html"},"naming":{"naming_configuration":"naming_configuration.html","naming_javascript":"naming_javascript.html"},"plugins":{"installing_a_plugin":"installing_plugins.html","creating_a_plugin":"creating_plugins.html","plugin_reference":"plugin_reference.html"},"cockpit":{"cockpit_introduction":"cockpit_introduction.html","cockpit_dashboard":"cockpit_dashboard.html","cockpit_deployment":"cockpit_deployment.html","cockpit_explorer":"cockpit_explorer.html","cockpit_editor":"cockpit_editor.html","cockpit_debugger":"cockpit_debugger.html"},"reference":{"embark_commands":"embark_commands.html"},"miscellaneous":{"migrating_from_3":"migrating_from_3.x.html","troubleshooting":"troubleshooting.html","contributing":"contributing.html"}}},"templates":[{"name":"Vyper Template","description":"Template to demonstrate the use of the Vyper contracts","install":"embark new AppName --template vyper","thumbnail":"vyper.png","link":"https://github.com/embarklabs/embark-vyper-template","tags":["vyper","contracts"]},{"name":"Embark Demo React Template","description":"A React Application showcasing Embark's functionality","install":"embark demo","thumbnail":"react.png","link":"https://embark.embarklabs.io/docs/create_project.html#Creating-a-Demo-Project","tags":["react","contracts","whisper","ipfs"]},{"name":"Typescript Template","description":"Template with Typescript support pre-configured","thumbnail":"typescript.png","install":"embark new AppName --template typescript","link":"https://github.com/embarklabs/embark-typescript-template","tags":["typescript","frontend"]},{"name":"Vue.js Template","description":"Ready to use Template for using Embark with vue.js","thumbnail":"vuejs.png","install":"embark new AppName --template vue","link":"https://github.com/embarklabs/embark-vue-template","tags":["vue.js","frontend"]},{"name":"ethvtx Template","description":"Demo app for ethvtx, an Ethereum-Ready & Framework-Agnostic Redux configuration","thumbnail":"vortex.png","install":"embark new AppName --template Horyus/ethvtx_embark","link":"https://github.com/Horyus/ethvtx_embark","tags":["react"]},{"name":"Bamboo Template","description":"Template to demonstrate use of the Bamboo contracts","install":"embark new AppName --template bamboo","thumbnail":"bamboo.png","link":"https://github.com/embarklabs/embark-bamboo-template","tags":["bamboo","contracts"]},{"name":"Solidity Gas Golfing","description":"Boilerplate and tests for the first Solidity Gas Golfing Contest","thumbnail":"sggc.png","install":"embark new AppName --template embarklabs/sggc","link":"https://github.com/embarklabs/sggc","tags":["solidity","tests","fun"]}],"tutorials":[{"name":"How to create a Token Factory with Ethereum — Part 1","description":"Create and Deploy a Token with Ethereum","link":"/tutorials/token_factory_1.html","tags":["token","ethereum"]},{"name":"How to create a Token Factory with Ethereum — Part 2","description":"Create a DApp that can deploy Tokens on the fly","link":"/tutorials/token_factory_2.html","tags":["token","ethereum","client-side-deployment"]},{"name":"How to deploy to a testnet with Infura","description":"Deploy and interact with your Dapp on a testnet with the use of Infura","link":"/tutorials/infura_guide.html","tags":["ethereum","deployment","testnet"]}],"versions":{"latest":{"label":"stable (v4)","url":"https://embark.embarklabs.io/docs"},"3.2":{"label":"v3.2","url":"https://5ca4e0fdb29712000adde37f--embark-site-versions.netlify.com/docs/"}}}},"excerpt":"","more":"

To deploy to a test network (or even the mainnet), you usually have to synchronize a blockchain node yourself to be able to connect.

\n

There is thankfully another alternative to save time and it is to use something like Infura, that has already synchronized nodes to which you can connect to.

\n

They offer nodes for the most popular testnets like Ropsten, Kovan and Rinkeby and also for the main network.

\n

Registration

To start you will need to first register with Infura. Go to https://infura.io/register and register.

\n

Afterwards, you will get an API KEY by email. Save this key, you will need it to configure Infura. Careful, it is private.

\n

\"Screenshot\"

\n

Account Configuration

To deploy to Infura, we need to configure Embark with an account containing funds.

\n

In this example we will use a mnemonic.
It is also possible to use a private key (the documentation for the accounts functionality can be found here).

\n

Make sure to read our recommendations on how to make sure your credentials stay secure here.

\n

Edit your contract configuration (usually found at config/contracts.js) and add a new environment, which we will name infura:

\n
\n\ninfura: {\n  deployment:{\n    accounts: [\n      {\n        mnemonic: process.env.yourMnemonic\n      }\n    ]\n  }\n}\n
\n\n

Make sure the account has funds in the network you are deploying to. Most testnets have faucets.
For example you can find a faucet for Rinkeby here.

\n

Adding Infura

Now we will add the infura endpoint to our configuration. You should replace the key in the host field with your own.
We will use Rinkeby for this example. You can specify the network as <network>.infura.io.

\n
\n\ninfura: {\n  deployment:{\n    accounts: [\n      {\n        mnemonic: process.env.yourMnemonic\n      }\n    ],\n    host: \"rinkeby.infura.io/YOUR_KEY\",\n    port: false,\n    protocol: 'https'\n    type: \"rpc\"\n  }\n}\n
\n\n

Deploying

Now to deploy, all you need to do is run embark run infura and Embark will deploy using Infura!

\n

\"Screenshot\"

\n"},{"layout":"plugins","tagline":"Pick one and start right away.","title":"Templates","data":"templates","_content":"","source":"templates/index.md","raw":"layout: plugins\ntagline: 'Pick one and start right away.'\ntitle: Templates\ndata: templates\n---\n","date":"2020-01-17T19:00:03.900Z","updated":"2020-01-17T19:00:03.900Z","path":"templates/index.html","comments":1,"_id":"ck5ijm3s600237heg3zfh286o","content":"","site":{"data":{"authors":{"iuri_matias":{"name":"Iuri Matias","twitter":"iurimatias","image":"https://pbs.twimg.com/profile_images/928272512181563392/iDJdvy2k_400x400.jpg"},"pascal_precht":{"name":"Pascal Precht","twitter":"pascalprecht","image":"https://pbs.twimg.com/profile_images/993785060733194241/p3oAIMDP_400x400.jpg"},"anthony_laibe":{"name":"Anthony Laibe","twitter":"a_laibe","image":"https://pbs.twimg.com/profile_images/257742900/13168239_400x400.jpg"},"jonathan_rainville":{"name":"Jonathan Rainville","twitter":"ShyolGhul","image":"https://pbs.twimg.com/profile_images/993873866878570496/-aE4byjj_400x400.jpg"},"andre_medeiros":{"name":"Andre Medeiros","twitter":"superdealloc","image":"https://pbs.twimg.com/profile_images/965722487735701504/m58KNgWN_400x400.jpg"},"eric_mastro":{"name":"Eric Mastro","twitter":"ericmastro","image":"https://avatars1.githubusercontent.com/u/5089238?s=460&v=4"},"michael_bradley":{"name":"Michael Bradley","image":"https://avatars3.githubusercontent.com/u/194260?s=460&v=4"},"richard_ramos":{"name":"Richard Ramos","twitter":"richardramos_me","image":"https://pbs.twimg.com/profile_images/1063160577973866496/aM313uHG_400x400.jpg"},"jonny_zerah":{"name":"Jonny Zerah","twitter":"jonnyzerah","image":"https://pbs.twimg.com/profile_images/1043774340490248192/gI9aGy17_400x400.jpg"},"robin_percy":{"name":"Robin Percy","twitter":"rbin","image":"https://avatars1.githubusercontent.com/u/29288325?s=400&v=4"}},"categories":{"tutorials":"Tutorials","announcements":"Announcements"},"languages":{"en":"English"},"plugins":[{"name":"embark-bamboo","description":"plugins_page.plugins.bamboo.desc","link":"https://www.npmjs.com/package/embark-bamboo","thumbnail":"bamboo.png","tags":["language","smart-contracts"]},{"name":"embark-solc","description":"plugins_page.plugins.solc.desc","link":"https://www.npmjs.com/package/embark-solc","thumbnail":"solidity.png","tags":["solidity","language","smart-contracts"]},{"name":"embark-solium","description":"plugins_page.plugins.solium.desc","link":"https://www.npmjs.com/package/embark-solium","thumbnail":"solium.png","tags":["linter","solidity","solium"]},{"name":"embark-etherscan-verifier","description":"plugins_page.plugins.verifier.desc","link":"https://www.npmjs.com/package/embark-etherscan-verifier","tags":["solidity","etherscan","smart-contracts"]},{"name":"embark-status","description":"plugins_page.plugins.status.desc","link":"https://www.npmjs.com/package/embark-status-plugin","thumbnail":"status.png","tags":["status","mobile"]},{"name":"embark-remix","description":"plugins_page.plugins.remix.desc","link":"https://www.npmjs.com/package/embark-remix","thumbnail":"remix.png","tags":["remix","debugger"]},{"name":"embark-slither","description":"plugins_page.plugins.slither.desc","link":"https://www.npmjs.com/package/embark-slither","tags":["solidity"]},{"name":"embark-snark","description":"plugins_page.plugins.snark.desc","link":"https://www.npmjs.com/package/embark-snark","tags":["snark"]},{"name":"embark-fortune","description":"plugins_page.plugins.fortune.desc","link":"https://www.npmjs.com/package/embark-fortune","thumbnail":"fortune.jpg","tags":["fun"]},{"name":"embark-pug","description":"plugins_page.plugins.pug.desc","link":"https://www.npmjs.com/package/embark-pug","legacy":true,"thumbnail":"pug.png","tags":["pug","jade","templates"]},{"name":"embark-haml","description":"plugins_page.plugins.haml.desc","link":"https://www.npmjs.com/package/embark-haml","legacy":true,"thumbnail":"haml.png","tags":["haml","templates"]},{"name":"embark-mythx","description":"plugins_page.plugins.mythx.desc","link":"https://www.npmjs.com/package/embark-mythx","thumbnail":"mythx.png","tags":["mythx","smart-contracts"]}],"menu":{"docs":"/docs/","plugins":"/plugins/","chat":"/chat/","blog":"/news/"},"sidebar":{"docs":{"getting_started":{"overview":"overview.html","installation":"installation.html","faq":"faq.html"},"general_usage":{"creating_project":"create_project.html","structure":"structure.html","running_apps":"running_apps.html","dashboard":"dashboard.html","using_the_console":"using_the_console.html","environments":"environments.html","configuration":"configuration.html","pipeline_and_webpack":"pipeline_and_webpack.html","javascript_usage":"javascript_usage.html"},"smart_contracts":{"contracts_configuration":"contracts_configuration.html","contracts_deployment":"contracts_deployment.html","contracts_imports":"contracts_imports.html","contracts_testing":"contracts_testing.html","contracts_javascript":"contracts_javascript.html"},"blockchain_node":{"blockchain_configuration":"blockchain_configuration.html","blockchain_accounts_configuration":"blockchain_accounts_configuration.html"},"storage":{"storage_configuration":"storage_configuration.html","storage_deployment":"storage_deployment.html","storage_javascript":"storage_javascript.html"},"messages":{"messages_configuration":"messages_configuration.html","messages_javascript":"messages_javascript.html"},"naming":{"naming_configuration":"naming_configuration.html","naming_javascript":"naming_javascript.html"},"plugins":{"installing_a_plugin":"installing_plugins.html","creating_a_plugin":"creating_plugins.html","plugin_reference":"plugin_reference.html"},"cockpit":{"cockpit_introduction":"cockpit_introduction.html","cockpit_dashboard":"cockpit_dashboard.html","cockpit_deployment":"cockpit_deployment.html","cockpit_explorer":"cockpit_explorer.html","cockpit_editor":"cockpit_editor.html","cockpit_debugger":"cockpit_debugger.html"},"reference":{"embark_commands":"embark_commands.html"},"miscellaneous":{"migrating_from_3":"migrating_from_3.x.html","troubleshooting":"troubleshooting.html","contributing":"contributing.html"}}},"templates":[{"name":"Vyper Template","description":"Template to demonstrate the use of the Vyper contracts","install":"embark new AppName --template vyper","thumbnail":"vyper.png","link":"https://github.com/embarklabs/embark-vyper-template","tags":["vyper","contracts"]},{"name":"Embark Demo React Template","description":"A React Application showcasing Embark's functionality","install":"embark demo","thumbnail":"react.png","link":"https://embark.embarklabs.io/docs/create_project.html#Creating-a-Demo-Project","tags":["react","contracts","whisper","ipfs"]},{"name":"Typescript Template","description":"Template with Typescript support pre-configured","thumbnail":"typescript.png","install":"embark new AppName --template typescript","link":"https://github.com/embarklabs/embark-typescript-template","tags":["typescript","frontend"]},{"name":"Vue.js Template","description":"Ready to use Template for using Embark with vue.js","thumbnail":"vuejs.png","install":"embark new AppName --template vue","link":"https://github.com/embarklabs/embark-vue-template","tags":["vue.js","frontend"]},{"name":"ethvtx Template","description":"Demo app for ethvtx, an Ethereum-Ready & Framework-Agnostic Redux configuration","thumbnail":"vortex.png","install":"embark new AppName --template Horyus/ethvtx_embark","link":"https://github.com/Horyus/ethvtx_embark","tags":["react"]},{"name":"Bamboo Template","description":"Template to demonstrate use of the Bamboo contracts","install":"embark new AppName --template bamboo","thumbnail":"bamboo.png","link":"https://github.com/embarklabs/embark-bamboo-template","tags":["bamboo","contracts"]},{"name":"Solidity Gas Golfing","description":"Boilerplate and tests for the first Solidity Gas Golfing Contest","thumbnail":"sggc.png","install":"embark new AppName --template embarklabs/sggc","link":"https://github.com/embarklabs/sggc","tags":["solidity","tests","fun"]}],"tutorials":[{"name":"How to create a Token Factory with Ethereum — Part 1","description":"Create and Deploy a Token with Ethereum","link":"/tutorials/token_factory_1.html","tags":["token","ethereum"]},{"name":"How to create a Token Factory with Ethereum — Part 2","description":"Create a DApp that can deploy Tokens on the fly","link":"/tutorials/token_factory_2.html","tags":["token","ethereum","client-side-deployment"]},{"name":"How to deploy to a testnet with Infura","description":"Deploy and interact with your Dapp on a testnet with the use of Infura","link":"/tutorials/infura_guide.html","tags":["ethereum","deployment","testnet"]}],"versions":{"latest":{"label":"stable (v4)","url":"https://embark.embarklabs.io/docs"},"3.2":{"label":"v3.2","url":"https://5ca4e0fdb29712000adde37f--embark-site-versions.netlify.com/docs/"}}}},"excerpt":"","more":""},{"title":"Blockchain client configuration","layout":"docs","_content":"\nWhen in developing, to interact with a blockchain, it is necessary to use a local Ethereum node, either using a simulator or a client like Geth or Parity. In this guide we'll explore how to configure a blockchain client we want Embark to connect to. Embark uses the `blockchain.js` file inside the `./config` folder by default for blockchain related configurations. This [can be configured](/docs/configuration.html#config) to different locations if we want to.\n\nEmbark offers a lot of configuration options and most of them already come with a decent default so we can start right away.\n\n## Common Parameters\n\nHere are the common parameters. You will often need only a few of them to make your Embark node work.\n\nIf you want more configuration options, you can find them [here](/docs/blockchain_configuration.html#Advanced-parameters)\n\n```\nmodule.exports = {\n default: {\n enabled: true,\n client: \"geth\"\n },\n development: { \n clientConfig: {\n miningMode: 'dev'\n }\n },\n testnet: {\n endpoint: \"https://external-node.com\",\n accounts: [\n {\n mnemonic: \"12 word mnemonic\"\n }\n ]\n }\n}\n```\n\nSimilar to [configuring Smart Contracts](/docs/contracts_configuration.html), this config contains environments that help configuring certain parameters differently depending of the environment. You can read more about [environments here](https://embark.embarklabs.io/docs/environments.html).\n\n### Parameter descriptions\n\nMost of the options are self-explanatory, still, here are some brief descriptions:\n\nOption | Type: `default` | Value\n--- | --- | --- \n`enabled` | boolean: `true` | Whether or not to spawn an Ethereum node\n`client` | string: `geth` | Client to use for the Ethereum node. Currently supported: `geth` and `parity`\n`miningMode` | string: `dev` | The mining mode to use for the node.
`dev`: This is a special mode where the node uses a development account as defaultAccount. This account is already funded and transactions are faster.
`auto`: Uses a mining script to mine only when needed.
`always`: Miner is always on.
`off`: Turns off the miner\n`endpoint` | string | Endpoint to connect to. Works for external endpoints (like Infura) and local ones too (only for nodes started by `embark run`)\n`accounts` | array | Accounts array for the node and to deploy. When no account is given, defaults to one node account. For more details, go [here](/docs/blockchain_accounts_configuration.html)\n\n## Advanced parameters\n\nHere are all the parameters you can use to customize your node. Note that they all come with defaults that make it that you don't need to specify those.\n\nWe recommend putting those inside the `clientConfig` object a better structure.\n\nOption | Type: `default` | Value \n--- | --- | --- \n`rpcHost` | string: `localhost` | Host the RPC server listens to\n`rpcPort` | number: `8545` | Port the RPC server listens to\n`rpcCorsDomain` | object | The CORS domains the node accepts\n`rpcCorsDomain.auto` | | When set to true, Embark checks your other configurations to set the CORS domains. This only adds the required domains.\n`rpcCorsDomain.additionalCors` | | Manual list of CORS domains to accept. If `auto` is set to `true`, any URLs specified here will be applied *in addition to* those automatically added with `auto`.\n`wsRPC` | boolean: `true` | Whether or not to enable the Websocket server\n`wsOrigins` | object | Same as `rpcCorsDomain`, but for the Websocket server\n`wsHost` | string: `localhost` | Same as `rpcHost`, but for the Websocket server\n`wsPort` | number: `8546` | Same as `rpcPort`, but for the Websocket server\n`ethereumClientBin` | string: `geth` | Path to the client binary. By default, Embark uses the client name as an executable (if it is in the PATH)\n`datadir` | string | Directory where to put the Node's data (eg: keystores)\n`networkType` | string: `custom` | Can be: `testnet`, `rinkeby`, `kovan` or custom, in which case, it will use the specified `networkId`\n`networkId` | number: `1337` | Used when `networkType` is set as `custom`. [List of known network ids](https://github.com/ethereumbook/ethereumbook/blob/3e8cf74eb935d4be495f4306b73de027af95fd97/contrib/devp2p-protocol.asciidoc#known-current-network-ids)\n`nodiscover`| boolean: `true` | Disables the peer discovery mechanism when set to `true`\n`maxpeers` | number: `0` | Maximum number of network peers\n`proxy` | boolean: `true` | Whether or not Embark should use a proxy to add functionalities. This proxy is used by Embark to see the different transactions that go through, for example, and shows them to you.\n`targetGasLimit` | number | Artificial target gas floor for the blocks to mine\n`genesisBlock` | string | The genesis file to use to create the network. This file is used when creating the network. It tells the client the parameters to initiate the node with. You can read more on [genesis blocks here](https://arvanaghi.com/blog/explaining-the-genesis-block-in-ethereum/)\n\n{% notification info 'Using Parity and Metamask' %}\n\nParity has very strict CORS policies. In order to use it with Metamask (or any other browser extension), you need to add the extension's URL in the CORS.\n\nYou can do so by opening Metamask in its own tab. Then, copy the URL. It will look something like `chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn`.\n\nAfterwards, in your blockchain config, add it to `additionalCors` of `rpcCorsDomain` and `wsOrigins`.\n{% endnotification %}\n\n## Privatenet configuration\n\nA private network is really similar to using the development mode of a client. The biggest differences is that it does not come with a default pre-funded account and it will not use POA (proof of authority), meaning that blocks will need to be mined.\n\nLuckily, Embark has settings to limit the mining to a minimum so that everything can run smoothly while testing in a more realistic environment before going to a test network.\n\n### Privatenet parameters\n\nHere are common parameters for private net configurations:\n```\nprivatenet: {\n clientConfig: {\n miningMode: 'auto',\n genesisBlock: \"config/privatenet/genesis.json\"\n }\n accounts: [\n {\n nodeAccounts: true,\n password: \"config/privatenet/password\"\n }\n ]\n}\n```\n\nNote that we can always use the parameters we saw in the [Common parameters section](#Common-Parameters) to override the `default` parameters.\n\n### Parameter descriptions\n\nOption | Type: `value` | Description \n--- | --- | --- \n`miningMode` | string: `auto` | You need to set `miningMode` to `auto` or `always` so you don't use the development mode\n`genesisBlock` | string | File to start the chain in a clean state for your private network\n`accounts` | array | Array of accounts to connect to. Go to the [Accounts configuration](/docs/blockchain_accounts_configuration.html) page to learn more on accounts\n\n## Testnet configuration\n\nTest networks are networks that are public. Knowing that, if we want to connect to a node that we control, we will first need to synchronize it. This can take hours, as we need to download the blocks that we are missing from the other peers.\n\nThe big advantage of using a local synced node is that we have control over it and it preserves our privacy, as we aren't using a third party node. However, as mentioned, it takes a lot of time to synchronize a node and also requires a lot of computer resources, so keep it in mind if you want to go down that route.\n\n### Testnet parameters\n\n```\ntestnet: {\n networkType: \"testnet\",\n syncMode: \"light\",\n accounts: [\n {\n nodeAccounts: true,\n password: \"config/testnet/password\"\n }\n ]\n}\n```\n\nHere are the necessary parameters. Again, we can add more to override as you see fit.\n\n### Parameter descriptions\n\nOption | Type: `default` | Value \n--- | --- | --- \n`networkType` | string: `testnet` | Again, used to specify the network. `testnet` here represents Ropsten. You can change the network by using a `networkId` by changing `networkType` to `custom`\n`syncMode` | string | Blockchain sync mode\n`syncMode = 'light' `| | Light clients synchronize a bare minimum of data and fetch necessary data on-demand from the network. Much lower in storage, potentially higher in bandwidth\n`syncMode = 'fast'` | | Faster, but higher store\n`syncMode = 'full'`| | Normal sync\n`accounts` | array | Array of accounts to connect to. Go to the [Accounts configuration](/docs/blockchain_accounts_configuration.html) page to learn more on accounts\n\n## Mainnet configuration\n\nFinally, the main network, a.k.a. mainnet. It may come as no surprise, but to sync to the mainnet, the step and configurations are actually the same as for a [test network](#Testnet-configuration). The only major difference is that the `networkType` needs to be `custom` with the `networkId` set to `1`.\n\n```\nmainnet: {\n networkType: \"custom\",\n networkId: 1,\n syncMode: \"light\",\n accounts: [\n {\n nodeAccounts: true,\n password: \"config/mainnet/password\"\n }\n ]\n}\n```\n","source":"docs/blockchain_configuration.md","raw":"title: Blockchain client configuration\nlayout: docs\n---\n\nWhen in developing, to interact with a blockchain, it is necessary to use a local Ethereum node, either using a simulator or a client like Geth or Parity. In this guide we'll explore how to configure a blockchain client we want Embark to connect to. Embark uses the `blockchain.js` file inside the `./config` folder by default for blockchain related configurations. This [can be configured](/docs/configuration.html#config) to different locations if we want to.\n\nEmbark offers a lot of configuration options and most of them already come with a decent default so we can start right away.\n\n## Common Parameters\n\nHere are the common parameters. You will often need only a few of them to make your Embark node work.\n\nIf you want more configuration options, you can find them [here](/docs/blockchain_configuration.html#Advanced-parameters)\n\n```\nmodule.exports = {\n default: {\n enabled: true,\n client: \"geth\"\n },\n development: { \n clientConfig: {\n miningMode: 'dev'\n }\n },\n testnet: {\n endpoint: \"https://external-node.com\",\n accounts: [\n {\n mnemonic: \"12 word mnemonic\"\n }\n ]\n }\n}\n```\n\nSimilar to [configuring Smart Contracts](/docs/contracts_configuration.html), this config contains environments that help configuring certain parameters differently depending of the environment. You can read more about [environments here](https://embark.embarklabs.io/docs/environments.html).\n\n### Parameter descriptions\n\nMost of the options are self-explanatory, still, here are some brief descriptions:\n\nOption | Type: `default` | Value\n--- | --- | --- \n`enabled` | boolean: `true` | Whether or not to spawn an Ethereum node\n`client` | string: `geth` | Client to use for the Ethereum node. Currently supported: `geth` and `parity`\n`miningMode` | string: `dev` | The mining mode to use for the node.
`dev`: This is a special mode where the node uses a development account as defaultAccount. This account is already funded and transactions are faster.
`auto`: Uses a mining script to mine only when needed.
`always`: Miner is always on.
`off`: Turns off the miner\n`endpoint` | string | Endpoint to connect to. Works for external endpoints (like Infura) and local ones too (only for nodes started by `embark run`)\n`accounts` | array | Accounts array for the node and to deploy. When no account is given, defaults to one node account. For more details, go [here](/docs/blockchain_accounts_configuration.html)\n\n## Advanced parameters\n\nHere are all the parameters you can use to customize your node. Note that they all come with defaults that make it that you don't need to specify those.\n\nWe recommend putting those inside the `clientConfig` object a better structure.\n\nOption | Type: `default` | Value \n--- | --- | --- \n`rpcHost` | string: `localhost` | Host the RPC server listens to\n`rpcPort` | number: `8545` | Port the RPC server listens to\n`rpcCorsDomain` | object | The CORS domains the node accepts\n`rpcCorsDomain.auto` | | When set to true, Embark checks your other configurations to set the CORS domains. This only adds the required domains.\n`rpcCorsDomain.additionalCors` | | Manual list of CORS domains to accept. If `auto` is set to `true`, any URLs specified here will be applied *in addition to* those automatically added with `auto`.\n`wsRPC` | boolean: `true` | Whether or not to enable the Websocket server\n`wsOrigins` | object | Same as `rpcCorsDomain`, but for the Websocket server\n`wsHost` | string: `localhost` | Same as `rpcHost`, but for the Websocket server\n`wsPort` | number: `8546` | Same as `rpcPort`, but for the Websocket server\n`ethereumClientBin` | string: `geth` | Path to the client binary. By default, Embark uses the client name as an executable (if it is in the PATH)\n`datadir` | string | Directory where to put the Node's data (eg: keystores)\n`networkType` | string: `custom` | Can be: `testnet`, `rinkeby`, `kovan` or custom, in which case, it will use the specified `networkId`\n`networkId` | number: `1337` | Used when `networkType` is set as `custom`. [List of known network ids](https://github.com/ethereumbook/ethereumbook/blob/3e8cf74eb935d4be495f4306b73de027af95fd97/contrib/devp2p-protocol.asciidoc#known-current-network-ids)\n`nodiscover`| boolean: `true` | Disables the peer discovery mechanism when set to `true`\n`maxpeers` | number: `0` | Maximum number of network peers\n`proxy` | boolean: `true` | Whether or not Embark should use a proxy to add functionalities. This proxy is used by Embark to see the different transactions that go through, for example, and shows them to you.\n`targetGasLimit` | number | Artificial target gas floor for the blocks to mine\n`genesisBlock` | string | The genesis file to use to create the network. This file is used when creating the network. It tells the client the parameters to initiate the node with. You can read more on [genesis blocks here](https://arvanaghi.com/blog/explaining-the-genesis-block-in-ethereum/)\n\n{% notification info 'Using Parity and Metamask' %}\n\nParity has very strict CORS policies. In order to use it with Metamask (or any other browser extension), you need to add the extension's URL in the CORS.\n\nYou can do so by opening Metamask in its own tab. Then, copy the URL. It will look something like `chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn`.\n\nAfterwards, in your blockchain config, add it to `additionalCors` of `rpcCorsDomain` and `wsOrigins`.\n{% endnotification %}\n\n## Privatenet configuration\n\nA private network is really similar to using the development mode of a client. The biggest differences is that it does not come with a default pre-funded account and it will not use POA (proof of authority), meaning that blocks will need to be mined.\n\nLuckily, Embark has settings to limit the mining to a minimum so that everything can run smoothly while testing in a more realistic environment before going to a test network.\n\n### Privatenet parameters\n\nHere are common parameters for private net configurations:\n```\nprivatenet: {\n clientConfig: {\n miningMode: 'auto',\n genesisBlock: \"config/privatenet/genesis.json\"\n }\n accounts: [\n {\n nodeAccounts: true,\n password: \"config/privatenet/password\"\n }\n ]\n}\n```\n\nNote that we can always use the parameters we saw in the [Common parameters section](#Common-Parameters) to override the `default` parameters.\n\n### Parameter descriptions\n\nOption | Type: `value` | Description \n--- | --- | --- \n`miningMode` | string: `auto` | You need to set `miningMode` to `auto` or `always` so you don't use the development mode\n`genesisBlock` | string | File to start the chain in a clean state for your private network\n`accounts` | array | Array of accounts to connect to. Go to the [Accounts configuration](/docs/blockchain_accounts_configuration.html) page to learn more on accounts\n\n## Testnet configuration\n\nTest networks are networks that are public. Knowing that, if we want to connect to a node that we control, we will first need to synchronize it. This can take hours, as we need to download the blocks that we are missing from the other peers.\n\nThe big advantage of using a local synced node is that we have control over it and it preserves our privacy, as we aren't using a third party node. However, as mentioned, it takes a lot of time to synchronize a node and also requires a lot of computer resources, so keep it in mind if you want to go down that route.\n\n### Testnet parameters\n\n```\ntestnet: {\n networkType: \"testnet\",\n syncMode: \"light\",\n accounts: [\n {\n nodeAccounts: true,\n password: \"config/testnet/password\"\n }\n ]\n}\n```\n\nHere are the necessary parameters. Again, we can add more to override as you see fit.\n\n### Parameter descriptions\n\nOption | Type: `default` | Value \n--- | --- | --- \n`networkType` | string: `testnet` | Again, used to specify the network. `testnet` here represents Ropsten. You can change the network by using a `networkId` by changing `networkType` to `custom`\n`syncMode` | string | Blockchain sync mode\n`syncMode = 'light' `| | Light clients synchronize a bare minimum of data and fetch necessary data on-demand from the network. Much lower in storage, potentially higher in bandwidth\n`syncMode = 'fast'` | | Faster, but higher store\n`syncMode = 'full'`| | Normal sync\n`accounts` | array | Array of accounts to connect to. Go to the [Accounts configuration](/docs/blockchain_accounts_configuration.html) page to learn more on accounts\n\n## Mainnet configuration\n\nFinally, the main network, a.k.a. mainnet. It may come as no surprise, but to sync to the mainnet, the step and configurations are actually the same as for a [test network](#Testnet-configuration). The only major difference is that the `networkType` needs to be `custom` with the `networkId` set to `1`.\n\n```\nmainnet: {\n networkType: \"custom\",\n networkId: 1,\n syncMode: \"light\",\n accounts: [\n {\n nodeAccounts: true,\n password: \"config/mainnet/password\"\n }\n ]\n}\n```\n","date":"2020-01-19T20:56:53.007Z","updated":"2020-01-19T20:56:53.007Z","path":"docs/blockchain_configuration.html","_id":"ck5ijm3ts00257hegda3sa842","comments":1,"content":"

When in developing, to interact with a blockchain, it is necessary to use a local Ethereum node, either using a simulator or a client like Geth or Parity. In this guide we’ll explore how to configure a blockchain client we want Embark to connect to. Embark uses the blockchain.js file inside the ./config folder by default for blockchain related configurations. This can be configured to different locations if we want to.

\n

Embark offers a lot of configuration options and most of them already come with a decent default so we can start right away.

\n

Common Parameters

Here are the common parameters. You will often need only a few of them to make your Embark node work.

\n

If you want more configuration options, you can find them here

\n
module.exports = {
default: {
enabled: true,
client: "geth"
},
development: {
clientConfig: {
miningMode: 'dev'
}
},
testnet: {
endpoint: "https://external-node.com",
accounts: [
{
mnemonic: "12 word mnemonic"
}
]
}
}
\n\n

Similar to configuring Smart Contracts, this config contains environments that help configuring certain parameters differently depending of the environment. You can read more about environments here.

\n

Parameter descriptions

Most of the options are self-explanatory, still, here are some brief descriptions:

\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
OptionType: defaultValue
enabledboolean: trueWhether or not to spawn an Ethereum node
clientstring: gethClient to use for the Ethereum node. Currently supported: geth and parity
miningModestring: devThe mining mode to use for the node.
dev: This is a special mode where the node uses a development account as defaultAccount. This account is already funded and transactions are faster.
auto: Uses a mining script to mine only when needed.
always: Miner is always on.
off: Turns off the miner
endpointstringEndpoint to connect to. Works for external endpoints (like Infura) and local ones too (only for nodes started by embark run)
accountsarrayAccounts array for the node and to deploy. When no account is given, defaults to one node account. For more details, go here
\n

Advanced parameters

Here are all the parameters you can use to customize your node. Note that they all come with defaults that make it that you don’t need to specify those.

\n

We recommend putting those inside the clientConfig object a better structure.

\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
OptionType: defaultValue
rpcHoststring: localhostHost the RPC server listens to
rpcPortnumber: 8545Port the RPC server listens to
rpcCorsDomainobjectThe CORS domains the node accepts
rpcCorsDomain.autoWhen set to true, Embark checks your other configurations to set the CORS domains. This only adds the required domains.
rpcCorsDomain.additionalCorsManual list of CORS domains to accept. If auto is set to true, any URLs specified here will be applied in addition to those automatically added with auto.
wsRPCboolean: trueWhether or not to enable the Websocket server
wsOriginsobjectSame as rpcCorsDomain, but for the Websocket server
wsHoststring: localhostSame as rpcHost, but for the Websocket server
wsPortnumber: 8546Same as rpcPort, but for the Websocket server
ethereumClientBinstring: gethPath to the client binary. By default, Embark uses the client name as an executable (if it is in the PATH)
datadirstringDirectory where to put the Node’s data (eg: keystores)
networkTypestring: customCan be: testnet, rinkeby, kovan or custom, in which case, it will use the specified networkId
networkIdnumber: 1337Used when networkType is set as custom. List of known network ids
nodiscoverboolean: trueDisables the peer discovery mechanism when set to true
maxpeersnumber: 0Maximum number of network peers
proxyboolean: trueWhether or not Embark should use a proxy to add functionalities. This proxy is used by Embark to see the different transactions that go through, for example, and shows them to you.
targetGasLimitnumberArtificial target gas floor for the blocks to mine
genesisBlockstringThe genesis file to use to create the network. This file is used when creating the network. It tells the client the parameters to initiate the node with. You can read more on genesis blocks here
\n
\n

Using Parity and Metamask

\n

Parity has very strict CORS policies. In order to use it with Metamask (or any other browser extension), you need to add the extension’s URL in the CORS.

\n

You can do so by opening Metamask in its own tab. Then, copy the URL. It will look something like chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn.

\n

Afterwards, in your blockchain config, add it to additionalCors of rpcCorsDomain and wsOrigins.

\n

\n
\n\n\n\n

Privatenet configuration

A private network is really similar to using the development mode of a client. The biggest differences is that it does not come with a default pre-funded account and it will not use POA (proof of authority), meaning that blocks will need to be mined.

\n

Luckily, Embark has settings to limit the mining to a minimum so that everything can run smoothly while testing in a more realistic environment before going to a test network.

\n

Privatenet parameters

Here are common parameters for private net configurations:

\n
privatenet: {
clientConfig: {
miningMode: 'auto',
genesisBlock: "config/privatenet/genesis.json"
}
accounts: [
{
nodeAccounts: true,
password: "config/privatenet/password"
}
]
}
\n\n

Note that we can always use the parameters we saw in the Common parameters section to override the default parameters.

\n

Parameter descriptions

\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
OptionType: valueDescription
miningModestring: autoYou need to set miningMode to auto or always so you don’t use the development mode
genesisBlockstringFile to start the chain in a clean state for your private network
accountsarrayArray of accounts to connect to. Go to the Accounts configuration page to learn more on accounts
\n

Testnet configuration

Test networks are networks that are public. Knowing that, if we want to connect to a node that we control, we will first need to synchronize it. This can take hours, as we need to download the blocks that we are missing from the other peers.

\n

The big advantage of using a local synced node is that we have control over it and it preserves our privacy, as we aren’t using a third party node. However, as mentioned, it takes a lot of time to synchronize a node and also requires a lot of computer resources, so keep it in mind if you want to go down that route.

\n

Testnet parameters

testnet: {
networkType: "testnet",
syncMode: "light",
accounts: [
{
nodeAccounts: true,
password: "config/testnet/password"
}
]
}
\n\n

Here are the necessary parameters. Again, we can add more to override as you see fit.

\n

Parameter descriptions

\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
OptionType: defaultValue
networkTypestring: testnetAgain, used to specify the network. testnet here represents Ropsten. You can change the network by using a networkId by changing networkType to custom
syncModestringBlockchain sync mode
syncMode = 'light'Light clients synchronize a bare minimum of data and fetch necessary data on-demand from the network. Much lower in storage, potentially higher in bandwidth
syncMode = 'fast'Faster, but higher store
syncMode = 'full'Normal sync
accountsarrayArray of accounts to connect to. Go to the Accounts configuration page to learn more on accounts
\n

Mainnet configuration

Finally, the main network, a.k.a. mainnet. It may come as no surprise, but to sync to the mainnet, the step and configurations are actually the same as for a test network. The only major difference is that the networkType needs to be custom with the networkId set to 1.

\n
mainnet: {
networkType: "custom",
networkId: 1,
syncMode: "light",
accounts: [
{
nodeAccounts: true,
password: "config/mainnet/password"
}
]
}
\n","site":{"data":{"authors":{"iuri_matias":{"name":"Iuri Matias","twitter":"iurimatias","image":"https://pbs.twimg.com/profile_images/928272512181563392/iDJdvy2k_400x400.jpg"},"pascal_precht":{"name":"Pascal Precht","twitter":"pascalprecht","image":"https://pbs.twimg.com/profile_images/993785060733194241/p3oAIMDP_400x400.jpg"},"anthony_laibe":{"name":"Anthony Laibe","twitter":"a_laibe","image":"https://pbs.twimg.com/profile_images/257742900/13168239_400x400.jpg"},"jonathan_rainville":{"name":"Jonathan Rainville","twitter":"ShyolGhul","image":"https://pbs.twimg.com/profile_images/993873866878570496/-aE4byjj_400x400.jpg"},"andre_medeiros":{"name":"Andre Medeiros","twitter":"superdealloc","image":"https://pbs.twimg.com/profile_images/965722487735701504/m58KNgWN_400x400.jpg"},"eric_mastro":{"name":"Eric Mastro","twitter":"ericmastro","image":"https://avatars1.githubusercontent.com/u/5089238?s=460&v=4"},"michael_bradley":{"name":"Michael Bradley","image":"https://avatars3.githubusercontent.com/u/194260?s=460&v=4"},"richard_ramos":{"name":"Richard Ramos","twitter":"richardramos_me","image":"https://pbs.twimg.com/profile_images/1063160577973866496/aM313uHG_400x400.jpg"},"jonny_zerah":{"name":"Jonny Zerah","twitter":"jonnyzerah","image":"https://pbs.twimg.com/profile_images/1043774340490248192/gI9aGy17_400x400.jpg"},"robin_percy":{"name":"Robin Percy","twitter":"rbin","image":"https://avatars1.githubusercontent.com/u/29288325?s=400&v=4"}},"categories":{"tutorials":"Tutorials","announcements":"Announcements"},"languages":{"en":"English"},"plugins":[{"name":"embark-bamboo","description":"plugins_page.plugins.bamboo.desc","link":"https://www.npmjs.com/package/embark-bamboo","thumbnail":"bamboo.png","tags":["language","smart-contracts"]},{"name":"embark-solc","description":"plugins_page.plugins.solc.desc","link":"https://www.npmjs.com/package/embark-solc","thumbnail":"solidity.png","tags":["solidity","language","smart-contracts"]},{"name":"embark-solium","description":"plugins_page.plugins.solium.desc","link":"https://www.npmjs.com/package/embark-solium","thumbnail":"solium.png","tags":["linter","solidity","solium"]},{"name":"embark-etherscan-verifier","description":"plugins_page.plugins.verifier.desc","link":"https://www.npmjs.com/package/embark-etherscan-verifier","tags":["solidity","etherscan","smart-contracts"]},{"name":"embark-status","description":"plugins_page.plugins.status.desc","link":"https://www.npmjs.com/package/embark-status-plugin","thumbnail":"status.png","tags":["status","mobile"]},{"name":"embark-remix","description":"plugins_page.plugins.remix.desc","link":"https://www.npmjs.com/package/embark-remix","thumbnail":"remix.png","tags":["remix","debugger"]},{"name":"embark-slither","description":"plugins_page.plugins.slither.desc","link":"https://www.npmjs.com/package/embark-slither","tags":["solidity"]},{"name":"embark-snark","description":"plugins_page.plugins.snark.desc","link":"https://www.npmjs.com/package/embark-snark","tags":["snark"]},{"name":"embark-fortune","description":"plugins_page.plugins.fortune.desc","link":"https://www.npmjs.com/package/embark-fortune","thumbnail":"fortune.jpg","tags":["fun"]},{"name":"embark-pug","description":"plugins_page.plugins.pug.desc","link":"https://www.npmjs.com/package/embark-pug","legacy":true,"thumbnail":"pug.png","tags":["pug","jade","templates"]},{"name":"embark-haml","description":"plugins_page.plugins.haml.desc","link":"https://www.npmjs.com/package/embark-haml","legacy":true,"thumbnail":"haml.png","tags":["haml","templates"]},{"name":"embark-mythx","description":"plugins_page.plugins.mythx.desc","link":"https://www.npmjs.com/package/embark-mythx","thumbnail":"mythx.png","tags":["mythx","smart-contracts"]}],"menu":{"docs":"/docs/","plugins":"/plugins/","chat":"/chat/","blog":"/news/"},"sidebar":{"docs":{"getting_started":{"overview":"overview.html","installation":"installation.html","faq":"faq.html"},"general_usage":{"creating_project":"create_project.html","structure":"structure.html","running_apps":"running_apps.html","dashboard":"dashboard.html","using_the_console":"using_the_console.html","environments":"environments.html","configuration":"configuration.html","pipeline_and_webpack":"pipeline_and_webpack.html","javascript_usage":"javascript_usage.html"},"smart_contracts":{"contracts_configuration":"contracts_configuration.html","contracts_deployment":"contracts_deployment.html","contracts_imports":"contracts_imports.html","contracts_testing":"contracts_testing.html","contracts_javascript":"contracts_javascript.html"},"blockchain_node":{"blockchain_configuration":"blockchain_configuration.html","blockchain_accounts_configuration":"blockchain_accounts_configuration.html"},"storage":{"storage_configuration":"storage_configuration.html","storage_deployment":"storage_deployment.html","storage_javascript":"storage_javascript.html"},"messages":{"messages_configuration":"messages_configuration.html","messages_javascript":"messages_javascript.html"},"naming":{"naming_configuration":"naming_configuration.html","naming_javascript":"naming_javascript.html"},"plugins":{"installing_a_plugin":"installing_plugins.html","creating_a_plugin":"creating_plugins.html","plugin_reference":"plugin_reference.html"},"cockpit":{"cockpit_introduction":"cockpit_introduction.html","cockpit_dashboard":"cockpit_dashboard.html","cockpit_deployment":"cockpit_deployment.html","cockpit_explorer":"cockpit_explorer.html","cockpit_editor":"cockpit_editor.html","cockpit_debugger":"cockpit_debugger.html"},"reference":{"embark_commands":"embark_commands.html"},"miscellaneous":{"migrating_from_3":"migrating_from_3.x.html","troubleshooting":"troubleshooting.html","contributing":"contributing.html"}}},"templates":[{"name":"Vyper Template","description":"Template to demonstrate the use of the Vyper contracts","install":"embark new AppName --template vyper","thumbnail":"vyper.png","link":"https://github.com/embarklabs/embark-vyper-template","tags":["vyper","contracts"]},{"name":"Embark Demo React Template","description":"A React Application showcasing Embark's functionality","install":"embark demo","thumbnail":"react.png","link":"https://embark.embarklabs.io/docs/create_project.html#Creating-a-Demo-Project","tags":["react","contracts","whisper","ipfs"]},{"name":"Typescript Template","description":"Template with Typescript support pre-configured","thumbnail":"typescript.png","install":"embark new AppName --template typescript","link":"https://github.com/embarklabs/embark-typescript-template","tags":["typescript","frontend"]},{"name":"Vue.js Template","description":"Ready to use Template for using Embark with vue.js","thumbnail":"vuejs.png","install":"embark new AppName --template vue","link":"https://github.com/embarklabs/embark-vue-template","tags":["vue.js","frontend"]},{"name":"ethvtx Template","description":"Demo app for ethvtx, an Ethereum-Ready & Framework-Agnostic Redux configuration","thumbnail":"vortex.png","install":"embark new AppName --template Horyus/ethvtx_embark","link":"https://github.com/Horyus/ethvtx_embark","tags":["react"]},{"name":"Bamboo Template","description":"Template to demonstrate use of the Bamboo contracts","install":"embark new AppName --template bamboo","thumbnail":"bamboo.png","link":"https://github.com/embarklabs/embark-bamboo-template","tags":["bamboo","contracts"]},{"name":"Solidity Gas Golfing","description":"Boilerplate and tests for the first Solidity Gas Golfing Contest","thumbnail":"sggc.png","install":"embark new AppName --template embarklabs/sggc","link":"https://github.com/embarklabs/sggc","tags":["solidity","tests","fun"]}],"tutorials":[{"name":"How to create a Token Factory with Ethereum — Part 1","description":"Create and Deploy a Token with Ethereum","link":"/tutorials/token_factory_1.html","tags":["token","ethereum"]},{"name":"How to create a Token Factory with Ethereum — Part 2","description":"Create a DApp that can deploy Tokens on the fly","link":"/tutorials/token_factory_2.html","tags":["token","ethereum","client-side-deployment"]},{"name":"How to deploy to a testnet with Infura","description":"Deploy and interact with your Dapp on a testnet with the use of Infura","link":"/tutorials/infura_guide.html","tags":["ethereum","deployment","testnet"]}],"versions":{"latest":{"label":"stable (v4)","url":"https://embark.embarklabs.io/docs"},"3.2":{"label":"v3.2","url":"https://5ca4e0fdb29712000adde37f--embark-site-versions.netlify.com/docs/"}}}},"excerpt":"","more":"

When in developing, to interact with a blockchain, it is necessary to use a local Ethereum node, either using a simulator or a client like Geth or Parity. In this guide we’ll explore how to configure a blockchain client we want Embark to connect to. Embark uses the blockchain.js file inside the ./config folder by default for blockchain related configurations. This can be configured to different locations if we want to.

\n

Embark offers a lot of configuration options and most of them already come with a decent default so we can start right away.

\n

Common Parameters

Here are the common parameters. You will often need only a few of them to make your Embark node work.

\n

If you want more configuration options, you can find them here

\n
module.exports = {
default: {
enabled: true,
client: "geth"
},
development: {
clientConfig: {
miningMode: 'dev'
}
},
testnet: {
endpoint: "https://external-node.com",
accounts: [
{
mnemonic: "12 word mnemonic"
}
]
}
}
\n\n

Similar to configuring Smart Contracts, this config contains environments that help configuring certain parameters differently depending of the environment. You can read more about environments here.

\n

Parameter descriptions

Most of the options are self-explanatory, still, here are some brief descriptions:

\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
OptionType: defaultValue
enabledboolean: trueWhether or not to spawn an Ethereum node
clientstring: gethClient to use for the Ethereum node. Currently supported: geth and parity
miningModestring: devThe mining mode to use for the node.
dev: This is a special mode where the node uses a development account as defaultAccount. This account is already funded and transactions are faster.
auto: Uses a mining script to mine only when needed.
always: Miner is always on.
off: Turns off the miner
endpointstringEndpoint to connect to. Works for external endpoints (like Infura) and local ones too (only for nodes started by embark run)
accountsarrayAccounts array for the node and to deploy. When no account is given, defaults to one node account. For more details, go here
\n

Advanced parameters

Here are all the parameters you can use to customize your node. Note that they all come with defaults that make it that you don’t need to specify those.

\n

We recommend putting those inside the clientConfig object a better structure.

\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
OptionType: defaultValue
rpcHoststring: localhostHost the RPC server listens to
rpcPortnumber: 8545Port the RPC server listens to
rpcCorsDomainobjectThe CORS domains the node accepts
rpcCorsDomain.autoWhen set to true, Embark checks your other configurations to set the CORS domains. This only adds the required domains.
rpcCorsDomain.additionalCorsManual list of CORS domains to accept. If auto is set to true, any URLs specified here will be applied in addition to those automatically added with auto.
wsRPCboolean: trueWhether or not to enable the Websocket server
wsOriginsobjectSame as rpcCorsDomain, but for the Websocket server
wsHoststring: localhostSame as rpcHost, but for the Websocket server
wsPortnumber: 8546Same as rpcPort, but for the Websocket server
ethereumClientBinstring: gethPath to the client binary. By default, Embark uses the client name as an executable (if it is in the PATH)
datadirstringDirectory where to put the Node’s data (eg: keystores)
networkTypestring: customCan be: testnet, rinkeby, kovan or custom, in which case, it will use the specified networkId
networkIdnumber: 1337Used when networkType is set as custom. List of known network ids
nodiscoverboolean: trueDisables the peer discovery mechanism when set to true
maxpeersnumber: 0Maximum number of network peers
proxyboolean: trueWhether or not Embark should use a proxy to add functionalities. This proxy is used by Embark to see the different transactions that go through, for example, and shows them to you.
targetGasLimitnumberArtificial target gas floor for the blocks to mine
genesisBlockstringThe genesis file to use to create the network. This file is used when creating the network. It tells the client the parameters to initiate the node with. You can read more on genesis blocks here
\n
\n

Using Parity and Metamask

\n

Parity has very strict CORS policies. In order to use it with Metamask (or any other browser extension), you need to add the extension’s URL in the CORS.

\n

You can do so by opening Metamask in its own tab. Then, copy the URL. It will look something like chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn.

\n

Afterwards, in your blockchain config, add it to additionalCors of rpcCorsDomain and wsOrigins.

\n

\n
\n\n\n\n

Privatenet configuration

A private network is really similar to using the development mode of a client. The biggest differences is that it does not come with a default pre-funded account and it will not use POA (proof of authority), meaning that blocks will need to be mined.

\n

Luckily, Embark has settings to limit the mining to a minimum so that everything can run smoothly while testing in a more realistic environment before going to a test network.

\n

Privatenet parameters

Here are common parameters for private net configurations:

\n
privatenet: {
clientConfig: {
miningMode: 'auto',
genesisBlock: "config/privatenet/genesis.json"
}
accounts: [
{
nodeAccounts: true,
password: "config/privatenet/password"
}
]
}
\n\n

Note that we can always use the parameters we saw in the Common parameters section to override the default parameters.

\n

Parameter descriptions

\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
OptionType: valueDescription
miningModestring: autoYou need to set miningMode to auto or always so you don’t use the development mode
genesisBlockstringFile to start the chain in a clean state for your private network
accountsarrayArray of accounts to connect to. Go to the Accounts configuration page to learn more on accounts
\n

Testnet configuration

Test networks are networks that are public. Knowing that, if we want to connect to a node that we control, we will first need to synchronize it. This can take hours, as we need to download the blocks that we are missing from the other peers.

\n

The big advantage of using a local synced node is that we have control over it and it preserves our privacy, as we aren’t using a third party node. However, as mentioned, it takes a lot of time to synchronize a node and also requires a lot of computer resources, so keep it in mind if you want to go down that route.

\n

Testnet parameters

testnet: {
networkType: "testnet",
syncMode: "light",
accounts: [
{
nodeAccounts: true,
password: "config/testnet/password"
}
]
}
\n\n

Here are the necessary parameters. Again, we can add more to override as you see fit.

\n

Parameter descriptions

\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
OptionType: defaultValue
networkTypestring: testnetAgain, used to specify the network. testnet here represents Ropsten. You can change the network by using a networkId by changing networkType to custom
syncModestringBlockchain sync mode
syncMode = 'light'Light clients synchronize a bare minimum of data and fetch necessary data on-demand from the network. Much lower in storage, potentially higher in bandwidth
syncMode = 'fast'Faster, but higher store
syncMode = 'full'Normal sync
accountsarrayArray of accounts to connect to. Go to the Accounts configuration page to learn more on accounts
\n

Mainnet configuration

Finally, the main network, a.k.a. mainnet. It may come as no surprise, but to sync to the mainnet, the step and configurations are actually the same as for a test network. The only major difference is that the networkType needs to be custom with the networkId set to 1.

\n
mainnet: {
networkType: "custom",
networkId: 1,
syncMode: "light",
accounts: [
{
nodeAccounts: true,
password: "config/mainnet/password"
}
]
}
\n"},{"title":"Testing Smart Contracts","layout":"docs","_content":"\nTesting is a crucial part of developing robust and high-quality software. That's why Embark aims to make testing our Smart Contract as easy as possible. In this guide we'll explore Embark specific testing APIs and how to write tests for our Smart Contracts.\n\n## Creating tests\n\nTest files resides in a project's `test` folder. Any JavaScript file within `test/` is considered a spec file and will be executed by Embark as such. A spec file contains test specs which are grouped in `contract()` functions. A single spec is written using `it()` blocks. \n\nHere's what such a test could look like:\n\n```\ncontract('SomeContract', () => {\n it('should pass', () => {\n assert.ok(true);\n });\n});\n```\n\nThis is a single test spec which will always pass. We're using a globally available `assert` object to make assertions in our specs. If you're familiar with the [Mocha testing framework](https://mochajs.org), this syntax might be familiar. In fact, Embark uses Mocha as a test runner behind the scenes.\n\n`contract()` is just an alias for Mocha's `describe()` function and is globally available. In general, global functions and objects are:\n\n- `contract()`: Same as Mocha's `describe`\n- `config()`: Function to configure Embark and deploy contracts\n- `web3`: Web3 object\n- `assert`: Node's assert\n- Mocha functions: `describe()`, `it()`, `before()`, etc.\n\n### Importing EmbarkJS\n\nIf we want to use any of EmbarkJS' APIs, we can require it as expected:\n\n```\nconst EmbarkJS = require('Embark/EmbarkJS');\n```\n\nFor more information on EmbarkJS's APIs, head over to [this guide](/docs/javascript_usage.html).\n\n## Running tests\n\nOnce we've written our tests, we can execute them using Embark's `test` command:\n\n```\n$ embark test\n```\n\nAs mentioned earlier, this will pick up all files inside the `test/` folder and run them as test files.\n\n### Running test subsets\n\nIf we aren't interested in running all tests but only a specific subset, we can specify a test file as part of the `test` command like this:\n\n```\n$ embark test test/SomeContract_spec.js\n```\n\n### Running tests against a different node\n\nBy default, tests are run using an Ethereum simulator ([Ganache](https://www.truffleframework.com/ganache)). We can use the `--node` option to change that behavior. Passing `--node embark` to `embark test` will use the Ethereum node associated with an already running embark process. We can also specify a custom endpoint, for example:\n\n```\n$ embark test --node ws://localhost:8556\n```\n\n### Outputting gas cost details\n\nWhen running tests, we can even get an idea of what the gas costs of our Smart Contract deployments are. Embark comes with a `--gasDetails` option that makes this possible.\n\n```\n$ embark test --gasDetails\n```\n\n## Test environment\n\nWhen running tests, the default [environment}(/docs/environments.html) is `test`. You can obviously change this using the `--env` flag.\n\nThe special thing with the `test` environment is that if you do not have a `test` section in your module configuration, that module with be disabled (`enabled: false`). This is done to speed up the test as if you don't need a module, it is disabled.\n\n## Configuring Smart Contracts for tests\n\nVery similar to how we [configure our Smart Contracts](/docs/contracts_configuration.html) for deployment, we have to configure them for our tests as well. This is important, so that our Smart Contracts get deployed with the correct testing data.\n\nTo do that, Embark adds a global `config()` function to the execution context, which uses the same API as the configuration object for our application's Smart Contracts. So if we had a `SomeContract` that should be picked up for deployment, this is what the configuration would look like:\n\n```\nconfig({\n contracts: {\n deploy: {\n SomeContract: {} // options as discussed in Smart Contract configuration guide\n }\n }\n});\n\ncontract('SomContract', () => {\n ...\n});\n```\n\nOne thing that's important to note here is that, behind the scenes, Embark has to run `config()` first to deploy the Smart Contracts and only **then** starts running tests. This will have an impact on the developer experience when importing Smart Contract instances within spec files. But more on that later.\n\n{% notification info 'A note on config()' %}\nThe global `config()` function is used for Smart Contract deployment and therefore delays the execution of tests until deployment is done.\n{% endnotification %}\n\n## Accessing Smart Contract instances\n\nTo write meaningful tests, we obviously want to interact with our Smart Contracts. As we know, [Embark generates Smart Contract instances](/docs/javascript_usage.html#Embark-Artifacts) for us. All we have to do is importing and using them accordingly.\n\nThe following code imports `SomeContract` and calls an imaginary method on it inside a spec:\n\n```\nconst SomeContract = require('EmbarkJS/contracts/SomeContract');\n\nconfig({\n contracts: {\n deploy: {\n SomeContract: {}\n }\n }\n});\n\ncontract('SomeContract', () => {\n\n it('should do something', async () => {\n const result = await SomeContract.methods.doSomething.call();\n assert.equal(result, 'foo');\n });\n});\n```\n\nThere's one gotcha to keep in mind though. Looking at the snippet above, it seems like we can use `SmartContract` right away once it is imported. However, this is not actually true. As mentioned earlier, Embark first has to actually deploy our Smart Contracts and until that happens, all imported Smart Contract references are empty objects.\n\nThis is not a problem anymore when using Smart Contract instances inside spec blocks, because we know that tests are executed after all Smart Contracts have been deployed. Embark will hydrate the imported references with actual data before the tests are run.\n\n{% notification info 'Smart Contract reference hydration' %}\nSmart Contract references imported from EmbarkJS are empty until the Smart Contract are actually deployed. This means Smart Contract references can only be used inside `contract()` blocks.\n{% endnotification %}\n\n## Configuring accounts\n\nAccounts within the testing environment can be configured [just like we're used to](/docs/contracts_deployment.html). The same rules apply here, and [configuring an Ether balance](/docs/contracts_deployment.html#Configuring-account-balance-for-development) is supported as well. Configuring custom accounts in tests is especially useful if we want to use a specific account for our tests. \n\n```\nconfig({\n blockchain: {\n accounts: [\n {\n privateKeyFile: 'path/to/file',\n balance: '42 shannon'\n }\n ]\n }\n});\n```\n\n## Accessing Accounts\n\nObviously, we want to access all configured accounts as well. Sometimes we want to test functions or methods that require us to specify a `from` address to send transactions from. For those cases we very likely want to access any of our our available accounts.\n\nAll available accounts are emitted by `config()` and can be accessed using a callback parameter like this:\n\n```\nlet accounts = [];\n\nconfig({\n ...\n}, (err, accounts) => {\n accounts = accounts;\n});\n```\n\nYou can also grab the accounts from the callback of the `contract()` function (`describe` alias):\n\n```\ncontract('SomeContract', (accounts) => {\n const myAccounts = accounts[0];\n\n it('should do something', async () => {\n ...\n });\n});\n```\n\n## Connecting to a different node\n\nBy default, Embark will use an internal VM to run the tests. However we can also specify a node to connect to and run the tests there, using the `host`, `port` and `type` options as shown below:\n\n```\nconfig({\n blockchain: {\n \"endpoint\": \"http://localhost:8545\"\n }\n});\n```\n\n## Configuring modules\n\nYou can configure the different Embark modules directly in your test file. The available modules are: [storage](/docs/storage_configuration.html), [namesystem](/docs/naming_configuration.html) and [communication](/docs/messages_configuration.html).\n\nAll configuration options for the respective modules are available. Also, the configurations you put inside the `config` function are merged inside the ones that are in the configuration file (meaning that you don't have to put all the provider options if they are already in the default configs).\n\n```\nconfig({\n storage: {\n enabled: true\n },\n communication: {\n enabled: true\n },\n namesystem: {\n enabled: true,\n register: {\n rootDomain: \"test.eth\"\n }\n }\n});\n```\n\nIf the module is not started (eg. IPFS), Embark will start it for you.\n\n## Manually deploying Smart Contracts\n\nAs mentioned earlier, Embark handles the deployment of our Smart Contracts using the function `config()` function. If we wish to deploy particular Smart Contracts manually, we can do so using an imported Smart Contract reference. We just need to make sure that we're doing this inside a `contract()` block as discussed earlier:\n\n```\nconst SimpleStorage = require('Embark/contracts/SimpleStorage');\n\ncontract('SimpleStorage Deploy', () => {\n let SimpleStorageInstance;\n\n before(async function() {\n SimpleStorageInstance = await SimpleStorage.deploy({ arguments: [150] }).send();\n });\n\n it('should set constructor value', async () => {\n let result = await SimpleStorageInstance.methods.storedData().call();\n assert.strictEqual(parseInt(result, 10), 150);\n });\n});\n```\n\n## Util functions\n\n### assert.reverts\n\nUsing `assert.reverts`, you can easily assert that your transaction reverts.\n\n```javascript\nawait assert.reverts(contractMethodAndArguments[, options][, message])\n```\n\n- `contractMethodAndArguments`: [Function] Contract method to call `send` on, including the arguments\n- `options`: [Object] Optional options to pass to the `send` function\n- `message`: [String] Optional string to match the revert message\n\nReturns a promise that you can wait for with `await`.\n\n```javascript\nit(\"should revert with a value lower than 5\", async function() {\n await assert.reverts(SimpleStorage.methods.setHigher5(2), {from: web3.eth.defaultAccount},\n 'Returned error: VM Exception while processing transaction: revert Value needs to be higher than 5');\n });\n```\n\n### assert.eventEmitted\n\nUsing `eventEmitted`, you can assert that a transaction has emitted an event. You can also check for the returned values.\n\n```javascript\nassert.eventEmitted(transaction, event[, values])\n```\n\n- `transaction`: [Object] Transaction object returns by a `send` call\n- `event`: [String] Name of the event being emitted\n- `values`: [Array or Object] Optional array or object of the returned values of the event.\n - Using array: The order of the values put in the array need to match the order in which the values are returned by the event\n - Using object: The object needs to have the right key/value pair(s)\n \n```javascript\nit('asserts that the event was triggered', async function() {\n const transaction = await SimpleStorage.methods.set(100).send();\n assert.eventEmitted(transaction, 'EventOnSet', {value: \"100\", success: true});\n});\n```\n\n### increaseTime\n\nThis function lets you increase the time of the EVM. It is useful in the case where you want to test expiration times for example.\n\n```javascript\nawait increaseTime(amount);\n```\n\n`amount`: [Number] Number of seconds to increase\n\n```javascript\nit(\"should have expired after increasing time\", async function () {\n await increaseTime(5001);\n const isExpired = await Expiration.methods.isExpired().call();\n assert.strictEqual(isExpired, true);\n});\n```\n\n## Code coverage\n\nEmbark allows you to generate a coverage report for your Solidity Smart Contracts by passing the `--coverage` option on the `embark test` command.\n\n```\n$ embark test --coverage\n```\n\nThe generated report looks something like this:\n\n![Coverage Report: Files](/coverage-files.png)\n\nThis gives us a birds-eye view on the state of the coverage of our Smart Contracts: how many of the functions were called, how many lines were hit, even whether all the branch cases were executed. When selecting a file, a more detailed report is produced. Here's what it looks like:\n\n![Coverage Report: Detailed](/coverage-report.png)\n","source":"docs/contracts_testing.md","raw":"title: Testing Smart Contracts\nlayout: docs\n---\n\nTesting is a crucial part of developing robust and high-quality software. That's why Embark aims to make testing our Smart Contract as easy as possible. In this guide we'll explore Embark specific testing APIs and how to write tests for our Smart Contracts.\n\n## Creating tests\n\nTest files resides in a project's `test` folder. Any JavaScript file within `test/` is considered a spec file and will be executed by Embark as such. A spec file contains test specs which are grouped in `contract()` functions. A single spec is written using `it()` blocks. \n\nHere's what such a test could look like:\n\n```\ncontract('SomeContract', () => {\n it('should pass', () => {\n assert.ok(true);\n });\n});\n```\n\nThis is a single test spec which will always pass. We're using a globally available `assert` object to make assertions in our specs. If you're familiar with the [Mocha testing framework](https://mochajs.org), this syntax might be familiar. In fact, Embark uses Mocha as a test runner behind the scenes.\n\n`contract()` is just an alias for Mocha's `describe()` function and is globally available. In general, global functions and objects are:\n\n- `contract()`: Same as Mocha's `describe`\n- `config()`: Function to configure Embark and deploy contracts\n- `web3`: Web3 object\n- `assert`: Node's assert\n- Mocha functions: `describe()`, `it()`, `before()`, etc.\n\n### Importing EmbarkJS\n\nIf we want to use any of EmbarkJS' APIs, we can require it as expected:\n\n```\nconst EmbarkJS = require('Embark/EmbarkJS');\n```\n\nFor more information on EmbarkJS's APIs, head over to [this guide](/docs/javascript_usage.html).\n\n## Running tests\n\nOnce we've written our tests, we can execute them using Embark's `test` command:\n\n```\n$ embark test\n```\n\nAs mentioned earlier, this will pick up all files inside the `test/` folder and run them as test files.\n\n### Running test subsets\n\nIf we aren't interested in running all tests but only a specific subset, we can specify a test file as part of the `test` command like this:\n\n```\n$ embark test test/SomeContract_spec.js\n```\n\n### Running tests against a different node\n\nBy default, tests are run using an Ethereum simulator ([Ganache](https://www.truffleframework.com/ganache)). We can use the `--node` option to change that behavior. Passing `--node embark` to `embark test` will use the Ethereum node associated with an already running embark process. We can also specify a custom endpoint, for example:\n\n```\n$ embark test --node ws://localhost:8556\n```\n\n### Outputting gas cost details\n\nWhen running tests, we can even get an idea of what the gas costs of our Smart Contract deployments are. Embark comes with a `--gasDetails` option that makes this possible.\n\n```\n$ embark test --gasDetails\n```\n\n## Test environment\n\nWhen running tests, the default [environment}(/docs/environments.html) is `test`. You can obviously change this using the `--env` flag.\n\nThe special thing with the `test` environment is that if you do not have a `test` section in your module configuration, that module with be disabled (`enabled: false`). This is done to speed up the test as if you don't need a module, it is disabled.\n\n## Configuring Smart Contracts for tests\n\nVery similar to how we [configure our Smart Contracts](/docs/contracts_configuration.html) for deployment, we have to configure them for our tests as well. This is important, so that our Smart Contracts get deployed with the correct testing data.\n\nTo do that, Embark adds a global `config()` function to the execution context, which uses the same API as the configuration object for our application's Smart Contracts. So if we had a `SomeContract` that should be picked up for deployment, this is what the configuration would look like:\n\n```\nconfig({\n contracts: {\n deploy: {\n SomeContract: {} // options as discussed in Smart Contract configuration guide\n }\n }\n});\n\ncontract('SomContract', () => {\n ...\n});\n```\n\nOne thing that's important to note here is that, behind the scenes, Embark has to run `config()` first to deploy the Smart Contracts and only **then** starts running tests. This will have an impact on the developer experience when importing Smart Contract instances within spec files. But more on that later.\n\n{% notification info 'A note on config()' %}\nThe global `config()` function is used for Smart Contract deployment and therefore delays the execution of tests until deployment is done.\n{% endnotification %}\n\n## Accessing Smart Contract instances\n\nTo write meaningful tests, we obviously want to interact with our Smart Contracts. As we know, [Embark generates Smart Contract instances](/docs/javascript_usage.html#Embark-Artifacts) for us. All we have to do is importing and using them accordingly.\n\nThe following code imports `SomeContract` and calls an imaginary method on it inside a spec:\n\n```\nconst SomeContract = require('EmbarkJS/contracts/SomeContract');\n\nconfig({\n contracts: {\n deploy: {\n SomeContract: {}\n }\n }\n});\n\ncontract('SomeContract', () => {\n\n it('should do something', async () => {\n const result = await SomeContract.methods.doSomething.call();\n assert.equal(result, 'foo');\n });\n});\n```\n\nThere's one gotcha to keep in mind though. Looking at the snippet above, it seems like we can use `SmartContract` right away once it is imported. However, this is not actually true. As mentioned earlier, Embark first has to actually deploy our Smart Contracts and until that happens, all imported Smart Contract references are empty objects.\n\nThis is not a problem anymore when using Smart Contract instances inside spec blocks, because we know that tests are executed after all Smart Contracts have been deployed. Embark will hydrate the imported references with actual data before the tests are run.\n\n{% notification info 'Smart Contract reference hydration' %}\nSmart Contract references imported from EmbarkJS are empty until the Smart Contract are actually deployed. This means Smart Contract references can only be used inside `contract()` blocks.\n{% endnotification %}\n\n## Configuring accounts\n\nAccounts within the testing environment can be configured [just like we're used to](/docs/contracts_deployment.html). The same rules apply here, and [configuring an Ether balance](/docs/contracts_deployment.html#Configuring-account-balance-for-development) is supported as well. Configuring custom accounts in tests is especially useful if we want to use a specific account for our tests. \n\n```\nconfig({\n blockchain: {\n accounts: [\n {\n privateKeyFile: 'path/to/file',\n balance: '42 shannon'\n }\n ]\n }\n});\n```\n\n## Accessing Accounts\n\nObviously, we want to access all configured accounts as well. Sometimes we want to test functions or methods that require us to specify a `from` address to send transactions from. For those cases we very likely want to access any of our our available accounts.\n\nAll available accounts are emitted by `config()` and can be accessed using a callback parameter like this:\n\n```\nlet accounts = [];\n\nconfig({\n ...\n}, (err, accounts) => {\n accounts = accounts;\n});\n```\n\nYou can also grab the accounts from the callback of the `contract()` function (`describe` alias):\n\n```\ncontract('SomeContract', (accounts) => {\n const myAccounts = accounts[0];\n\n it('should do something', async () => {\n ...\n });\n});\n```\n\n## Connecting to a different node\n\nBy default, Embark will use an internal VM to run the tests. However we can also specify a node to connect to and run the tests there, using the `host`, `port` and `type` options as shown below:\n\n```\nconfig({\n blockchain: {\n \"endpoint\": \"http://localhost:8545\"\n }\n});\n```\n\n## Configuring modules\n\nYou can configure the different Embark modules directly in your test file. The available modules are: [storage](/docs/storage_configuration.html), [namesystem](/docs/naming_configuration.html) and [communication](/docs/messages_configuration.html).\n\nAll configuration options for the respective modules are available. Also, the configurations you put inside the `config` function are merged inside the ones that are in the configuration file (meaning that you don't have to put all the provider options if they are already in the default configs).\n\n```\nconfig({\n storage: {\n enabled: true\n },\n communication: {\n enabled: true\n },\n namesystem: {\n enabled: true,\n register: {\n rootDomain: \"test.eth\"\n }\n }\n});\n```\n\nIf the module is not started (eg. IPFS), Embark will start it for you.\n\n## Manually deploying Smart Contracts\n\nAs mentioned earlier, Embark handles the deployment of our Smart Contracts using the function `config()` function. If we wish to deploy particular Smart Contracts manually, we can do so using an imported Smart Contract reference. We just need to make sure that we're doing this inside a `contract()` block as discussed earlier:\n\n```\nconst SimpleStorage = require('Embark/contracts/SimpleStorage');\n\ncontract('SimpleStorage Deploy', () => {\n let SimpleStorageInstance;\n\n before(async function() {\n SimpleStorageInstance = await SimpleStorage.deploy({ arguments: [150] }).send();\n });\n\n it('should set constructor value', async () => {\n let result = await SimpleStorageInstance.methods.storedData().call();\n assert.strictEqual(parseInt(result, 10), 150);\n });\n});\n```\n\n## Util functions\n\n### assert.reverts\n\nUsing `assert.reverts`, you can easily assert that your transaction reverts.\n\n```javascript\nawait assert.reverts(contractMethodAndArguments[, options][, message])\n```\n\n- `contractMethodAndArguments`: [Function] Contract method to call `send` on, including the arguments\n- `options`: [Object] Optional options to pass to the `send` function\n- `message`: [String] Optional string to match the revert message\n\nReturns a promise that you can wait for with `await`.\n\n```javascript\nit(\"should revert with a value lower than 5\", async function() {\n await assert.reverts(SimpleStorage.methods.setHigher5(2), {from: web3.eth.defaultAccount},\n 'Returned error: VM Exception while processing transaction: revert Value needs to be higher than 5');\n });\n```\n\n### assert.eventEmitted\n\nUsing `eventEmitted`, you can assert that a transaction has emitted an event. You can also check for the returned values.\n\n```javascript\nassert.eventEmitted(transaction, event[, values])\n```\n\n- `transaction`: [Object] Transaction object returns by a `send` call\n- `event`: [String] Name of the event being emitted\n- `values`: [Array or Object] Optional array or object of the returned values of the event.\n - Using array: The order of the values put in the array need to match the order in which the values are returned by the event\n - Using object: The object needs to have the right key/value pair(s)\n \n```javascript\nit('asserts that the event was triggered', async function() {\n const transaction = await SimpleStorage.methods.set(100).send();\n assert.eventEmitted(transaction, 'EventOnSet', {value: \"100\", success: true});\n});\n```\n\n### increaseTime\n\nThis function lets you increase the time of the EVM. It is useful in the case where you want to test expiration times for example.\n\n```javascript\nawait increaseTime(amount);\n```\n\n`amount`: [Number] Number of seconds to increase\n\n```javascript\nit(\"should have expired after increasing time\", async function () {\n await increaseTime(5001);\n const isExpired = await Expiration.methods.isExpired().call();\n assert.strictEqual(isExpired, true);\n});\n```\n\n## Code coverage\n\nEmbark allows you to generate a coverage report for your Solidity Smart Contracts by passing the `--coverage` option on the `embark test` command.\n\n```\n$ embark test --coverage\n```\n\nThe generated report looks something like this:\n\n![Coverage Report: Files](/coverage-files.png)\n\nThis gives us a birds-eye view on the state of the coverage of our Smart Contracts: how many of the functions were called, how many lines were hit, even whether all the branch cases were executed. When selecting a file, a more detailed report is produced. Here's what it looks like:\n\n![Coverage Report: Detailed](/coverage-report.png)\n","date":"2020-01-17T19:00:03.896Z","updated":"2020-01-17T19:00:03.896Z","path":"docs/contracts_testing.html","comments":1,"_id":"ck5ijm3tu00277hegd72zaomq","content":"

Testing is a crucial part of developing robust and high-quality software. That’s why Embark aims to make testing our Smart Contract as easy as possible. In this guide we’ll explore Embark specific testing APIs and how to write tests for our Smart Contracts.

\n

Creating tests

Test files resides in a project’s test folder. Any JavaScript file within test/ is considered a spec file and will be executed by Embark as such. A spec file contains test specs which are grouped in contract() functions. A single spec is written using it() blocks.

\n

Here’s what such a test could look like:

\n
contract('SomeContract', () => {
it('should pass', () => {
assert.ok(true);
});
});
\n\n

This is a single test spec which will always pass. We’re using a globally available assert object to make assertions in our specs. If you’re familiar with the Mocha testing framework, this syntax might be familiar. In fact, Embark uses Mocha as a test runner behind the scenes.

\n

contract() is just an alias for Mocha’s describe() function and is globally available. In general, global functions and objects are:

\n
    \n
  • contract(): Same as Mocha’s describe
  • \n
  • config(): Function to configure Embark and deploy contracts
  • \n
  • web3: Web3 object
  • \n
  • assert: Node’s assert
  • \n
  • Mocha functions: describe(), it(), before(), etc.
  • \n
\n

Importing EmbarkJS

If we want to use any of EmbarkJS’ APIs, we can require it as expected:

\n
const EmbarkJS = require('Embark/EmbarkJS');
\n\n

For more information on EmbarkJS’s APIs, head over to this guide.

\n

Running tests

Once we’ve written our tests, we can execute them using Embark’s test command:

\n
$ embark test
\n\n

As mentioned earlier, this will pick up all files inside the test/ folder and run them as test files.

\n

Running test subsets

If we aren’t interested in running all tests but only a specific subset, we can specify a test file as part of the test command like this:

\n
$ embark test test/SomeContract_spec.js
\n\n

Running tests against a different node

By default, tests are run using an Ethereum simulator (Ganache). We can use the --node option to change that behavior. Passing --node embark to embark test will use the Ethereum node associated with an already running embark process. We can also specify a custom endpoint, for example:

\n
$ embark test --node ws://localhost:8556
\n\n

Outputting gas cost details

When running tests, we can even get an idea of what the gas costs of our Smart Contract deployments are. Embark comes with a --gasDetails option that makes this possible.

\n
$ embark test --gasDetails
\n\n

Test environment

When running tests, the default [environment}(/docs/environments.html) is test. You can obviously change this using the --env flag.

\n

The special thing with the test environment is that if you do not have a test section in your module configuration, that module with be disabled (enabled: false). This is done to speed up the test as if you don’t need a module, it is disabled.

\n

Configuring Smart Contracts for tests

Very similar to how we configure our Smart Contracts for deployment, we have to configure them for our tests as well. This is important, so that our Smart Contracts get deployed with the correct testing data.

\n

To do that, Embark adds a global config() function to the execution context, which uses the same API as the configuration object for our application’s Smart Contracts. So if we had a SomeContract that should be picked up for deployment, this is what the configuration would look like:

\n
config({
contracts: {
deploy: {
SomeContract: {} // options as discussed in Smart Contract configuration guide
}
}
});

contract('SomContract', () => {
...
});
\n\n

One thing that’s important to note here is that, behind the scenes, Embark has to run config() first to deploy the Smart Contracts and only then starts running tests. This will have an impact on the developer experience when importing Smart Contract instances within spec files. But more on that later.

\n
\n

A note on config()

\n

The global config() function is used for Smart Contract deployment and therefore delays the execution of tests until deployment is done.

\n

\n
\n\n\n\n

Accessing Smart Contract instances

To write meaningful tests, we obviously want to interact with our Smart Contracts. As we know, Embark generates Smart Contract instances for us. All we have to do is importing and using them accordingly.

\n

The following code imports SomeContract and calls an imaginary method on it inside a spec:

\n
const SomeContract = require('EmbarkJS/contracts/SomeContract');

config({
contracts: {
deploy: {
SomeContract: {}
}
}
});

contract('SomeContract', () => {

it('should do something', async () => {
const result = await SomeContract.methods.doSomething.call();
assert.equal(result, 'foo');
});
});
\n\n

There’s one gotcha to keep in mind though. Looking at the snippet above, it seems like we can use SmartContract right away once it is imported. However, this is not actually true. As mentioned earlier, Embark first has to actually deploy our Smart Contracts and until that happens, all imported Smart Contract references are empty objects.

\n

This is not a problem anymore when using Smart Contract instances inside spec blocks, because we know that tests are executed after all Smart Contracts have been deployed. Embark will hydrate the imported references with actual data before the tests are run.

\n
\n

Smart Contract reference hydration

\n

Smart Contract references imported from EmbarkJS are empty until the Smart Contract are actually deployed. This means Smart Contract references can only be used inside contract() blocks.

\n

\n
\n\n\n\n

Configuring accounts

Accounts within the testing environment can be configured just like we’re used to. The same rules apply here, and configuring an Ether balance is supported as well. Configuring custom accounts in tests is especially useful if we want to use a specific account for our tests.

\n
config({
blockchain: {
accounts: [
{
privateKeyFile: 'path/to/file',
balance: '42 shannon'
}
]
}
});
\n\n

Accessing Accounts

Obviously, we want to access all configured accounts as well. Sometimes we want to test functions or methods that require us to specify a from address to send transactions from. For those cases we very likely want to access any of our our available accounts.

\n

All available accounts are emitted by config() and can be accessed using a callback parameter like this:

\n
let accounts = [];

config({
...
}, (err, accounts) => {
accounts = accounts;
});
\n\n

You can also grab the accounts from the callback of the contract() function (describe alias):

\n
contract('SomeContract', (accounts) => {
const myAccounts = accounts[0];

it('should do something', async () => {
...
});
});
\n\n

Connecting to a different node

By default, Embark will use an internal VM to run the tests. However we can also specify a node to connect to and run the tests there, using the host, port and type options as shown below:

\n
config({
blockchain: {
"endpoint": "http://localhost:8545"
}
});
\n\n

Configuring modules

You can configure the different Embark modules directly in your test file. The available modules are: storage, namesystem and communication.

\n

All configuration options for the respective modules are available. Also, the configurations you put inside the config function are merged inside the ones that are in the configuration file (meaning that you don’t have to put all the provider options if they are already in the default configs).

\n
config({
storage: {
enabled: true
},
communication: {
enabled: true
},
namesystem: {
enabled: true,
register: {
rootDomain: "test.eth"
}
}
});
\n\n

If the module is not started (eg. IPFS), Embark will start it for you.

\n

Manually deploying Smart Contracts

As mentioned earlier, Embark handles the deployment of our Smart Contracts using the function config() function. If we wish to deploy particular Smart Contracts manually, we can do so using an imported Smart Contract reference. We just need to make sure that we’re doing this inside a contract() block as discussed earlier:

\n
const SimpleStorage = require('Embark/contracts/SimpleStorage');

contract('SimpleStorage Deploy', () => {
let SimpleStorageInstance;

before(async function() {
SimpleStorageInstance = await SimpleStorage.deploy({ arguments: [150] }).send();
});

it('should set constructor value', async () => {
let result = await SimpleStorageInstance.methods.storedData().call();
assert.strictEqual(parseInt(result, 10), 150);
});
});
\n\n

Util functions

assert.reverts

Using assert.reverts, you can easily assert that your transaction reverts.

\n
await assert.reverts(contractMethodAndArguments[, options][, message])
\n\n
    \n
  • contractMethodAndArguments: [Function] Contract method to call send on, including the arguments
  • \n
  • options: [Object] Optional options to pass to the send function
  • \n
  • message: [String] Optional string to match the revert message
  • \n
\n

Returns a promise that you can wait for with await.

\n
it(\"should revert with a value lower than 5\", async function() {
await assert.reverts(SimpleStorage.methods.setHigher5(2), {from: web3.eth.defaultAccount},
'Returned error: VM Exception while processing transaction: revert Value needs to be higher than 5');
});
\n\n

assert.eventEmitted

Using eventEmitted, you can assert that a transaction has emitted an event. You can also check for the returned values.

\n
assert.eventEmitted(transaction, event[, values])
\n\n
    \n
  • transaction: [Object] Transaction object returns by a send call
  • \n
  • event: [String] Name of the event being emitted
  • \n
  • values: [Array or Object] Optional array or object of the returned values of the event.
      \n
    • Using array: The order of the values put in the array need to match the order in which the values are returned by the event
    • \n
    • Using object: The object needs to have the right key/value pair(s)
    • \n
    \n
  • \n
\n
it('asserts that the event was triggered', async function() {
const transaction = await SimpleStorage.methods.set(100).send();
assert.eventEmitted(transaction, 'EventOnSet', {value: \"100\", success: true});
});
\n\n

increaseTime

This function lets you increase the time of the EVM. It is useful in the case where you want to test expiration times for example.

\n
await increaseTime(amount);
\n\n

amount: [Number] Number of seconds to increase

\n
it(\"should have expired after increasing time\", async function () {
await increaseTime(5001);
const isExpired = await Expiration.methods.isExpired().call();
assert.strictEqual(isExpired, true);
});
\n\n

Code coverage

Embark allows you to generate a coverage report for your Solidity Smart Contracts by passing the --coverage option on the embark test command.

\n
$ embark test --coverage
\n\n

The generated report looks something like this:

\n

\"Coverage

\n

This gives us a birds-eye view on the state of the coverage of our Smart Contracts: how many of the functions were called, how many lines were hit, even whether all the branch cases were executed. When selecting a file, a more detailed report is produced. Here’s what it looks like:

\n

\"Coverage

\n","site":{"data":{"authors":{"iuri_matias":{"name":"Iuri Matias","twitter":"iurimatias","image":"https://pbs.twimg.com/profile_images/928272512181563392/iDJdvy2k_400x400.jpg"},"pascal_precht":{"name":"Pascal Precht","twitter":"pascalprecht","image":"https://pbs.twimg.com/profile_images/993785060733194241/p3oAIMDP_400x400.jpg"},"anthony_laibe":{"name":"Anthony Laibe","twitter":"a_laibe","image":"https://pbs.twimg.com/profile_images/257742900/13168239_400x400.jpg"},"jonathan_rainville":{"name":"Jonathan Rainville","twitter":"ShyolGhul","image":"https://pbs.twimg.com/profile_images/993873866878570496/-aE4byjj_400x400.jpg"},"andre_medeiros":{"name":"Andre Medeiros","twitter":"superdealloc","image":"https://pbs.twimg.com/profile_images/965722487735701504/m58KNgWN_400x400.jpg"},"eric_mastro":{"name":"Eric Mastro","twitter":"ericmastro","image":"https://avatars1.githubusercontent.com/u/5089238?s=460&v=4"},"michael_bradley":{"name":"Michael Bradley","image":"https://avatars3.githubusercontent.com/u/194260?s=460&v=4"},"richard_ramos":{"name":"Richard Ramos","twitter":"richardramos_me","image":"https://pbs.twimg.com/profile_images/1063160577973866496/aM313uHG_400x400.jpg"},"jonny_zerah":{"name":"Jonny Zerah","twitter":"jonnyzerah","image":"https://pbs.twimg.com/profile_images/1043774340490248192/gI9aGy17_400x400.jpg"},"robin_percy":{"name":"Robin Percy","twitter":"rbin","image":"https://avatars1.githubusercontent.com/u/29288325?s=400&v=4"}},"categories":{"tutorials":"Tutorials","announcements":"Announcements"},"languages":{"en":"English"},"plugins":[{"name":"embark-bamboo","description":"plugins_page.plugins.bamboo.desc","link":"https://www.npmjs.com/package/embark-bamboo","thumbnail":"bamboo.png","tags":["language","smart-contracts"]},{"name":"embark-solc","description":"plugins_page.plugins.solc.desc","link":"https://www.npmjs.com/package/embark-solc","thumbnail":"solidity.png","tags":["solidity","language","smart-contracts"]},{"name":"embark-solium","description":"plugins_page.plugins.solium.desc","link":"https://www.npmjs.com/package/embark-solium","thumbnail":"solium.png","tags":["linter","solidity","solium"]},{"name":"embark-etherscan-verifier","description":"plugins_page.plugins.verifier.desc","link":"https://www.npmjs.com/package/embark-etherscan-verifier","tags":["solidity","etherscan","smart-contracts"]},{"name":"embark-status","description":"plugins_page.plugins.status.desc","link":"https://www.npmjs.com/package/embark-status-plugin","thumbnail":"status.png","tags":["status","mobile"]},{"name":"embark-remix","description":"plugins_page.plugins.remix.desc","link":"https://www.npmjs.com/package/embark-remix","thumbnail":"remix.png","tags":["remix","debugger"]},{"name":"embark-slither","description":"plugins_page.plugins.slither.desc","link":"https://www.npmjs.com/package/embark-slither","tags":["solidity"]},{"name":"embark-snark","description":"plugins_page.plugins.snark.desc","link":"https://www.npmjs.com/package/embark-snark","tags":["snark"]},{"name":"embark-fortune","description":"plugins_page.plugins.fortune.desc","link":"https://www.npmjs.com/package/embark-fortune","thumbnail":"fortune.jpg","tags":["fun"]},{"name":"embark-pug","description":"plugins_page.plugins.pug.desc","link":"https://www.npmjs.com/package/embark-pug","legacy":true,"thumbnail":"pug.png","tags":["pug","jade","templates"]},{"name":"embark-haml","description":"plugins_page.plugins.haml.desc","link":"https://www.npmjs.com/package/embark-haml","legacy":true,"thumbnail":"haml.png","tags":["haml","templates"]},{"name":"embark-mythx","description":"plugins_page.plugins.mythx.desc","link":"https://www.npmjs.com/package/embark-mythx","thumbnail":"mythx.png","tags":["mythx","smart-contracts"]}],"menu":{"docs":"/docs/","plugins":"/plugins/","chat":"/chat/","blog":"/news/"},"sidebar":{"docs":{"getting_started":{"overview":"overview.html","installation":"installation.html","faq":"faq.html"},"general_usage":{"creating_project":"create_project.html","structure":"structure.html","running_apps":"running_apps.html","dashboard":"dashboard.html","using_the_console":"using_the_console.html","environments":"environments.html","configuration":"configuration.html","pipeline_and_webpack":"pipeline_and_webpack.html","javascript_usage":"javascript_usage.html"},"smart_contracts":{"contracts_configuration":"contracts_configuration.html","contracts_deployment":"contracts_deployment.html","contracts_imports":"contracts_imports.html","contracts_testing":"contracts_testing.html","contracts_javascript":"contracts_javascript.html"},"blockchain_node":{"blockchain_configuration":"blockchain_configuration.html","blockchain_accounts_configuration":"blockchain_accounts_configuration.html"},"storage":{"storage_configuration":"storage_configuration.html","storage_deployment":"storage_deployment.html","storage_javascript":"storage_javascript.html"},"messages":{"messages_configuration":"messages_configuration.html","messages_javascript":"messages_javascript.html"},"naming":{"naming_configuration":"naming_configuration.html","naming_javascript":"naming_javascript.html"},"plugins":{"installing_a_plugin":"installing_plugins.html","creating_a_plugin":"creating_plugins.html","plugin_reference":"plugin_reference.html"},"cockpit":{"cockpit_introduction":"cockpit_introduction.html","cockpit_dashboard":"cockpit_dashboard.html","cockpit_deployment":"cockpit_deployment.html","cockpit_explorer":"cockpit_explorer.html","cockpit_editor":"cockpit_editor.html","cockpit_debugger":"cockpit_debugger.html"},"reference":{"embark_commands":"embark_commands.html"},"miscellaneous":{"migrating_from_3":"migrating_from_3.x.html","troubleshooting":"troubleshooting.html","contributing":"contributing.html"}}},"templates":[{"name":"Vyper Template","description":"Template to demonstrate the use of the Vyper contracts","install":"embark new AppName --template vyper","thumbnail":"vyper.png","link":"https://github.com/embarklabs/embark-vyper-template","tags":["vyper","contracts"]},{"name":"Embark Demo React Template","description":"A React Application showcasing Embark's functionality","install":"embark demo","thumbnail":"react.png","link":"https://embark.embarklabs.io/docs/create_project.html#Creating-a-Demo-Project","tags":["react","contracts","whisper","ipfs"]},{"name":"Typescript Template","description":"Template with Typescript support pre-configured","thumbnail":"typescript.png","install":"embark new AppName --template typescript","link":"https://github.com/embarklabs/embark-typescript-template","tags":["typescript","frontend"]},{"name":"Vue.js Template","description":"Ready to use Template for using Embark with vue.js","thumbnail":"vuejs.png","install":"embark new AppName --template vue","link":"https://github.com/embarklabs/embark-vue-template","tags":["vue.js","frontend"]},{"name":"ethvtx Template","description":"Demo app for ethvtx, an Ethereum-Ready & Framework-Agnostic Redux configuration","thumbnail":"vortex.png","install":"embark new AppName --template Horyus/ethvtx_embark","link":"https://github.com/Horyus/ethvtx_embark","tags":["react"]},{"name":"Bamboo Template","description":"Template to demonstrate use of the Bamboo contracts","install":"embark new AppName --template bamboo","thumbnail":"bamboo.png","link":"https://github.com/embarklabs/embark-bamboo-template","tags":["bamboo","contracts"]},{"name":"Solidity Gas Golfing","description":"Boilerplate and tests for the first Solidity Gas Golfing Contest","thumbnail":"sggc.png","install":"embark new AppName --template embarklabs/sggc","link":"https://github.com/embarklabs/sggc","tags":["solidity","tests","fun"]}],"tutorials":[{"name":"How to create a Token Factory with Ethereum — Part 1","description":"Create and Deploy a Token with Ethereum","link":"/tutorials/token_factory_1.html","tags":["token","ethereum"]},{"name":"How to create a Token Factory with Ethereum — Part 2","description":"Create a DApp that can deploy Tokens on the fly","link":"/tutorials/token_factory_2.html","tags":["token","ethereum","client-side-deployment"]},{"name":"How to deploy to a testnet with Infura","description":"Deploy and interact with your Dapp on a testnet with the use of Infura","link":"/tutorials/infura_guide.html","tags":["ethereum","deployment","testnet"]}],"versions":{"latest":{"label":"stable (v4)","url":"https://embark.embarklabs.io/docs"},"3.2":{"label":"v3.2","url":"https://5ca4e0fdb29712000adde37f--embark-site-versions.netlify.com/docs/"}}}},"excerpt":"","more":"

Testing is a crucial part of developing robust and high-quality software. That’s why Embark aims to make testing our Smart Contract as easy as possible. In this guide we’ll explore Embark specific testing APIs and how to write tests for our Smart Contracts.

\n

Creating tests

Test files resides in a project’s test folder. Any JavaScript file within test/ is considered a spec file and will be executed by Embark as such. A spec file contains test specs which are grouped in contract() functions. A single spec is written using it() blocks.

\n

Here’s what such a test could look like:

\n
contract('SomeContract', () => {
it('should pass', () => {
assert.ok(true);
});
});
\n\n

This is a single test spec which will always pass. We’re using a globally available assert object to make assertions in our specs. If you’re familiar with the Mocha testing framework, this syntax might be familiar. In fact, Embark uses Mocha as a test runner behind the scenes.

\n

contract() is just an alias for Mocha’s describe() function and is globally available. In general, global functions and objects are:

\n
    \n
  • contract(): Same as Mocha’s describe
  • \n
  • config(): Function to configure Embark and deploy contracts
  • \n
  • web3: Web3 object
  • \n
  • assert: Node’s assert
  • \n
  • Mocha functions: describe(), it(), before(), etc.
  • \n
\n

Importing EmbarkJS

If we want to use any of EmbarkJS’ APIs, we can require it as expected:

\n
const EmbarkJS = require('Embark/EmbarkJS');
\n\n

For more information on EmbarkJS’s APIs, head over to this guide.

\n

Running tests

Once we’ve written our tests, we can execute them using Embark’s test command:

\n
$ embark test
\n\n

As mentioned earlier, this will pick up all files inside the test/ folder and run them as test files.

\n

Running test subsets

If we aren’t interested in running all tests but only a specific subset, we can specify a test file as part of the test command like this:

\n
$ embark test test/SomeContract_spec.js
\n\n

Running tests against a different node

By default, tests are run using an Ethereum simulator (Ganache). We can use the --node option to change that behavior. Passing --node embark to embark test will use the Ethereum node associated with an already running embark process. We can also specify a custom endpoint, for example:

\n
$ embark test --node ws://localhost:8556
\n\n

Outputting gas cost details

When running tests, we can even get an idea of what the gas costs of our Smart Contract deployments are. Embark comes with a --gasDetails option that makes this possible.

\n
$ embark test --gasDetails
\n\n

Test environment

When running tests, the default [environment}(/docs/environments.html) is test. You can obviously change this using the --env flag.

\n

The special thing with the test environment is that if you do not have a test section in your module configuration, that module with be disabled (enabled: false). This is done to speed up the test as if you don’t need a module, it is disabled.

\n

Configuring Smart Contracts for tests

Very similar to how we configure our Smart Contracts for deployment, we have to configure them for our tests as well. This is important, so that our Smart Contracts get deployed with the correct testing data.

\n

To do that, Embark adds a global config() function to the execution context, which uses the same API as the configuration object for our application’s Smart Contracts. So if we had a SomeContract that should be picked up for deployment, this is what the configuration would look like:

\n
config({
contracts: {
deploy: {
SomeContract: {} // options as discussed in Smart Contract configuration guide
}
}
});

contract('SomContract', () => {
...
});
\n\n

One thing that’s important to note here is that, behind the scenes, Embark has to run config() first to deploy the Smart Contracts and only then starts running tests. This will have an impact on the developer experience when importing Smart Contract instances within spec files. But more on that later.

\n
\n

A note on config()

\n

The global config() function is used for Smart Contract deployment and therefore delays the execution of tests until deployment is done.

\n

\n
\n\n\n\n

Accessing Smart Contract instances

To write meaningful tests, we obviously want to interact with our Smart Contracts. As we know, Embark generates Smart Contract instances for us. All we have to do is importing and using them accordingly.

\n

The following code imports SomeContract and calls an imaginary method on it inside a spec:

\n
const SomeContract = require('EmbarkJS/contracts/SomeContract');

config({
contracts: {
deploy: {
SomeContract: {}
}
}
});

contract('SomeContract', () => {

it('should do something', async () => {
const result = await SomeContract.methods.doSomething.call();
assert.equal(result, 'foo');
});
});
\n\n

There’s one gotcha to keep in mind though. Looking at the snippet above, it seems like we can use SmartContract right away once it is imported. However, this is not actually true. As mentioned earlier, Embark first has to actually deploy our Smart Contracts and until that happens, all imported Smart Contract references are empty objects.

\n

This is not a problem anymore when using Smart Contract instances inside spec blocks, because we know that tests are executed after all Smart Contracts have been deployed. Embark will hydrate the imported references with actual data before the tests are run.

\n
\n

Smart Contract reference hydration

\n

Smart Contract references imported from EmbarkJS are empty until the Smart Contract are actually deployed. This means Smart Contract references can only be used inside contract() blocks.

\n

\n
\n\n\n\n

Configuring accounts

Accounts within the testing environment can be configured just like we’re used to. The same rules apply here, and configuring an Ether balance is supported as well. Configuring custom accounts in tests is especially useful if we want to use a specific account for our tests.

\n
config({
blockchain: {
accounts: [
{
privateKeyFile: 'path/to/file',
balance: '42 shannon'
}
]
}
});
\n\n

Accessing Accounts

Obviously, we want to access all configured accounts as well. Sometimes we want to test functions or methods that require us to specify a from address to send transactions from. For those cases we very likely want to access any of our our available accounts.

\n

All available accounts are emitted by config() and can be accessed using a callback parameter like this:

\n
let accounts = [];

config({
...
}, (err, accounts) => {
accounts = accounts;
});
\n\n

You can also grab the accounts from the callback of the contract() function (describe alias):

\n
contract('SomeContract', (accounts) => {
const myAccounts = accounts[0];

it('should do something', async () => {
...
});
});
\n\n

Connecting to a different node

By default, Embark will use an internal VM to run the tests. However we can also specify a node to connect to and run the tests there, using the host, port and type options as shown below:

\n
config({
blockchain: {
"endpoint": "http://localhost:8545"
}
});
\n\n

Configuring modules

You can configure the different Embark modules directly in your test file. The available modules are: storage, namesystem and communication.

\n

All configuration options for the respective modules are available. Also, the configurations you put inside the config function are merged inside the ones that are in the configuration file (meaning that you don’t have to put all the provider options if they are already in the default configs).

\n
config({
storage: {
enabled: true
},
communication: {
enabled: true
},
namesystem: {
enabled: true,
register: {
rootDomain: "test.eth"
}
}
});
\n\n

If the module is not started (eg. IPFS), Embark will start it for you.

\n

Manually deploying Smart Contracts

As mentioned earlier, Embark handles the deployment of our Smart Contracts using the function config() function. If we wish to deploy particular Smart Contracts manually, we can do so using an imported Smart Contract reference. We just need to make sure that we’re doing this inside a contract() block as discussed earlier:

\n
const SimpleStorage = require('Embark/contracts/SimpleStorage');

contract('SimpleStorage Deploy', () => {
let SimpleStorageInstance;

before(async function() {
SimpleStorageInstance = await SimpleStorage.deploy({ arguments: [150] }).send();
});

it('should set constructor value', async () => {
let result = await SimpleStorageInstance.methods.storedData().call();
assert.strictEqual(parseInt(result, 10), 150);
});
});
\n\n

Util functions

assert.reverts

Using assert.reverts, you can easily assert that your transaction reverts.

\n
await assert.reverts(contractMethodAndArguments[, options][, message])
\n\n
    \n
  • contractMethodAndArguments: [Function] Contract method to call send on, including the arguments
  • \n
  • options: [Object] Optional options to pass to the send function
  • \n
  • message: [String] Optional string to match the revert message
  • \n
\n

Returns a promise that you can wait for with await.

\n
it(\"should revert with a value lower than 5\", async function() {
await assert.reverts(SimpleStorage.methods.setHigher5(2), {from: web3.eth.defaultAccount},
'Returned error: VM Exception while processing transaction: revert Value needs to be higher than 5');
});
\n\n

assert.eventEmitted

Using eventEmitted, you can assert that a transaction has emitted an event. You can also check for the returned values.

\n
assert.eventEmitted(transaction, event[, values])
\n\n
    \n
  • transaction: [Object] Transaction object returns by a send call
  • \n
  • event: [String] Name of the event being emitted
  • \n
  • values: [Array or Object] Optional array or object of the returned values of the event.
      \n
    • Using array: The order of the values put in the array need to match the order in which the values are returned by the event
    • \n
    • Using object: The object needs to have the right key/value pair(s)
    • \n
    \n
  • \n
\n
it('asserts that the event was triggered', async function() {
const transaction = await SimpleStorage.methods.set(100).send();
assert.eventEmitted(transaction, 'EventOnSet', {value: \"100\", success: true});
});
\n\n

increaseTime

This function lets you increase the time of the EVM. It is useful in the case where you want to test expiration times for example.

\n
await increaseTime(amount);
\n\n

amount: [Number] Number of seconds to increase

\n
it(\"should have expired after increasing time\", async function () {
await increaseTime(5001);
const isExpired = await Expiration.methods.isExpired().call();
assert.strictEqual(isExpired, true);
});
\n\n

Code coverage

Embark allows you to generate a coverage report for your Solidity Smart Contracts by passing the --coverage option on the embark test command.

\n
$ embark test --coverage
\n\n

The generated report looks something like this:

\n

\"Coverage

\n

This gives us a birds-eye view on the state of the coverage of our Smart Contracts: how many of the functions were called, how many lines were hit, even whether all the branch cases were executed. When selecting a file, a more detailed report is produced. Here’s what it looks like:

\n

\"Coverage

\n"},{"title":"Contributing to Embark","layout":"docs","_content":"\nWe would love for you to contribute to Embark and help make it even better than it is\ntoday! As a contributor, here are the guidelines we would like you to follow:\n\n - [Code of Conduct](#coc)\n - [Question or Problem?](#question)\n - [Issues and Bugs](#issue)\n - [Feature Requests](#feature)\n - [Submission Guidelines](#submit)\n - [Coding Rules](#rules)\n - [Commit Message Guidelines](#commit)\n\n## Code of Conduct\nHelp us keep Embark open and inclusive. Please read and follow our [Code of Conduct](https://github.com/embarklabs/embark/blob/master/CODE_OF_CONDUCT.md).\n\n## Got a Question or Problem?\n\nDo not open issues for general support questions as we want to keep GitHub issues for bug reports and feature requests. You've got much better chances of getting your question answered on [Stack Exchange](https://ethereum.stackexchange.com/search?tab=newest&q=embark) where the questions should be tagged with tag `embark`.\n\nStack Exchange is a much better place to ask questions since:\n\n- there are thousands of people willing to help\n- questions and answers stay available for public viewing so your question / answer might help someone else\n- Stack Exchange's voting system assures that the best answers are prominently visible.\n\nTo save your and our time, we will systematically close all issues that are requests for general support and redirect people to Stack Exchange.\n\nIf you would like to chat about the question in real-time, you can reach out via [our gitter channel](https://gitter.im/embark-framework/Lobby).\n\n## Found a Bug?\nIf you find a bug in the source code, you can help us by\n[submitting an issue](#submit-issue) to our [GitHub Repository](https://github.com/embarklabs/embark/). Even better, you can\n[submit a Pull Request](#submit-pr) with a fix.\n\n## Missing a Feature?\nYou can *request* a new feature by [submitting an issue](#submit-issue) to our GitHub\nRepository. If you would like to *implement* a new feature, please submit an issue with\na proposal for your work first, to be sure that we can use it.\nPlease consider what kind of change it is:\n\n* For a **Major Feature**, first open an issue and outline your proposal so that it can be\ndiscussed. This will also allow us to better coordinate our efforts, prevent duplication of work,\nand help you to craft the change so that it is successfully accepted into the project.\n* **Small Features** can be crafted and directly [submitted as a Pull Request](#submit-pr).\n\n## Submission Guidelines\n\n### Submitting an Issue\n\nBefore you submit an issue, please search the issue tracker, maybe an issue for your problem already exists and the discussion might inform you of workarounds readily available.\n\nWe want to fix all the issues as soon as possible, but before fixing a bug we need to reproduce and confirm it. In order to reproduce bugs, we will systematically ask you to provide steps to reproduce your issue.\n\nYou can file new issues by filling out our [new issue form](https://github.com/embarklabs/embark/issues/new/choose).\n\n### Submitting a Pull Request (PR)\nBefore you submit your Pull Request (PR) consider the following guidelines:\n\n1. Search [GitHub](https://github.com/embarklabs/embark/pulls) for an open or closed PR\n that relates to your submission. You don't want to duplicate effort.\n1. Fork the embarklabs/embark repo.\n1. Make your changes in a new git branch:\n\n ```shell\n git checkout -b my-fix-branch master\n ```\n\n1. Create your patch, **including appropriate test cases**.\n1. Run the QA suite, by running `$ npm run qa` and ensure that all steps succeed.\n1. Commit your changes using a descriptive commit message that follows our\n [commit message conventions](#commit). Adherence to these conventions\n is necessary because release notes are automatically generated from these messages.\n\n ```shell\n git commit -a\n ```\n Note: the optional commit `-a` command line option will automatically \"add\" and \"rm\" edited files.\n\n1. Push your branch to GitHub:\n\n ```shell\n git push origin my-fix-branch\n ```\n\n1. In GitHub, send a pull request to `embark:master`.\n* If we suggest changes then:\n * Make the required updates.\n * Re-run the test suites to ensure tests are still passing.\n * Rebase your branch and force push to your GitHub repository (this will update your Pull Request):\n\n ```shell\n git rebase master -i\n git push -f\n ```\n\nThat's it! Thank you for your contribution!\n\n#### After your pull request is merged\n\nAfter your pull request is merged, you can safely delete your branch and pull the changes\nfrom the main (upstream) repository:\n\n* Delete the remote branch on GitHub either through the GitHub web UI or your local shell as follows:\n\n ```shell\n git push origin --delete my-fix-branch\n ```\n\n* Check out the master branch:\n\n ```shell\n git checkout master -f\n ```\n\n* Delete the local branch:\n\n ```shell\n git branch -D my-fix-branch\n ```\n\n* Update your master with the latest upstream version:\n\n ```shell\n git pull --ff upstream master\n ```\n\n## Coding Rules\nTo ensure consistency throughout the source code, keep these rules in mind as you are working:\n\n* All public API methods **must be documented**.\n\n## Commit Message Guidelines\n\nWe have very precise rules over how our git commit messages can be formatted. This leads to **more\nreadable messages** that are easy to follow when looking through the **project history**. But also,\nwe use the git commit messages to **generate the Embark change log**.\n\n### Commit Message Format\nEach commit message consists of a **header**, a **body** and a **footer**. The header has a special\nformat that includes a **type**, a **scope** and a **subject**:\n\n```\ntype(@embark|@cockpit/): \n\n\n\n