Questions tagged [ethereumjs]

For questions regarding the installation or use of EthereumJS, a Javascript library that implements a number of Ethereum utility functions.

1
vote
1answer
30 views

where does the metamask fits in Dapps architecture?

i am learning building Dapps. And i got to know to know about metamask. I've read about metamask is an ethereum wallet which we can use to sign Tx's without running a full node and inject web3 to ...
0
votes
2answers
21 views

Cannot declare web3 object in JavaScript

When I try to declare a web3 object It's always undefined. I'm writting in JavaScript and using Infura as my provider for the ETH mainnet. I also tried with a local blockchain instead of Infura, but ...
0
votes
1answer
25 views

How to call setter method of smart contract with web3 1.0.0

I don't know why but i'm not able to perform transaction with this code. please help me out i'm stuck. i just have to call setter method of my contract with some arguments. router.post("/set", async ...
0
votes
0answers
19 views

Web3js v0.20.7 - callback ls not a function

I'm facing issue of callback is not a function in web3js 0.20.7 when i call the method of sendRawTransaction to deploy smart contract with web3. When i used the same method just to call deployed ...
0
votes
0answers
19 views

How to use bip39 module in angular?

I am trying to create an ethereum wallet app using Ionic. I have tried to import bip39 node module directly in the angular project but it gives me error. Please help import { Injectable } from '@...
0
votes
1answer
12 views

connecting geth to web3.go 1.0 via websockets or HTTP

Is there anyThing similar to web3.js written in go that allows me to communicate with the geth client ?
1
vote
0answers
21 views

How to do loop all the metamask Accounts loop and display data from that address in React frontend + Dapp App JS [duplicate]

I want to Display data stored on the Ropsten Network in more then 2 metamask accounts. I want to display the result on the Home page in the table form. For that I need to loop through each ...
0
votes
1answer
18 views

how do etherscan get all the token balance of particular address?

I want to create service where just by providing address i can fetch all the token (erc 20 & erc721) balance just like etherscan for a private network? is there any way to do it by writing for ...
0
votes
1answer
39 views

How to deploy Smart Contracts With Web3 Using Async/Await?

