How to use the @truffle/provider.testConnection function in @truffle/provider

To help you get started, we’ve selected a few @truffle/provider 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 / environment / environment.js View on Github external
detect: async function(config) {
    expect.options(config, ["networks"]);

    helpers.setUpConfig(config);
    helpers.validateNetworkConfig(config);

    const interfaceAdapter = new InterfaceAdapter({
      provider: config.provider,
      networkType: config.networks[config.network].type
    });
    const web3 = new Web3Shim({
      provider: config.provider,
      networkType: config.networks[config.network].type
    });

    await Provider.testConnection(config);
    await helpers.detectAndSetNetworkId(config, web3, interfaceAdapter);
    await helpers.setFromOnConfig(config, web3, interfaceAdapter);
  },
github trufflesuite / truffle / packages / core / lib / commands / migrate.js View on Github external
.then(async () => {
        await Provider.testConnection(conf);
        await Environment.detect(conf);

        const {
          dryRunOnly,
          dryRunAndMigrations
        } = command.determineDryRunSettings(conf, options);

        if (dryRunOnly) {
          conf.dryRun = true;
          await setupDryRunEnvironmentThenRunMigrations(conf);
        } else if (dryRunAndMigrations) {
          const currentBuild = conf.contracts_build_directory;
          conf.dryRun = true;

          await setupDryRunEnvironmentThenRunMigrations(conf);

@truffle/provider

Beefed up provider module for Truffle

MIT
Latest version published 1 year ago

Package Health Score

55 / 100
Full package analysis