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
0
votes
0answers
13 views

How to solve this error

\?\C:\Users\keval\Desktop\project\dcrowdfund\D-crowdfund\node_modules\scrypt\build\Release\scrypt.node is not a valid Win32 application. \?\C:\Users\keval\Desktop\project\dcrowdfund\D-crowdfund\...
0
votes
0answers
16 views

Problems subscribing to infura via websockets

So I have a dapp that includes a node server, which I have got to work successfully using ganache, using this line: web3 = new Web3(new Web3.providers.WebsocketProvider('http://127.0.0.1:8545')) I ...
0
votes
0answers
21 views

contract not deployed [on hold]

I am getting this error in the browser console and dont what to do please help... ERROR Error: Uncaught (in promise): Error: Contract has not been deployed to detected network (network/artifact ...
1
vote
1answer
18 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 ...
0
votes
1answer
21 views

Not getting getPastEvents or once function using contract instance

I have followed Web3 documentation to subscribe an evnet, I have created Instance of web3 using infura url as argument. Created contract object using, const contract = web3.eth.contract(abi, ...
0
votes
1answer
22 views

About send Ethereum Classic (ETC) coin

Need guideline for send ETC coin using web3js,As per documented flow I understand we can access all methods same as ETH but I have query regarding set provider for ETC after that I can connect to ETC ...
0
votes
0answers
27 views

TypeError: Cannot read property 'Crypto' of undefined

I have a code block for sending transaction let address_from = '0x0b2af884cc5a98816ba186ca6f7e839a7dd36053'; let address_to = req.params.address; let nonce = web3.eth.getTransactionCount(...
0
votes
1answer
14 views

How to connect a NodeJS App to locally running Ganache

Most of the tutorials I have found so far connect a FrontEnd App (say, React) through the web3.js that gets injected by Metamask. I have been asked to produce an NodeJS App that connects to a ...
0
votes
1answer
52 views

Ethereum gas limit using Geth

I am running a private blockchain using Geth, after upgrading the servers- I had stopped the miner and restarted it after upgrading the specs. Now I am getting all sorts of errors, the main one being ...
2
votes
1answer
56 views

Different outputs for Keccak256(), which one is right?

To get a value from contract storage I used this geth code succesfully: var contractAddress = '0x88e726de6cbadc47159c6ccd4f7868ae7a037730' var index = '...
0
votes
1answer
42 views

Load Smartcontract in Nodejs

I created the server based on golang. This server can load smart contract that is deployed using its address. It works on my local machine, but it does not work on EC2 instance. So I decided to ...
2
votes
2answers
66 views

Ganache GUI installation error

node version v12.8.0,npm version 6.10.2 I followed the below steps to install the ganache GUI but I got the error $mkdir ~/ganache $git clone https://github.com/trufflesuite/ganache.git $npm install ...
0
votes
3answers
64 views

Response stuck when creating contract

I am creating a contract on my local blockchain network using web3. On my node , contact is created and address is generated. But on node application, response is struck. Here is my node code: ...
0
votes
0answers
14 views

truffle - toUtf8 on Migrations not working

I'm deploying my contracts via migrations and would like to show some info on the console about them just by getting data from these contracts and displaying it. I'm sending a deployed contract to the ...
0
votes
0answers
29 views

Cannot access myContract.events in web3.js version 0.20.7 [duplicate]

It seems that I do not have access to certain tools in web3js that allow me to subscribe to events. When I tried to use contractInstance.once('allEvents', callback) after instantiating a contract, I ...
0
votes
0answers
16 views

Can I Create Node.js API for each function in Smart Contract but sign a Transaction from frontend via Metamask.?

I am trying to develop a Dapp with nodejs backend but I cannot get accounts from Metamask which resides on my frontend. I tried to create an endpoint for each function in Smart Contract. And it seems ...
0
votes
1answer
40 views

Sending value to a solidity contract method from web3 results in `Invalid Tuple Value` error

I'm sending values to a solidity 0.5.1 method using web3 and keep getting an invalid Tuple value error. Here's the relevant contract code: struct mystruct { bytes32 id; string str; } ...
0
votes
1answer
42 views

Using vanilla javascript with web3 and metamask

I have searched severally on how to use web3 with metamask without nodejs without any success. I want to be able to get an instance of a user's metamask account through web3 and vanilla javascript ...
0
votes
1answer
33 views

Deploy contract didnt resolve the promise

im facing a problem deploying a simple smart contract. When i use ganacha-cli, the program enter in a loop of confimation event, counting from 1. Thats the first problem. Output: Account: ...
0
votes
0answers
14 views

How to save contract address to database with web3js and mongoose when I deploying a contract?

I wanted to get my contract address after it deployed, and then save it into my mongoDB. But instead of that, my contract address is deployed after it. So my mongoDB won't save my contract address. ...
0
votes
0answers
26 views

Handling a promise in a return function

I am trying to console.log the blockNumber that my transaction was confirmed in with the following code: web3.eth.sendTransaction( {from:account3, to: account2, value: web3.utils.toWei('1','ether'...
1
vote
0answers
47 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 ...
0
votes
1answer
29 views

How do I load the `web3` module using the html `script` element?

How do I load the web3 module into the frontend of my application using the html script element? I have already installed the web3 module using npm. This is the path to the web3 module in my app ...
0
votes
1answer
63 views

How to use window function in controller (node.js)?

So this is my users controller to upload a file : exports.postUploadFile = (req, res, next) => { var ethereumURI = req.body.ethereumURI; var abi = JSON.parse(req.body.abi); var ...
0
votes
1answer
92 views

Failed to install Truffle on MacOS Mojave

I am currently really struggling in getting Truffle up and running. I am running MacOS Mojave and have Node (v.10.16.0) and NPM (6.9.0) and have tried npm install -g truffle and have gotten: ...
1
vote
0answers
22 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
119 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 ...
0
votes
0answers
31 views

intermediate value is not iterable

I try to construct a transaction with Node (11.4.0), ethereumjs-tx (1.3.7) and web3 (1.0.0-beta.55) and Infura. Infura gives me '0x35b' for the nonce, then I create the tx: amount = 0.001; nonce = '...
0
votes
1answer
148 views

TypeError: this.provider.sendAsync is not a function

First I connected web3 with Infura. Then reading an ethereum account. I receive the following error while fetching account balance through node.js console. > web3.eth.getBalance(address, (err, ...
1
vote
1answer
40 views

Error installing zos-lib@2.4.0

I am working through the tutorial for zeppelin-os found here: https://docs.zeppelinos.org/docs/linking.html and have an error when running zos create Could not find file zos-lib/contracts/...
0
votes
0answers
18 views

I keep getting this Error when i tried to use contracts instance to call a contract's function?

I tried creating instance by: const certificate = Certificate.deployed(); OR const certificate = Certificate.at(config.contract_id); ANd i get this Error below: TypeError: Cannot read property '...
1
vote
1answer
68 views

Store data on Blockchain via Backend App

First of all, sorry about my bad english. I looked in the forum but I did not find a similar situation, but I apologize if I'm repeating something here. I need to develop an application that runs on ...
2
votes
0answers
56 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'); ...
1
vote
0answers
32 views

Trying and failing to switch my dapp from local node to infura, please help? [closed]

I have a nodejs 'server' running that listens for events on the blockchain. Currently I have this line in my code: var provider = new Web3.providers.HttpProvider("http://localhost:8545"); But I'm ...
1
vote
1answer
137 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 ...
0
votes
0answers
63 views

Expressjs backend (truffle box) with metamask

I use truffle to unbox the express-js box (https://truffleframework.com/boxes/express-box). The code loads the web3 instance in server side which connects directly to ganache. Now I want to be able to ...
3
votes
1answer
108 views

Generate Ethereum address with private key

How can I generate ethereum account address and private key that works on ethereum main network using web3 in nodejs?
0
votes
1answer
30 views

Initialize an array of struct within a struct

I am working on a use case of "Purchase Order" wherein there will be multiple Products listed/ordered under one Purchase Order(PO) by a buyer. 1 PO : N Products struct Product{ bytes32 ...
0
votes
1answer
25 views

get Transfer events from 0x0 address for ERC20 token

I am trying to get all the events that originate from zero (0x0) address in order to capture the mint activity for my ERC20 token. Here is my code snippet: var instance = web3.eth.contract(abi).at(...
0
votes
0answers
22 views

How to sign a txn using web3 (1.0) and nodejs?

Firstly I know this has been asked before, but I have became confused with so many different formats and the move to 1.0. Many online resources do not make it clear about the version and I have become ...
0
votes
1answer
111 views

The method eth_sendTransaction does not exist/is not available on infura

Im trying to send transaction to simple greeter contract with web3.js on infura node.while doing soo, Im getting this error. throw errors.InvalidResponse(result); ^ Error: The method ...
0
votes
0answers
46 views

How can I comparing fingerprint using solidity language?

I have a fingerprint image stored in IPFS and I want to compare with another fingerprint image, because i need to know if is the same fingerprint ,is there some way, some lib that i can compare this ...
0
votes
1answer
138 views

problem of call() returns null

contract permission{ struct transaction { address payable sender; address receiver; string datatype; Status status; } function getTransactionCount() public view ...
3
votes
2answers
143 views

USD Coin Balance Check By Web3

Now I am getting trouble on checking the USDC balance in my wallet address using web3. USDC is also said that it is ERC20 token, but when I checked the token contract ...
0
votes
0answers
33 views

web3.eth.sign() problem [duplicate]

I am using infura and web3 0.20.0 in back-end.(nodejs, I don't want to interact with metamask(front-end)) Now, I am facing a problem. I tried to use ERC865. solidity function ...
1
vote
3answers
31 views

How can i send data to Contract's function with sendTransaction?

i hava contract like this pragma solidity ^0.5.0; contract Sample { string public name = "sample"; function set(string memory _name) public { name = _name; } function get() ...
0
votes
2answers
60 views

Solidity event isn't fired

I'm trying to listen for an event I've created on remix IDE , from NodeJS. I call a smart contract method from where the event is triggered and I'm waiting for it in my console...but I don't receive ...
1
vote
0answers
25 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
171 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 ...
0
votes
0answers
144 views

Node: How Can I Import Web3 To Node.js?

I'm trying to import the web3 library in Node.js so that I can handle Ethereum smart contract events, however I can't get the import to work. I'm running Babel on each file to convert to es5, and the ...