This is my Javascript code. I keep getting an error that states Error: No privateKey given to the TransactionSigner. at TransactionSigner._callee$ (/Users/payton/WebstormProjects/Esgro_DAPP/...
0
votes
0answers
28 views

Web3 Websocket Connection To Infura Rinkeby Ropsten

This is my Javascript code. I keep getting an error that states (node:30062) UnhandledPromiseRejectionWarning: TypeError: privateKey.startsWith is not a function I am using node 12.1.0 & ...
2
votes
1answer
36 views

How to create a private ethereum network [closed]

I want to understand how to create a private blockchain using ethereum and create a minable coin. Also, I want to know if I can modify the consensus algorithm that runs on every node? There are ...
0
votes
1answer
24 views

Why Could not find artifacts for contract from any sources

I am using windows 10 with truffle and ganache-cli. I have 2 contracts file to be deployed contain interfaces of other contracts defined within the contract: Contracts: ERC721Mintable.sol Ownable ...
0
votes
1answer
101 views

Web3 - Cannot read property 'clearSubscriptions' of undefined

While creating a web3 instance, and attempting to call setProvider with a valid provider (Ganache), I get a TypeError. TypeError: Cannot read property 'clearSubscriptions' of undefined Steps to ...
0
votes
1answer
26 views

How do I deposit Ether to Smart Contract using Web3.js

So I am creating a web application that interacts with a smart contract that I deployed on the Ropsten TestNet. I am able to withdraw ether from the contract to my Metamask account using a withdraw ...
0
votes
0answers
17 views

getting an error while deploying smart contract of ethereum

I am getting an error while trying to deploy smart contract of voting dapp on ethereum I have searched for the solution for the same and i got a question with same problem but there no solution. ...
2
votes
2answers
338 views

How to connect with public Ethereum Blockchain on a backend/web server?

In the backend of a Web application I have to communicate with the public Ethereum Blockchain. On local development machine, I run ganache as testrpc and connect with such a line of code: web3 = new ...
0
votes
0answers
34 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
42 views

Can I create & run test cases for smart contract without truffle?How?

does truffle is necessary for smart contract testing? Is there any alternative way, so that we can perform smart contract testing without truffle?
0
votes
2answers
57 views

msg.sender in contract is empty

I have the following deployment script var contract = web3.eth.contract(response.abi); var bytecode = response.bytecode; var options = { from: ...
0
votes
0answers
20 views

Etherscan API call at specific block number

I'm trying to use Etherscan API to call a specific method from smart contract, however, i cannot call at specific block number. For example: This is the API: https://api.etherscan.io/api?module=...
1
vote
1answer
58 views

Timeout exceeded during the transaction confirmation process. Be aware the transaction could still get confirmed

contract deploy , web3 version is 1.0.0-beta.52. let {bytecode, interface} = require('./1-compile') let Web3 = require('web3') let web3 = new Web3('http://localhost:7545') console.log('version :',...
0
votes
1answer
26 views

Method personal_sign not supported

I'm trying to use personal_sign and getting not supported error. I'm using web3 v 0.20.1 I first tried using infura and was not able to resolve the issue, so then I connected to a geth node with this ...
0
votes
0answers
10 views

Problem installing ethereum-abi module

I tried to install ethereumjs-abi module using node package manager. I used the following standard command: npm install ethereumjs-abi Although in the end I got the message from the installer that ...
1
vote
2answers
41 views

How do I recover the address from message and signature generated with web3.personal.sign?

Is there any way to do that? To recover address in nodejs server-side from signature and message after it was signed with web3.personal.sign client-side? I tried this: https://ethereum.stackexchange....
0
votes
0answers
11 views

Calculating the PPS reward

I'm trying to write a DAPP to calculate estimated rewards of miners. What is the right way to calculate PPS reward? Single Share Reward => (portDifficulty / networkDifficulty) * BlockReward Total ...
0
votes
2answers
27 views

eth.sendTransaction successful or not?

I sent 1 ETH on a private chain from node1 to node2. >eth.sendTransaction({ from: "0x30278b135d0f5c10eb0684ff18bfd84912ae0f2b", gasPrice: "5000000000", gas: "21000", to: '...
1
vote
0answers
24 views

Smart Contract ABI in Remix (Ethereum)

When I deploy smart contract on the Rinkeby network using Remix the ABI of smart contract does not contain its address, so how do I connect it with my frontend application.
0
votes
0answers
94 views

how to generate ethereum address from mnemonic and derivation path without using ethereumjs-wallet npm package?

Is there any way to generate ethereum address from mnemonic and derivation path without using ethereumjs-wallet npm package? I have generated mnemonic using bip39 and i can generate Ethereum ...
0
votes
1answer
104 views

ethereumjs-wallet/hdkey is no more in npm

how to generate multiple addresses from single mnemonic? var hdkey = require("ethereumjs-wallet/hdkey") var bip39 = require("bip39"); // You can generate a mnemonic seed with bip39 library var ...
1
vote
1answer
32 views

is the gas price on test net equal to main net?

I have 1 contract deploying on test net, let say it use 300,000 gas for executing 1 function. On main net, this contract will cost 300,000 gas per function also? Thanks
0
votes
0answers
32 views

Store data on ethereum block chain using react js

I'm trying to store data on ethereum blockchain by doing this import storemetadata from "./storemetadata"; where i have the smart contract ABI in storemetadata I now add name like so storemetadata....
0
votes
0answers
9 views

How to get Metamask return the rawTransaction from the JSON transaction?

I am in the process of exposing a web interface to interact with a back-end Web3 Json Rpc compatible node, but it is necessary that I add additional parameters in the jsonrpc request before submitting ...
3
votes
2answers
102 views

how to setup a ethereum private blockchain?

Does anyone know how to set up a private blockchain in ethereum network? is that possible to run a private ethereum node? I have seen forking of public blockchain like EOS into a private blockchain.i ...
0
votes
1answer
32 views

how to connect my html form that is username and password to blockchin and taking the username as metamask key?

I am developing a decentralized cloud web application, when the user will login into the application he/she will generate password from blockchain, I am not getting how to connect my html form that is ...
-1
votes
1answer
25 views

Smart contract to strore and retrieve address and ID in blockchian using mapping

I want to store some address and their ids in blockchain using mapping and i want to know how to get the stored addresses when searching with their respective IDs.
1
vote
1answer
59 views

Doubt in terminologies used in Ganache Interface

I am developing a DApp (an e-commerce app) based on Ethereum. I wrote the solidity contract and interact it with a NodeJS server/web3js API. I am running a Ganache Ethereum RPC client locally. The app ...
0
votes
1answer
78 views

Expected ';' but got 'payable'

I have written following Smart contract. pragma solidity >=0.4.17; contract factoryCampaign { Campaign[] public deployedCampaign; function createCampaign (uint256 minimumContribution) ...
-1
votes
1answer
101 views

UnhandledPromiseRejectionWarning: Error: invalid json request

my deploy.js script returns this error : "(node:6636) UnhandledPromiseRejectionWarning: Error: invalid json request at D:\kickstart\node_modules\truffle-hdwallet-provider\dist\index.js:15:620862 ...
1
vote
0answers
43 views

Ecrecover wrong address is returned

I'm trying to validate signed data with ecrecover. The message is signed like this on the FE: return this.web3.eth.personal.sign( `${nonce}`, publicAddress ).then( ( signature ) => { ...
0
votes
1answer
39 views

HTTP query create request error for oraclize

I have tried to deploy a sample contract having oraclizer query using truffle+ethereum bridge+solidity. First ethereum bridge made up and got OAR address which is used in sample contract in ...
0
votes
0answers
176 views

How to access the return value of function of ethereum contract using web3 in javascript?

I have written a basic hello world! smart contract and deployed using testrpc and truffle. I have a function in the contract that returns a value and i am using this function and the value it returns ...
0
votes
0answers
41 views

Unable to transfer token from one personal account to another

I have created two personal account on private blockchain with geth. This is the balance of one account web3.fromWei(eth.getBalance(eth.accounts[0]), "ether"); 100000000000 And this is of the ...
0
votes
0answers
100 views

unable to deploy contract on rinkeby network

I am trying to deploy my contract to rinkeby test network but unable to do so here is my contract code. pragma solidity ^0.4.17; contract Inbox { string public message; function Inbox(string ...
0
votes
1answer
94 views

web3 reading memory string gives error

i have declared a string variable in struct like struct test{ string testString; } I have written a function to access the variable like function getteststring(uint256 index)public ...
0
votes
1answer
45 views

Cannot see account created when using getAccounts

i have setup private blockchain on vm using geth and i have created personal account for deployment of contract on private blockchain. Now, when i try to create new account, i am able to do so but i ...
0
votes
0answers
65 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
77 views

How to create trueUSD token to my eth address [closed]

I am newbee about smart contract and eth tokens. I have created an eth account by: let account = web3Client.eth.accounts.create() I have my account details. I need to add some true usd token to eth ...
1
vote
3answers
161 views

Sign Message Using private key instead of kesytore

I need to sign data using the private key and not keystore file. I can get data using: var hash = "0x" + ethereumjs.ABI.soliditySHA3( ["address", "uint256", "uint256"], [web3.eth....
0
votes
0answers
23 views

In ethereumj, why the signature use loop to get v?

In the java version of Ethereum, I see the signature code as follows: public ECDSASignature sign(byte[] messageHash) { ECDSASignature sig = doSign(messageHash); // Now we have to work ...
0
votes
0answers
11 views

How to read the data from block?

In my smart contract, I am inserting plain text message. I can also update the message. After updating, if I want to see the previous message, is it possible? Can I see all the data in etherscan.io?...