Most answered questions in Blockchain

0 votes
1 answer

Truffle Compile failing, ParserError: Expected token LParen got Identifier function

Your parentheses are mismatched. pragma solidity ^0.4.17; import "truffle/Assert.sol"; import ...READ MORE

Oct 9, 2018 in Blockchain by Omkar
• 69,230 points
2,274 views
0 votes
1 answer

Getting “web3.eth.filter is not a function” while trying to monitor Ethereum blocks

It appears you are using web3.js v1.0. ...READ MORE

Oct 9, 2018 in Blockchain by Omkar
• 69,230 points
2,405 views
0 votes
1 answer

Solidity ParserError: Expected identifier but got '='

Hey, the solidity grammar doesn't allow assignments ...READ MORE

Oct 9, 2018 in Blockchain by Omkar
• 69,230 points
9,022 views
0 votes
1 answer

truffle migrate Error

testrpc Check your truffle.js config port and ip ...READ MORE

Oct 8, 2018 in Blockchain by Omkar
• 69,230 points
1,148 views
0 votes
1 answer

How can I inject and use this javascript library (web3) with JavascriptCore

The web3.js library has dependencies on bignumber.js and crypto-js.js (See dependencies here). You will ...READ MORE

Oct 8, 2018 in Blockchain by Omkar
• 69,230 points
786 views
0 votes
1 answer

Get specific JSON data value using array from Coin Market Cap API

