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
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....
3
votes
0answers
196 views

How to derive the private key from UTC file? [duplicate]

I want to implement a client-side wallet where the transaction is generated and signed on the browser, and sent to the server which is running a geth node. Apparently ethereumjs-tx does what I want ...
2
votes
1answer
939 views

How to display or log events in nodejs?

Following is a very simple contract which implements deposit and withdraw functions. I have defined two events : deposited(address from, string msg) withDrawn(address from, string msg) The contract ...
3
votes
1answer
61 views

What should be the input for following functions in web3js?

web3 js functions like: getTransaction() What should be the input? contract address or account address or transaction hash? likewise for other contracts like getTransactionReceipt and all?
1
vote
0answers
552 views

How to access events via nodejs that were created in solidity [duplicate]

Following is my contract: pragma solidity ^0.4.4; contract Process{ address public owner; uint balance; uint amount; function Process(){ owner = msg.sender; balance = 1000; } event ...
4
votes
1answer
3k views

Different hash values for keccak256 functions?

In solidity i used the following command: keccak256(firstName, lastName, studentId); ->0x157effbe0a2f53d887ad79b0dc3e9eb6084c3025ae0114a253b8f94f83c1462d And, in NodeJS i used the following ...
14
votes
4answers
18k views

unable to connect Ethereum node even RPC port: 8545 is open

I have created my private Ethereum blockchain network. From different servers I am able to connected and added into the network as peer without any problem. The way I run my server: geth --...
4
votes
1answer
284 views

Use modifier function to create heirachy of smart contracts

I have 3 contracts that I want to implement. The contracts are master , admin and customer. So the master contract is initiated by a single person, the owner of the private chain (based on geth). The ...
3
votes
1answer
2k views

Develop/Run Dapps with Node.js

I read in the manual that programmers can use common languages to program Dapps. Questions: So I could program a Dapp without Solidity just with JS, node.js, HTML, CSS, and HTML. Or do I still need ...
1
vote
1answer
821 views

Connect to Ethereum Node using Nodejs

I have the following ethereum node running as : sudo geth --rpc --rpcaddr "127.0.0.1" --rpcport "8000" --rpccorsdomain "*" --datadir "/home/Ethereum/Data/node1" --port "30303" --maxpeers 2 --ipcapi "...
3
votes
1answer
436 views

Problem with `truffle init`

I can't start truffle, this is the Error: truffle init /usr/local/lib/node_modules/truffle/node_modules/ether-pudding/index.js:182 for (var file of files) { ^^ SyntaxError: ...
3
votes
2answers
3k views

How to make a GUI with Geth

Actually, I'm not even sure if what I'm asking is possible. At the moment, I can run a script in the Geth Console which is creating contract in local. I would like to create a simple interface with 2 ...
14
votes
6answers
25k views

How to get transactions by account using web3 js?

I'm sure this question was asked before, but I did not find any result that helped my problem. How can I get the transactions (in and out) for a given account? I use nodejs and web3? With this line ...
3
votes
1answer
405 views

Making a contract in the geth console

I have the following code in a script name contract.js ( foo, pwd and id are replaced by their value in my actual script) var web3=require('web3'); personal.unlockAccount('id', "pwd") var aContract = ...
2
votes
1answer
450 views

How to use Smart contract which was successfully mined through Nodejs

I am able to successfully mine one simple contract through NodeJs. But don't know how to use that contract mined address in another nodeJs file or geth server. Below Steps I have followed 1) started ...
7
votes
1answer
377 views

“bloc init” not found

I am trying to start programming with solidity for Ethereum. I am working with this tutorial: https://medium.com/@ConsenSys/solidity-integration-with-visual-studio-8bdab2ff8a74#.hunrp4l0i Apparently ...
6
votes
1answer
3k views

Geth get deployed contract

I am new to the blockchain and up until now I have managed to deploy contracts and transfer ether through both geth console and node code... I am now trying to figure out how to get the contract that ...
0
votes
2answers
785 views

A NodeJS app running on AWS instance + Web3 object

I have an NodeJS app running on AWS instance(the one you get for free). I want to get access to Web3 object in my server.js file. I don't think that installing and running full client like Geth on AWS ...
19
votes
6answers
28k views

Deploy contract from NodeJS using web3

I'm trying to create and deploy a smart contract through NodeJS using web3, but it is not working as I get a "web3.eth.contract.new is not a function". Here is my code: var web3 = require('ethereum....
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, ...
1
vote
0answers
514 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': ...
2
votes
2answers
750 views

Using node.js modules/code from the JavaScript console of geth

I have a JS filter which checks for the ether transferred in a recent transaction. I have loaded this script from the interactive JS console and it's working fine. Based on the ether in the ...
5
votes
5answers
8k views

Solc --version: command not found

I'm trying to use solc with no success. I download solc with npm install solc but when I run solc --version the console output is: command not found. If I list packages npm list I'm able to see ...
8
votes
2answers
3k views

How can I connect to geth by IPC on nodejs?

This this the command line i have used to get geth running. geth ipc --ipcapi "admin,db,eth,debug,miner,net,shh,txpool,personal,web3" --ipcpath "/root/.ethereum_experiment/geth.ipc" so from node js ...
5
votes
1answer
243 views

How to retrieve The DAO proposals using geth?

I'm using Node.JS with Web3 interface to a Go Geth server. I'm trying to get proposals in both TESTNET and LIVENET but I'm unable: What I've done so far: I'm using Node.JS I've got the .abi ...
3
votes
1answer
2k views

NodeJS+web3 - Reading from a contract works, how about writing to a contract? [duplicate]

In Mist you can call functions of contracts in two ways: On the left panel, to call functions that read from a contract (the result is immediate). On the right panel, to call functions that write ...
5
votes
3answers
2k views

Subscription sample using websockets or IPC?

So I was using the web3 API from the NodeJS 'web3' module very happily and it works very well (it uses HTTP transport AFAIU). But now I want to receive events from the server (without polling), and ...
11
votes
1answer
5k views

Error: personal_unlockAccount method not implemented

Using web3 under nodejs I suddenly want to unlock my account before calling a DAO contract function: var Web3 = require('./node_modules/web3/lib/web3'); // dont override global variable if (typeof ...
3
votes
2answers
1k views

How do I pull a private key out of a keystore using eth-lightwallet “No seed set”

I am using eth-lightwallet on a NodeJS server. I am getting a stack trace when I try and get the private key from the keystore. It is flagging this line "keystore.generateNewAddress(pwDerivedKey);" I ...
3
votes
1answer
379 views

Did anyone succeed in using Truffle with Node v6?

Truffle looks to be buggy when using with Node v6 (installed from homebrew). There's a ticket on Truffle github, but none seems to take it into account. Are people not using Node v6 or is there a ...
7
votes
1answer
2k views

Why can't I connect by IPC?

I have successfully run geth --rpc to test some functionality, but I need the personal API which according to this answer should be done by IPC. When I run geth --ipcapi "db,eth,net,web3,personal" --...
4
votes
2answers
649 views

What does “code and ABI that are needed by web3” refer to in solc / nodejs

var input = "contract x { function g() {} }"; var output = solc.compile(input, 1); // 1 activates the optimiser for (var contractName in output.contracts) { // code and ABI that are needed by web3 ...
8
votes
1answer
3k views

How to connect NodeJS to the Ethereum network?

I have Mist wallet running on Windows 8. I want to connect my NodeJS applcation to the Ethereum network. I have no idea where to start. Could you point me to the direction I should be looking at? Are ...
10
votes
2answers
1k views

How can I trigger a PHP script when a transaction is received?

My goal is to have a PHP script be invoked whenever a transaction is received by a given address. I know Javascript but this is my first sally into Node.js. I think the right approach is to run a ...
6
votes
1answer
1k views

How can i setup a web3 webservice that listens for events from my smart contract?

I have a smart contract that broadcasts events to web3 clients, upon each event being broadcast, the listening client makes a tx call to my contract. I would like to set up an 'always on' event ...
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. ...
8
votes
2answers
2k views

contract event not firing in web3 node console

It appears my events are not being fired in my node application when I transact the contract in the ethereum wallet gui. I deployed a custom contract via ethereum-wallet I have fired up geth attach ...
8
votes
1answer
13k views

Error: Invalid JSON RPC response: undefined from node web3.js app

I'm getting Error: Invalid JSON RPC response: undefined from my node.js application when it tries to execute a function. My steps: ethereum wallet 0.5.1 to deploy a contract to the testnet. start the ...
2
votes
1answer
850 views

Possible to make a REST call within geth console?

I want to listen to events on a contract and then send them to a rest endpoint. Is it possible to make a REST call within the geth console? Alternatively, if I have a node application and I load web3,...
5
votes
1answer
2k views

How to update the web3 API version in geth?

I spent a couple of hours on upgrading web3 API to v0.15.3 in geth (on Mac OSX) with no effect. I installed the newest geth and it says: web3.version { api: "0.13.0", client: "Geth/v1.3.4/darwin/...
3
votes
1answer
462 views

Node.js, Geth & Events

I've been tracking a case where my Node.Js server just stop receiving events, basically for each contract, when I do a contact.allEvents({ fromBlock: startblock }, (error, data) => { ... }); It ...
5
votes
2answers
261 views

How do I fix Javascript stack overflows when compiling very large file with solc?

If I compile a very large file with solc the stack overflows. This will happen most commonly in node because the default stack is only 984kbytes, which is strangely what you would expect for a 1990s ...
5
votes
1answer
2k views

Making web3.js work from node server code

I'm running a geth node on the testnet and trying to run web3.js method from my node server code. var coinbase = web3.eth.coinbase; console.log(coinbase); However, I'm getting a provider not set or ...