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,268 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,400 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,005 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,141 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
780 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,660 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
444 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,127 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,066 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
942 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,783 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
638 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
517 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,273 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,185 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
517 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
628 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
819 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,723 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
368 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
686 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,423 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
725 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
628 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,016 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,773 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,190 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,481 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,280 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
741 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
537 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,004 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,725 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
712 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,630 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
820 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,337 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,573 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,199 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
625 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,758 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
309 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,247 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
326 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,922 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,122 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,565 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
718 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,153 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,948 views