use inArray function. example: $.getJSON("//api.coinmarketcap.com/v1/ticker/?limit=0", function(data) { ...READ MORE

Oct 8, 2018 in Blockchain by Omkar
• 69,230 points
1,673 views
0 votes
1 answer

How to choose which function is called first in Node Js

You can do something like: infuraProvider.getBlockNumber().then(function(blockNumber) { ...READ MORE

Oct 8, 2018 in Blockchain by Omkar
• 69,230 points
451 views
0 votes
1 answer

javascript bytes32 to string

Assuming you're using web3 on the JS side, it's web3.toAscii. Example ...READ MORE

Oct 8, 2018 in Blockchain by Omkar
• 69,230 points
3,135 views
0 votes
1 answer

pubToAddress method from ethereumjs-util throws AssertionError: false == true

This code works fine: var keythereum = require('keythereum'); var ...READ MORE

Oct 8, 2018 in Blockchain by Omkar
• 69,230 points
1,067 views
0 votes
1 answer

What is the difference between creating a new solidity contract with and without the `new` keyword?

You cannot omit new keyword for creating ...READ MORE

Oct 8, 2018 in Blockchain by Omkar
• 69,230 points
951 views
0 votes
1 answer

Ethereum, web3, Error: invalid argument 0: cannot unmarshal non-string as hex data, when I call a contract

I have the same problem. But with ...READ MORE

Oct 8, 2018 in Blockchain by Omkar
• 69,230 points
1,793 views
0 votes
1 answer

Solidity different token price

Yes you can do this by modifying ...READ MORE

Oct 8, 2018 in Blockchain by Omkar
• 69,230 points
650 views
0 votes
1 answer

Sending hash in function parameter

I am developing a smart contract using ...READ MORE

Oct 8, 2018 in Blockchain by Omkar
• 69,230 points
523 views
0 votes
1 answer

How can I deploy a hyperledger business network using docker-compose?

If you want to use Composer, be ...READ MORE

Oct 4, 2018 in Blockchain by Perry
• 17,100 points
1,274 views
0 votes
1 answer

How to define the path to hyperledger-fabric chaincode?

You can find that in docker-compose files ...READ MORE

Oct 4, 2018 in Blockchain by Perry
• 17,100 points
1,231 views
0 votes
1 answer

Contract deployment is raising gas issue while transaction and issue vary on various networksbl

Starting time can't be in the past. new ...READ MORE

Oct 3, 2018 in Blockchain by Omkar
• 69,230 points
519 views
0 votes
1 answer

Error when Installing Ethereum: Package 'ethereum' has no installation candidate

It seems that there is a compatibility ...READ MORE

Oct 3, 2018 in Blockchain by digger
• 26,740 points
632 views
0 votes
1 answer

Web is not injected by metamask

You need to do import the Web3 ...READ MORE

Oct 3, 2018 in Blockchain by slayer
• 29,350 points
824 views
0 votes
1 answer

Truffle migrate fails due to missing function, but it exists in node_modules

deployer.deploy(password1, password2, deadline, {value: 100, from: accounts[0]}); ...READ MORE

Oct 3, 2018 in Blockchain by digger
• 26,740 points
1,752 views
0 votes
1 answer

Access variables through auto-generated getters from a different contract

You just need to pass it in ...READ MORE

Oct 3, 2018 in Blockchain by slayer
• 29,350 points
370 views
0 votes
1 answer

Handling UI when a trasaction is in pending (MetaMask)

You need to use the state of ...READ MORE

Oct 3, 2018 in Blockchain by digger
• 26,740 points
692 views
0 votes
1 answer

Error when trying to deploy Ethereum smart contract using web3j

Create a new credential based on the Credentials.create ...READ MORE

Oct 3, 2018 in Blockchain by slayer
• 29,350 points
1,434 views
0 votes
1 answer

What happens to Ether in a smart contract after selfdestruct?

selfdestruct takes one argument an address and then sends all ...READ MORE

Oct 3, 2018 in Blockchain by digger
• 26,740 points
736 views
0 votes
1 answer

Truffle migration error (test rpc is running)

1) Run the following command: npm install -g ...READ MORE

Oct 3, 2018 in Blockchain by slayer
• 29,350 points
629 views
0 votes
1 answer

How do display all the events logs from a smart contract?

You'll need to watch the events. const filter ...READ MORE

Oct 3, 2018 in Blockchain by digger
• 26,740 points
3,027 views
0 votes
1 answer

How do I initialize an array in a struct

You need to manually change the length ...READ MORE

Oct 1, 2018 in Blockchain by Perry
• 17,100 points
2,782 views
0 votes
1 answer

Cannot find package “google/protobuf”

Firstly, your import is wrong, you are ...READ MORE

Oct 1, 2018 in Blockchain by Perry
• 17,100 points
3,199 views
0 votes
1 answer

How to make Observable from callback?

RxJS includes a bindNodeCallback observable creator specifically for creating ...READ MORE

Oct 1, 2018 in Blockchain by digger
• 26,740 points
2,485 views
0 votes
1 answer

How to fix browser/IERC20.sol:4:53: Warning: This declaration shadows an existing declaration

I believe the issue is the reuse ...READ MORE

Oct 1, 2018 in Blockchain by slayer
• 29,350 points
1,285 views
0 votes
1 answer

Why is (startingBalance - endBalance) > (gasUsed * gasPrice) for an Ethereum transaction?

startingBalance and endBalance are BigNumber objects. Change ...READ MORE

Oct 1, 2018 in Blockchain by digger
• 26,740 points
745 views
0 votes
1 answer

Web3j: Writing operations on a contract always throw “java.lang.ArrayIndexOutOfBoundsException”

That exception is thrown when you pass ...READ MORE

Oct 1, 2018 in Blockchain by slayer
• 29,350 points
540 views
0 votes
1 answer

Send all Tokens and Eth to a Address automatically

require(token.transfer(beneficiary, token.balanceOf(this))); where token is the ERC20 token you're transferring. ...READ MORE

Oct 1, 2018 in Blockchain by digger
• 26,740 points
4,016 views
0 votes
1 answer

Ethereum client-go RPC response 403 “invalid host specified”

Adding --rpcvhosts=* should solve the issue READ MORE

Oct 1, 2018 in Blockchain by slayer
• 29,350 points
1,745 views
0 votes
1 answer

How to call function in one contract from another contract in private blockchain?

Please check whether you have byzantiumBlock: 0 in your ...READ MORE

Oct 1, 2018 in Blockchain by digger
• 26,740 points
715 views
0 votes
1 answer

web3.eth.sendSignedTransaction() always return “Returned error: nonce too low”

This bit of code looks wrong: var rawTx ...READ MORE

Oct 1, 2018 in Blockchain by slayer
• 29,350 points
5,645 views
0 votes
1 answer

Solidity mocha : address is not a contract error

Try the following: // Initialize contract variable with ...READ MORE

Oct 1, 2018 in Blockchain by digger
• 26,740 points
829 views
0 votes
1 answer

Add Peers does not add a peer in Geth console

Setup actual boot node, don't treat base ...READ MORE

Sep 28, 2018 in Blockchain by slayer
• 29,350 points
2,351 views
0 votes
1 answer

Invalid method parameters for eth_sendTransaction

params needs to be an array, try {"jsonrpc":"2.0","method":"eth_se ...READ MORE

Sep 28, 2018 in Blockchain by digger
• 26,740 points
1,585 views
0 votes
1 answer

NodeJS POST Request Over JSON-RPC

You're missing the --header option: curl --request POST \ ...READ MORE

Sep 28, 2018 in Blockchain by digger
• 26,740 points
2,206 views
0 votes
1 answer

How to run Meteor insert within a Fiber?

Just replace events.watch(function(error, event) { ... }); with events.watch(Meteor.bindEnvironment(function(error, event) ...READ MORE

Sep 28, 2018 in Blockchain by slayer
• 29,350 points
626 views
0 votes
1 answer

How to get value from solidity contract using java?

web3j caters for this very use case. It ...READ MORE

Sep 28, 2018 in Blockchain by slayer
• 29,350 points
1,770 views
0 votes
1 answer

Etheruem: Pyethereum Error

Try running this: sudo easy_install -U setuptools In my ...READ MORE

Sep 28, 2018 in Blockchain by digger
• 26,740 points
310 views
0 votes
1 answer

Uncaught ReferenceError: web3 is not defined at window.onload

I think the onload is giving the issue. Try this ...READ MORE

Sep 28, 2018 in Blockchain by slayer
• 29,350 points
2,251 views
0 votes
1 answer

How are the ethers sent to smart contract in the IBM example?

They are in magical variable msg. The function ...READ MORE

Sep 28, 2018 in Blockchain by digger
• 26,740 points
332 views
0 votes
1 answer

Can't call contract function in truffle console

Inspect the object adoption within the console. You will ...READ MORE

Sep 28, 2018 in Blockchain by slayer
• 29,350 points
2,926 views
0 votes
1 answer

Why estimateGas always returns null or zero?

The Web3 API uses error first style callbacks. Your ...READ MORE

Sep 28, 2018 in Blockchain by digger
• 26,740 points
1,125 views
0 votes
1 answer

ethereum eth_sendTransaction via PHP curl

Your params field is missing a wrapping array. Try ...READ MORE

Sep 27, 2018 in Blockchain by slayer
• 29,350 points
4,579 views
0 votes
1 answer

How to achieve simple OOP in Solidity?

contract A { uint public ...READ MORE

Sep 27, 2018 in Blockchain by slayer
• 29,350 points
721 views
0 votes
1 answer

Truffle init: throw er; // Unhandled 'error' event

Modified the cli.bundled.js: replaced https.request with request Diff: ...READ MORE

Sep 27, 2018 in Blockchain by digger
• 26,740 points
2,161 views
0 votes
1 answer

NPM cannot install “truffle” on Windows

Your install is failing at node-gyp rebuild. Solutions ...READ MORE

Sep 27, 2018 in Blockchain by slayer
• 29,350 points
3,964 views