Questions tagged [nodejs]

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

Filter by
Sorted by
Tagged with
0
votes
1answer
15 views

Why my contract binary does not set?

My project is in Truffle. I programmed a smart contract and want to deploy it with JavaScript. But the following error occurs: Error: Contract error: contract binary not set. Can't deploy new ...
0
votes
1answer
27 views

getTransaction sometimes returns null when transaction is pending

I am looking to get real time transaction data as it is broadcasted to the ethereum network, so I have subscribed to pendingTransactions. This only returns the transaction hash though, so I have to ...
0
votes
0answers
17 views

How to make sign tx for erc20 token transfer? [duplicate]

How can I make an erc20 token transfer in node, I know to transfer eth is like this for using ethers. Lib: let privateKey = "0x3141592653589793238462643383279502884197169399375105820974944592" let ...
0
votes
0answers
25 views

How to get type of a contract internal transaction? [duplicate]

I'd like to get type(create, call, ...) of a contract internal transaction, like [this page of etherscan.][1] However, I couldn't find it any responses and documents of web3js. I'm getting a contract ...
0
votes
1answer
19 views

How can I keep nodejs running even after crash on Ubuntu [closed]

Is there any way I can run the nodejs program app.js always in the server even it crash? So I do not need to keep restarting node app.js by nohup
1
vote
1answer
17 views

What is an index position of an uncle?

I see this document. But I don't understand what is an index position of an uncle. I'd like to get informations of uncle blocks like etherscan.io However I don't know a value of the index position ...
1
vote
0answers
17 views

How to deploy blockchain app in heroku

I want to deploy my blockchain app in heroku and i just want to use ganache as my blockchain network. is that possible?
0
votes
0answers
22 views

Is it possible to use ganache blockchain when I deploy my web app in heroku? or should I deploy the contract first to a test network?

const web3 = new Web3( new Web3.providers.HttpProvider( "https://kovan.infura.io/v3/INFURA_KEY" ) ); const abi = JSON.parse( '[ { "constant": false, "inputs": [ { "internalType": "string", "...
1
vote
1answer
25 views

Get each transactions from response of txpool.getContent()

I'm trying to get each transactions from response of txpool.getContent(). The response structure is here. > pending: { '0x0000000186c96Ab17A967d7A3033db82efcA587B': { '11': [Object] }, '...
2
votes
2answers
30 views

Meanings of a txpool.getContent() response

I'd like to understand the structure of response for txpool.getContent(). I got a following response from my geth node. > pending: { '0x0000000186c96Ab17A967d7A3033db82efcA587B': { '11': [...
1
vote
1answer
46 views

When testing a contract, NodeJS returns: “SyntaxError: Unexpected token u in JSON at position 0”

My NodeJS script gives me this error: 1)"before each" hook for "deploy a factory and a lottery" SyntaxError: Unexpected token u in JSON at position 0 at JSON.parse((anonymous)) at Context.(anonymous) ...
1
vote
0answers
17 views

How to sign transactions using Metamask and send the signed transaction to NodeJS so that it can be added on Ropsten Infura?

I have developed a secure file sharing application in NodeJS(v10.16.1) + Express(v4.17.1) + Truffle(v5.1.15) + Metamask(v7.7.8) which works perfectly on localhost. I am using @truffle/contract(v4.1.11)...
1
vote
2answers
42 views

web3 - Error when calling sendTransaction with @truffle/contract on Ropsten Infura

My smart contract is already deployed on Ropsten TestNet provided by Infura at 0x63865E0F065C7b865e1a2EE4d99C383A414Bec22 address. I want to sendTransaction using NodeJS(v.10.16.1) + Web3(v.1.2.6) + @...
1
vote
2answers
64 views

How to get pending transactions with using geth or other client?

I would like to get pending transactions with using geth. And I tried to use 'web3.eth.pendingTransactions' on geth console. So the geth returned '[]'. > web3.eth.pendingTransactions [] But I ...
1
vote
2answers
32 views

Contract deployment with “truffle-contract”

My purpose is deploying a smart contract to a private network with Node-js. I work on Truffle and Ganache. I tried it with "truffle-contract". But in deploying process an error occurs. My contract ...
1
vote
1answer
16 views

problem of connecting to ethereum

I am using web3@0.20.7 and infura to connect Ropsten testing network. I haven't opened my website(using ethereum) for a while. Today I restarted my website, and I can not connect to ethereum with ...
0
votes
1answer
23 views

