The Stack Overflow podcast is back! Listen to an interview with our new CEO.

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
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....
1
vote
1answer
954 views

Deploy smart-contract using nodejs

I am trying to follow the following example. http://hypernephelist.com/2016/12/13/compile-deploy-ethereum-smart-contract-web3-solc.html But I get the following error. Can anybody show me what is ...
1
vote
1answer
123 views

Deploying multiple contracts with web3js 1.0 at once

I'm new to Nodejs and Ethereum so I apologize in advance for any obvious mistakes. I want to deploy multiple contracts in advance to have addresses ready when they are needed. I use this to deploy ...
3
votes
1answer
2k views

Truffle Framework “Block-scoped declarations not yet supported outside strict mode”

I have tried to install and use the Truffle Framework through npm on Elementary OS (Ubuntu distribution). There where no obvious issues with the installation but when running any command e.g. "truffle ...
1
vote
1answer
280 views

Getting an HTTP Query Error when making GET-Requests using Oraclize to a local Node.js server

I am running a testrpc instance combined with Ethereum Bridge. Upon calling the smart-contract function "purchaseLogo" using Metamask (and web3), 2 oraclize_queries are getting initiated and make a ...
0
votes
2answers
309 views

Invalid genesis file:cannot unmarshal number into Go struct field Genesis.alloc of type *math.HexOrDecimal256

Here is my genesis.json file { "config": { "chainId": 15, "homesteadBlock": 0, "eip155Block": 0, "eip158Block": 0 }, "gasLimit": "21000000", "difficulty": "20000", ...
1
vote
3answers
823 views

Using ganache-cli provider causes “Error: Provider not set or invalid”

I'm trying to write and run tests for my smart contract and I get this error: "Error: Provider not set or invalid" Smart contract code: const assert = require('assert'); const ganache = require('...
0
votes
2answers
231 views

Running web3 from node.js powershell in none Administrator mode always shows an error

I am using Windows and installed web3js as general option "npm install web3@0.20.2 -g" using Windows powershell. I run powershell as administrator. After installation i am able to get web3 object ...
1
vote
0answers
282 views

Sending signed data from web3 [duplicate]

So I'm only using Infura and web3 here, no local node running and I want to use functions like : mycontract.methods.function(msg).send({from: address, gas: 200000}) it won't work because it is a ...
5
votes
1answer
454 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 ...
0
votes
1answer
120 views

Web3js: Looping through a web3js function

By using the Truffle Console and Ganache test node, I am calling this function: Contract.deployed().then(function(instance) {return instance.createListing("1", 3, {from: address})}) When this will ...
0
votes
0answers
94 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
97 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
2answers
255 views

Can I use Web3.js to deploy and access smart contracts with a local TestRPC client?

I am at the point where I have migrated my smart contract to a local copy of the TestRPC test client. 1) Using a Node.JS app running on the same PC as the TestRPC test client, can I use the deploy() ...
1
vote
1answer
773 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
1answer
663 views

How to get the contract address after deploying contract without using truffle?

I'm currently using web3 0.20.6 and I'm planning to stay in web3@0.20.6 because there are issues with HTTP in the beta versions of web3@1.0.0-beta.* like The current provider doesn't support ...
0
votes
1answer
255 views

TypeError: LoginContract.LoginAttempt is not a function

