Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [nodejs]

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

1
vote
0answers
23 views

HDWalletProvider & truffleconfig: 'truffle migrate' will compile but not do anything else

I am trying to build a React app with Truffle. Firstly, my file structure is like so, with root_dir being the project root directory: root_dir/node_modules/src/libs/truffle All of truffle's files, ...
1
vote
0answers
24 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 ...
0
votes
0answers
12 views

Can I avoid metamask popups with calls to a server-side js script in order to pay for transactions?

I have a dapp that allows a user to input some info via the GUI, and this info is stored to the blockchain(testnet for now) when the user presses a button. This naturally incurs a cost, which causes ...
0
votes
1answer
26 views

AssertionError: amount did not match: expected {} to equal 1000000000000000000

Truffle v5.0.5 (core: 5.0.5) Solidity v0.5.0 (solc-js) Node v10.15.1 const ApprovalContracts = artifacts.require('../../contracts/ApprovalContracts.sol'); // Pulls in my smart contract // the ...
1
vote
1answer
27 views

How to compile Solidity ^0.5.5 contract with Node.js?

I am terribly new in Solidity and now I try to learn how to compile a contract in Solidity ^0.5.5 (No versions below). I have the contract as follow (UsersContract.sol) pragma solidity ^0.5.5; ...
0
votes
0answers
11 views

How can I better set up automatic sending of ethereum from the first address to the second address when I receive any amount for the first one?

I use Node.js. Every 5 seconds I check the address balance using the function eth.getBalance. When I receive funds to the first address, the function of transferring funds to the second address is ...
0
votes
1answer
26 views

How to run an ethereum event listening Node.js “script” (not app) in a server (heroku or aws) [on hold]

