Questions tagged [nodejs]

Node.js is a platform built on Chrome's JavaScript runtime for easily building fast and scalable network applications.

240 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
0
votes
0answers
864 views

TypeError: CreateListFromArrayLike called on non-object

I have this contract and deployed it to my local client (ganache gui) and its abi.json file (of solc compiler generated). The third file is param.txt which contains encoded functions with arguments ...
0
votes
1answer
3k views

Get an error: insufficient funds for gas * price + value

I need to send erc20 tokens from one address to another, provided that the token balance is not empty. I check the balance as follows: const balance = contractInstance.methods.balanceOf (...
0
votes
3answers
49 views

Could not assign contract state variable value to javascript variable

I want to retrieve and assign the value of my contract state variable to my javascript variable.I am doing as per guidlines provided on this community, but failed to assigned. my javascript code is ...
0
votes
1answer
482 views

getPastEvents on localhost is not a function error

Now, I'm working on an Ethereum Blockchain project to transfer the ownership of stored devices by using local web3 provider at the truffle environment. Truffle v5.0.27 (core: 5.0.27) Solidity v0.5....
0
votes
1answer
217 views

end process after web3 sendTransaction return transactionHash

I want to end the process after sendTransaction return transactionHash. Here is my code currently : const Web3 = require('web3'); const web3 = new Web3("http://127.0.0.1:8545"); async function task(...
0
votes
1answer
308 views

About send Ethereum Classic (ETC) coin

Need guideline for send ETC coin using web3js,As per documented flow I understand we can access all methods same as ETH but I have query regarding set provider for ETC after that I can connect to ETC ...
0
votes
1answer
636 views

Sending value to a solidity contract method from web3 results in `Invalid Tuple Value` error

I'm sending values to a solidity 0.5.1 method using web3 and keep getting an invalid Tuple value error. Here's the relevant contract code: struct mystruct { bytes32 id; string str; } ...
0
votes
1answer
160 views

Deploy contract didnt resolve the promise

im facing a problem deploying a simple smart contract. When i use ganacha-cli, the program enter in a loop of confimation event, counting from 1. Thats the first problem. Output: Account: ...
0
votes
0answers
165 views

Handling a promise in a return function

I am trying to console.log the blockNumber that my transaction was confirmed in with the following code: web3.eth.sendTransaction( {from:account3, to: account2, value: web3.utils.toWei('1','ether'...
0
votes
1answer
1k views

How do I load the `web3` module using the html `script` element?

How do I load the web3 module into the frontend of my application using the html script element? I have already installed the web3 module using npm. This is the path to the web3 module in my app ...
0
votes
0answers
2k views

intermediate value is not iterable

I try to construct a transaction with Node (11.4.0), ethereumjs-tx (1.3.7) and web3 (1.0.0-beta.55) and Infura. Infura gives me '0x35b' for the nonce, then I create the tx: amount = 0.001; nonce = '...
0
votes
0answers
85 views

I keep getting this Error when i tried to use contracts instance to call a contract's function?

I tried creating instance by: const certificate = Certificate.deployed(); OR const certificate = Certificate.at(config.contract_id); ANd i get this Error below: TypeError: Cannot read property '...
0
votes
1answer
503 views

get Transfer events from 0x0 address for ERC20 token

I am trying to get all the events that originate from zero (0x0) address in order to capture the mint activity for my ERC20 token. Here is my code snippet: var instance = web3.eth.contract(abi).at(...
0
votes
0answers
85 views

How can I comparing fingerprint using solidity language?

I have a fingerprint image stored in IPFS and I want to compare with another fingerprint image, because i need to know if is the same fingerprint ,is there some way, some lib that i can compare this ...
0
votes
0answers
359 views

Node: How Can I Import Web3 To Node.js?

I'm trying to import the web3 library in Node.js so that I can handle Ethereum smart contract events, however I can't get the import to work. I'm running Babel on each file to convert to es5, and the ...
0
votes
0answers
22 views

Send Data into BlockChain Network using w3?

HI I want to store my bank information on ethereum network using w3. can anyone help me to send my data //Bank.sol pragma solidity >=0.4.21 <0.6.0; contract Bank { struct User {...
0
votes
1answer
373 views

Error while I am compiling the contract using node

saitejas-MacBook-Air:Inbox saitejakuruva$ sudo node compile.js assert.js:340 throw err; ^ AssertionError [ERR_ASSERTION]: Invalid callback specified. at wrapCallback (/Users/saitejakuruva/...
0
votes
1answer
117 views

how to use backup node in web3 connection?

node1= running on port 8545 => current synced block is 2000, and node2= running on port 3545 => current synced block is latest When i am using web3 into another page and print web3 object it ...
0
votes
0answers
177 views

How to use multiple app.js in truffle project?

I'm new to blockchain and currently developing small application for educational purpose using solidity. I am using truffle framework and stuck at a point. currently there is only one app.js file in ...
0
votes
1answer
483 views

ipfs.files.add(Buffer) function causing TypeError: Cannot read property 'add' of undefined

I am trying to upload an image to ipfs using ipfs.files.add() function but it is causing me this error Uncaught TypeError: Cannot read property 'add' of undefined at App.onSubmit (App.js:70) at ...
0
votes
0answers
2k views

TypeError: Cannot read property 'slice' of undefined

web3.eth.accounts.signTransaction(transactionObject, process.env.WALLET_PRIVATE_KEY, function (error, signedTx) { if (error) { log(`${error}`.red); } else { web3.eth....
0
votes
0answers
284 views

To transfer tokens using google cloud function

I am transferring token to the User's wallet when they create account. For that I am using google cloud functions. Here, on the account creation event, tokens will get transferred to the address. My ...
0
votes
1answer
59 views

How to configure APIs to run with Ropsten addresses

I have my contracts deployed on Ropsten network. I deployed those contracts from my local machine using Truffle migrate. Then I set up an AWS EC2 Ubuntu server to host my RESTful APIs. I installed ...
0
votes
0answers
1k views

FATAL ERROR: Rebalance Allocation failed - process out of memory

So while running truffle compile for my contracts on AWS Ubuntu server I got the following error: <--- Last few GCs ---> [17055:0x3985730] 11958 ms: Scavenge 511.7 (553.4) -> 506.9 (553.4) ...
0
votes
0answers
237 views

Getting an error cannot read property "encodeParameters" of undefined

I am running a node.js server but while running it, i am getting following error. what could be the possible reason?
0
votes
2answers
827 views

Error: Cannot find module 'ethereumjs-wallet'

A truffle test needs ethereumjs-wallet const wallet = require('ethereumjs-wallet'); I tried npm install ethereumjs-wallet and even npm uninstall ethereumjs-wallet npm install --save ethereumjs-...
0
votes
2answers
928 views

How to state private keys when using node.js and ethereum to run a contract?

I have to run node.js to execute smart contracts. My quetsion is about the keys. I have seen this from the docs - 1. Code to sign 2. Code to execute But I am unsure how the two are combined. Could ...
0
votes
0answers
67 views

Callback for transaction mined

Coursetro.setFile(fileName,"test hash",function(error, result){ if(!error) { console.log("Transaction submitted"); } else{ console.log("Error " + error); } }); I am calling the ...
0
votes
0answers
338 views

Calling contract with web3 keeps running out of gas

I am trying to test executing a method on an existing contract, but the transaction keeps running out of gas, and I can't figure out why. I am trying to call an Etheroll contract on the Rinkeby test ...
0
votes
1answer
517 views

Error: `Invalid JSON RPC response` when running estimateGas on Infura

Why am I getting an error when doing a gas estimation on infura. I am using web3 v1.0 and here is my code: let Web3 = require('web3'); var web3 = new Web3(new Web3.providers.HttpProvider('http://...
0
votes
3answers
2k views

calling smart contract functions from app.js

I deployed a smart contract to ganache network using truffle from account1. The code of smart contract is as follows. pragma solidity ^0.4.0; import "./strings.sol"; import "./safemath.sol"; ...
0
votes
1answer
250 views

Solidity solc compiler error on code Remix can compile

I am attempting to compile the following solidity code using solc in NodeJS. pragma solidity ^0.4.11; contract helloWorld { string public message; function constructor() public{ message = "...
0
votes
0answers
111 views

Storing string containing delimiters in contracts - Error: invalid argument 0

I have created an array in contract where I'm pushing a string(concatt = IN23450.001 by concatenating 'IN2345' and '0.001'). Contract contract BDetails { struct Details { bytes32[] ...
0
votes
0answers
108 views

has anyone written a nodejs server side component to listen only for Ethereum Events?

I tried the below code to run it using the pm2 module, as nohup command as well. But, this doesn't seem to work. I saw this, but no code is present. so this is what I'm trying to accomplish. I want ...
0
votes
0answers
825 views

Running Npm init on powershell but its stuck and I can't proceed

I can't run truffle commands on windows powershell so I went to do the steps that I got here. However npm init got me stuck and I can't proceed: Here is the stuck screen: EDIT: After I uninstalled ...
0
votes
2answers
290 views

Ethereum transactions inside full node

I am creating basic peer-to-peer ETH exchange on running geth full node, and can't find out how to make transactions inside node, from one account to another. Is it even possible to transfer funds ...
0
votes
1answer
297 views

testrpc --account private key length is invalid even though its my account

I tried to initiate a testrpc account and passing my account with value to test the transactions but when I keyed in my key 0x94fd019eeb92780477b01ce5555513d3755b5193 it says that the key is invalid. ...
0
votes
0answers
255 views

web3.personal.unlockAccount creates too many nodejs defunct processes

I am getting a lot of [nodejs] [defunct] process when run this code. Is there a way to check if an account is already unlocked or lock the account to properly close the nodejs process it starts so ...
0
votes
0answers
84 views

Test RPC via Node and repeated contract calls

On the testrpc, I deploy a contract: myContract.new(.... And it works great. I get a transaction hash, a transaction reciept, and a contract created address output in the terminal. But then I ...
0
votes
0answers
481 views

web3 angular not working in IE 11

Have a problem with web3. In the project on angular use this library. In all browsers everything is good but in ie 11 it gives an error and does not load. Error in this line const {keccak256, ...

1 2 3 4
5