What is .new()?

I am using the following code to deploying a smart contract to a private network with Node-js. But the error TypeError: contract_object.new is not a function occurs. What are .new() and the error's ...
1
vote
0answers
20 views

ipfs with ethereum

Module not found: Can't resolve 'ipfs-api' in 'C:\Users.......\src' I have used this code //using the infura.io node, otherwise ipfs requires you to run a //daemon on your own computer/server. const ...
1
vote
0answers
37 views

UnhandledPromiseRejectionWarning TypeError when deploying multiple contracts (>200) at the same time

I get the following error: (node:6540) UnhandledPromiseRejectionWarning: TypeError: this.removeListener is not a function at Object.receipt (c:\Users\pruto\OneDrive\Documents\Smart contracts\...
1
vote
2answers
44 views

Assigning address, data, and gas to smart contract to deploy with Node-js

I used this guide to deploy a smart contract with Node-js. I followed as far as my contract was created as an object. Because the mentioned guide is old some web3 methods changed nowadays. So it looks ...
1
vote
3answers
31 views

Deploy smart contract with Node-js

I want to deploy a smart contract with Node-js. I followed this guide but an error occurs where i effort instantiate my smart contract. app.js: var Web3=require('web3'); var fs=require('fs'); var ...
0
votes
1answer
17 views

Write eth address to file

I need to generate several hundred addresses with eth keys and write them to a file, but only iteration numbers are written to the file, what's the problem? for(var i = 0; i < amount; i++) { fs....
0
votes
1answer
14 views

Deployment transaction mined but contractAddress still empty

I'm trying to deploy a very simple smart contract on Ropsten through Infura When I launch (on Ubuntu) my deploy.js script, everything seems to work except I don't get the contractAddress in the ...
1
vote
1answer
41 views

Ethereum - How does the smart contract get deployed via web3?

I am trying create an application using NodeJS, web3, ganache and write a smart contract with solidity on Ethereum as a part of my final year project. Reading the documentations, I still have a few ...
1
vote
1answer
35 views

web3 - Error while calling smart contract pure function via web3 using nodejs?

This is my smart contract written in solidity (v.0.5.16) - pragma solidity ^0.5.0; contract MyContract { function myFunction() public pure returns(uint256 myNumber, string memory myString) { ...
0
votes
1answer
27 views

How can I extract a wallet address from event data?

I have a contract that returns event data including the sender's address: event Result( address indexed _walletAddress, string _name, uint256 _amount ) And in my Node.js app I try to ...
0
votes
2answers
23 views

Sending ether from list of addresses with web3.js

I would like to read the csv text file and make a transaction via web3.js like what I did with web3.py Here is my python code #!/usr/bin/python3.7 import os import time import pandas as pd from ...
0
votes
0answers
27 views

Access to smart contract's value in Browser

My Truffle project is this contract that just shows Yerevan is love: pragma solidity ^0.5.12; contract TEST{ string public note="Yerevan is love"; function rep() public view returns(string memory){ ...
1
vote
2answers
35 views

Get hash transaction by your encode input data

In my application i must follow the use case: I need to record any document hash on the Ropsten (eth testnet) blockchain. The hash is unique and i'm using a mapping in my smart contract to accomplish ...
0
votes
1answer
34 views

Access to smart contract's value in Node-js

I am working on a simple Truffle project that just shows "Yerevan is love". My contract code: pragma solidity ^0.5.12; contract TEST{ bytes note="Yerevan is love"; function fname() public view ...
0
votes
1answer
28 views

I cannot see Ethereum accounts in Browser

There are 10 Ethereum accounts in Ganache. I work on a Truffle project. Whenever i run the following codes in Nodejs: var Web3 = require('web3'); var web3 = new Web3("ws://localhost:8545"); var acc= ...
0
votes
0answers
21 views

XMLHttpRequest() does not work probably in a Truffle project

I want to connect to my smart contract in a Truffle project and get some information from it. The smart contract's name is "TEST". The follow is my app.js code that should communicate with my smart ...
1
vote
1answer
17 views

Problem with contracts being deployed multiple times in Node.JS backend

I have a Javascript frontend that passes records in a JSON to the backend via Express to be deployed to the blockchain (currently using Rinkeby) with truffle-hdwallet-provider. This appears to work ...
1
vote
0answers
40 views

Why can I only deploy approx. 3 smart contracts per minute with infura using Ropsten and Rinkeby

I have created a Dapp that is written in Solidity and compiled with Truffle on both Rinkeby and Ropsten. I have also created a frontend for batch file uploads and a backend for the actual deploying ...
0
votes
1answer
87 views

Calling function from existing truffle contract in node.js

This is probably a very simple problem to solve, but I am setting up a node.js backend using express for my Dapp and I can now deploy new contracts just fine. I now need to figure out how to make ...
0
votes
0answers
16 views

How to send a value back to html from node.js using express and truffle

I am running truffle code with Node.JS in the backend to deploy contracts. Using the Express Library, I can interact with the Node backend. Here is the code for the HTML page: <form id="myForm" ...
0
votes
1answer
62 views

Problem with running truffle code with node.js

I am trying to run truffle code with Node.JS in the backend to deploy contracts. I want to be able to do this interactively and I am intending to use the Express Library to interact with the Node ...
0
votes
1answer
24 views

Why do we use `serialize` function of `ethereumjs-tx` package before broadcasting a transaction

I just want to know the purpose/functionality of serialize function which we use before broadcasting a transaction: const serializedTransaction = tx.serialize() const raw = '0x' + ...
1
vote
3answers
258 views

Project ID is required

I got an error at sendSignedTransaction is : Project ID is required. Can you please let me know that what is the actual problem? This is my code: try { const ethereumUri = 'https://ropsten....
1
vote
2answers
32 views

Node JS problem Interacting with Ethereum Smart Contract

I'm having only partial success with a Node.js script I wrote that interacts with one of my Ethereum Smart Contracts. Here's what's working: -I'm able to call methods in the Smart Contract from my ...
0
votes
1answer
16 views

Wrong version of web3.js

$ npm show web3 web3@1.2.5-rc.0 | LGPL-3.0 | deps: 8 | versions: 115 Ethereum JavaScript API https://github.com/ethereum/web3.js#readme ... $ node app/test.js VERSION { api: '0.18.4', node: [...
3
votes
1answer
82 views

Contract does not exist at address

I have setup a private Quorum network and successfully deployed contracts and executed contract functions using Visual Studio Code and remix. When i try to deploy the exact same contract manually ...
0
votes
1answer
35 views

Getting stuck in truffle testing

I am trying to run a test and I am getting the following message; I have tried the following; npm install scrypt npm install web3 as to solve the yellow message and when running truffle test ...
3
votes
4answers
367 views

How essential is a knowledge of Javascript to learning solidity/ethereum?

I am new to the ethereum space, and though I can code in C and C++, I keep noticing in the docs that there are references to Javascript and node.js and how similar it is to solidity as well as ...
1
vote
2answers
83 views

Ganache Processing becomes very slow (with Automining Option) after consecutive thousands transactions

I am trying to deploy thousands of contracts on Ganache GUI. At first, it process all transactions very fast (deploy contracts and transactions for calling setters functions) . After some transactions,...
0
votes
0answers
72 views

Error: Returned values aren't valid, did it run Out of Gas? during deployment of huge number of contracts

I am trying to deploy very large number of contracts (more than 300 thousands) with automine option at Ganache GUI .. Is it possible to do such experiments ? when i want to deploy such huge number of ...
0
votes
1answer
131 views

the tx doesn't have the correct nonce. account has nonce of: 12 tx has nonce of: 3 - Ganache

I am trying to run my simple contract with different parameters (in the form of encoded signatures) and intends to put multiple transaction into ONE block. If I set Ganache GUI with automine option, ...
1
vote
2answers
53 views

The method eth_sendTransaction does not exist/is not available, when using Ropsten Network

My following code previously works perfectly at Ganache, but when i switched it to Ropsten Network, it give captioned error. Here is Code: async function finalSettersFunctions(){ var myFunc; ...
0
votes
1answer
137 views

UnhandledPromiseRejectionWarning: Error: Returned error: nonce too low

I am trying to deploy some contracts on Ropsten network. Here is my code async function finalDeploy(r){ for(i=0; i<constructorParams.length; i++) { const options = { data: '0x' + ...
0
votes
1answer
27 views

Could not deploy on Ropsten network using Truffle

I have following truffle-config.js file const fs = require('fs'); const HDWalletProvider = require("truffle-hdwallet-provider"); const secrets = JSON.parse( fs.readFileSync("abc.txt").toString()....

1
2 3 4 5
10