microsoft / vscode-azure-blockchain-ethereum Goto Github PK
View Code? Open in Web Editor NEWBlockchain extension for VS Code
License: Other
Blockchain extension for VS Code
License: Other
Hello, this feature "Show smart contract interaction page" after deployment to local network does not work. Tried it several times and just get a blank page but if I try it on the HelloBlockchain.sol contract, it works.
Version: 1.38.1 (user setup)
Commit: b37e54c98e1a74ba89e03073e5a3761284e3ffb0
Date: 2019-09-11T13:35:15.005Z
Electron: 4.2.10
Chrome: 69.0.3497.128
Node.js: 10.11.0
V8: 6.9.427.31-electron.0
OS: Windows_NT x64 10.0.17763
pragma solidity ^0.5.0;
contract Context {
constructor () internal { }
function _msgSender() internal view returns (address) {
return msg.sender;
}
function _msgData() internal view returns (bytes memory) {
this;
return msg.data;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
// Gas optimization: this is cheaper than requiring 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
// Solidity only automatically asserts when dividing by 0
require(b > 0, errorMessage);
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return mod(a, b, "SafeMath: modulo by zero");
}
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b != 0, errorMessage);
return a % b;
}
}
contract tokens is Context, IERC20 {
using SafeMath for uint256;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
uint256 private _totalSupply;
function totalSupply() public view returns (uint256) {
return _totalSupply;
}
function balanceOf(address account) public view returns (uint256) {
return _balances[account];
}
function transfer(address recipient, uint256 amount) public returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function increaseAllowance(address spender, uint256 addedValue) public returns (bool) {
_approve(_msgSender(), spender, _allowances[_msgSender()][spender].add(addedValue));
return true;
}
function decreaseAllowance(address spender, uint256 subtractedValue) public returns (bool) {
_approve(_msgSender(), spender, _allowances[_msgSender()][spender].sub(subtractedValue, "ERC20: decreased allowance below zero"));
return true;
}
function _transfer(address sender, address recipient, uint256 amount) internal {
require(sender != address(0), "ERC20: transfer from the zero address");
require(recipient != address(0), "ERC20: transfer to the zero address");
_balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance");
_balances[recipient] = _balances[recipient].add(amount);
emit Transfer(sender, recipient, amount);
}
// function verifySchedule(uint scheduleid) internal view returns (uint) {
// uint amount = validateSchedule(scheduleid);
// return amount;
// }
// function _mint(uint256 amount) internal returns(bool) {
// require(owner() == msg.sender, "ERC20: mint to the zero address");
// address _account = owner();
// _totalSupply = _totalSupply.add(amount);
// _balances[_account] = _balances[_account].add(amount);
// return true;
// }
// function generateToken(uint scheduleid) public returns(bool) {
// require(owner() == msg.sender, "ERC20: mint to the zero address");
// //if token verifySchedule come back true
// uint256 amount = verifySchedule(scheduleid);
// if(_mint(amount))
// updateSchedule(scheduleid, true);
// return true;
// }
function _approve(address owner, address spender, uint256 amount) internal {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
}
vscode-azure-blockchain-ethereum v1.5.0
VSCode: 1.47.2
After building and deploying a sample smart contract (HelloBlockchain.sol) to Azure Blockchain Service, unable to send transaction via Smartcontract interation Page, which can be accessed from [Show Smart contract Interation Page].
seems like there was same issue that VSCode said same error content. but same symptom was reproduced in v1.5.0 as well.
in v1.5.0, in my understanding the plugin supports smart contract intraction page for contracts deployed to ABS.
Prev Issue(Closed): #52
all the steps I tried are based from https://docs.microsoft.com/en-us/azure/blockchain/service/send-transaction
I can find "Azure Blockchain: Generate Smart Contract UI" in Command Palette. However, when I want to use it, it shows there are no matching commands.
The first FAQ seems to be unfinished. It is like this:
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 in a
In some youtube videos of the Microsoft Developer, has a different view of console in Blockchain Services (https://www.youtube.com/watch?v=yZQ9a22q82E).
It is an interesting view showing the blocks, tps and block count.
But, in my actual view, there is no such data.
I need to do something in order to view that block explorer?
I'm following the HelloBlockchain examples from Microsoft's official documentation , after launching the Smart Contract Interaction Page in VS Code to test the "SendRequest" method, once I provide a text entry for the message and hit "Execute", it fails with "method handler crashed
", and no additional information is logged in the Output:
The first thing that caught my eye is the "Requestor" field being empty, unlike the documentation.
This is the HelloBlockchain.sol
code that was automatically generated:
pragma solidity ^0.5.5;
contract HelloBlockchain
{
//Set of States
enum StateType { Request, Respond }
//List of properties
StateType public State;
address public Requestor;
address public Responder;
string public RequestMessage;
string public ResponseMessage;
event StateChanged(string stateData);
// constructor function
constructor(string memory message) public
{
RequestMessage = message;
State = StateType.Request;
emit StateChanged('Request');
}
// call this function to send a request
function SendRequest(string memory requestMessage) public
{
Requestor = msg.sender;
RequestMessage = requestMessage;
State = StateType.Request;
}
// call this function to send a response
function SendResponse(string memory responseMessage) public
{
Responder = msg.sender;
// call ContractUpdated() to record this action
ResponseMessage = responseMessage;
State = StateType.Respond;
emit StateChanged('Response');
}
}
When trying to install truffle
form the intro page link is fails.
Looking at the debug logs I see that it tries to install it with
"/usr/bin/node" "/home/krasi/bin/npm/bin/npm" "i" "-g" "truffle@>=5.0.0 <6.0.0"
and it fails with
390 error Error: EACCES: permission denied, access '/usr/lib'
For some reason there is another node binary in
$ which node
/home/krasi/.nvm/versions/node/v12.17.0/bin/node
I am not sure why the install script doesn't just use:
"node" "npm" "i" "-g" "truffle@>=5.0.0 <6.0.0"
and let the system resolve the correct paths.
This is kubuntu 20.04 LTS
full log attached
i am getting squigglies for something that I want to ignore and isn't an error, just a style guideline I disagree with. How can I turn off one of the linter settings when editing a Solidity file?
Build Contracts is instead building to app/src/contracts which is the default directory for compiled files in my truffle project. Contracts SHOULD build here, so the plugin is building correctly.
However, it seems that the Smart Contract Interaction page, looks for things in the build folder.
I have tried manually copying over the json files from app/src/contracts to build/ but it this just caused the program to crash.
Specifically, when I try and select 'show smart contract interaction page' I get the error "Contract not deployed yet" even though I just deployed it previously with zero errors.
Curiously, I note that when I click 'deploy contracts' from the above error message, I am greeted with "Compiled contract is missing for solidity file.". I do NOT get this message when I deploy via the command palette.
I am also having issues debugging- I get the error "No compiled contracts found in /repo/build/contracts"
Wat do?
Hi,
I think we can add a reference to the Azure Blockchain developer container in the docs.
If you find the idea interesting I could create a PR with the requiered changes.
Thoughts?
Created the demo project
created a local network
compiled the contracts
deployed the contracts
right click on HelloBlockchain.sol
-> Show interaction page -> black page with ⚙️ Loading dapp...
code -v
1.45.1
5763d909d5f12fe19f215cbfdd29a91c0fa9208a
x64
Blockchain Development Kit for Ethereum
1.3.1
logs:
Get version for required apps: node,npm,git,python,truffle,ganache-cli
[Execute command] v14.3.0
[Execute command] 6.14.5
[Execute command] git version 2.19.1
[Execute command] Python 2.7.16
[Execute command] [email protected] /home/krasi/src/github.com/krasi-georgiev/playground
└── [email protected] invalid
[Execute command] npm[Execute command] ERR! invalid: [email protected] /home/krasi/src/github.com/krasi-georgiev/playground/node_modules/truffle
[Execute command] [email protected] /home/krasi/src/github.com/krasi-georgiev/playground
└── (empty)
[Execute command] Ganache CLI v6.9.1 (ganache-core: 2.10.2)
Get version for required apps: truffle
[Execute command]
Working dir: /home/krasi/src/github.com/krasi-georgiev/playground
Running command
npx truffle compile
[Execute command]
Compiling your contracts...
[Execute command] ===========================
[Execute command] > Compiling ./contracts/HelloBlockchain.sol
[Execute command] > Compiling ./contracts/Migrations.sol
[Execute command] > Artifacts written to /home/krasi/src/github.com/krasi-georgiev/playground/build/contracts
[Execute command] > Compiled successfully using:
- solc: 0.5.16+commit.9c3226ce.Emscripten.clang
[Execute command] Finished running command
[Execute command] 3635
[Execute command] 3635
Get version for required apps: truffle
[Execute command]
Working dir: /home/krasi/src/github.com/krasi-georgiev/playground
Running command
npx truffle migrate --reset --network loc_test_test
[Execute command]
Compiling your contracts...
[Execute command] ===========================
[Execute command] > Everything is up to date, there is nothing to compile.
[Execute command]
[Execute command]
[Execute command]
Starting migrations...
======================
> Network name: 'loc_test_test'
> Network id: 1590594385261
> Block gas limit: 6721975 (0x6691b7)
[Execute command]
1_initial_migration.js
======================
[Execute command]
Replacing 'Migrations'
----------------------
[Execute command] > transaction hash: 0x9da9b8308916e1c1cdd94cd20d521460b9460bc1d28d3cf166b2fd3ec44bd06b
[Execute command] - Blocks: 0 Seconds: 0
[Execute command] > Blocks: 0 Seconds: 0
[Execute command] > contract address: 0xF53B102Bb039a8032Be0026d0e8D42a61c527798
> block number: 13
> block timestamp: 1590602473
> account: 0xC6d8D978150a1b020EBb55e56dBf9A3A6785A16c
> balance: 99.94744078
> gas used: 225237 (0x36fd5)
> gas price: 20 gwei
> value sent: 0 ETH
> total cost: 0.00450474 ETH
[Execute command] - Saving migration to chain.
[Execute command] > Saving migration to chain.
[Execute command] > Saving artifacts
-------------------------------------
> Total cost: 0.00450474 ETH
[Execute command]
2_deploy_contracts.js
=====================
[Execute command]
Replacing 'HelloBlockchain'
---------------------------
[Execute command] > transaction hash: 0xfa16c69430d9a404add5dc2580fe4c57355b002140bad0d89b5ba41cbf3de0c5
[Execute command] - Blocks: 0 Seconds: 0
[Execute command] > Blocks: 0 Seconds: 0
[Execute command] > contract address: 0x48365DA825Bb3408D56FC234Eb712f0ec2C5fb99
> block number: 15
> block timestamp: 1590602473
> account: 0xC6d8D978150a1b020EBb55e56dBf9A3A6785A16c
> balance: 99.93647462
> gas used: 505945 (0x7b859)
> gas price: 20 gwei
> value sent: 0 ETH
> total cost: 0.0101189 ETH
[Execute command]
[Execute command] - Saving migration to chain.
[Execute command] > Saving migration to chain.
[Execute command] > Saving artifacts
-------------------------------------
> Total cost: 0.0101189 ETH
Summary
=======
> Total deployments: 2
> Final cost: 0.01462364 ETH
[Execute command]
[Execute command] Finished running command
[Azure Blockchain] Deploy succeeded
Currently Deploy Contracts
when used with OpenZeppelin Contracts creates a migration file for all of the contracts in the chosen category when only one contract is likely to need migration.
The user has to delete the 99_deploy_openzeppelin.js
during the Deploy Contracts
work flow:
var SimpleToken = artifacts.require("SimpleToken");
module.exports = deployer => {
deployer.deploy(SimpleToken);
};
Deploy Contracts
Some contracts have parameters required for deploy. Do you want to specify them?
99_deploy_openzeppelin.js
Ideally there would be support for creating a Truffle migration for select OpenZeppelin Contracts when using Deploy Contracts
.
For example OpenZeppelin Contracts v3.x has an ERC20 and an ERC721 preset contract that would be great with this workflow: https://docs.openzeppelin.com/contracts/3.x/api/presets
Migrations file created for ERC20 tokens:
var ERC20 = artifacts.require("ERC20");
var SafeMath = artifacts.require("SafeMath");
var ERC20Burnable = artifacts.require("ERC20Burnable");
var ERC20Capped = artifacts.require("ERC20Capped");
var ERC20Mintable = artifacts.require("ERC20Mintable");
var Roles = artifacts.require("Roles");
var ERC20Pausable = artifacts.require("ERC20Pausable");
var SafeERC20 = artifacts.require("SafeERC20");
var Address = artifacts.require("Address");
var TokenTimelock = artifacts.require("TokenTimelock");
module.exports = deployer => {
deployer.deploy(SafeMath);
deployer.deploy(Roles);
deployer.deploy(SafeERC20);
deployer.deploy(Address);
deployer.link(SafeMath, ERC20);
deployer.link(SafeMath, ERC20Burnable);
deployer.link(SafeMath, ERC20Capped);
deployer.link(Roles, ERC20Capped);
deployer.link(SafeMath, ERC20Mintable);
deployer.link(Roles, ERC20Mintable);
deployer.link(SafeMath, ERC20Pausable);
deployer.link(Roles, ERC20Pausable);
deployer.link(SafeERC20, TokenTimelock);
deployer.deploy(ERC20);
deployer.deploy(ERC20Burnable);
deployer.deploy(ERC20Capped);
deployer.deploy(ERC20Mintable);
deployer.deploy(ERC20Pausable);
deployer.deploy(TokenTimelock);
};
I have the error below when creating a new project following the steps below:
https://docs.microsoft.com/en-gb/azure/blockchain/service/send-transaction
Create a smart contract
Get version for required apps: node,npm,git [Execute command] Working dir: c:_MyLab\AzureCode\Blockchain\HelloBlockchain Running command npx truffle unbox Azure-Samples/Blockchain-Ethereum-Template [Execute command] Starting unbox... [Execute command] ================= [Execute command] - Preparing to download box [Execute command] √ Preparing to download box [Execute command] - Downloading [Execute command] × Downloading [Execute command] Unbox failed! [Execute command] × Downloading [Execute command] Unbox failed! [Execute command] RequestError: Error: connect ETIMEDOUT 151.101.16.133:443 at new RequestError (C:\Users\username\AppData\Roaming\npm\node_modules\truffle\build\webpack:\node_modules\request-promise-core\lib\errors.js:14:1) at Request.plumbing.callback (C:\Users\username\AppData\Roaming\npm\node_modules\truffle\build\webpack:\node_modules\request-promise-core\lib\plumbing.js:87:1) at Request.RP$callback [as _callback] (C:\Users\username\AppData\Roaming\npm\node_modules\truffle\build\webpack:\node_modules\request-promise-core\lib\plumbing.js:46:1) at self.callback (C:\Users\username\AppData\Roaming\npm\node_modules\truffle\build\webpack:\node_modules\request\request.js:185:1) at Request.emit (events.js:315:20) at Request.onRequestError (C:\Users\username\AppData\Roaming\npm\node_modules\truffle\build\webpack:\node_modules\request\request.js:881:1) at ClientRequest.emit (events.js:315:20) at TLSSocket.socketErrorListener (_http_client.js:426:9) at TLSSocket.emit (events.js:315:20) at emitErrorNT (internal/streams/destroy.js:92:8) at emitErrorAndCloseNT (internal/streams/destroy.js:60:3) at processTicksAndRejections (internal/process/task_queues.js:84:21) [Execute command] Truffle v5.1.39 (core: 5.1.39) [Execute command] Node v12.18.3 [Execute command] Finished running command
Same issue when I running the same command like below:
C:\_MyLab\AzureCode\Blockchain\HelloBlockchain>npx truffle unbox Azure-Samples/Blockchain-Ethereum-Template
My Internet connection is working.
Sometimes, the error is
RequestError: Error: getaddrinfo ENOENT raw.githubusercontent.com
instead of
RequestError: Error: connect ETIMEDOUT 199.232.56.133:443
If download the app mannually, and run another command below, another error:
Get version for required apps: truffle [Execute command] Working dir:
c:_MyLab\AzureCode\Blockchain\HelloBlockchain Running command npx
truffle compile [Execute command] Error: Cannot find module
'truffle-hdwallet-provider' Require stack:
- c:_MyLab\AzureCode\Blockchain\HelloBlockchain\truffle-config.js
- C:\Users\username\AppData\Roaming\npm\node_modules\truffle\node_modules\original-require\index.js
- C:\Users\username\AppData\Roaming\npm\node_modules\truffle\build\cli.bundled.js
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:965:15)
at Function.Module._load (internal/modules/cjs/loader.js:841:27)
at Module.require (internal/modules/cjs/loader.js:1025:19)
at require (internal/modules/cjs/helpers.js:72:18)
at Object. (c:_MyLab\AzureCode\Blockchain\HelloBlockchain\truffle-config.js:1:26)
at Module._compile (internal/modules/cjs/loader.js:1137:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1157:10)
at Module.load (internal/modules/cjs/loader.js:985:32)
at Function.Module._load (internal/modules/cjs/loader.js:878:14)
at Module.require (internal/modules/cjs/loader.js:1025:19)
at Object.require (internal/modules/cjs/helpers.js:72:18)
at Function.load (C:\Users\username\AppData\Roaming\npm\node_modules\truffle\build\webpack:\packages\config\dist\index.js:161:1)
at Function.detect (C:\Users\username\AppData\Roaming\npm\node_modules\truffle\build\webpack:\packages\config\dist\index.js:150:1)
at Object.run (C:\Users\username\AppData\Roaming\npm\node_modules\truffle\build\webpack:\packages\core\lib\commands\compile.js:68:1)
at Command.run (C:\Users\username\AppData\Roaming\npm\node_modules\truffle\build\webpack:\packages\core\lib\command.js:136:1)
at Object. (C:\Users\username\AppData\Roaming\npm\node_modules\truffle\build\webpack:\packages\core\cli.js:51:1)
at webpack_require (C:\Users\username\AppData\Roaming\npm\node_modules\truffle\build\webpack:\webpack\bootstrap:19:1)
at C:\Users\username\AppData\Roaming\npm\node_modules\truffle\build\webpack:\webpack\bootstrap:83:1
at Object. (C:\Users\username\AppData\Roaming\npm\node_modules\truffle\build\cli.bundled.js:89:10)
at Module._compile (internal/modules/cjs/loader.js:1137:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1157:10)
at Module.load (internal/modules/cjs/loader.js:985:32) [Execute command] Truffle v5.1.39 (core: 5.1.39) Node v12.18.3 [Execute
command] Finished running command
When developing a Solidity 0.5 contract with the plugin (as OpenZeppelin Contracts 2.5.0 is Solidity 0.5) an error Source file requires different compiler version
is shown:
Ideally the plugin could automagically configure solc version in Solidity plugin (@ext:juanblanco.solidity) when using OpenZeppelin Contracts.
pragma solidity ^0.5.0;
import "./openZeppelin/token/ERC20/ERC20.sol";
import "./openZeppelin/token/ERC20/ERC20Detailed.sol";
/**
* @title SimpleToken
* @dev Very simple ERC20 Token example, where all tokens are pre-assigned to the creator.
* Note they can later distribute these tokens as they wish using `transfer` and other
* `ERC20` functions.
*/
contract SimpleToken is ERC20, ERC20Detailed {
/**
* @dev Constructor that gives msg.sender all of existing tokens.
*/
constructor() public ERC20Detailed("SimpleToken", "SIM", 18) {
_mint(msg.sender, 100000 * (10**uint256(decimals())));
}
}
Hi,
From the docs, I saw Azure Blockchain: Create a new network
. How do I connect to non-Azure Blockchain node i.e. Ganache or Goerli testnet (via Infura)?
Thank you.
Issue Type: Bug
Installed extension then try to either connect to consortium and/or create a new service. Even the refresh command not found. Tried to uninstall and reinstall.
I see:
Extension version: 0.1.4
VS Code version: Code 1.35.0 (553cfb2c2205db5f15f3ee8395bbd5cf066d357d, 2019-06-04T01:17:12.481Z)
OS version: Windows_NT x64 10.0.17763
Bug
azure-blockchain
1.6.0
Windows_NT x64 10.0.19042
1.54.3
I have an error below when deploying a Sodality basic project via VSC following the steps below:
https://docs.microsoft.com/en-gb/azure/blockchain/service/send-transaction#deploy-a-smart-contract
Get version for required apps: truffle
[Execute command]
Working dir: c:\_MyLab\AzureCode\Blockchain\HelloBlockchain
Running command
npx truffle migrate --reset --network abs_consortiumhello1_membername_membername
[Execute command]
Compiling your contracts...
[Execute command] ===========================
[Execute command] > Everything is up to date, there is nothing to compile.
[Execute command]
[Execute command]
[Execute command]
Starting migrations...
======================
> Network name: 'abs_consortiumhello1_membername_membername'
> Network id: 204
> Block gas limit: 2328199759 (0x8ac5824f)
[Execute command]
1_initial_migration.js
======================
[Execute command]
Deploying 'Migrations'
----------------------
[Execute command] > transaction hash: 0x59aabcf635ffecf410bc49cb70f720a77b8d7631af29bc4fe52e56696426c237
[Execute command] - Blocks: 0 Seconds: 0
[Execute command] > Blocks: 1 Seconds: 9
[Execute command] > contract address: 0x57aD50C452B5916947725c17eee15e66bc7D20B2
> block number: 1968
> block timestamp: 1597926758
> account: 0xeD95E6eb7a1536D0c23d79D538c93d1EeD8cf8de
> balance: 0
> gas used: 225237 (0x36fd5)
> gas price: 0 gwei
> value sent: 0 ETH
> total cost: 0 ETH
[Execute command]
[Execute command] - Saving migration to chain.
[Execute command] > Saving migration to chain.
[Execute command] > Saving artifacts
-------------------------------------
> Total cost: 0 ETH
[Execute command]
2_deploy_contracts.js
=====================
[Execute command]
Deploying 'HelloBlockchain'
---------------------------
[Execute command]
[Execute command] Error: *** Deployment Failed ***
"HelloBlockchain" -- Invalid JSON RPC response: "".
at C:\Users\username\AppData\Roaming\npm\node_modules\truffle\build\webpack:\packages\deployer\src\deployment.js:364:1
at processTicksAndRejections (internal/process/task_queues.js:97:5)
at Migration._deploy (C:\Users\username\AppData\Roaming\npm\node_modules\truffle\build\webpack:\packages\migrate\Migration.js:68:1)
at Migration._load (C:\Users\username\AppData\Roaming\npm\node_modules\truffle\build\webpack:\packages\migrate\Migration.js:55:1)
at Migration.run (C:\Users\username\AppData\Roaming\npm\node_modules\truffle\build\webpack:\packages\migrate\Migration.js:171:1)
at Object.runMigrations (C:\Users\username\AppData\Roaming\npm\node_modules\truffle\build\webpack:\packages\migrate\index.js:150:1)
at Object.runFrom (C:\Users\username\AppData\Roaming\npm\node_modules\truffle\build\webpack:\packages\migrate\index.js:110:1)
at Object.runAll (C:\Users\username\AppData\Roaming\npm\node_modules\truffle\build\webpack:\packages\migrate\index.js:114:1)
at Object.run (C:\Users\username\AppData\Roaming\npm\node_modules\truffle\build\webpack:\packages\migrate\index.js:79:1)
at runMigrations (C:\Users\username\AppData\Roaming\npm\node_modules\truffle\build\webpack:\packages\core\lib\commands\migrate.js:269:1)
at C:\Users\username\AppData\Roaming\npm\node_modules\truffle\build\webpack:\packages\core\lib\commands\migrate.js:231:1
[Execute command] Truffle v5.1.41 (core: 5.1.41)
[Execute command] Node v12.18.3
[Execute command] Finished running command
[Azure Blockchain] Deploy failed
Request to support latest OpenZeppelin Contracts versions
The plugin currently supports OpenZeppelin Contracts 2.5.0 (Solidity 0.5)
The latest version of 2.x is 2.5.1
The latest version of 3.x is 3.0.1 (Solidity 0.6)
I am running:
Windows 10
WSL2
Trying to see why my version of Python is not found.. I am running WSL and the integrated terminal is set up to run bash but I have python installed on windows and linux and python is configured the environment variables for both environments should be configured correctly. If I run 'python' from the command line, I will be able to enter the REPL with no issues from bash or powershell.
I'm not sure why the azure blockchain toolkit won't recognize my installed python.
Please advise
Initial migration is stuck at
Saving migration to chain.
[Execute Error: Error: Error: Returned error: authentication needed: password or unlock
at Object.run (/home/venkatesh/.nvm/versions/node/v10.15.0/lib/node_modules/truffle/build/webpack:/packages/truffle-migrate/index.js:92:1)
at process._tickCallback (internal/process/next_tick.js:68:7)
Probably an ABS configuration issue. Need Assistance.
Versions:
Truffle v5.0.31 (core: 5.0.31)
Node v10.15.0
Screenshot:
When launching the extension I get the following error:
[Telemetry Client] Initialize done with error: Instrumentation key not found, pass the key in the config to this method or set the key in the environment variable APPINSIGHTS_INSTRUMENTATIONKEY before starting the server Get version for required apps
Moreover, every time I try to execute command Azure Blockchain: New Solidity Project
I get error Get version for required apps
, but no further details about missing dependencies.
I have already installed all the required dependencies, as confirmed by the following output:
[Execute command] v10.15.3
[Execute command] 6.4.1
[Execute command] git version 2.21.0.windows.1
[Execute command] Python 2.7.15
[Execute command] Truffle v5.0.18 (core: 5.0.18)
[Execute command] Solidity v0.5.0 (solc-js)
[Execute command] Node v10.15.3
Web3.js v1.0.0-beta.37
[Execute command] Ganache CLI v6.4.3 (ganache-core: 2.5.5)
I'm currently trying to run the plugin on an existing project. The truffle project and thus the config file are located in a nested directory (I'm using a monorepo).
Running Build Contracts
for example fails
ExtendableError: Could not find suitable configuration file.
I suspect it tried to find the config file in the root folder.
Is there any way to set the path to the truffle project?
I get no interactive prompt to type in my credentials to connect to Infura when clicking Sign in to Infura account
. I know I should be getting a prompt, after watching this video (go to 1:50).
1.55.0-insider
11.2.1
(M1 chip)Remote-SSH
): Ubuntu 20.04
1.6.0
6.14.4
2.25.1
10.19.0
5.2.6
1.2.9
0.5.16
v6.12.2
(ganache-core: 2.13.2
)After connecting to remote machine via Remote-SSH I press:
I get no interactive prompt to login whatsoever and on the bottom of the screen I see:
This keeps pending until it times out. If I click on it before timing out, I get:
Happy to provide more details if needed.
command 'truffle.newSolidityProject' not found
And it doesn't seem to be installed any longer.
Also, trying to unbox anything from truffle doesn't seem to be working either as they all fail with gyp-error on no matter what build-tools or version of VS is installed.
Hi:
By my knowledge the Python 2 will be out of support quiet soon, so, I am just wondering if this extension can work with Python 3? I don't think depends on a out of support software would be a very good idea.
Firstly: the Smart Contract Interaction page is fantastic.
Currently read functions that take parameters such as balanceOf
and allowance
in an ERC20 token are not supported in Smart Contract Interaction and show Sorry! Complex structures has not supported yet!
Simple ERC20 token example
pragma solidity ^0.5.0;
import "./openZeppelin/token/ERC20/ERC20.sol";
import "./openZeppelin/token/ERC20/ERC20Detailed.sol";
/**
* @title SimpleToken
* @dev Very simple ERC20 Token example, where all tokens are pre-assigned to the creator.
* Note they can later distribute these tokens as they wish using `transfer` and other
* `ERC20` functions.
*/
contract SimpleToken is ERC20, ERC20Detailed {
/**
* @dev Constructor that gives msg.sender all of existing tokens.
*/
constructor() public ERC20Detailed("SimpleToken", "SIM", 18) {
_mint(msg.sender, 10000 * (10**uint256(decimals())));
}
}
Bug
azure-blockchain
1.5.0
Windows_NT x64 10.0.19042
1.50.0
I'm following the HelloBlockchain examples from https://docs.microsoft.com/en-us/azure/blockchain/service/send-transaction
Deployment of the automatically generated smart contracts fails with the following error message in VS Code:
Failed to run command - npx truffle migrate --reset --network <mynetwork>. More details in output
Details in the output say that: "Migrations" -- method handler crashed.
When trying to create a new Solidity project, I get the error, "To run command you should install required apps. Please see details on the Requirements Page", indicating that I don't have a required application. I've checked all versions, they are all either at the required version or later. Any idea what's going on here?
Jeffreys-MacBook-Pro:truffle_testing jschmitz$ node --version
v10.15.0
Jeffreys-MacBook-Pro:truffle_testing jschmitz$ npm --version
6.14.5
Jeffreys-MacBook-Pro:truffle_testing jschmitz$ git --version
git version 2.21.1 (Apple Git-122.3)
Jeffreys-MacBook-Pro:truffle_testing jschmitz$ python --version
Python 2.7.16
Jeffreys-MacBook-Pro:truffle_testing jschmitz$ truffle --version
Truffle v5.1.28 - a development framework for Ethereum
Jeffreys-MacBook-Pro:truffle_testing jschmitz$ ganache-cli -v
Ganache CLI v6.1.0 (ganache-core: 2.1.0)
Expected identifier, got 'LParen'
SPDX license identifier not provided in source file. Before publishing, consider adding a comment containing "SPDX-License-Identifier: " to each source file. Use "SPDX-License-Identifier: UNLICENSED" for non-open-source code. Please see https://spdx.org for more information.
Visibility for constructor is ignored. If you want the contract to be non-deployable, making it "abstract" is sufficient.
How to fix them?
node 10.15.3
git 2.22.0.windows.1
python 2.7.15
npm 6.9.0
Windows build 10.0.18362.175
VS Code 1.35.1
When I created a Basic Project via the VS Code extension, it would fail with deprecation errors; however, I could connect to my consortium without any issues.
After talking with MS experts, it was recommended I install the the Windows Global Build tools via the command "npm install --global windows-build-tools" which I ran in an elevated PowerShell session. I did run into an initial problem with this install, and I had to delete the folder "...\AppData\Roaming\npm\node_modules\windows-build-tools" - this was likely due to processes that we're still active. Once I rebooted and reran the install, everything worked perfectly.
I am getting this error "Failed to run command - npx truffle migrate --reset --network filzablockchain. More details in output" when I try to deploy my Dapp on ABS following the given instructions. In output I get this major error: [Execute command] ReferenceError: HDWalletProvider is not defined.
Here is my full Dapp Link: https://github.com/filzatariq/decentralized-newsfeed
The Dapp is created using Truffle Petshop Box : https://github.com/truffle-box/pet-shop-box
vscode-azure-blockchain-ethereum v1.5.0
VSCode: 1.47.2
When opening a smart contract via [Show smartcontract intraction page], it failed and the plugin warned contract not deployed yet.
deployed smart contract was newly added sol file to HelloBlockchain project, which is the auto-generated template.
Since contract addresses are all valid, this is extension issue.
(1) Select Blockchain > New Solidity Project (Basic)
(2) Add another sol file (example: another.sol) to the created project
(3) Add another deploy_contracts.js (example: 3_deploy_contracts.js) for another.sol
(4) Build
(5) Deploy them to Azure Blockchain Service
(6) In log console, the plugin shows their contract addresses and accounts.
(7) When select another.sol and tried to debug by [Show Smartcontract intraction page], warning came up:
Issue Type: Bug
I have installed Python 2.7.15 by clicking on "install python" button on Azure Blockchain start page. The install has been successful. I have restarted the machine post install. Still, when I go to start page of the extension, I see "Install Python" enabled stating I need Python to go on.
Extension version: 0.1.2
VS Code version: Code 1.33.1 (51b0b28134d51361cf996d2f0a1c698247aeabd8, 2019-04-11T08:27:14.102Z)
OS version: Windows_NT x64 10.0.18890
Item | Value |
---|---|
CPUs | Intel(R) Core(TM) i7-6600U CPU @ 2.60GHz (4 x 2808) |
GPU Status | 2d_canvas: enabled checker_imaging: disabled_off flash_3d: enabled flash_stage3d: enabled flash_stage3d_baseline: enabled gpu_compositing: enabled multiple_raster_threads: enabled_on native_gpu_memory_buffers: disabled_software rasterization: enabled surface_synchronization: enabled_on video_decode: enabled webgl: enabled webgl2: enabled |
Memory (System) | 7.93GB (0.23GB free) |
Process Argv | |
Screen Reader | no |
VM | 0% |
I have encountered an issue when following the tutorial (https://docs.microsoft.com/en-gb/azure/blockchain/service/ethereum-logic-app#generate-a-workflow) to use VS Code to generate logic app workflow for REST based micro-service.
I’m using the HelloBlockchain.sol smart contract that is deployed to ABS. I am able to use the generated logic app to read data from the smart contract (property.requestMessage) but when I try to write data (function.sendRequest) I get the following error message in the logic app:
{
"status": 400,
"message": "Encountered RPC error when establishing communicating with the blockchain network -32000: method handler crashed\r\nclientRequestId: f6ffae1b-899e-404b-9113-37d2249b3a9b",
"error": {
"message": "Encountered RPC error when establishing communicating with the blockchain network -32000: method handler crashed"
},
"source": "blockchainethereum-we.azconn-we-01.p.azurewebsites.net"
}
I’ve tried using private key and account address & account password in the connection, two different smart contracts as well as using GET instead of POST with hardcoded data but the the error still persist.
Hi, I maintain VS Code's Webview API
Our telemetry suggests that your extension uses webviews and may be loading resources in these webviews using hardcoded vscode-resource:
URIs. These URIs have some important limitations and don't work properly when VS Code is run in a browser. We are also making changes in the desktop version of VS Code that may cause these URIs to not work properly in future versions of VS Code.
While we are making our best effort to continue support existing webview extensions that use vscode-resource:
URIs on desktop versions of VS Code, we will not able to fully support all uses cases.
To ensure that your extension continues to work in as many environments as possible—including on web and remotely—please:
Switch to use the Webview.asWebviewUri
function for loading resources.
Switch to use the Webview.cspSource
property in content security policies.
These APIs shipped around 2 years ago so they should be available in all modern versions of VS Code. You can find additional information about the issue here: microsoft/vscode#97962
Let me know if you have any questions about this change
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.