Here is my Login.sol pragma solidity ^0.4.2; contract Login { event LoginAttempt(address sender, string challenge); function Login (string challenge) public { LoginAttempt(msg.sender, ...
2
votes
1answer
41 views

Ethereum Mini Documents

Im trying to figure out the best way to approach a problem. I would like give a user the ability to store documents that each have value. So each time they create a new document, they can add ...
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
2answers
3k views

Unable to npm install web3 on Windows 10

I followed every thing on this page : https://medium.com/@PrateeshNanada/steps-to-install-testrpc-in-windows-10-96989a6cd594 Except step number 5 where my Node.js version is 8.10.0 instead of 8.10.2 ...
2
votes
1answer
2k views

Connect to ropsten network from Node.js

I need to connect to Ropsten network from my Node.js backend . I need to read logs and extract data from them and listen to changes in the network for my contract. The problem is that i don't know how ...
1
vote
1answer
629 views

Multiple Transactions From Same Address With Same Details

I am running a local Ethereum node which takes a perceivable amount of time to mine blocks. I am trying to develop a bullet-proof way of dynamically calling transactional methods on an Ethereum smart ...
0
votes
1answer
599 views

Error: Provider not set or invalid

I'm not able to connect metamask with nodejs. var Web3 = require('web3'); var web3 = new Web3(); if (typeof web3 !== 'undefined') { // Use Mist/MetaMask's provider web3 = new Web3(...
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 ...
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
2answers
235 views

Is it possible to create a web3 daemon?

I am using nodejs to call my smart contract's functions instead of calling within geth-client. Each time, when I run node call.js, it requires additional time Web3 to connect into local ethereum ...
0
votes
3answers
806 views

Implementing a Simple Voting DApp on Ethereum Blockchain

I am new to Ethereum, Truffle and Solidity. I am looking for a good resource to get started on implementing a DApp for Voting on Ethereum Blockchain. Could you please point me to the correct resource? ...
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
1answer
1k views

How web3.eth subscription works?

I tried code from web3js docs , but it didnt woork for me. I dont get any logs. Any idea why? code i used: var subscription = web3.eth.subscribe('syncing', function(error, sync){ if (!error) ...
0
votes
2answers
1k views

Hosting Ethereum Node on VPS

I am developing a website (Php/mysql) for trading, which will communicate with block chain via smart contract. My website will be a service based website. it will not a high traffic website and have ...
1
vote
2answers
1k views

how can I prevent web3 function calls printing out the Promise; I only want the actual value printed out

I'm using node.js to execute a simple JavaScript script that tests access to the rinkeby blockchain using an infura endpoint. specifically, it is checking the balance of my address. In the code if I ...
1
vote
0answers
28 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
1answer
57 views

Organize received customer deposits payments

What's the best way to organize received payments? Is the only possibility to assign a new payments address to each customer or is it possible to identify customers reliably on data payload 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 ...
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 ...
1
vote
2answers
442 views

Web3js 1.0.x: contract.at not a function

I am trying to follow this flow to access a contract that has been mined previously: var MyContract = new web3.eth.Contract(abiJSON); // instantiate by address var contractInstance = MyContract.at(...
0
votes
0answers
382 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
1answer
607 views

how to use node await syntax with web3 version 1.x

I am trying to use node await syntax but keep getting errors. I run web3 = new Web3(new Web3.providers.HttpProvider('https://mainnet.infura.io')); let isListening = await web3.eth.net.isListening(); ...
1
vote
0answers
372 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 -...
0
votes
2answers
117 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
479 views

web3 v1 beta. estimateGas throwing Transaction execution error

I am using web3 verion 1 (beta) connected to a remote Parity node via websocket. There is a deployed contract TestContract with a test function that emits a Tested event that simply echoes back msg....
1
vote
1answer
383 views

How do I close web3 such that mocha tests exit properly?

I'm writing a simple NodeJS (Node 9.4.0) server that's using web3 (1 beta) to interact with Ethereum. I've created a simple utility web3 as follows: const Web3 = require('web3') const url = process....
0
votes
1answer
231 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. ...
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 ...
0
votes
1answer
3k views

Cannot read property 'contract' of undefined. Node api interacting with smart contract

Hi I'm trying to interact with an Ethereum smart contract from my node js api. My controller function is as follows: var web3 = require('web3'); module.exports.getTokenBalance = function(req, res) {...
0
votes
1answer
198 views

Reading variables from web3 (Documentation is out of date)

I'm trying to read an ownersNum public uint from my contract. I instantiate in node: l = console.log; var web3 = new Web3(new Web3.providers.HttpProvider("http://localhost:8545")); let c = new web3....
0
votes
1answer
319 views

using web3js on a server without geth or any client [duplicate]

related to for using web3.js it is necessary to install geth into your system I want to use web3js with nodejs server to get interact with a smartcontract deployed on rinkeby/mainnet. Do I need to ...
0
votes
3answers
325 views

Variable in external js file not being set

I have run into something that seems pretty weird to me, although there's a good chance it's just a basic knowledge gap issue. As you can see, the following execution within the Node console produces ...
1
vote
1answer
244 views

What's the Convention used to get a Contract's ABI uploaded to a Node.js Server instance?

I'm still a brand new student of Ethereum, and I'm trying to figure out How to instantiate a Contract from a Node.js instance using Web3. I'm also using the Truffle Suite but for development/Testing ...
3
votes
4answers
2k views

Equivalent of `web3.eth.accounts[x]` in web3 1.0.0-beta.27

I have testrpc initialised: testrpc -a 10 And have connected via http from a node command line using web3 version 1.0.0-beta.27: var Web3 = require('web3'); var web3 = new Web3('http://localhost:...