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
1
vote
0answers
11 views

Verifying ETH Deposit Contract signatures using Chainsafe BLS library

I am attempting to verify BLS signatures using the Chainsafe BLS library. I am attempting to independently verify signatures associated with deposits to the ETH Deposit Contract. In order to test that ...
1
vote
1answer
18 views

Why am I receiving invalid transaction hashes?

I am very new to this whole ethereum and web3 part. I've learned from this tutorial Link Here about how it is suposed to work and what information should my code deliver to me. But for some reason all ...
0
votes
1answer
10 views

How do I pass data into web3.eth.subscribe('pendingTransactions') [closed]

I need to be able to pass an object into the subscription Listener for web3.eth.subscribe('pendingTransactions') const subscription = web3.eth.subscribe('alchemy_fullPendingTransactions') ...
0
votes
1answer
18 views

how to covert a string to a ether address (20 bytes)?

I have tried to use sha3 but it return error since invalid address. Here is my code. The sha3 returns 32 bytes address. I wonder is there other function that returns 20 bytes . var to_add = web3.sha3(...
1
vote
1answer
20 views

Truffle ganache fork

Suppose I have access to a full archive Node and I want to fork from a specific block using Ganache. Using ganache-cli, I can specify where to fork using the --fork parameter by passing it the Node ...
1
vote
0answers
26 views

Call() function returns “Error: Returned values aren't valid, did it run Out of Gas?”

I am connecting to Binance Smart Chain mainnet via rpc. The error message I get is following: (node:17667) UnhandledPromiseRejectionWarning: Error: Returned values aren't valid, did it run Out of Gas? ...
0
votes
0answers
41 views

throw new Error(“Could not find artifacts for ” + import_path + “ from any sources”);

I’m receiving then ex error: C:\Users\xxxxx\AppData\Roaming\npm\node_modules\truffle\build\commands.bundled.js:455204 throw new Error("Could not find artifacts for " + import_path + " ...
0
votes
0answers
27 views

Compatible versions of npm, truffle, node and web3 for Solidity 0.7.2

I'm using: Solidity 0.7.2, Node v12.18.4, Truffle v5.1.49 (core: 5.1.49), npm 6.14.8, web3 1.3.0 I want to know what versions are compatible with solidity 0.7.2. Many thanks and have a nice weekend.
1
vote
0answers
18 views

How to filter 2 indexed event fields, both fields array?

I have this event: event onSubmissionBoth(bytes32[] indexed docHash, string[] indexed doc4DHash); Now I log into the event like this: function submitHash(bytes32[] calldata docHash,string[] calldata ...
1
vote
1answer
31 views

Where to define the MetaMask window.ethereum.on Listener

I have tried to include the window.ethereum.on listener to detect account changes in MetaMask, in my mounted () {} method. When the listener is triggered, it itself triggers the location.reload() ...
0
votes
1answer
34 views

Receiving 'undefined' when using getBalance from web3

I am trying to fetch the balance of an address by web3 and node from Ropsten network with the commands below: var Test = require('web3') var url = 'https://ropsten.infura.io/v3/...' var web3 = new ...
0
votes
0answers
10 views

howt to generate AST tree form (not in JSON form) from Solidity File (.sol)

I have .sol file and want to generate AST only from .sol file. My scenario is that at the command line (after installation some package), I just have to give a command like package_command --AST [from ...
0
votes
0answers
9 views

Recursively search for Ethereum nodes

Hi I'm trying crawl the Ethereum network to get a full list of nodes including IP and client info in nodejs. I know that it's hard to achieve 100% accuracy on a p2p network but I would like to get ...
0
votes
0answers
65 views

Remixd won't connect to browser IDE

I have a small issue with remixd connecting to my browser IDE instance. I have tried on both MacOS and Linux with the result being virtually the same When I run the following: remixd -s /home/garrett/ ...
1
vote
1answer
39 views

Truffle - deploy and interact with a contract locally from a script

I have created a contract, wrote a migration and a test. When I run truffle test the contract is deployed locally and then the tests are run against it. All is working fine. I also added a function to ...
1
vote
1answer
40 views

Node version upgrade for contract deployment throws error

I wrote a solidity contract using version 0.4.24 using OpenZeppline-solidity version 1.12.0. This used to deploy using the Nodejs version 8.12. The Nodejs version 8 is no longer being maintained from ...
0
votes
0answers
16 views

Events stop triggering after a while

I created a script that subscribes to PairCreated event on Uniswap using Web3 and Infura API. The event works for a few minutes but stops working after a while (timeouts?). How can I make it watch the ...
0
votes
0answers
19 views

How to get a public IP address with IPFS-JS

With IPFS JS when I run this: const ipfsNode = await IPFS.create(); const addresses = await ipfsNode.swarm.localAddrs(); console.log(addresses); I get this: Swarm listening on /ip4/127.0.0.1/tcp/4002/...
1
vote
1answer
20 views

Get deployed contract dynamically in node JS

I am using Node JS and ethereum smart-contract. Every time contract gets deployed new addresses generated. Is there a way that node JS always gets an updated address of a contract? Any API so that I ...
0
votes
1answer
76 views

Error: Returned error: VM Exception while processing transaction: revert when using methods.MyMethods.Send

I am writing a simple betting application that will return double the ether deposited by the player, provided they guess correctly the random number generated by the virtual slot machine. it works ...
1
vote
1answer
40 views

Automatically register number into Kovan test net with signed transaction (Infura API + NodeJS)

I have a very simple Smart Contract deployed using remix.ethereum which is: pragma solidity ^ 0.6.0; contract primerContrato { uint storeddata; function set(uint x) public{ storeddata = x; } ...
0
votes
0answers
45 views

Getting an “ Unhandled promise rejection” error when making transaction from account1 to a contract

I keep getting a Promise Rejection error whenever I make a transaction from account 1 to a contract. The contract is used to send ether to account 2 when it receives ether from account 1. For security ...
0
votes
1answer
96 views

web3 eth return returns a nonexistent transaction hash

I'm trying to create transactions something like this: var sender = meth.eth.accounts.privateKeyToAccount(data.fromPrivate) meth.sendTransaction({ sender, to: data.to, amount: data.value, }, cb) ...
1
vote
0answers
23 views

where to host express api that communicates with smart contract to be fully decentralised?

I need to host express api that communicates with smart contract to be fully decentralised. Any to host it decentralised.
2
votes
1answer
238 views

Ethereum Error: Provider does not support subscriptions: HDWalletProvider

I am making a flash loan request using web3 , truffle and keep getting the error in an event listener: The current provider doesn't support subscriptions: HDWalletProvider. I am connecting to the ...
0
votes
1answer
40 views

web3.eth basic functionality

I'm just trying to get web3.eth in node.js to tell me what the current block number is but I get an error 'UnhandledPromiseRejectionWarning: Error: Invalid JSON RPC response: ""', I have &...
0
votes
0answers
74 views

How to Manage Bulk of transaction through web3.js?

I have following code to send a transaction: const account = web3.eth.accounts.privateKeyToAccount(process.env.PRIVATE_KEY_1) const transaction = contract.methods.submitHash(docHash); const options = ...
0
votes
0answers
48 views

require Statement returns Transaction Revert Error instead of provided custom error message

For example, i have this piece of code here require(keys[_address].purpose != _purpose, "Key Already Exists"); in a Smart Contract. Upon executing a function and failing a requirement, ...
0
votes
1answer
33 views

Decoding input paramters throws invalidity error

Using the abi for a smart contract that I got, I was trying to decode the input parameters for a transaction receipt using web3.eth.abi.decodeParameters function. The logs.json file is as below: { &...
1
vote
0answers
73 views

Solidity function calls from javascript work locally but fail on ropsten,kovan etc with Error: Returned values aren't valid, did it run Out of Gas?

I have a smart contract whose function calls works fine when called locally using javascript and ganache. But when I deploy to ropsten and others, the calls to its functions fail with Error: Returned ...
0
votes
0answers
21 views

Trying to deploy a simple contract using node and getting the error: Unhandled Promise Rejection / Contract code couldn't be stored

I am doing an online course and trying to deploy using node. Can anyone help ID what I might be doing wrong. Thank you for any help! The error is below, followed by the js code. iii@iii:~/Digital ...
1
vote
0answers
63 views

How to speed up ethreum transaction after initiating

Is there any possibility to speed up transaction after creating transaction receipt. My project need to similar functionality we have with metamask is there a way we can accomplish this using any ...
0
votes
0answers
23 views

Can we determine gas price for a function without deploying it? [duplicate]

I want to store a document hash on an Ethereum network. I have two options. 1st one is to send the transaction directly through a node js application with input field as the document hash ie, ...
1
vote
1answer
136 views

Could not find a declaration file for module 'solc''

I have installed solc without any errors or warning, but when i am trying to run node compile.js command in cmd then i am getting following error On checking the code, i found that "const solc = ...
0
votes
0answers
13 views

migrate error from new buffer(process.env)

I follow the book Ethereum from Gavin Wood and when i use truffle migrate --network ganache it gives me following error; TypeError [ERR_INVALID_ARG_TYPE]: The first argument must be one of type ...
0
votes
1answer
11 views

Pushing process to background causes high kswapd0

I have a cpu-intensive process running on a raspberry pi that's executed by running a nodejs file. Running the first command (below) and then running the file on another tab works just fine. However ...
0
votes
1answer
36 views

ERC20 Transaction failing due to invalid nonce value

I am trying to send an erc20 transaction but I keep getting an error telling me that the account I'm sending the transaction from has a nonce value of 1 while the tx has a nonce value of 31613. I am ...
0
votes
0answers
28 views

web3 getTransactionReceipt instant response

How come the second time i call getTransactionReceipt with the same transactionhash i get an instant response? code: async function test() { prmoise1 = web3.eth.getTransactionReceipt( '...
1
vote
1answer
66 views

API node js with call and send to a contract without metamask

I am new in Solidity. I'm trying to create a API in node js, which can be use without a navigator like chrome with MetaMask. I would like to test it with postman. But i have some problems with web to ...
0
votes
0answers
79 views

Deploy contract with web3 with ABI in JSON file give me “SyntaxError: Unexpected token o in JSON at position 1” [duplicate]

I got problem with my deploy.js script to te deploy my smart contract with web3. When I run it, I always got this error: Attempting to deploy from account XXXXXXXXXXXXXX (node:25929) ...
0
votes
1answer
42 views

web3.eth.getBlock isn't triggered

Basically, i want get the callback result of first method to get each index value in pass it to the second method to scan this value, in this case is an ethereum transaction to get the input value. ...
1
vote
1answer
32 views

How to fix Data location must be “memory” for return parameter in function, but none was given.?

pragma solidity >= 0.5.0 < 0.7.0; contract Adoption { address[16] public adopters; function getAdopters() public view returns(address[16]) { return adopters; } function adopt(uint ...
0
votes
1answer
70 views

Why my contract binary does not set?

My project is in Truffle. I programmed a smart contract and want to deploy it with JavaScript. But the following error occurs: Error: Contract error: contract binary not set. Can't deploy new ...
0
votes
2answers
141 views

getTransaction sometimes returns null when transaction is pending

I am looking to get real time transaction data as it is broadcasted to the ethereum network, so I have subscribed to pendingTransactions. This only returns the transaction hash though, so I have to ...
0
votes
0answers
18 views

How to make sign tx for erc20 token transfer? [duplicate]

How can I make an erc20 token transfer in node, I know to transfer eth is like this for using ethers. Lib: let privateKey = "0x3141592653589793238462643383279502884197169399375105820974944592" let ...
0
votes
0answers
26 views

How to get type of a contract internal transaction? [duplicate]

I'd like to get type(create, call, ...) of a contract internal transaction, like [this page of etherscan.][1] However, I couldn't find it any responses and documents of web3js. I'm getting a contract ...
0
votes
1answer
26 views

How can I keep nodejs running even after crash on Ubuntu [closed]

Is there any way I can run the nodejs program app.js always in the server even it crash? So I do not need to keep restarting node app.js by nohup
1
vote
1answer
30 views

What is an index position of an uncle?

I see this document. But I don't understand what is an index position of an uncle. I'd like to get informations of uncle blocks like etherscan.io However I don't know a value of the index position ...
1
vote
0answers
60 views

How to deploy blockchain app in heroku

I want to deploy my blockchain app in heroku and i just want to use ganache as my blockchain network. is that possible?
0
votes
0answers
43 views

Is it possible to use ganache blockchain when I deploy my web app in heroku? or should I deploy the contract first to a test network?

const web3 = new Web3( new Web3.providers.HttpProvider( "https://kovan.infura.io/v3/INFURA_KEY" ) ); const abi = JSON.parse( '[ { "constant": false, "inputs": [ { "internalType": "string", "...

1
2 3 4 5
10