Содержание
- Frequently Asked Questions (FAQ)
- Q: I installed all of the pre-requisite software, but I still get the "missing" or "old version" notification for Python
- Adding your Python directory to your PATH variable directly
- Reinstalling/fixing the Python installation
- 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
Frequently Asked Questions (FAQ)
-
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
-
On Windows, you may edit your PATH variable by going to the Windows search bar and typing "env"
- Once the System Properties panel launches, select
Environment Variables
- In the Environment Variables editor, select the System Variables, Path line and click Edit
Finally, select New to add a new entry to your PATH, then type in
C:\Python27\
(or whichever directory you installed Python to), and select OK to save- To verify your changes, open up a new command prompt and type
python --version
as shown below
- Once the System Properties panel launches, select
Reinstalling/fixing the Python installation
-
On Windows, you may edit your PATH variable by going to the Windows search bar and typing "add"
-
Scroll down to your Python installation and click
modify
-
In the Python dialog box, click
Change Python
-
Scroll down and select the red X next to
Add python.exe to Path
, then chose theWill be installed on local hard drive
option. -
Click Next
-
You can verify your changes by opening up a command prompt and typing
python --version
as shown below
-
-
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
-
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
-
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');
-
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) }
-
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.
-
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.
-
On Windows, you may edit your PATH variable by going to the Windows search bar and typing "env"
-
Once the System Properties panel launches, select
Environment Variables
-
In the Environment Variables editor, select the System Variables, Path line and click Edit
-
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)
- 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:
- 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"
}
}
}
};
- Quickstart
- Command Palette
- Azure Blockchain Service Management
- Infura Service Management
- Azure Blockchain Service Consortium Management
- Contract Management
- Interacting with your Smart Contract
- Debugging Smart Contracts
- Testing Smart Contracts
- Generating Micro-services from Smart Contracts
- Generating Code to Publish Smart Contract Event Data to a Database
- Generating Code to Publish Smart Contract Event Data to Power BI
- Generating Code to Publish Smart Contract Event Data to Service Bus
- Generating Code to Publish Smart Contract Event Data to Event Grid
- Tips, shortcuts and other productivity helpers
- FAQ