How to use @truffle/migrate - 6 common examples

To help you get started, we’ve selected a few @truffle/migrate examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github trufflesuite / truffle / packages / core / lib / testing / testrunner.js View on Github external
TestRunner.prototype.deploy = function(callback) {
  Migrate.run(
    this.config.with({
      reset: true,
      quiet: true
    }),
    callback
  );
};
github trufflesuite / truffle / packages / core / lib / commands / migrate.js View on Github external
async function runMigrations(config) {
      Migrate.launchReporter(config);

      if (options.f) {
        await Migrate.runFrom(options.f, config);
      } else {
        const needsMigrating = await Migrate.needsMigrating(config);

        if (needsMigrating) {
          await Migrate.run(config);
        } else {
          config.logger.log("Network up to date.");
        }
      }
    }
  }
github trufflesuite / truffle / packages / core / lib / commands / migrate.js View on Github external
async function runMigrations(config) {
      Migrate.launchReporter(config);

      if (options.f) {
        await Migrate.runFrom(options.f, config);
      } else {
        const needsMigrating = await Migrate.needsMigrating(config);

        if (needsMigrating) {
          await Migrate.run(config);
        } else {
          config.logger.log("Network up to date.");
        }
      }
    }
  }
github trufflesuite / truffle / packages / core / lib / commands / migrate.js View on Github external
async function runMigrations(config) {
      Migrate.launchReporter(config);

      if (options.f) {
        await Migrate.runFrom(options.f, config);
      } else {
        const needsMigrating = await Migrate.needsMigrating(config);

        if (needsMigrating) {
          await Migrate.run(config);
        } else {
          config.logger.log("Network up to date.");
        }
      }
    }
  }
github trufflesuite / truffle / packages / core / lib / commands / migrate.js View on Github external
async function runMigrations(config) {
      Migrate.launchReporter(config);

      if (options.f) {
        await Migrate.runFrom(options.f, config);
      } else {
        const needsMigrating = await Migrate.needsMigrating(config);

        if (needsMigrating) {
          await Migrate.run(config);
        } else {
          config.logger.log("Network up to date.");
        }
      }
    }
  }
github trufflesuite / truffle / packages / core / lib / commands / migrate.js View on Github external
prepareConfigForRealMigrations: async function(buildDir, options) {
    const Artifactor = require("@truffle/artifactor");
    const Resolver = require("@truffle/resolver");
    const Migrate = require("@truffle/migrate");
    const { Environment } = require("@truffle/environment");
    const Config = require("@truffle/config");

    let accept = true;

    if (options.interactive) {
      accept = await Migrate.acceptDryRun();
    }

    if (accept) {
      const config = Config.detect(options);

      config.contracts_build_directory = buildDir;
      config.artifactor = new Artifactor(buildDir);
      config.resolver = new Resolver(config);

      try {
        await Environment.detect(config);
      } catch (error) {
        throw new Error(error);
      }

      config.dryRun = false;

@truffle/migrate

On-chain migrations management

MIT
Latest version published 9 months ago

Package Health Score

50 / 100
Full package analysis