Questions tagged [nodejs]

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

255 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
1
vote
0answers
33 views

How to filter 2 indexed event fields, both fields array?

I have this event: event onSubmissionBoth(bytes32[] indexed docHash, string[] indexed doc4DHash); Now I log into the event like this: function submitHash(bytes32[] calldata docHash,string[] calldata ...
1
vote
1answer
111 views

Node version upgrade for contract deployment throws error

I wrote a solidity contract using version 0.4.24 using OpenZeppline-solidity version 1.12.0. This used to deploy using the Nodejs version 8.12. The Nodejs version 8 is no longer being maintained from ...
1
vote
0answers
42 views

where to host express api that communicates with smart contract to be fully decentralised?

I need to host express api that communicates with smart contract to be fully decentralised. Any to host it decentralised.
1
vote
0answers
122 views

Solidity function calls from javascript work locally but fail on ropsten,kovan etc with Error: Returned values aren't valid, did it run Out of Gas?

I have a smart contract whose function calls works fine when called locally using javascript and ganache. But when I deploy to ropsten and others, the calls to its functions fail with Error: Returned ...
1
vote
0answers
553 views

How to speed up ethreum transaction after initiating

Is there any possibility to speed up transaction after creating transaction receipt. My project need to similar functionality we have with metamask is there a way we can accomplish this using any ...
1
vote
1answer
713 views

API node js with call and send to a contract without metamask

I am new in Solidity. I'm trying to create a API in node js, which can be use without a navigator like chrome with MetaMask. I would like to test it with postman. But i have some problems with web to ...
1
vote
0answers
2k 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
0answers
123 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
454 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
526 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 ...
1
vote
1answer
39 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
52 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 ...
1
vote
1answer
71 views

How could return events of specific args?

In my solidity contract, I just have one event which is: transferOwnerShip (uint id, address indexed newowner); and I want to filter the events log in order to retrieve only the events that belong ...
1
vote
1answer
110 views

How to print the value of encoded getter functions of contract

UPDATED: Sorry for Inconvenience, I have updated all my question and accept my apology , being naive user. I have encoded getter functions of my contract i.e. ...
1
vote
0answers
583 views

Error: Cross origin null forbidden : ---Problem in downloading Open source contracts from Etherscan.io

UPDATED: I am trying to download source code of open source verified contract from Etherscan.io. Here is my procedure as directed by Ann. 1. Download CSV file of captioned contracts. 2. Write ...
1
vote
0answers
51 views

How to check current status of state variables

I have deployed my contract locally into Ganache (GUI) and then send/call lot of transactions. After these transactions, now I want to check the current status of all state variables. Is there any way/...
1
vote
0answers
89 views

How to interact with smart contracts on Ganache from Express app

How can I interact with the smart contract on ganache from my express app using Web3.js Any Tutorials?
1
vote
1answer
64 views

how can i fetch all the tokens from ethereum network to my wallet ?using web3js(nodejs) or web3j(java)?

I'm trying to fetch all the available tokens from ethereum network into my android wallet but could not able to find an suitable solution other than web scrapping
1
vote
1answer
223 views

Problems subscribing to infura via websockets

So I have a dapp that includes a node server, which I have got to work successfully using ganache, using this line: web3 = new Web3(new Web3.providers.WebsocketProvider('http://127.0.0.1:8545')) I ...
1
vote
0answers
78 views

Error while installing web3@1.0.0-beta.26 on Windows 10

I am getting the following error while installing web3@1.0.0-beta.26 on Windows 10. npm ERR! code ETARGET npm ERR! notarget No matching version found for web3-core@1.0.0 npm ERR! notarget In most ...
1
vote
0answers
452 views

"truffle init" not working after installing

After I install truffle with: $ npm install -g truffle And get: /usr/local/Cellar/node/12.5.0/bin/truffle -> /usr/local/Cellar/node/12.5.0/lib/node_modules/truffle/build/cli.bundled.js truffle@5....
1
vote
0answers
538 views

raw_tx_demo.js of "Mastering Ethereum" : TypeError: ethTx is not a constructor

I ran raw_tx_demo.js, an example code on page 119 of "Mastering Ethereum" by Antonopoulos and Wood, but got an error message below: $ node raw_tx_demo.js /Users/gemcutter/raw_tx_demo.js:22 tx = new ...
1
vote
1answer
958 views

Smart Contract is being deployed but call does not return contract address after deployment

So I have been trying to deploy a smart contract using nodejs, but when I call the function to deploy, I get no contract address on my console. It's like the send() function never completed its ...
1
vote
0answers
37 views

Deploy script not working and not throwing any errors

const HDWalletProvider = require('truffle-hdwallet-provider'); const Web3 = require('web3'); const { interface, bytecode } = require('./compile'); const provider = new HDWalletProvider( 'Mneomonic'...
1
vote
1answer
468 views

Truffle contract.deployed does not get the latest instance deployed

I am developing a back-end DApp using truffle and nodejs on a private network. My application call Contract.deployed() and print the address of the obtained Contract. When I call truffle migrate --...
1
vote
1answer
552 views

How do I send multiple transactions from one wallet in Nodejs?

Hi I've been reading around and I came across Web3.js It's not apparent to me how I can send Ether from one wallet to multiple recipients other than in a batch-style request (which inevitably takes a ...
1
vote
0answers
825 views

metamask and infura - Managing and signing with private keys

I am using Infura as a node for my DApp so I need to send raw transactions by signing them. These transactions can come from multiple users of an application so each user must sign and send a raw ...
1
vote
1answer
950 views

Cannot connect to ganache-cli with web3 and nodejs

from package.json: "ganache-cli": "^6.3.0", "web3": "^1.0.0-beta.41", in my createContract.js const Web3 = require("web3"); const ganache = require("ganache-cli"); console.log('ganache.provider :', ...
1
vote
0answers
61 views

GETH node works on Apache but not on ExpressJs

I had a running GETH node linked to my localhost (hosted with Apache) , I had to migrate the project on a ExpressJs running on port 3000 and now I have Error: CONNECTION ERROR: Couldn't connect to ...
1
vote
1answer
1k views

Sending string as address to smartcontract

I have trouble sending an address to a deployed contract, my function looks like this: function addNote(uint _value, address _owner) public { ... } and when I'm sending the parameters: contract....
1
vote
1answer
288 views

Why does triggering a send on a contract method work, while call doesn't?

I'm still somewhat new to web development and solidity, so do correct any of my misunderstandings. I've been working with web3 on the front end, but now I'm trying to set up a server side web3 ...
1
vote
0answers
80 views

import packages in petdapp

I unboxed petdapp and done some editing where I need to import bcrypt-nodejs in app.js and used following steps. npm install bcrypt-nodejs --save npm install require --save app.js var bcrypt = ...
1
vote
1answer
183 views

How can I configure node when I run truffle test?

How can I get truffle test to execute node with the --abort-on-uncaught-exception option? I'm guessing that I should probably add something in the Truffle's configuration file (truffle.js), but the ...
1
vote
0answers
527 views

web3 v 1.0.0-beta.34 contract.methods.myMethod().send hangs

I am using web3 (installed from npm, version 1.0.0-beta.34) to write a nodejs script that should invoke the method update() defined in a contract I deployed with Truffle on my private ethereum ...
1
vote
1answer
2k views

call to smart contract function from express project using web3

I'm trying to create a API fo my smart contract functions like following: router.get('/',function (req,res) { var web3 = new Web3(new Web3.providers.HttpProvider('https://ropsten.infura.io/key'));...
1
vote
0answers
1k views

How to access multiple return values from solidity function in web3.js

I have written a solidity contract deployed on Ropsten network. I am using lite-server, NodeJS to develop a front-end. I have figured out how to use events and I can access a getter with one return ...
1
vote
0answers
30 views

Audio alerts or pop ups with geth

Is it possible to play an audio alert inside of geth or make a pop up alert? I know you can make a system beep with console.log(“\007”) but I want something a little less generic because this is the ...
1
vote
0answers
610 views

Geth - Web3 : Invalid number of parameters for "MyMethod". Got 0 expected 1!

I'm using Web3.js (@1.0) and not @0.2 This is really annoying ! My Private blockchain is running thanks to the following command : vgeth --datadir "T:\Programs\Ethereum\Own\" --networkid 2154 --rpc -...
1
vote
0answers
488 views

Invalid JSON response when using web3js in nodejs with infura provider

I am trying to build a simple Dapp. Tested already in local testnet (test rpc), next wanted to test it in rinkeby. Since I used web3 in server side, unable to capture injected web3 from metamask, so ...
1
vote
0answers
632 views

How to call Solidity contract function in node.js only after the contract has been deployed?

Would like to call the deployedContract.changeFirstName function only after the deployedContract is complete because deployedContract is an asynchronous function. What would be the best way to do that?...
1
vote
1answer
77 views

liaison entre web3 et nodejs [using web3js and nodjs]

Bonjour, j'ai développé une app avec nodejs et je voulais la transférer vers une dapp en intégrant le web3 librairie. En effet j'ai crée les smart contract il le me reste juste la façon de faire la ...
1
vote
0answers
527 views

npm install ethereumjs-util on a raspberry pi

I am using a raspberry pi as an air-gapped computer. Web3 installs and works just fine on my pi. My problem is I need to get a public address from a private key and this requires ethereumjs-util which ...
1
vote
1answer
573 views

Running ethereumjs/testrpc from a Docker container

I'm taking a stab at creating a set-up where I have a Docker container from which I run ethereumjs/testrpc (an Ethereum testing environment) and another Docker container running an Express app. I then ...
1
vote
0answers
164 views

Race condition / async calls in web3 database writes

I'm using web3.eth.filter to listen for specific topics, pull data from those logs, and write to a database. Part of the database update function checks the previous document (sorted by block number) ...
1
vote
0answers
370 views

Can't send transaction using NODE-RED platform - "Warning! Error encountered during contract execution [Bad instruction]"

I'm trying to use NODE-RED (https://nodered.org/) on my RPi using web3 and geth to send simple transactions. The code is the following: //variables var Web3 = global.get('web3'); var upc_abi = //...
1
vote
0answers
450 views

How to create an ethereum accounts for my own token using node js web3

I have created my own token and now I want to create accounts for clients where they stock tokens using node js express.But I have no idea how to generate accounts' address ! Can anyone help me please ...
1
vote
0answers
209 views

Catching signals with node.js - unexpected behaviour

I'm used to catching SIGTERM and SIGINT on my node.js scripts. I use process.on('SIGTERM',function(){ <stuff> }); and I can call other functions that revert some changes before closing, or just ...
1
vote
0answers
530 views

testrpc install in windows

I'm getting this error while installing testrpc: C:\Users\user\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\src\win_delay_load_hook.c(34): error C2373: '__pfnDliNotifyHook2': ...
0
votes
0answers
3 views

hardhat shorthand plugin not showing custom tasks

I installed hardhat's shorthand plugin and when I run hh and hit "tab" I get all the default autocomplete tasks but not the custom ones: check -- Check whatever you need clean ...
0
votes
1answer
39 views

[SOLVED]: CANNOT find my pending transactions using: ether.js & [provider.on("pending") and provider.getTransaction(tx)]

I am using Quicknode and ether.js to monitor pending transactions using the following code: provider.on("pending", async (tx) => { provider.getTransaction(tx).then(function (transaction)...