I have a requirement in which i need to deploy a node.js "script" (not app or dapp) which is supposed to run perpetually in a server environment 24/7. this script needs to access the public ethereum (...
1
vote
2answers
32 views

Can I trigger the execution of a js file from a smart contract?

I'm a noob at this, so excuse me if this is a ludicrous question.. I have a ReactJS app that interacts with a smart contract via web3. At a certain point, some data gets stored to the contract, by ...
1
vote
2answers
35 views

Trying to test the contracts fully

truffle(develop)> version Truffle v5.0.5 (core: 5.0.5) Solidity v0.5.0 (solc-js) Node v10.15.1 const ApprovalContracts = artifacts.require('../../contracts/ApprovalContracts.sol'); contract ('...
0
votes
1answer
27 views

how to use backup node in web3 connection?

node1= running on port 8545 => current synced block is 2000, and node2= running on port 3545 => current synced block is latest When i am using web3 into another page and print web3 object it ...
0
votes
0answers
31 views

How to use multiple app.js in truffle project?

I'm new to blockchain and currently developing small application for educational purpose using solidity. I am using truffle framework and stuck at a point. currently there is only one app.js file in ...
0
votes
0answers
23 views

Private Network in node.js

When I create a private ethereum network to run tests. How this network is simulated? Is the actual Ethereum network running on it? Or is the processing power of my computer used to simulate the ...
0
votes
1answer
24 views

Truffle - how to share variables and functions between test files? [closed]

I have files in Test directory, each one performs different test but all of them contain at least exactly the same functions "register" and "vote", also few arrays like votings = [], groups = [] and ...
0
votes
0answers
31 views

ipfs.files.add(Buffer) function causing TypeError: Cannot read property 'add' of undefined

I am trying to upload an image to ipfs using ipfs.files.add() function but it is causing me this error Uncaught TypeError: Cannot read property 'add' of undefined at App.onSubmit (App.js:70) at ...
1
vote
2answers
100 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:...
1
vote
2answers
44 views

Create a blockchain platform to store students and its degree results on it [closed]

I would like to create a application on blockchain where i will store all students data and their results on blockchain So anyone having a idea how can i do that or is that feasible to create a that ...
0
votes
1answer
132 views

How to deploy a smart contract using Infura and web3js@1.x.x on NodeJS?

I have an application written in NodeJS that each time it starts has to deploy a smart contract. Once the contract is deployed this application will interact with it making some transactions and ...
1
vote
1answer
16 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 ...
0
votes
0answers
25 views

Debugging a reverted transaction

I have two wallets: Wallet1: 0x8882528C7104e146E0500203C353C09922575385 Wallet2: 0xddCf0FeC78b5a20B9138F5DDb1357E3B60026a67 Each of them has more than 1 Ropsten ETH. Using web3js and Infura ...
1
vote
1answer
12 views

How to resolve 'ethereumjs-testrpc@beta' error while using 'npm –g install ethereumjs-testrpc@beta' in Nodejs command prompt

While setting up my Solidity Environment Using NodeJS, Node Package Manager (NPM) and Truffle which was successfully installed. But at the point of running "npm –g install ethereumjs-testrpc@beta" I ...
0
votes
0answers
41 views

TypeError: Cannot read property 'slice' of undefined

web3.eth.accounts.signTransaction(transactionObject, process.env.WALLET_PRIVATE_KEY, function (error, signedTx) { if (error) { log(`${error}`.red); } else { web3.eth....
1
vote
1answer
64 views

How to compile solidity files in nodejs using solc@0.5.4?

I am using node@10.14.2 and solc@0.5.4 to compile solidity files using the following code: var solc = require('solc'); var input = { language: 'Solidity', sources: { 'Bon.sol':{ content:...
0
votes
0answers
27 views

Get the result back of a smart contract function call using INFURA

This is the function I use to send a signed transaction using Infura to invoke a smart contrac function (see details for the params of the transaction). web3.eth.sendSignedTransaction('0x' + ...
0
votes
0answers
21 views

UnhandledPromiseRejectionWarning: AssertionError [ERR_ASSERTION]: The field to must have byte length of 20

I'm encountering a problem that I'm not able to solve. The code should launch a configured transaction with the details object. The current configuration is set to Ropsten and I am using the INFURA ...
0
votes
1answer
65 views

infura don't catch event

when i'm working on ganache all event that i have emit are store in my nodejs server but when i turn to kovan or ropsten my server don't catch event . i'm working with infura this my code no ...
1
vote
1answer
68 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 :', ...
0
votes
1answer
30 views

How to send raw transaction if I don't have private Key but I know my password?

I am doing raw transaction to send token from one account to another. But I don't have private key of my account but i do have the password. How can I send raw transaction using my password only. Here ...
0
votes
0answers
14 views

Error in establishing the connection between Geth and Api (Invalid JSON RPC response)

For my test project, I have my geth running in main server(rpc port-8117). The api(node.js), which is used to interact with the geth is present in the other system. In the api, I have given the http ...
0
votes
1answer
31 views

How to deploy a dapp which uses multiple blockchain

I am a newbie and started learning dapp on ethereum. Up till now, I wrote smart contracts; created frontend with html, css and js; deployed smart dapp on either private network(geth, ganache) or ...
0
votes
0answers
61 views

To transfer tokens using google cloud function

I am transferring token to the User's wallet when they create account. For that I am using google cloud functions. Here, on the account creation event, tokens will get transferred to the address. My ...
0
votes
1answer
28 views

How to configure APIs to run with Ropsten addresses

I have my contracts deployed on Ropsten network. I deployed those contracts from my local machine using Truffle migrate. Then I set up an AWS EC2 Ubuntu server to host my RESTful APIs. I installed ...
1
vote
1answer
194 views

How to call contract functions using web3?

I have deployed my contract in private blockchain, now I am calling functions using Nodejs and web3. Here, I want to transfer tokens for which I need to unlock my account from which I am transferring ...
0
votes
1answer
22 views

Doubt with ethereum-input-data-decoder when decoding a variable uint256

the input data of the variable uint256 is "22092018" but when using ethereum-input-data-decoder I return "BN: 15118f2". Instead of getting "BN: 15118f2" with the decoder, have the original value of ...
0
votes
0answers
179 views

FATAL ERROR: Rebalance Allocation failed - process out of memory

So while running truffle compile for my contracts on AWS Ubuntu server I got the following error: <--- Last few GCs ---> [17055:0x3985730] 11958 ms: Scavenge 511.7 (553.4) -> 506.9 (553.4) ...
1
vote
1answer
172 views

how to upload file into ipfs from node js without uploading files into node js server [closed]

I need to upload multiple files into ipfs from node js. Flow: file(html,angularJS) --> node.js --> IPFS --> ipfs hash save into DB. I have sent a file from HTML(angularJS) and I got the ...
0
votes
2answers
24 views

Web3 js APIs Installation Requirements

If I am using Infura Node interact with smart contracts. And I want to build/setup web3 apis on a ubuntu machine on AWS. Do i need to install truffle on that machine or just node.js and web3 is enough?...
0
votes
0answers
35 views

How to decode transfer log data Node

I am trying to decode transfer log to get the addresses to and from, and potentially the value but most important address from and to. const subscribe = () => { subscription = web3.eth....
0
votes
0answers
55 views

Error in compiling the contract [duplicate]

I am getting this error while compiling the contract using solc: assert.js:350 throw err; ^enter code here AssertionError [ERR_ASSERTION]: Invalid callback specified This is my deploy.js file.......
0
votes
0answers
106 views

Getting an error cannot read property “encodeParameters” of undefined

I am running a node.js server but while running it, i am getting following error. what could be the possible reason?
0
votes
0answers
42 views

i can't get rid of this error

const HDWalletProvider = require("truffle-hdwallet-provider"); const Web3 = require('web3'); const {interface,bytecode} = require('./compile.js'); const provider = new HDWalletProvider( 'slim ...
0
votes
1answer
48 views

web3.eth.getBlockNumber returns { [Function: get] request: [Function: bound ] }

0 down vote favorite I am using express and web3 while i get the blockNumber it returns { [Function: get] request: [Function: bound ] } my code is var express = require('express'); var app = ...
2
votes
0answers
105 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
1answer
72 views

Deploying a smart contract

i was following this nice tutorial to make simple Daap,and at one place i got stuck. I'm really newish to that, so hope someone could explain that. This is the link and the place where i get stuck,if ...
0
votes
2answers
979 views

Error: Cannot find module 'truffle-hdwallet-provider'

I got the following errors while trying to deploy my smart contract: sers-Air:lottery user$ node deploy.js internal/modules/cjs/loader.js:582 throw err; ^ Error: Cannot find module '...
1
vote
1answer
45 views

Information lost when getting string from byte32 Solidiy smart contract

I have a number as a string which I pass to smart contract function as a parameter. The function takes byte32 as a parameter. Here is the node.js code for executing the contract function: const app =...
0
votes
1answer
95 views

“truffle test” says “assert.rejects” is not a function even it is Node 10

As per the official documentation, assert.rejects was added since Node v10.0.0. Also, the node console confirms that: even though, truffle test throws this error: TypeError: assert.rejects is ...
1
vote
1answer
52 views

Detecting nodes by an identity in Ethereum network?

According to this answer: (https://bitcoin.stackexchange.com/a/63657/41513) the following can be definition of a node: "A node is a computer that has a copy of the blockchain (or at least a part ...
0
votes
1answer
78 views

How can i get my var in Web3, i always get Promise { <pending> }

var gogo =web3.eth.getBalance("0xXXXXXXXXXXXXXX") .then(console.log); console.log(gogo); if (gogo > 123) { console.log('enough.'); } how to run if in this case? Thanks for helping me.
1
vote
1answer
322 views

Send signed transaction from nodejs to private SmartContract using webjs in Quorum network not working

Context I have a quorum network mounted following the example of 7nodes. In node 1 I have deployed a smart contract privately, putting the public key of this ("BULeR8JyUWhiuuCMU/HLA0Q5pzkYT+...
1
vote
2answers
270 views

How to convert a uint to 64 byte hex string using Node.js?

Sir, If my uint is 10,how to convert 10 to '0x000000000000000000000000000000000000000000000000000000000000000a' by using Node.js? and reverse it from '...