Questions tagged [nodejs]

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

127 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
8
votes
0answers
1k views

web3 websocket connection prevents node process from exiting

I have a node js process that creates a web3 websocket connection, like so: web3 = new Web3('ws://localhost:7545') When the process completes, it does not exit, but rather hangs forever with no ...
7
votes
1answer
508 views

Truffle unbox drizzle not working properly

truffle version = 4.1.4 truffle unbox drizzle truffle compile truffle migrate npm run build npm run start this gets me this error: Truffle Drizzle-box fails with TypeError: (0 , _drizzle....
5
votes
1answer
453 views

Connecting to remote Geth client from AWS hosted server via web3 needs fix

There is a general problem that is affecting most everyone who tries to initialize AWS hosted servers with a remote Geth instance. It would be great to have documentation to address a fix or at least ...
4
votes
0answers
224 views

how to get revert at the previous timestamp of evm in testrpc

I am testing my contracts so at some point i need to increase the timestamp of evm that i achieve through evm_timeIncrease but now i want to execute some functions on the basis of current timestamp ...
4
votes
0answers
477 views

sendTransaction and events not working in NodeJS app

I have a contract deployed on the testnet, I can do the following within geth: reference.transfer.sendTransaction(bob, 467, {from:me}) However I can't do this within my node console (with web3 etc. ...
3
votes
3answers
463 views

web3.eth.Contract(abi, address) doesn't return contract instance

i'am trying to make a instance of my contract in js using web3, but when I use the function web3.eth.Contract(abi, address) the result is not the expected(I take the ABI from remix). this is the code:...
3
votes
0answers
170 views

Geth - Events not working/firing

I have an API (expressjs - nodejs) listening for different events from my contract. var web3 = new Web3(new Web3.providers.WebsocketProvider("ws://localhost:8546")); var tokenContract = new web3.eth....
3
votes
0answers
75 views

SQL syntax error near `logsBloom` when call web3.eth.sendTransaction

When I am trying to call web3.eth.sendTransaction I receive this error stack: Error: ER_PARSE_ERROR: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server ...
3
votes
0answers
536 views

web3.eth.getBalance(address) throws an error: Invalid JSON RPC response: “”

var web3 = new Web3(new Web3.providers.HttpProvider("http://localhost:8545")); web3.eth.getBalance(address) throws an error: Invalid JSON RPC response: "" while address is some existing valid ...
3
votes
1answer
429 views

Cannot make subscribe newBlockHeaders work

I'm doing this to get all blocks from the network: var web3 = new Web3(); web3.setProvider(new Web3.providers.IpcProvider("...", net)); web3.eth.subscribe('newBlockHeaders', function (err, result) { ...
3
votes
0answers
520 views

“Invalid DER format public key” error trying to use bitcore-ecies for encryption with Ethereum keys

I started this blog for generation of the keys. Which I'm able to follow successfully. My generated Private, public key and the address is mentioned in the testIdentity variable in the code below. ...
3
votes
3answers
117 views

How to setup 'topics' for function getPastLogs ()?

Sir, I want to read the past event log by using getPastLogs(),but I got the whole log.I hope I can filter some log. I find I can setup the 'topics' in getPastLogs(),but it always fails. How ...
2
votes
0answers
64 views

Error while importing Libp2p package in blockchain

I have installed some js-libp2p's packages on my Ethereum Blockchain-ipfs project and I wrote some codes like below. const TCP = require('libp2p-tcp'); const MulticastDNS = require('libp2p-mdns'); ...
2
votes
0answers
192 views

Transaction not mined error when deploying to quorum maker server

I get the following error when attempting to deploy my zeppelin erc20 token to a quorum server(used quorum maker). (master) $ node migrations/2_proj.js ``````` transactionHash ...
2
votes
0answers
111 views

Initialize Metamask from front-end use of Nodejs

Building a simple ERC-20 Token payment screen for a simple shopping cart. I am having an issue figuring out how to use Metamask to allow others to make secure payments. As we dont have access to other ...
2
votes
0answers
184 views

How to sign transactions using metamask while developing in nodejs?

I am developing an application in nodejs. I need to interact with my smart contract and also want to sign the transaction using metamask as I don't want to manage they keys. I copied the following ...
2
votes
2answers
83 views

Deploying contract using web3js fails

I am trying to deploy contract using web3js in nodejs on ganache cli test server, but it fails with error as follows : D:\Thrive\PoC\NodeWebAPI\node_modules\web3\lib\web3\contract.js:149 ...
2
votes
0answers
77 views

Input data into remix through javascript

I am trying to update and call data to remix using node js. I have the temperature captured in my js code and I am trying to call it using the updateWeather function. Node.js code let request = ...
2
votes
0answers
268 views

Customizable key generator for Node JS

I've been looking for a javescript/nodejs package that would take a passphrase as input and generate a public key. But I need it to produce the exact same public key with the exact same passphrase - ...
2
votes
0answers
74 views

Can a view function from a funded smart contract execute a send() transaction on an external contract?

I'm creating an open source voting app with a Node.JS front end. I'm hoping I can create a smart contract that can use funds allocated to it at creation time, so that participating voters don't have ...
2
votes
1answer
226 views

Does it make sense to have a Node.js backend serving json to frontend for dapp?

Currently, the architecture I am looking at is that the smart contract (SC) sits on the ethereum network, but it is a complex and multilevel contract system. Just navigating through the tiers of the ...
2
votes
0answers
274 views

Using Truffle with Node JS (MongoDB)

I am trying to use truffle along with a MongoDB database which means that I need multiple ports. For local testing, I have been starting up my RPC, switching the port that the app is listening, and ...
2
votes
0answers
133 views

web3.eth.subscribe give response blank

I am using web3 1.0.0 on nodejs all working fine but web3.eth.subscribe not working for pendingTransactions, I don't understand what is the issue. I'm using web3 version : 1.0.0 OS : windows ...
2
votes
1answer
497 views

How to call the functions of Ethereum Smart Contract from Android/iOS application?

I've been learning solidity & viper for some time now but i am wondering if it's possible to call the functions/methods of a smart contract (already deployed on Ethereum Network) from an Android/...
2
votes
0answers
655 views

Swarm web3 upload file from browser

Im following this documentation to implement an application that I pick a file with an input tag <input id="upload" type="file" /> and im tyring to upload using web3 js : document....
2
votes
0answers
880 views

Ledger Wallet Node JS api signTransaction_async - implementation issue

I tried to implement the Ledger node js api (https://www.npmjs.com/package/ledgerco) in my application. The first part with getAddress_async works, but I’m stuck with the signTransaction_async. I ...
2
votes
0answers
472 views

Unable to send eth with the web3 API

I'm new to this web3 API and I'm trying to use it with NodeJS. I've not been able to make a single transaction from one address to another. I've been able to successfully retrieve the balance of my ...
2
votes
0answers
382 views

Parity with Nodejs - Sending bulk transactions

I'm running a private testnet with Parity, and interacting with it using a nodejs cli. I have a script with which I trigger multiple transactions in quick succession for a smart contract that I have ...
2
votes
0answers
651 views

reference a deployed contract in truffle or node.js

I have a previously deployed contract on my PRIVATE-NET which I know its address. Now I am using truffle. How do I reference this contract in truffle console using its address? I looked through web3....
2
votes
0answers
258 views

Unit testing compiled Contracts with Pudding and Mocha + NodeJS constructor not being invoked

I just starting out looking at Ethereum and am trying to test a Contract (using the simple cryptocurrency contract as an example) using Mocha, so I can take advantage of things like chai and sinon, ...
2
votes
1answer
253 views

convert padded topics address to valid address string

I am parsing some information from the topics array. I receive 32bit padded addresses in some indexes. Is there a web3 utility function or useful helper method to get these back into normal sized ...
1
vote
1answer
31 views

Duplication of events in permissioned geth Chain with clique PoA consensus algorithm

I have an Ethereum chain running on my local host via geth and i am using the clique PoA Algorithm. I have 4 authority nodes so the number of Nodes allowed to sign a block should always be 1 because ...
1
vote
0answers
54 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
30 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 ...
1
vote
0answers
132 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
164 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
26 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
201 views

Error: Node error: {“code”:-32015,“data”:“Reverted 0x”,“message”:“VM execution error.”}

I deployed my smart contract on Kovan Etherium testnet. After that, I am trying to interact with smart contract methods using web3 1.0.0. Below is my node js code: var Web3 = require('web3'); var api ...
1
vote
1answer
39 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
137 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
28 views

Web3 1.0 Nested contract promises

What is the best way to handled nested contract call with web3 1.0? I'm trying to collect all data needed and format it into something useable. It could require 2 or 3 calls though. Is there a easy ...
1
vote
1answer
319 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
1answer
196 views

Retrieve event args from getPastLogs

When we use web3.eth.getPastLogs it returns topic and data properties together with rest data. Does it possible to retrieve event args parsing just data and topic as filter? Without to make additional ...
1
vote
0answers
35 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
548 views

Parity, Web3, Nodejs - Error: Transaction was not mined within 750 seconds, please make sure your transaction was properly sent

I'm using Parity ( "ropsten" test net), Nodejs and web3js to deploy smart contract from my system. Parity is synchronised in test mode, but when I run below code using Nodejs, it gave me a transaction ...
1
vote
0answers
59 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
139 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
335 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
771 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
954 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 ...