Skip to content
This repository has been archived by the owner on Nov 16, 2023. It is now read-only.
Cale Teeter edited this page Apr 3, 2020 · 13 revisions

Frequently Asked Questions (FAQ)

Q: I have installed Python, but still get the "missing" or "old version" notification
Q: I am using a Truffle box or I have created my own project structure and would like to use the deployment options in the extension
Q: I have installed the extension and get prompted that Git client is not installed however it is installed
Q: I am using the extension to create a new Solidity project and I am getting errors when creating the project
Q: I am using an old version of Azure Blockchain Service and I am getting an error when deploying contracts: [Execute command] Error: Error: Error: gas required exceeds allowance or always failing transaction
  • Q: I installed all of the pre-requisite software, but I still get the "missing" or "old version" notification for Python

  • A: It's pretty likely that Python was installed without being added to your system PATH variable (the default installation mode of Python). To resolve this problem, you need to add your Python directory to the system path. You may do this by editing your PATH variable directly, or by reinstalling/fixing your Python installation as shown below

    Adding your Python directory to your PATH variable directly
    1. On Windows, you may edit your PATH variable by going to the Windows search bar and typing "env"

      Find Environment Editor

      1. Once the System Properties panel launches, select Environment Variables

      Environment Editor

      1. In the Environment Variables editor, select the System Variables, Path line and click Edit

      Edit System Variables

      Finally, select New to add a new entry to your PATH, then type inC:\Python27\ (or whichever directory you installed Python to), and select OK to save

      Add Python to your PATH

      1. To verify your changes, open up a new command prompt and type python --version as shown below

      verify Python

    Reinstalling/fixing the Python installation
    1. On Windows, you may edit your PATH variable by going to the Windows search bar and typing "add"

      Add Remove Programs

    2. Scroll down to your Python installation and click modify

      Modify Add Remove

    3. In the Python dialog box, click Change Python

      Change Python

    4. Scroll down and select the red X next to Add python.exe to Path, then chose the Will be installed on local hard drive option.

      Install to local HD

    5. Click Next

      Click Next

    6. You can verify your changes by opening up a command prompt and typing python --version as shown below

      Verify Python

  • Q: I am using a Truffle box or I have created my own project structure and would like to use the deployment options in the extension

    Adding the wallet provider to your existing project
  1. Update your project to include the required package for the wallet. The underlying requirement is for truffle-hdwallet-provider.

    If you have an existing package.json as part of your project, you can simply add the following to your dependencies section:

    "truffle-hdwallet-provider": "1.0.10"
    

    If you do NOT have an existing package.json as part of your project, you can create one by running the following:

    npm init -y
    npm install truffle-hdwallet-provider@1.0.10 --save
    
  2. Update the truffle configuration to include the use of the wallet provider and a native node package to access the file system. This should be added to top of the package.json file.

    const HDWalletProvider = require('truffle-hdwallet-provider');
    const fs = require('fs');
    
  3. To deploy locally to the managed ganache instance inside the extension, the wallet is NOT required. What is required to use the deployment is a network section for development. If this is not present in the package.json file, this can be added to the networks section.

    development: {
      host: "127.0.0.1",     // Localhost (default: none)
      port: 8545,            // Standard Ethereum port (default: none)
      network_id: "*",       // Any network (default: none)
    }
    
  4. To deploy to another target including Azure Blockchain Service, no other configuration is needed. When selecting deploy contracts, the relevant network section will be added dynamnically to the truffle configuration.

  5. To deploy to another target, that has been manually added to the truffle configuration, the provider will need to be added manually. Updated the truffle configuration, specific network section to use this provider:

    provider: new HDWalletProvider(fs.readFileSync('<path to a file with a 12 work mnemonic', 'utf-8'), "<uri to rpc endpoint>")
    

NOTE: A complete example configuration can be seen https://github.com/Azure-Samples/Blockchain-Ethereum-Template/blob/master/truffle-config.js

NOTE: Some older truffle boxes use a truffle configuration file named truffle.js, versus the new one of using truffle-config.js. This is required for Windows based use of the Truffle suite.

  • Q: I have installed the extension and get prompted that Git client is not installed however it is installed

    The issue is caused by the fact that the git client is not added to the system path at installation. The fix is to update the path manually, details are below for Windows based machines.
  1. On Windows, you may edit your PATH variable by going to the Windows search bar and typing "env"

    Find Environment Editor

  2. Once the System Properties panel launches, select Environment Variables

    Environment Editor

  3. In the Environment Variables editor, select the System Variables, Path line and click Edit

    Edit System Variables

  4. Finally, select New to add a new entry to your PATH, then type in C:\Program Files\Git\bin\ (or whichever directory you installed Git to), and select OK to save

  • Q: I am using the extension to create a new solidity project and I am getting errors when creating the project

    The issue is caused by a dependency that requires a C++ compiler to be installed. This can be remedied with a build tools installation. (NOTE: this solution pertains to Windows based operating systems only)
  1. Open a Powershell shell under administrator rights, and run the following command:
npm install --global windows-build-tools

NOTE: This installation will take a few minutes to install fully, so please be sure to wait to the command completely finishes.

  • Q: I am using an old version of Azure Blockchain Service and I am getting an error when deploying contracts

    The issue is caused by the fact an EVM version upgrade is not in sync with the default configuration used by Truffle. The Azure Blockchain Service will support the latest EVM version and Truffle as well, however if the instance is older, it could be using a different evm version. To correct this a simple configuration change is needed:
  1. Add the following section to the truffle-config.js.
compilers: {
    solc: {
      version: "0.5.0",
      settings: {
        evmVersion: "byzantium"
      }
    }
  }

NOTE: This section should be added to the root of the configuration that is exported. __NOT__ to the networks section

Full example configuration

const HDWalletProvider = require("truffle-hdwallet-provider");
const fs = require("fs");
module.exports = {
  networks: {
    development: {
      host: "127.0.0.1",
      port: 8545,
      network_id: "*"
    },
    abs_node: {
      network_id: "*",
      gas: 0,
      gasPrice: 0,
      provider: new HDWalletProvider(fs.readFileSync('<your mnemonic file', 'utf-8'), '<your rpc endpoint>')
    }
  },
  compilers: {
    solc: {
      version: "0.5.0",
      settings: {
        evmVersion: "byzantium"
      }
    }
  }
};
Clone this wiki locally