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
2
votes
1answer
4k views

TypeError: (intermediate value).at is not a function

This is my code: import React, { Component } from 'react'; import logo from './logo.svg'; import './App.css'; import Web3 from 'web3'; var ETHEREUM_CLIENT = new Web3(new Web3.providers.HttpProvider("...
4
votes
2answers
970 views

Testing in ropsten network with truffle.js gives me this error

root@ubuntu-4gb-nyc3-01:~# truffle migrate --network ropsten (node:14686) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 2): TypeError: this.provider.sendAsync is not a ...
6
votes
1answer
5k views

Send signed transaction web3

Trying to send a transaction with web3 on ropsten. The code runs on Remix, but now I'm trying to send it via the node console. It connects fine too(web3 works), but for some reason the transaction ...
4
votes
2answers
445 views

Can't install testrpc [npm error]

getting the following error. npm ERR! Linux 4.4.0-87-generic npm ERR! argv "/usr/local/n/versions/node/8.2.1/bin/node" "/usr/bin/npm" "install" "-g" "ethereumjs-testrpc" npm ERR! node v8.2.1 npm ERR! ...
7
votes
3answers
1k views

How to send a lot of transactions to ethereum, using js

I'm trying to send a lot of transactions to Ethereum with one program written in js. I use node js, web3 and infura ropsten. The problem is: if i send transactions at once, most of them just disappear....
3
votes
1answer
867 views

How can i send data into blockchain

please i dont come to send data from form with inputs to blockchain database, using nodejs, web3 and dust (engine templating ) ? please share some exemples if exists .. Thanks,
5
votes
5answers
2k views

nodejs and web3: Unhandled rejection Error: Transaction was not mined within 50 blocks, please make sure your transaction was properly send

I am trying to send ETH from one of my account to another with web3 from nodejs: web3.eth.personal.unlockAccount(config.mainGethAccount, config.gethPassword, function () { console.log("...
1
vote
1answer
63 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
1answer
645 views

Accessing events from nodejs: Cannot read property 'on' of undefined

This is my source code in nodejs: var Web3 = require('web3'); var web3 = new Web3(); web3.setProvider(new web3.providers.HttpProvider('http://localhost:8545')); var abi = ... var contract = new web3....
1
vote
2answers
2k views

How to access geth from nodejs

I have geth running on localhost: geth.exe --testnet --fast --cache 1024 --ipcpath \\.\pipe\geth.ipc --rpccorsdomain * --rpcport 8545 --rpc If I do the following: var Web3 = require('web3'); var ...
0
votes
1answer
929 views

http: Accept error: accept tcp 127.0.0.1:8545: accept: too many open files; retrying in 5ms

I am running geth -rpc and node to directly interact with the blockchain. When executing a large amount of requests I noticed the following error: http: Accept error: accept tcp 127.0.0.1:8545: ...
18
votes
1answer
14k views

How to convert string to bytes32 in web3js?

I have a contract with a public variable that's bytes32. If I enter the value 20160528 then it auto converts to bytes32. Is there anyway to convert it back from the nodejs terminal? I've been ...
0
votes
1answer
727 views

Unlock remote account

I have smart contract deployed that accepts funds (via fallback function function() payable { ... }). Also I have frontend using web3 to send funds. When I tested it with local node (and JSON wallets ...
27
votes
7answers
24k views

web3.eth.contract is not a function when making contract

Whenever I try and make a contract, I get: web3.eth.contract is not a function I'm using this code: const path = require('path'); const fs = require('fs'); const solc = require('solc'); ...
3
votes
3answers
731 views

Deploying smart contract programatically from web3 / nodejs

I'm building a Dapp where, whenever a user creates an account, it automatically creates an Ethereum address for the user (I'm exposing the personal module over RPC for now, but it's just for playing ...
4
votes
1answer
352 views

node loses connection to testrpc

Following this tutorial on writing a voting contract and deploying on testrpc I created the below js code into voting.js and ran it by: > node > require('./voting.js'); After printing web3....
1
vote
1answer
1k views

Cannot run truffle behind proxy? [duplicate]

I've installed truffle and related software on my office PC. I've set the proxy server for node.js. The truffle init got the following error. Is it proxy issue? H:\work\eth> truffle.cmd init ...
2
votes
3answers
4k views

API in Node.js for Solidity smart contract

How to make API for Ethereum smart contract in Node.js? Can anyone send good examples? Is it even a standard way to make API in Node.js so it can interact with any interface because most examples I ...
3
votes
2answers
869 views

Issue creating an Ethereum app with Node JS and web3

For the past week I have been trying to make an app that runs on a node.js server to control the balance going out of different ethereum accounts / wallets. Here is what I have done so far: (on my ...
5
votes
1answer
146 views

Is the Ethereum client Javascript API supposed to be publically available? [duplicate]

I am still trying to understand the Ethereum design, and one thing I can't work out is if all Ethereum nodes are supposed to expose the JavaScript API and if that is supposed to be publically ...
1
vote
0answers
470 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
521 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 ...
4
votes
3answers
946 views

How to retrieve stored data from blockchain?

I built a dapp integrating IPFS and Ethereum, in which the blockchain will store (in transaction) the links of every file uploaded to IPFS. But I want to display the IPFS links of all the files I ...
1
vote
1answer
422 views

nodejs continues to watch an Event, even geth is killed on the background

I am running a script to watch my events as follows: run.js: var fs = require('fs'); Web3 = require("web3"); web3 = new Web3(new Web3.providers.HttpProvider("http://localhost:8545")); address="...
2
votes
1answer
380 views

Connection to a node

I have a rpi3 and it have to be a node of a blockchain. I have a script python on raspberry, which gather data from an accelerometer. Checked some conditions,I should store these data,plus other ...
3
votes
1answer
2k views

Uncaught Type Error when calling a contract function using the web3 JavaScript API?

I wrote a contract to enable registration of a name. As an example, one of the functions takes in a name as a string, then outputs information on the registration of the name (name, registrant, last ...
2
votes
1answer
1k views

Ethereum JavaScript console account authentication error

I am trying to run my first contract, but I am getting this error when using my dev testnet account. Error: authentication needed: password or unlock undefined I am using geth to run JS console ...
6
votes
1answer
413 views

Is truffle based on node and is it possible to run some kind of node debugger in order to pause the Javascript tests and examine variables?

I am currently developing a Dapp and using truffle test to verify the contract. However, I find that I am also debugging the Javascript that runs the test with a lot of console.log() statements. This ...
1
vote
1answer
241 views

How do I encode address field when creating new instance of a contract?

when I query my accounts on my local test rpc, I get this: > web3.eth.accounts[0] '0x8a39ab283fb500e3be48a68f6c9d90371bfaa345' All good, but when I try to create an instance of a contract I ...
0
votes
1answer
564 views

Node Testing and Port 3000

I am using node to test solidity with a ReactJS front end. After IPFS required I used a SSL I had to add some changes to my nginx conf and now port 3000 is not being found. I installed the SSL and ...
1
vote
0answers
153 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) ...
9
votes
1answer
2k views

Is it safe to publicly host a parity node?

In the normal use case, Parity runs on localhost. However, I'm building a demo web site that uses Web3JS to connect to a public parity node running on port 8545. I am publicly serving a Node/VueJS ...
1
vote
0answers
297 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
424 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 ...
2
votes
2answers
520 views

How to autonomously trigger transactions from Node.js?

I have a a JS file running on NodeJS on multiple devices which interact to each other, trying to write data on the Blockchain and send transactions. The problem is that every time I have to manually ...
2
votes
1answer
5k views

NodeJS+web3 - contract method call not a function

I trying to use nodejs with web3.js to do the full process of compile,delpoly and method call.After read the api here. I found the contract-methods. myContractReturned.call().getCount(); But when I ...
1
vote
3answers
1k views

Problem with web3js and testrpc

And have a problem with web3js on testrpc, I can't create and set an instance of web3. Terminal said that web3 is undefined. (ref error) Also when I try to execute methods in my contract for example ...
1
vote
2answers
243 views

Embark serverside

This is perhaps a stupid question but i'm not getting it. How do you use Embark in NodeJS or is it client side JavaScript only. Because in the demo there is no server side code. It looks like it's ...
2
votes
1answer
92 views

Reading Function Calls Transactions

I am working on a small project designed to show and teach people how the blockchain and smart contracts operate. In order to do so I had in mind to showcase the transactions on https://testnet....
1
vote
1answer
926 views

I want to use crypto-js module in truffle / app.js

I want to use npm module "crypto-js" in app.js of truffle_project. But I can't use it. app.js: var CryptoJS = require("crypto-js"); // ... I build app, then I open build/index.html by browser, I ...
4
votes
1answer
270 views

How to monitor block synchronisation?

I want to display information about Geth, specifically eth.getBlock("latest").number, in a Node.Js GUI. However, I'm not sure how to keep it updated. One solution is to request the information from ...
2
votes
0answers
388 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 ...
1
vote
0answers
168 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 ...
14
votes
5answers
10k views

web3.js with promisified API

I'd like to take away the pain from web3 development callback hell and use Promise pattern and async/await keywords on both client side and on Node.js. Do there exist any web3.js builds or forks that ...
11
votes
2answers
3k views

How to connect etherwallet to my private blockchain?

I am unable to make etherwallet v3.4.2 to connect to my private blockchain. The way I run my private network: (please note that it works perfectly fine) geth --port 3000 --networkid 23422 --identity ...
2
votes
1answer
425 views

etherwallet-3.4.1/ on private chain setup - having 404 error

I am following the MyEtherWallet: Use Your Own Server Guide to use MyEtherWallet on my private ethereum network. I am doing this setup on my node, where my ethereum node runs. I have done first 4 ...
12
votes
1answer
7k views

How to generate a keystore (UTC) file from the raw private key?

If I have the plaintext private key, -how- can I generate a geth-compatible keystore file using Node.js? I think I need to encrypt it using the scrypt algorithm by supplying a password, but I don't ...
3
votes
1answer
333 views

How to check if the browser is Mist?

Whenever I want to use web3, I initialize it as follows: if (typeof web3 !== 'undefined') { web3 = new Web3(web3.currentProvider); } else { // set the provider you want from Web3.providers web3 ...
9
votes
1answer
2k views

Is it possible to call debug_traceTransaction from nodejs?

Following answer (https://ethereum.stackexchange.com/a/9437/4575) [ 1 ] guide us to call debug_trace through using geth: As documented in debug.traceTransaction(...), you can only access this API ...
2
votes
0answers
654 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....

1 5 6 7 8 9