/ docs / migrating_from_3.x.html
migrating_from_3.x.html
   1  <!DOCTYPE html>
   2  <html lang="en" dir="ltr">
   3    <head prefix="og: http://ogp.me/ns#">
   4    <meta charset="utf-8">
   5    <title>Migrating from Embark 3.x | Embark</title>
   6    <meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1">
   7    <meta name="viewport" content="width=device-width, initial-scale=1">
   8    <!-- Canonical links -->
   9    <link rel="canonical" href="https://framework.embarklabs.io/docs/migrating_from_3.x.html">
  10    <!-- Alternative links -->
  11    
  12  
  13    <!-- Icon -->
  14    <meta name="msapplication-TileColor" content="#080E1A">
  15    <link rel="icon" type="image/png" href="/assets/images/favicon-16.png" sizes="16x16" />
  16    <link rel="icon" type="image/png" href="/assets/images/favicon-32.png" sizes="32x32" />
  17  
  18    <link rel="apple-touch-icon" sizes="76x76" href="/assets/images/apple-touch-icon-60x60-precomposed.png">
  19    <link rel="apple-touch-icon" sizes="76x76" href="/assets/images/apple-touch-icon-76x76-precomposed.png">
  20    <link rel="apple-touch-icon" sizes="120x120" href="/assets/images/apple-touch-icon-120x120-precomposed.png">
  21    <link rel="apple-touch-icon" sizes="152x152" href="/assets/images/apple-touch-icon-152x152-precomposed.png">
  22    <link rel="apple-touch-icon" sizes="180x180" href="/assets/images/apple-touch-icon-precomposed.png">
  23    <link rel="apple-touch-icon" href="/assets/images/apple-touch-icon-precomposed.png">
  24    <!-- CSS -->
  25    
  26  <link rel="stylesheet" href="/css/embark.css">
  27  
  28    <!-- endbuild -->
  29  
  30    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css">
  31    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/docsearch.js@2/dist/cdn/docsearch.min.css" />
  32  
  33    <!-- RSS -->
  34    <link rel="alternate" href="/atom.xml" title="Embark">
  35    <meta property="og:image" content="/img/share.png?v=0.0.5" />
  36    <link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.15.4/styles/dracula.min.css">
  37  
  38    <script async defer src="https://buttons.github.io/buttons.js"></script>
  39  
  40  
  41  <script>
  42    !function(root, factory) {
  43      "function" == typeof define && define.amd ? // AMD. Register as an anonymous module unless amdModuleId is set
  44      define([], function() {
  45          return root.svg4everybody = factory();
  46      }) : "object" == typeof module && module.exports ? // Node. Does not work with strict CommonJS, but
  47      // only CommonJS-like environments that support module.exports,
  48      // like Node.
  49      module.exports = factory() : root.svg4everybody = factory();
  50  }(this, function() {
  51      /*! svg4everybody v2.1.9 | github.com/jonathantneal/svg4everybody */
  52      function embed(parent, svg, target) {
  53          // if the target exists
  54          if (target) {
  55              // create a document fragment to hold the contents of the target
  56              var fragment = document.createDocumentFragment(), viewBox = !svg.hasAttribute("viewBox") && target.getAttribute("viewBox");
  57              // conditionally set the viewBox on the svg
  58              viewBox && svg.setAttribute("viewBox", viewBox);
  59              // copy the contents of the clone into the fragment
  60              for (// clone the target
  61              var clone = target.cloneNode(!0); clone.childNodes.length; ) {
  62                  fragment.appendChild(clone.firstChild);
  63              }
  64              // append the fragment into the svg
  65              parent.appendChild(fragment);
  66          }
  67      }
  68      function loadreadystatechange(xhr) {
  69          // listen to changes in the request
  70          xhr.onreadystatechange = function() {
  71              // if the request is ready
  72              if (4 === xhr.readyState) {
  73                  // get the cached html document
  74                  var cachedDocument = xhr._cachedDocument;
  75                  // ensure the cached html document based on the xhr response
  76                  cachedDocument || (cachedDocument = xhr._cachedDocument = document.implementation.createHTMLDocument(""),
  77                  cachedDocument.body.innerHTML = xhr.responseText, xhr._cachedTarget = {}), // clear the xhr embeds list and embed each item
  78                  xhr._embeds.splice(0).map(function(item) {
  79                      // get the cached target
  80                      var target = xhr._cachedTarget[item.id];
  81                      // ensure the cached target
  82                      target || (target = xhr._cachedTarget[item.id] = cachedDocument.getElementById(item.id)),
  83                      // embed the target into the svg
  84                      embed(item.parent, item.svg, target);
  85                  });
  86              }
  87          }, // test the ready state change immediately
  88          xhr.onreadystatechange();
  89      }
  90      function svg4everybody(rawopts) {
  91          function oninterval() {
  92              // while the index exists in the live <use> collection
  93              for (// get the cached <use> index
  94              var index = 0; index < uses.length; ) {
  95                  // get the current <use>
  96                  var use = uses[index], parent = use.parentNode, svg = getSVGAncestor(parent), src = use.getAttribute("xlink:href") || use.getAttribute("href");
  97                  if (!src && opts.attributeName && (src = use.getAttribute(opts.attributeName)),
  98                  svg && src) {
  99                      if (polyfill) {
 100                          if (!opts.validate || opts.validate(src, svg, use)) {
 101                              // remove the <use> element
 102                              parent.removeChild(use);
 103                              // parse the src and get the url and id
 104                              var srcSplit = src.split("#"), url = srcSplit.shift(), id = srcSplit.join("#");
 105                              // if the link is external
 106                              if (url.length) {
 107                                  // get the cached xhr request
 108                                  var xhr = requests[url];
 109                                  // ensure the xhr request exists
 110                                  xhr || (xhr = requests[url] = new XMLHttpRequest(), xhr.open("GET", url), xhr.send(),
 111                                  xhr._embeds = []), // add the svg and id as an item to the xhr embeds list
 112                                  xhr._embeds.push({
 113                                      parent: parent,
 114                                      svg: svg,
 115                                      id: id
 116                                  }), // prepare the xhr ready state change event
 117                                  loadreadystatechange(xhr);
 118                              } else {
 119                                  // embed the local id into the svg
 120                                  embed(parent, svg, document.getElementById(id));
 121                              }
 122                          } else {
 123                              // increase the index when the previous value was not "valid"
 124                              ++index, ++numberOfSvgUseElementsToBypass;
 125                          }
 126                      }
 127                  } else {
 128                      // increase the index when the previous value was not "valid"
 129                      ++index;
 130                  }
 131              }
 132              // continue the interval
 133              (!uses.length || uses.length - numberOfSvgUseElementsToBypass > 0) && requestAnimationFrame(oninterval, 67);
 134          }
 135          var polyfill, opts = Object(rawopts), newerIEUA = /\bTrident\/[567]\b|\bMSIE (?:9|10)\.0\b/, webkitUA = /\bAppleWebKit\/(\d+)\b/, olderEdgeUA = /\bEdge\/12\.(\d+)\b/, edgeUA = /\bEdge\/.(\d+)\b/, inIframe = window.top !== window.self;
 136          polyfill = "polyfill" in opts ? opts.polyfill : newerIEUA.test(navigator.userAgent) || (navigator.userAgent.match(olderEdgeUA) || [])[1] < 10547 || (navigator.userAgent.match(webkitUA) || [])[1] < 537 || edgeUA.test(navigator.userAgent) && inIframe;
 137          // create xhr requests object
 138          var requests = {}, requestAnimationFrame = window.requestAnimationFrame || setTimeout, uses = document.getElementsByTagName("use"), numberOfSvgUseElementsToBypass = 0;
 139          // conditionally start the interval if the polyfill is active
 140          polyfill && oninterval();
 141      }
 142      function getSVGAncestor(node) {
 143          for (var svg = node; "svg" !== svg.nodeName.toLowerCase() && (svg = svg.parentNode); ) {}
 144          return svg;
 145      }
 146      return svg4everybody;
 147  });
 148  
 149  svg4everybody();
 150  </script>
 151  </head>
 152  
 153    <body>
 154      <header role="banner" class="c-header c-header--compact">
 155    <span class="c-header__background"></span>
 156    <div class="o-container c-header__content">
 157      <div class="c-header__top">
 158        <a href="/" title="Embark" class="c-logo c-logo--negative">Embark</a>
 159        <nav role="navigation" class="c-navigation">
 160          <div class="c-navigation__header">
 161            <a href="/" title="Embark" class="c-logo">Embark</a>
 162            <button class="c-navigation__close u-text-light" title="Close menu">
 163              <svg class="c-icon c-icon--xs"><use xlink:href="/../assets/icons/symbols.svg#icon-close"></use></svg>
 164            </button>
 165          </div>
 166          <div class="c-navigation__body">
 167            <ul class="c-navigation__list">
 168              <li class="c-navigation__item">
 169                <a href="/docs/quick_start.html" class="c-navigation__anchor " title="Quick Start">Quick Start</a>
 170              </li>
 171              <li class="c-navigation__item">
 172                <a href="/docs" class="c-navigation__anchor is-active" title="Learn">Learn</a>
 173              </li>
 174              <li class="c-navigation__item">
 175                <a href="/plugins" class="c-navigation__anchor " title="Plugins">Plugins</a>
 176              </li>
 177              <li class="c-navigation__item">
 178                <a href="/community" class="c-navigation__anchor " title="Community">Community</a>
 179              </li>
 180              <li class="c-navigation__item">
 181                <a href="https://blog.embarklabs.io" target="_blank" rel="noopener" class="c-navigation__anchor " title="Blog">Blog</a>
 182              </li>
 183            </ul>
 184          </div>
 185        </nav>
 186        <div class="o-flex o-flex-center">
 187          <form action="" class="o-flex__item u-hidden-until-large">
 188            <input type="search" placeholder="Search" id="search-input">
 189          </form>
 190          <div class="o-flex__item">
 191            <ul class="o-flex o-flex-center">
 192              <li class="o-flex__item">
 193                <a href="https://github.com/embarklabs/embark" title="Github" target="_blank" class="u-link-ghost">
 194                  <svg class="c-icon"><use xlink:href="/../assets/icons/symbols.svg#icon-github"></use></svg>
 195                </a>
 196              </li>
 197              <li class="o-flex__item">
 198                <a href="https://twitter.com/EmbarkProject" title="Twitter" target="_blank">
 199                  <svg class="c-icon"><use xlink:href="/../assets/icons/symbols.svg#icon-twitter"></use></svg>
 200                </a>
 201              </li>
 202              <li class="o-flex__item u-hidden-large-up">
 203                <button type="button"class="c-navigation__trigger u-link-ghost" title="Open menu">
 204                  <svg class="c-icon"><use xlink:href="/../assets/icons/symbols.svg#icon-navigation-menu"></use></svg>
 205                </button>
 206              </li>
 207            </ul>
 208          </div>
 209        </div>
 210      </div>
 211      <div class="c-quick-search o-distance-m u-hidden-large-up">
 212        <input type="search" id="inp-search" placeholder="Search">
 213      </div>
 214      <div class="c-header__body">
 215        <h1 class="c-title u-text-ghost">Documentation</h1>
 216  
 217        
 218  
 219        
 220        
 221      </div>
 222    </div>
 223  </header>
 224  
 225  
 226  <main role="main">
 227    <section class="o-guided-content o-distance">
 228      <div class="o-guided-content__wrapper">
 229        <button title="Open docs menu" id="guides-trigger" class="c-button c-button--minion u-hidden-large-up">
 230          <svg class="c-icon c-icon--xs"><use xlink:href="/../../assets/icons/symbols.svg#icon-navigation-menu"></use></svg>
 231          <span>Guides</span>
 232        </button>
 233        <div class="c-guide o-guided-content__guide"  id="guide-navigation">
 234          <div class="c-guide__header u-hidden-large-up">
 235            <a href="" title="Guides">
 236              Guides
 237            </a>
 238            <button type="button" title="Close menu" id="guides-close">
 239              <svg class="c-icon c-icon--xs"><use xlink:href="/../../assets/icons/symbols.svg#icon-close"></use></svg>
 240            </button>
 241          </div>
 242          <div class="c-guide__body">
 243            <nav role="navigation">
 244              
 245                <div class="">
 246                  <h3 class="c-category-title">Getting Started</h3>
 247                  <ul class="o-list-bare">
 248                    
 249                    <li class="o-list-bare__item">
 250                      <a href="/docs/overview.html" title="Overview" class="u-link-uniform ">Overview</a>
 251                      <!-- <div class="o-distance-m">
 252                        <ul class="o-list-bare c-navigation__subnav">
 253                          <li class="o-list-bare__item">
 254                            <a href="#" title="What is Embark?" class="u-link-uniform">What is Embark?</a>
 255                          </li>
 256                        </ul>
 257                      </div> -->
 258                    </li>
 259                    
 260                    <li class="o-list-bare__item">
 261                      <a href="/docs/installation.html" title="Installation" class="u-link-uniform ">Installation</a>
 262                      <!-- <div class="o-distance-m">
 263                        <ul class="o-list-bare c-navigation__subnav">
 264                          <li class="o-list-bare__item">
 265                            <a href="#" title="What is Embark?" class="u-link-uniform">What is Embark?</a>
 266                          </li>
 267                        </ul>
 268                      </div> -->
 269                    </li>
 270                    
 271                    <li class="o-list-bare__item">
 272                      <a href="/docs/faq.html" title="FAQ" class="u-link-uniform ">FAQ</a>
 273                      <!-- <div class="o-distance-m">
 274                        <ul class="o-list-bare c-navigation__subnav">
 275                          <li class="o-list-bare__item">
 276                            <a href="#" title="What is Embark?" class="u-link-uniform">What is Embark?</a>
 277                          </li>
 278                        </ul>
 279                      </div> -->
 280                    </li>
 281                    
 282                  </ul>
 283                
 284              
 285                <div class="o-distance-xl">
 286                  <h3 class="c-category-title">General Usage</h3>
 287                  <ul class="o-list-bare">
 288                    
 289                    <li class="o-list-bare__item">
 290                      <a href="/docs/create_project.html" title="Creating apps" class="u-link-uniform ">Creating apps</a>
 291                      <!-- <div class="o-distance-m">
 292                        <ul class="o-list-bare c-navigation__subnav">
 293                          <li class="o-list-bare__item">
 294                            <a href="#" title="What is Embark?" class="u-link-uniform">What is Embark?</a>
 295                          </li>
 296                        </ul>
 297                      </div> -->
 298                    </li>
 299                    
 300                    <li class="o-list-bare__item">
 301                      <a href="/docs/structure.html" title="App structure" class="u-link-uniform ">App structure</a>
 302                      <!-- <div class="o-distance-m">
 303                        <ul class="o-list-bare c-navigation__subnav">
 304                          <li class="o-list-bare__item">
 305                            <a href="#" title="What is Embark?" class="u-link-uniform">What is Embark?</a>
 306                          </li>
 307                        </ul>
 308                      </div> -->
 309                    </li>
 310                    
 311                    <li class="o-list-bare__item">
 312                      <a href="/docs/running_apps.html" title="Running apps" class="u-link-uniform ">Running apps</a>
 313                      <!-- <div class="o-distance-m">
 314                        <ul class="o-list-bare c-navigation__subnav">
 315                          <li class="o-list-bare__item">
 316                            <a href="#" title="What is Embark?" class="u-link-uniform">What is Embark?</a>
 317                          </li>
 318                        </ul>
 319                      </div> -->
 320                    </li>
 321                    
 322                    <li class="o-list-bare__item">
 323                      <a href="/docs/dashboard.html" title="Using the dashboard" class="u-link-uniform ">Using the dashboard</a>
 324                      <!-- <div class="o-distance-m">
 325                        <ul class="o-list-bare c-navigation__subnav">
 326                          <li class="o-list-bare__item">
 327                            <a href="#" title="What is Embark?" class="u-link-uniform">What is Embark?</a>
 328                          </li>
 329                        </ul>
 330                      </div> -->
 331                    </li>
 332                    
 333                    <li class="o-list-bare__item">
 334                      <a href="/docs/using_the_console.html" title="Using the console" class="u-link-uniform ">Using the console</a>
 335                      <!-- <div class="o-distance-m">
 336                        <ul class="o-list-bare c-navigation__subnav">
 337                          <li class="o-list-bare__item">
 338                            <a href="#" title="What is Embark?" class="u-link-uniform">What is Embark?</a>
 339                          </li>
 340                        </ul>
 341                      </div> -->
 342                    </li>
 343                    
 344                    <li class="o-list-bare__item">
 345                      <a href="/docs/environments.html" title="Environments" class="u-link-uniform ">Environments</a>
 346                      <!-- <div class="o-distance-m">
 347                        <ul class="o-list-bare c-navigation__subnav">
 348                          <li class="o-list-bare__item">
 349                            <a href="#" title="What is Embark?" class="u-link-uniform">What is Embark?</a>
 350                          </li>
 351                        </ul>
 352                      </div> -->
 353                    </li>
 354                    
 355                    <li class="o-list-bare__item">
 356                      <a href="/docs/configuration.html" title="Configuration" class="u-link-uniform ">Configuration</a>
 357                      <!-- <div class="o-distance-m">
 358                        <ul class="o-list-bare c-navigation__subnav">
 359                          <li class="o-list-bare__item">
 360                            <a href="#" title="What is Embark?" class="u-link-uniform">What is Embark?</a>
 361                          </li>
 362                        </ul>
 363                      </div> -->
 364                    </li>
 365                    
 366                    <li class="o-list-bare__item">
 367                      <a href="/docs/pipeline_and_webpack.html" title="Building & Compiling" class="u-link-uniform ">Building & Compiling</a>
 368                      <!-- <div class="o-distance-m">
 369                        <ul class="o-list-bare c-navigation__subnav">
 370                          <li class="o-list-bare__item">
 371                            <a href="#" title="What is Embark?" class="u-link-uniform">What is Embark?</a>
 372                          </li>
 373                        </ul>
 374                      </div> -->
 375                    </li>
 376                    
 377                    <li class="o-list-bare__item">
 378                      <a href="/docs/executing_scripts.html" title="Executing Scripts" class="u-link-uniform ">Executing Scripts</a>
 379                      <!-- <div class="o-distance-m">
 380                        <ul class="o-list-bare c-navigation__subnav">
 381                          <li class="o-list-bare__item">
 382                            <a href="#" title="What is Embark?" class="u-link-uniform">What is Embark?</a>
 383                          </li>
 384                        </ul>
 385                      </div> -->
 386                    </li>
 387                    
 388                    <li class="o-list-bare__item">
 389                      <a href="/docs/javascript_usage.html" title="Using EmbarkJS" class="u-link-uniform ">Using EmbarkJS</a>
 390                      <!-- <div class="o-distance-m">
 391                        <ul class="o-list-bare c-navigation__subnav">
 392                          <li class="o-list-bare__item">
 393                            <a href="#" title="What is Embark?" class="u-link-uniform">What is Embark?</a>
 394                          </li>
 395                        </ul>
 396                      </div> -->
 397                    </li>
 398                    
 399                  </ul>
 400                </div>
 401              
 402                <div class="o-distance-xl">
 403                  <h3 class="c-category-title">Smart Contract Development</h3>
 404                  <ul class="o-list-bare">
 405                    
 406                    <li class="o-list-bare__item">
 407                      <a href="/docs/contracts_configuration.html" title="Configuration" class="u-link-uniform ">Configuration</a>
 408                      <!-- <div class="o-distance-m">
 409                        <ul class="o-list-bare c-navigation__subnav">
 410                          <li class="o-list-bare__item">
 411                            <a href="#" title="What is Embark?" class="u-link-uniform">What is Embark?</a>
 412                          </li>
 413                        </ul>
 414                      </div> -->
 415                    </li>
 416                    
 417                    <li class="o-list-bare__item">
 418                      <a href="/docs/contracts_deployment.html" title="Accounts & Deployment" class="u-link-uniform ">Accounts & Deployment</a>
 419                      <!-- <div class="o-distance-m">
 420                        <ul class="o-list-bare c-navigation__subnav">
 421                          <li class="o-list-bare__item">
 422                            <a href="#" title="What is Embark?" class="u-link-uniform">What is Embark?</a>
 423                          </li>
 424                        </ul>
 425                      </div> -->
 426                    </li>
 427                    
 428                    <li class="o-list-bare__item">
 429                      <a href="/docs/contracts_imports.html" title="Special Imports" class="u-link-uniform ">Special Imports</a>
 430                      <!-- <div class="o-distance-m">
 431                        <ul class="o-list-bare c-navigation__subnav">
 432                          <li class="o-list-bare__item">
 433                            <a href="#" title="What is Embark?" class="u-link-uniform">What is Embark?</a>
 434                          </li>
 435                        </ul>
 436                      </div> -->
 437                    </li>
 438                    
 439                    <li class="o-list-bare__item">
 440                      <a href="/docs/contracts_testing.html" title="Testing" class="u-link-uniform ">Testing</a>
 441                      <!-- <div class="o-distance-m">
 442                        <ul class="o-list-bare c-navigation__subnav">
 443                          <li class="o-list-bare__item">
 444                            <a href="#" title="What is Embark?" class="u-link-uniform">What is Embark?</a>
 445                          </li>
 446                        </ul>
 447                      </div> -->
 448                    </li>
 449                    
 450                    <li class="o-list-bare__item">
 451                      <a href="/docs/contracts_javascript.html" title="Smart Contracts in JavaScript" class="u-link-uniform ">Smart Contracts in JavaScript</a>
 452                      <!-- <div class="o-distance-m">
 453                        <ul class="o-list-bare c-navigation__subnav">
 454                          <li class="o-list-bare__item">
 455                            <a href="#" title="What is Embark?" class="u-link-uniform">What is Embark?</a>
 456                          </li>
 457                        </ul>
 458                      </div> -->
 459                    </li>
 460                    
 461                  </ul>
 462                </div>
 463              
 464                <div class="o-distance-xl">
 465                  <h3 class="c-category-title">Blockchain Client</h3>
 466                  <ul class="o-list-bare">
 467                    
 468                    <li class="o-list-bare__item">
 469                      <a href="/docs/blockchain_configuration.html" title="Configuration" class="u-link-uniform ">Configuration</a>
 470                      <!-- <div class="o-distance-m">
 471                        <ul class="o-list-bare c-navigation__subnav">
 472                          <li class="o-list-bare__item">
 473                            <a href="#" title="What is Embark?" class="u-link-uniform">What is Embark?</a>
 474                          </li>
 475                        </ul>
 476                      </div> -->
 477                    </li>
 478                    
 479                    <li class="o-list-bare__item">
 480                      <a href="/docs/blockchain_accounts_configuration.html" title="Managing Accounts" class="u-link-uniform ">Managing Accounts</a>
 481                      <!-- <div class="o-distance-m">
 482                        <ul class="o-list-bare c-navigation__subnav">
 483                          <li class="o-list-bare__item">
 484                            <a href="#" title="What is Embark?" class="u-link-uniform">What is Embark?</a>
 485                          </li>
 486                        </ul>
 487                      </div> -->
 488                    </li>
 489                    
 490                  </ul>
 491                </div>
 492              
 493                <div class="o-distance-xl">
 494                  <h3 class="c-category-title">Storage (IPFS/Swarm)</h3>
 495                  <ul class="o-list-bare">
 496                    
 497                    <li class="o-list-bare__item">
 498                      <a href="/docs/storage_configuration.html" title="Configuration" class="u-link-uniform ">Configuration</a>
 499                      <!-- <div class="o-distance-m">
 500                        <ul class="o-list-bare c-navigation__subnav">
 501                          <li class="o-list-bare__item">
 502                            <a href="#" title="What is Embark?" class="u-link-uniform">What is Embark?</a>
 503                          </li>
 504                        </ul>
 505                      </div> -->
 506                    </li>
 507                    
 508                    <li class="o-list-bare__item">
 509                      <a href="/docs/storage_deployment.html" title="Deploying apps" class="u-link-uniform ">Deploying apps</a>
 510                      <!-- <div class="o-distance-m">
 511                        <ul class="o-list-bare c-navigation__subnav">
 512                          <li class="o-list-bare__item">
 513                            <a href="#" title="What is Embark?" class="u-link-uniform">What is Embark?</a>
 514                          </li>
 515                        </ul>
 516                      </div> -->
 517                    </li>
 518                    
 519                    <li class="o-list-bare__item">
 520                      <a href="/docs/storage_javascript.html" title="Storage APIs in JavaScript" class="u-link-uniform ">Storage APIs in JavaScript</a>
 521                      <!-- <div class="o-distance-m">
 522                        <ul class="o-list-bare c-navigation__subnav">
 523                          <li class="o-list-bare__item">
 524                            <a href="#" title="What is Embark?" class="u-link-uniform">What is Embark?</a>
 525                          </li>
 526                        </ul>
 527                      </div> -->
 528                    </li>
 529                    
 530                  </ul>
 531                </div>
 532              
 533                <div class="o-distance-xl">
 534                  <h3 class="c-category-title">Messages (Whisper)</h3>
 535                  <ul class="o-list-bare">
 536                    
 537                    <li class="o-list-bare__item">
 538                      <a href="/docs/messages_configuration.html" title="Configuration" class="u-link-uniform ">Configuration</a>
 539                      <!-- <div class="o-distance-m">
 540                        <ul class="o-list-bare c-navigation__subnav">
 541                          <li class="o-list-bare__item">
 542                            <a href="#" title="What is Embark?" class="u-link-uniform">What is Embark?</a>
 543                          </li>
 544                        </ul>
 545                      </div> -->
 546                    </li>
 547                    
 548                    <li class="o-list-bare__item">
 549                      <a href="/docs/messages_javascript.html" title="Messages in JavaScript" class="u-link-uniform ">Messages in JavaScript</a>
 550                      <!-- <div class="o-distance-m">
 551                        <ul class="o-list-bare c-navigation__subnav">
 552                          <li class="o-list-bare__item">
 553                            <a href="#" title="What is Embark?" class="u-link-uniform">What is Embark?</a>
 554                          </li>
 555                        </ul>
 556                      </div> -->
 557                    </li>
 558                    
 559                  </ul>
 560                </div>
 561              
 562                <div class="o-distance-xl">
 563                  <h3 class="c-category-title">Naming Systems (ENS)</h3>
 564                  <ul class="o-list-bare">
 565                    
 566                    <li class="o-list-bare__item">
 567                      <a href="/docs/naming_configuration.html" title="Configuration" class="u-link-uniform ">Configuration</a>
 568                      <!-- <div class="o-distance-m">
 569                        <ul class="o-list-bare c-navigation__subnav">
 570                          <li class="o-list-bare__item">
 571                            <a href="#" title="What is Embark?" class="u-link-uniform">What is Embark?</a>
 572                          </li>
 573                        </ul>
 574                      </div> -->
 575                    </li>
 576                    
 577                    <li class="o-list-bare__item">
 578                      <a href="/docs/naming_javascript.html" title="Naming Systems in JavaScript" class="u-link-uniform ">Naming Systems in JavaScript</a>
 579                      <!-- <div class="o-distance-m">
 580                        <ul class="o-list-bare c-navigation__subnav">
 581                          <li class="o-list-bare__item">
 582                            <a href="#" title="What is Embark?" class="u-link-uniform">What is Embark?</a>
 583                          </li>
 584                        </ul>
 585                      </div> -->
 586                    </li>
 587                    
 588                  </ul>
 589                </div>
 590              
 591                <div class="o-distance-xl">
 592                  <h3 class="c-category-title">Plugins</h3>
 593                  <ul class="o-list-bare">
 594                    
 595                    <li class="o-list-bare__item">
 596                      <a href="/docs/installing_plugins.html" title="Installing plugins" class="u-link-uniform ">Installing plugins</a>
 597                      <!-- <div class="o-distance-m">
 598                        <ul class="o-list-bare c-navigation__subnav">
 599                          <li class="o-list-bare__item">
 600                            <a href="#" title="What is Embark?" class="u-link-uniform">What is Embark?</a>
 601                          </li>
 602                        </ul>
 603                      </div> -->
 604                    </li>
 605                    
 606                    <li class="o-list-bare__item">
 607                      <a href="/docs/creating_plugins.html" title="Creating plugins" class="u-link-uniform ">Creating plugins</a>
 608                      <!-- <div class="o-distance-m">
 609                        <ul class="o-list-bare c-navigation__subnav">
 610                          <li class="o-list-bare__item">
 611                            <a href="#" title="What is Embark?" class="u-link-uniform">What is Embark?</a>
 612                          </li>
 613                        </ul>
 614                      </div> -->
 615                    </li>
 616                    
 617                    <li class="o-list-bare__item">
 618                      <a href="/docs/plugin_reference.html" title="Plugin APIs" class="u-link-uniform ">Plugin APIs</a>
 619                      <!-- <div class="o-distance-m">
 620                        <ul class="o-list-bare c-navigation__subnav">
 621                          <li class="o-list-bare__item">
 622                            <a href="#" title="What is Embark?" class="u-link-uniform">What is Embark?</a>
 623                          </li>
 624                        </ul>
 625                      </div> -->
 626                    </li>
 627                    
 628                  </ul>
 629                </div>
 630              
 631                <div class="o-distance-xl">
 632                  <h3 class="c-category-title">Cockpit Guides</h3>
 633                  <ul class="o-list-bare">
 634                    
 635                    <li class="o-list-bare__item">
 636                      <a href="/docs/cockpit_introduction.html" title="Introduction" class="u-link-uniform ">Introduction</a>
 637                      <!-- <div class="o-distance-m">
 638                        <ul class="o-list-bare c-navigation__subnav">
 639                          <li class="o-list-bare__item">
 640                            <a href="#" title="What is Embark?" class="u-link-uniform">What is Embark?</a>
 641                          </li>
 642                        </ul>
 643                      </div> -->
 644                    </li>
 645                    
 646                    <li class="o-list-bare__item">
 647                      <a href="/docs/cockpit_dashboard.html" title="Using the Dashboard" class="u-link-uniform ">Using the Dashboard</a>
 648                      <!-- <div class="o-distance-m">
 649                        <ul class="o-list-bare c-navigation__subnav">
 650                          <li class="o-list-bare__item">
 651                            <a href="#" title="What is Embark?" class="u-link-uniform">What is Embark?</a>
 652                          </li>
 653                        </ul>
 654                      </div> -->
 655                    </li>
 656                    
 657                    <li class="o-list-bare__item">
 658                      <a href="/docs/cockpit_deployment.html" title="Deployment" class="u-link-uniform ">Deployment</a>
 659                      <!-- <div class="o-distance-m">
 660                        <ul class="o-list-bare c-navigation__subnav">
 661                          <li class="o-list-bare__item">
 662                            <a href="#" title="What is Embark?" class="u-link-uniform">What is Embark?</a>
 663                          </li>
 664                        </ul>
 665                      </div> -->
 666                    </li>
 667                    
 668                    <li class="o-list-bare__item">
 669                      <a href="/docs/cockpit_explorer.html" title="Explorer View" class="u-link-uniform ">Explorer View</a>
 670                      <!-- <div class="o-distance-m">
 671                        <ul class="o-list-bare c-navigation__subnav">
 672                          <li class="o-list-bare__item">
 673                            <a href="#" title="What is Embark?" class="u-link-uniform">What is Embark?</a>
 674                          </li>
 675                        </ul>
 676                      </div> -->
 677                    </li>
 678                    
 679                    <li class="o-list-bare__item">
 680                      <a href="/docs/cockpit_editor.html" title="Code Editor" class="u-link-uniform ">Code Editor</a>
 681                      <!-- <div class="o-distance-m">
 682                        <ul class="o-list-bare c-navigation__subnav">
 683                          <li class="o-list-bare__item">
 684                            <a href="#" title="What is Embark?" class="u-link-uniform">What is Embark?</a>
 685                          </li>
 686                        </ul>
 687                      </div> -->
 688                    </li>
 689                    
 690                    <li class="o-list-bare__item">
 691                      <a href="/docs/cockpit_debugger.html" title="Using the Debugger" class="u-link-uniform ">Using the Debugger</a>
 692                      <!-- <div class="o-distance-m">
 693                        <ul class="o-list-bare c-navigation__subnav">
 694                          <li class="o-list-bare__item">
 695                            <a href="#" title="What is Embark?" class="u-link-uniform">What is Embark?</a>
 696                          </li>
 697                        </ul>
 698                      </div> -->
 699                    </li>
 700                    
 701                  </ul>
 702                </div>
 703              
 704                <div class="o-distance-xl">
 705                  <h3 class="c-category-title">Reference</h3>
 706                  <ul class="o-list-bare">
 707                    
 708                    <li class="o-list-bare__item">
 709                      <a href="/docs/embark_commands.html" title="CLI Commands" class="u-link-uniform ">CLI Commands</a>
 710                      <!-- <div class="o-distance-m">
 711                        <ul class="o-list-bare c-navigation__subnav">
 712                          <li class="o-list-bare__item">
 713                            <a href="#" title="What is Embark?" class="u-link-uniform">What is Embark?</a>
 714                          </li>
 715                        </ul>
 716                      </div> -->
 717                    </li>
 718                    
 719                  </ul>
 720                </div>
 721              
 722                <div class="o-distance-xl">
 723                  <h3 class="c-category-title">Miscellaneous</h3>
 724                  <ul class="o-list-bare">
 725                    
 726                    <li class="o-list-bare__item">
 727                      <a href="/docs/migrating_from_3.x.html" title="Migrating from Embark 3.x" class="u-link-uniform is-active">Migrating from Embark 3.x</a>
 728                      <!-- <div class="o-distance-m">
 729                        <ul class="o-list-bare c-navigation__subnav">
 730                          <li class="o-list-bare__item">
 731                            <a href="#" title="What is Embark?" class="u-link-uniform">What is Embark?</a>
 732                          </li>
 733                        </ul>
 734                      </div> -->
 735                    </li>
 736                    
 737                    <li class="o-list-bare__item">
 738                      <a href="/docs/troubleshooting.html" title="Troubleshooting" class="u-link-uniform ">Troubleshooting</a>
 739                      <!-- <div class="o-distance-m">
 740                        <ul class="o-list-bare c-navigation__subnav">
 741                          <li class="o-list-bare__item">
 742                            <a href="#" title="What is Embark?" class="u-link-uniform">What is Embark?</a>
 743                          </li>
 744                        </ul>
 745                      </div> -->
 746                    </li>
 747                    
 748                    <li class="o-list-bare__item">
 749                      <a href="/docs/contributing.html" title="Contributing" class="u-link-uniform ">Contributing</a>
 750                      <!-- <div class="o-distance-m">
 751                        <ul class="o-list-bare c-navigation__subnav">
 752                          <li class="o-list-bare__item">
 753                            <a href="#" title="What is Embark?" class="u-link-uniform">What is Embark?</a>
 754                          </li>
 755                        </ul>
 756                      </div> -->
 757                    </li>
 758                    
 759                  </ul>
 760                </div>
 761              
 762            </nav>
 763          </div>
 764        </div>
 765        <div class="o-guided-content__content">
 766          <p class="c-meta">Last updated: January 19th 2020
 767            (<a href="https://github.com/embarklabs/embark/edit/master/site/source/docs/migrating_from_3.x.md" target="_blank">
 768              Improve this guide <svg class="c-icon c-icon--xs"><use xlink:href="/../../assets/icons/symbols.svg#icon-pen-write-paper"></use></svg>
 769            </a>)
 770          </p>
 771          <div class="o-standard-page">
 772            <h1>Migrating from Embark 3.x</h1>
 773            <p>In this guide we’ll discuss the few steps to take a project from Embark 3.2.x to 4.x.</p>
 774  <p>If you already have 4.x, you can then upgrade to Embark 5 by continuing <a href="/docs/migrating_from_3.x.html#Updating-to-v5">below</a>.</p>
 775  <h2 id="Upgrading-to-v4"><a href="#Upgrading-to-v4" class="headerlink" title="Upgrading to v4"></a>Upgrading to v4</h2><p>In order to take an existing Embark 3.2.x project to version 4.x, the following steps are required:</p>
 776  <ol>
 777  <li>Adding a <code>generationDir</code> to the project’s <code>embark.json</code></li>
 778  <li>Updating “magic” EmbarkJS imports</li>
 779  <li>Installing a blockchain connector</li>
 780  <li>Updating blockchain account configurations</li>
 781  </ol>
 782  <p>Let’s walk through them step by step!</p>
 783  <h3 id="Adding-a-generationDir-to-embark-json"><a href="#Adding-a-generationDir-to-embark-json" class="headerlink" title="Adding a generationDir to embark.json"></a>Adding a <code>generationDir</code> to <code>embark.json</code></h3><p>Since version 4, Embark generates project <a href="/docs/javascript_usage.html#Embark-Artifacts">specific artifacts</a>. 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 <a href="/docs/configuration.html#generationDir"><code>generationDir</code></a> property to our project’s <code>embark.json</code> file.</p>
 784  <figure class="highlight plain"><table><tr><td class="code"><pre><span class="line">...</span><br><span class="line">&quot;generationDir&quot;: &quot;artifacts&quot;</span><br><span class="line">...</span><br></pre></td></tr></table></figure>
 785  
 786  <p>The value of <code>generationDir</code> is the name of the folder in which we want Embark to generate artifacts. For new projects, <code>artifacts</code> is the default.</p>
 787  <h3 id="Updating-“magic”-EmbarkJS-imports"><a href="#Updating-“magic”-EmbarkJS-imports" class="headerlink" title="Updating “magic” EmbarkJS imports"></a>Updating “magic” EmbarkJS imports</h3><p>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.</p>
 788  <p>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.</p>
 789  <p>For EmbarkJS, replace this import:</p>
 790  <figure class="highlight plain"><table><tr><td class="code"><pre><span class="line">import EmbarkJS from &#39;Embark&#x2F;EmbarkJS&#39;;</span><br></pre></td></tr></table></figure>
 791  <p>with</p>
 792  <figure class="highlight plain"><table><tr><td class="code"><pre><span class="line">import EmbarkJS from &#39;.&#x2F;artifacts&#x2F;embarkjs&#39;;</span><br></pre></td></tr></table></figure>
 793  
 794  <div class="c-notification c-notification--info">
 795    <p><strong>Attention!</strong></p>
 796    <p><p>Notice that the import path has to match the path we’ve specified in <code>generationDir</code> earlier.</p>
 797  </p>
 798  </div> 
 799  
 800  
 801  
 802  <p>For Smart Contract instances, replace:</p>
 803  <figure class="highlight plain"><table><tr><td class="code"><pre><span class="line">import CONTRACT_NAME from &#39;Embark&#x2F;contracts&#x2F;CONTRACT_NAME&#39;;</span><br></pre></td></tr></table></figure>
 804  
 805  <p>with</p>
 806  <figure class="highlight plain"><table><tr><td class="code"><pre><span class="line">import CONTRACT_NAME from &#39;.&#x2F;artifacts&#x2F;contracts&#x2F;CONTRACT_NAME&#39;;</span><br></pre></td></tr></table></figure>
 807  
 808  <h4 id="Remove-web3-imports"><a href="#Remove-web3-imports" class="headerlink" title="Remove web3 imports"></a>Remove web3 imports</h4><p>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.</p>
 809  <p>Remove the following import from your application:</p>
 810  <figure class="highlight plain"><table><tr><td class="code"><pre><span class="line">import web3 from &#39;Embark&#x2F;web3&#39;;</span><br></pre></td></tr></table></figure>
 811  
 812  <h3 id="Updating-Blockchain-configurations"><a href="#Updating-Blockchain-configurations" class="headerlink" title="Updating Blockchain configurations"></a>Updating Blockchain configurations</h3><p>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 <a href="/docs/blockchain_accounts_configuration.html">Accounts Blockchain configuration guide</a> in our docs.</p>
 813  <p>However, we did introduce some small breaking changes. We removed:</p>
 814  <ul>
 815  <li><strong>account</strong>: 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 <code>nodeAccounts</code> account type as described in the docs</li>
 816  <li><strong>simulatorMnemonic</strong>: Removed in favor of Ganache’s default mnemonic. If this functionality is still needed, please specify the desired mnemonic in the <a href="/docs/blockchain_accounts_configuration.md#parameter-descriptions">blockchain config’s mnemonic account type</a>.</li>
 817  </ul>
 818  <h2 id="Updating-to-v5"><a href="#Updating-to-v5" class="headerlink" title="Updating to v5"></a>Updating to v5</h2><p>Embark’s 5th version is full of improvements, especially in the configurations, all to make your life easier.</p>
 819  <p>In this guide, we’ll go through the different breaking changes introduced in Embark 5, that will let you upgrade from Embark 4.0.</p>
 820  <h3 id="Better-Smart-Contract-configuration"><a href="#Better-Smart-Contract-configuration" class="headerlink" title="Better Smart Contract configuration"></a>Better Smart Contract configuration</h3><p>One of the two configurations that changed the most is the Smart Contract configuration. The goal of this change is to make this file <strong>only</strong> about Smart Contracts. That way, no more confusing connection values and accounts. Those were moved to the blockchain config and will be discussed <a href="/docs/migrating_from_3.x.html#Blockchain-config">just below</a>.</p>
 821  <ol>
 822  <li>The <code>deployment</code> section was removed<ul>
 823  <li>It was moved to the Blockchain configuration as <code>endpoint</code>, which is way simpler than before</li>
 824  <li>The accounts were also moved to the Blockchain configuration</li>
 825  </ul>
 826  </li>
 827  <li><code>contracts</code> has been renamed to <code>deploy</code><ul>
 828  <li>The goal is to match the rest of the properties, i.e. <code>afterDeploy</code> and <code>beforeDeploy</code></li>
 829  <li>And also enables us to add new features for <code>embark test</code>, whereby you can modify the Blockchain and module configs in each test. Read more <a href="/docs/migrating_from_3.x.html#Tests">here</a></li>
 830  </ul>
 831  </li>
 832  <li>New <code>dappConnection</code> variable: <code>$EMBARK</code><ul>
 833  <li>This tells the Dapp to connect to Embark’s proxy and node<ul>
 834  <li>Doing so let’s you use the same accounts for deployment <strong>and</strong> in the Dapp<ul>
 835  <li>Plus, it let’s you benefit from a couple of other features inside your Dapp</li>
 836  </ul>
 837  </li>
 838  </ul>
 839  </li>
 840  <li>We recommend putting <code>$EMBARK</code> first in the <code>dappConnection</code> array in development, as it’s the easiest way to develop your Dapp</li>
 841  </ul>
 842  </li>
 843  </ol>
 844  <h3 id="Simplified-Blockchain-configuration"><a href="#Simplified-Blockchain-configuration" class="headerlink" title="Simplified Blockchain configuration"></a>Simplified Blockchain configuration</h3><p>The Blockchain configuration changed a lot, but in a good way, as it’s <strong>way</strong> simpler now. Hopefully, with all those changes, you’ll have an easier time understanding how the different configurations work.</p>
 845  <ol>
 846  <li>Defaults everywhere!<ul>
 847  <li>Most of the configs you were used to seeing in Embark 4 are simply defaults in Embark 5<ul>
 848  <li>That means you don’t have to specify them</li>
 849  <li>You can find the basic configurations <a href="/docs/blockchain_configuration.html#Common-Parameters">here</a></li>
 850  <li>If you want to modify some of the advanced parameters, you always can. Just put them in the <code>clientConfig</code> object. You can see all the options <a href="/docs/blockchain_configuration.html#Advanced-parameters">here</a></li>
 851  </ul>
 852  </li>
 853  </ul>
 854  </li>
 855  <li>There were a couple of renamed parameters:<ul>
 856  <li><code>isDev</code> =&gt; <code>miningMode: &#39;dev&#39;</code><ul>
 857  <li>This enables you to control the node’s mining mode with only one option, instead of two (<code>isDev</code> and <code>mineWhenNeeded</code> were both removed)</li>
 858  </ul>
 859  </li>
 860  <li><code>mineWhenNeeded</code> =&gt; <code>miningMode: &#39;auto&#39;</code><ul>
 861  <li>As said above, we combined the two options into <code>miningMode</code></li>
 862  <li><code>auto</code> is the same as <code>mineWhenNeeded: true</code></li>
 863  </ul>
 864  </li>
 865  <li><code>ethereumClientName</code> =&gt; <code>client</code><ul>
 866  <li>Just a basic rename, because it’s shorter and is more agnostic</li>
 867  </ul>
 868  </li>
 869  </ul>
 870  </li>
 871  <li>New <code>endpoint</code> parameter<ul>
 872  <li>This new parameter is the replacement for the Smart Contract configuration’s <code>deployment</code> section</li>
 873  <li>Before, you had to set <code>host</code>, <code>port</code> and <code>type</code> in the <code>deployement</code> section of the Smart Contracts configuration</li>
 874  <li>Now, all the options are in <code>endpoint</code><ul>
 875  <li>For example, you can just put <code>ws://localhost:1234</code> and Embark will connect to it</li>
 876  <li>If the connection doesn’t work, Embark will start the node using the endpoint</li>
 877  </ul>
 878  </li>
 879  <li>This makes it easier to connect to external nodes or change the local node configurations</li>
 880  </ul>
 881  </li>
 882  <li>The Blockchain configuration is now the <strong>only</strong> source of accounts<ul>
 883  <li>In Embark 4, there were <code>account</code> arrays in both the Smart Contract and Blockchain configs</li>
 884  <li>In Embark 5, there is only a blockchain <code>accounts</code> array</li>
 885  <li>The accounts there will be used for Smart Contract deployment, node creation <strong>and</strong> in the Dapp<ul>
 886  <li>Before you could see the accounts in your Dapp, but couldn’t use them</li>
 887  <li>Now, you can fund them, use them and debug with them</li>
 888  <li>This is thanks to our new proxy<ul>
 889  <li>All you have to do is set <code>$EMBARK</code> as the <code>dappConnection</code> in Smart Contracts configuration to connect to Embark’s proxy in your Dapp</li>
 890  </ul>
 891  </li>
 892  </ul>
 893  </li>
 894  </ul>
 895  </li>
 896  </ol>
 897  <p>Here is an example of how simple your Blockchain configuration can look now:</p>
 898  <figure class="highlight javascript"><table><tr><td class="code"><pre><span class="line"><span class="built_in">module</span>.exports = &#123;</span><br><span class="line">  <span class="keyword">default</span>: &#123;</span><br><span class="line">    enabled: <span class="literal">true</span>,</span><br><span class="line">    client: <span class="string">"geth"</span></span><br><span class="line">  &#125;,</span><br><span class="line"></span><br><span class="line">  development: &#123;</span><br><span class="line">    endpoint: <span class="string">'ws://locahost:1234'</span>,</span><br><span class="line">    clientConfig: &#123;</span><br><span class="line">      miningMode: <span class="string">'dev'</span></span><br><span class="line">    &#125;,</span><br><span class="line">    accounts: [</span><br><span class="line">      &#123;</span><br><span class="line">        mnemonic: <span class="string">"12 word mnemonic"</span>,</span><br><span class="line">        balance: <span class="string">"5ether"</span>,</span><br><span class="line">        numAddresses: <span class="number">10</span></span><br><span class="line">      &#125;</span><br><span class="line">    ]</span><br><span class="line">  &#125;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>
 899  
 900  <p>This will connect to a node started on you machine on the port <code>1234</code>, using a Websocket provider. If the node is not started, Embark will start it for you using Geth.</p>
 901  <p>The accounts used for deployment will be the ones coming from a mnemonic, all funded with 5 ETH.</p>
 902  <p>You can even use those accounts in your Dapp to test Smart Contract interactions, if <code>$EMBARK</code> is set in <code>dappConnection</code> in your Smart Contracts configuration.</p>
 903  <p>You could remove the <code>endpoint</code> and <code>accounts</code> and Embark would still work with its defaults.</p>
 904  <h3 id="Communication-configuration"><a href="#Communication-configuration" class="headerlink" title="Communication configuration"></a>Communication configuration</h3><p>This is a very simple change, but in Embark 5, a specific node is started when using a Communication service like Whisper.</p>
 905  <p>That means that if in your Communication configuration, you still point to the original port, it will conflict.</p>
 906  <p>All you have to do is change that port (usually <code>8546</code>) to something else, say <code>8557</code>.</p>
 907  <p>Here’s what an updated Communication configuration would look like:</p>
 908  <figure class="highlight javascript"><table><tr><td class="code"><pre><span class="line"><span class="built_in">module</span>.exports = &#123;</span><br><span class="line">  <span class="keyword">default</span>: &#123;</span><br><span class="line">    enabled: <span class="literal">false</span>,</span><br><span class="line">    provider: <span class="string">"whisper"</span>,</span><br><span class="line">    available_providers: [<span class="string">"whisper"</span>],</span><br><span class="line">    connection: &#123;</span><br><span class="line">      host: <span class="string">"localhost"</span>,</span><br><span class="line">      port: <span class="number">8557</span>,</span><br><span class="line">      type: <span class="string">"ws"</span></span><br><span class="line">    &#125;</span><br><span class="line">  &#125;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>
 909  
 910  <h3 id="Tests"><a href="#Tests" class="headerlink" title="Tests"></a>Tests</h3><p>There were few breaking changes related to <code>embark test</code>, mostly new features.</p>
 911  <ol>
 912  <li>The <code>deployment</code> section was removed<ul>
 913  <li>Much like the changes above, the <code>deployment</code> section has been deprecated</li>
 914  <li>You can still connect to an extenral node in tests and use custom accounts, it’s just simpler</li>
 915  <li>You can now add a <code>blockchain</code> section in the <code>config</code> function’s object and use the <code>endpoint</code> and <code>accounts</code> options</li>
 916  </ul>
 917  </li>
 918  <li><code>contracts</code> was renamed <code>deploy</code><ul>
 919  <li>Again, the test configs match the actual configs</li>
 920  <li>You now have the <code>contracts</code> section which represents the Smart Contract configuration, so you need the <code>deploy</code> parameter for the Smart Contract list</li>
 921  <li>See the example below</li>
 922  </ul>
 923  </li>
 924  <li>New module configs<ul>
 925  <li>You can now configure the namesystem on a per test basis</li>
 926  <li>Storage, Namesystem and Communication modules are disabled by default to speed up the test<ul>
 927  <li>You can enable them in your normal configuration files by adding the <code>test</code> environment and putting <code>enabled: true</code><ul>
 928  <li>Just like normal environments, the <code>test</code> environment merges with the <code>default</code> section</li>
 929  <li>All tests now default to the <code>test</code> environment, but you can still change this with <code>--environment</code></li>
 930  </ul>
 931  </li>
 932  </ul>
 933  </li>
 934  </ul>
 935  </li>
 936  </ol>
 937  <p>Example of a test with the new configs:</p>
 938  <figure class="highlight javascript"><table><tr><td class="code"><pre><span class="line">config(&#123;</span><br><span class="line">  blockchain: &#123;</span><br><span class="line">    accounts: [</span><br><span class="line">      &#123;</span><br><span class="line">        mnemonic: <span class="string">"12 word mnemonic"</span>,</span><br><span class="line">        balance: <span class="string">"5ether"</span>,</span><br><span class="line">        numAddresses: <span class="number">10</span></span><br><span class="line">      &#125;</span><br><span class="line">    ]</span><br><span class="line">  &#125;,</span><br><span class="line">  contracts: &#123;</span><br><span class="line">    deploy: &#123;</span><br><span class="line">      <span class="string">"SimpleStorage"</span>: &#123;</span><br><span class="line">        args: [<span class="number">100</span>]</span><br><span class="line">      &#125;</span><br><span class="line">    &#125;</span><br><span class="line">  &#125;,</span><br><span class="line">  namesystem: &#123;</span><br><span class="line">    enabled: <span class="literal">true</span>,</span><br><span class="line">    register: &#123;</span><br><span class="line">      <span class="string">"rootDomain"</span>: <span class="string">"test.eth"</span></span><br><span class="line">    &#125;</span><br><span class="line">  &#125;</span><br><span class="line">&#125;);</span><br><span class="line"></span><br><span class="line">describe(<span class="function"><span class="params">()</span> =&gt;</span> &#123;</span><br><span class="line">  <span class="comment">// Tests here</span></span><br><span class="line">&#125;);</span><br></pre></td></tr></table></figure>
 939  
 940  <p>This example deploys one Smart Contract, SimpleStorage, using the first of 10 accounts, generated from the mnemonic, which will be funded to 5 ETH.</p>
 941  <p>The Namesystem will also be enabled, with a root domain of <code>test.eth</code>, meaning you will be able, in your tests, to do <code>EmbarkJS.Names.resolve(&#39;test.eth&#39;)</code> and it will resolve to the owner of the name (the default account).</p>
 942  <p>Like before, those configs are all optional; but they allow you more flexibility, with simpler configuration objects that are easier to understand.</p>
 943  <h3 id="Library-and-Version-updates"><a href="#Library-and-Version-updates" class="headerlink" title="Library and Version updates"></a>Library and Version updates</h3><h4 id="NodeJS"><a href="#NodeJS" class="headerlink" title="NodeJS"></a>NodeJS</h4><p>To upgrade to Embark 5, you will first need to install  Node.js version 10.17 or above, but not beyond 10.x for now.</p>
 944  <p>The reason for that limit is because 12.x cause issues with some of the underlying Embark dependencies, which do not support Node 12.x yet.</p>
 945  <h4 id="Version-manager"><a href="#Version-manager" class="headerlink" title="Version manager"></a>Version manager</h4><p>In Embark 4, you could select the version of a couple of libraries in <code>embark.json</code>‘s <code>versions</code> object. As of Embark 5, only <code>solc</code> is available to modify.</p>
 946  <p>We deprecated the other libraries because they were rarely changed and most importantly, because their different versions had breaking changes that were annoying to support at the same time. With those deprecations, we ensure you the best experience possible when using the libraries offered.</p>
 947  <h4 id="ipfs-api"><a href="#ipfs-api" class="headerlink" title="ipfs-api"></a>ipfs-api</h4><p>We upgraded from the old <code>ipfs-api</code> to <code>ipfs-http-client</code>, because the former was deprecated.</p>
 948  <p>For most of you, no change is required, since EmbarkJS handles the API changes.</p>
 949  <p>However, if you did import <code>ipfs-api</code> yourself in your front-end Dapp, you’ll need to change it to <code>ipfs-http-client</code>, because <code>ipfs-api</code> is no longer installed as part of Embark 5.<br>Also, if you’ll be using it directly, be sure to review the <a href="https://github.com/ipfs/js-ipfs-http-client#usage" target="_blank" rel="noopener">docs for <code>ipfs-http-client</code></a> as there have been some API changes relative to <code>ipfs-api</code>.</p>
 950  
 951          </div>
 952          <div class="o-container-medium o-distance-l">
 953            <div class="o-flex o-flex-space-between">
 954    
 955    <div class="o-flex__item">
 956      <a href="/docs/embark_commands.html" class="c-button c-button--quite" title="Previous article">Previous</a>
 957    </div>
 958    
 959    
 960    <div class="o-flex__item">
 961      <a href="/docs/troubleshooting.html" class="c-button c-button--quite" title="Next article">Next</a>
 962    </div>
 963    
 964  </div>
 965  
 966  
 967          </div>
 968        </div>
 969        <div class="o-guided-content__addition">
 970          <h3 class="c-category-title">Contents</h3>
 971          <ol class="o-list-bare"><li class="o-list-bare__item o-list-bare-level-2 o-ellipsis"><a href="#Upgrading-to-v4" class="u-link-uniform">Upgrading to v4</a><ol class="o-list-bare__child"><li class="o-list-bare__item o-list-bare-level-3 o-ellipsis"><a href="#Adding-a-generationDir-to-embark-json" class="u-link-uniform">Adding a generationDir to embark.json</a></li><li class="o-list-bare__item o-list-bare-level-3 o-ellipsis"><a href="#Updating-“magic”-EmbarkJS-imports" class="u-link-uniform">Updating “magic” EmbarkJS imports</a><ol class="o-list-bare__child"><li class="o-list-bare__item o-list-bare-level-4 o-ellipsis"><a href="#Remove-web3-imports" class="u-link-uniform">Remove web3 imports</a></li></ol></li><li class="o-list-bare__item o-list-bare-level-3 o-ellipsis"><a href="#Updating-Blockchain-configurations" class="u-link-uniform">Updating Blockchain configurations</a></li></ol></li><li class="o-list-bare__item o-list-bare-level-2 o-ellipsis"><a href="#Updating-to-v5" class="u-link-uniform">Updating to v5</a><ol class="o-list-bare__child"><li class="o-list-bare__item o-list-bare-level-3 o-ellipsis"><a href="#Better-Smart-Contract-configuration" class="u-link-uniform">Better Smart Contract configuration</a></li><li class="o-list-bare__item o-list-bare-level-3 o-ellipsis"><a href="#Simplified-Blockchain-configuration" class="u-link-uniform">Simplified Blockchain configuration</a></li><li class="o-list-bare__item o-list-bare-level-3 o-ellipsis"><a href="#Communication-configuration" class="u-link-uniform">Communication configuration</a></li><li class="o-list-bare__item o-list-bare-level-3 o-ellipsis"><a href="#Tests" class="u-link-uniform">Tests</a></li><li class="o-list-bare__item o-list-bare-level-3 o-ellipsis"><a href="#Library-and-Version-updates" class="u-link-uniform">Library and Version updates</a><ol class="o-list-bare__child"><li class="o-list-bare__item o-list-bare-level-4 o-ellipsis"><a href="#NodeJS" class="u-link-uniform">NodeJS</a></li><li class="o-list-bare__item o-list-bare-level-4 o-ellipsis"><a href="#Version-manager" class="u-link-uniform">Version manager</a></li><li class="o-list-bare__item o-list-bare-level-4 o-ellipsis"><a href="#ipfs-api" class="u-link-uniform">ipfs-api</a></li></ol></li></ol></li></ol>
 972        </div>
 973      </div>
 974    </section>
 975  </main>
 976  
 977  <script src="/js/linkjuice/dist/linkjuice.min.js"></script>
 978  
 979      <footer role="contentinfo" class="c-footer o-distance-xxl">
 980    <div class="o-container">
 981      <div class="c-footer__top">
 982        <p class="c-category-title c-footer__top__title u-text-light">
 983          <a href="/" class="c-logo c-logo--negative" title="Embark">Embark</a>
 984        </p>
 985      </div>
 986      <div class="c-footer__body">
 987        <div class="o-grid">
 988          <div class="o-grid__column--1-1 o-grid__column--medium-1-2 o-grid__column--large-1-5">
 989            <p class="c-category-title u-text-light">Resources</p>
 990            <ul class="o-list-bare">
 991              <li class="o-list-bare__item">
 992                <a href="/docs/quick_start.html" class="u-link-ghost" title="Quick Start">Quick Start</a>
 993              </li>
 994              <li class="o-list-bare__item">
 995                <a href="/docs" class="u-link-ghost" title="Documentation">Documentation</a>
 996              </li>
 997              <li class="o-list-bare__item">
 998                <a href="https://blog.embarklabs.io" target="_blank" rel="noopener" class="u-link-ghost" title="Blog">Blog</a>
 999              </li>
1000              <li class="o-list-bare__item">
1001                <a href="/docs/faq.html" class="u-link-ghost" title="FAQ">FAQ</a>
1002              </li>
1003              <li class="o-list-bare__item">
1004                <a href="/docs/troubleshooting.html" class="u-link-ghost" title="Troubleshooting">Troubleshooting</a>
1005              </li>
1006            </ul>
1007          </div>
1008          <div class="o-grid__column--1-1 o-grid__column--medium-1-2 o-grid__column--large-1-5">
1009            <p class="c-category-title u-text-light">Help</p>
1010            <ul class="o-list-bare">
1011              <li class="o-list-bare__item">
1012                <a href="https://stackoverflow.com/questions/tagged/embark" target="_blank" rel="noopener" class="u-link-ghost" title="Embark Questions">Stack Overflow</a>
1013              </li>
1014              <li class="o-list-bare__item">
1015                <a href="https://gitter.im/embark-framework/Lobby" target="_blank" rel="noopener" class="u-link-ghost" title="Gitter">Gitter</a>
1016              </li>
1017              <li class="o-list-bare__item">
1018                <a href="https://github.com/embarklabs/embark/issues" target="_blank" rel="noopener" class="u-link-ghost" title="Report issues">Report issues</a>
1019              </li>
1020              <li class="o-list-bare__item">
1021                <a href="https://github.com/embarklabs/embark/blob/master/CODE_OF_CONDUCT.md" target="_blank" rel="noopener" class="u-link-ghost" title="Code of Conduct">Code of Conduct</a>
1022              </li>
1023            </ul>
1024          </div>
1025          <div class="o-grid__column--1-1 o-grid__column--medium-1-2 o-grid__column--large-1-5">
1026            <p class="c-category-title u-text-light">Community</p>
1027            <ul class="o-list-bare">
1028              <li class="o-list-bare__item">
1029                <a href="https://github.com/embarklabs" target="_blank" rel="noopener" class="u-link-ghost" title="Github">Github</a>
1030              </li>
1031              <li class="o-list-bare__item">
1032                <a href="https://twitter.com/EmbarkProject" target="_blank" rel="noopener" class="u-link-ghost" title="Twitter">Twitter</a>
1033              </li>
1034              <li class="o-list-bare__item">
1035                <a href="/docs/contributing.html" class="u-link-ghost" title="Contribute">Contribute</a>
1036              </li>
1037              <li class="o-list-bare__item">
1038                <a href="/community/#team" class="u-link-ghost" title="Team">Team</a>
1039              </li>
1040            </ul>
1041          </div>
1042  
1043          <div class="o-grid__column--1-1 o-grid__column--medium-1-2 o-grid__column--large-1-4">
1044            <p class="c-category-title u-text-light">The Status Network</p>
1045            <ul class="o-list-bare two-columns">
1046              <li class="o-list-bare__item"><a class="u-link-ghost" href="https://status.im/" target="_blank">Status</a></li>
1047              <li class="o-list-bare__item"><a class="u-link-ghost" href="https://keycard.tech/" target="_blank">Keycard</a></li>
1048              <li class="o-list-bare__item"><a class="u-link-ghost" href="https://dap.ps/" target="_blank">dap.ps</a></li>
1049              <li class="o-list-bare__item"><a class="u-link-ghost" href="https://teller.exchange/" target="_blank">Teller</a></li>
1050              <li class="o-list-bare__item"><a class="u-link-ghost" href="https://assemble.fund/" target="_blank">Assemble</a></li>
1051              <li class="o-list-bare__item"><a class="u-link-ghost" href="https://subspace.embarklabs.io/" target="_blank">Subspace</a></li>
1052              <li class="o-list-bare__item"><a class="u-link-ghost" href="https://vac.dev/" target="_blank">Vac</a></li>
1053              <li class="o-list-bare__item"><a class="u-link-ghost" href="https://nimbus.team/" target="_blank">Nimbus</a></li>
1054            </ul>
1055          </div>
1056        </div>
1057      </div>
1058      <div class="c-footer__bottom">
1059        <p class="u-text-light">
1060          <a href="https://status.im/privacy-policy.html" title="Privacy Policy" target="_blank" class="u-text-light">Privacy Policy</a>
1061          / © 2019-2020 Embark
1062        </p>
1063      </div>
1064    </div>
1065  </footer>
1066  
1067  
1068  
1069  
1070      <script src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.15.4/highlight.min.js"></script>
1071      <script src="https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.0/clipboard.min.js"></script>
1072      <script>
1073        const EMBARK_DOC_VERSIONS = {
1074          'latest': 'https://framework.embarklabs.io/docs','3.2': 'https://5ca4e0fdb29712000adde37f--embark-site-versions.netlify.com/docs/'
1075        };
1076      </script>
1077  
1078      
1079      <!-- Fathom - simple website analytics - https://github.com/usefathom/fathom -->
1080      <script>
1081      (function(f, a, t, h, o, m){
1082          a[h]=a[h]||function(){(a[h].q=a[h].q||[]).push(arguments)};
1083          o=f.createElement('script'),
1084          m=f.getElementsByTagName('script')[0];
1085          o.async=1; o.src=t; o.id='fathom-script';
1086          m.parentNode.insertBefore(o,m)
1087      })(document, window, '//fathom.status.im/tracker.js', 'fathom');
1088      fathom('set', 'siteId', 'YDUQQ');
1089      fathom('trackPageview');
1090      </script>
1091      <!-- / Fathom -->
1092      
1093  
1094      <script src="/js/index.js"></script>
1095  
1096      
1097      <script type="text/javascript" src="https://cdn.jsdelivr.net/npm/docsearch.js@2/dist/cdn/docsearch.min.js"></script>
1098      <script type="text/javascript">
1099        docsearch({
1100          apiKey: '439d8dc2add18007a2f31be4a9c0ed70',
1101          indexName: 'embark',
1102          inputSelector: '#search-input'
1103        });
1104      </script>
1105      
1106    </body>
1107  </html>
1108