ethereum

How to use ethereumjs-tx in browser

試著忘記壹切 提交于 2019-12-11 13:27:29
问题 Does it is needed to install npm ethereumjs-tx while using a browser version of it which is directly downloaded from github. If yes then how we can import the ethereumjs-tx module in our script file. Because both are two different things as my knowledge. 回答1: ethereumjs-tx as a browser build can be found here If it helps anyone in the future. EthereumJS community have created browser builds for most of their repositories here. Please use with caution as it has not been updated regularly. But

Can't install eth-testrpc with pip3

本小妞迷上赌 提交于 2019-12-11 12:57:19
问题 I can't install eth-testrpc for python 3.6 using pip3; this is the error Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-9xf75aun/secp256k1/ The thing is that i can using pip but it won't work. Any Id the entire error is here millahue@millahue-ProLiant-ML350e-Gen8:~$ sudo pip3 install eth-testrpc The directory '/home/millahue/.cache/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and

Web3.js sendSignedTransaction gives “Error: Failed to check for transaction receipt”

Deadly 提交于 2019-12-11 05:59:46
问题 I am using web3js v1.0.0-beta.34 to send signed transactions to a geth node Geth/v1.8.13-unstable-2e0391ea/linux-amd64/go1.10.3 in a loop. Problem: In the initial iterations of the loop, Node.js prints the transaction hash to console. But when the loop has been running for more than a handful of seconds, we start to get the error: Error: Failed to check for transaction receipt: {} at Object._fireError (/Users/x/test/node_modules/web3-utils/src/index.js:56:17) at /Users/x/test/node_modules

How to compile solidity using solc 0.5

时光总嘲笑我的痴心妄想 提交于 2019-12-11 05:58:14
问题 compile.js : const path = require('path'); const solc = require('solc'); const fs = require('fs-extra'); const buildPath = path.resolve(__dirname, 'build'); fs.removeSync(buildPath); const campaignPath = path.resolve(__dirname, 'contracts', 'Campaign.sol'); const source = fs.readFileSync(campaignPath, 'utf8'); var input = { language: 'Solidity', sources: { 'Campaign.sol': { content: source } }, settings: { outputSelection: { '*': { '*': [ '*' ] } } } } const output = solc.compile(input, 1)

Integrating web3 in cloud functions module

一个人想着一个人 提交于 2019-12-11 04:35:58
问题 I'm trying to integrate web3 (using truffle) in a cloud functions module and I keep getting this error: Error: Invalid JSON RPC response: "" Here is part of the implementation: admin.initializeApp(functions.config().firebase); const db = admin.database(); const provider = new HDWalletProvider(mnemonic, infura link); const web3 = new Web3(provider); As Far as I understand, the error indicates that truffle library is unable to establish a connection to the ethereum network. I wonder if this has

Remix Ethereum where goes the contract?

核能气质少年 提交于 2019-12-11 04:24:58
问题 I don't understand where actually the smart contract goes, when I click on create under remix.ethereum.org. If I choose for example the Injected Web3, this should publish the contract to the ropsten test net, right? But how can I access the contract then? When I use metamask it injects me the right provider when I use web3.js, but how can I find this contract now, if I don't want to use the injected web3, but manually choose the provider address in web3.js? Can I access the smart contract

Can't call contract function in truffle console

你离开我真会死。 提交于 2019-12-11 04:16:37
问题 I'm compiling and deploying the following contract to testrpc: pragma solidity ^0.4.4; contract Adoption { address[] public adopters; function adopt(uint petId) public returns (uint) { require(petId >= 0 && petId <= 15); adopters[petId] = msg.sender; return petId; } } Then I go to terminal and: truffle compile truffle migrate --reset Everything works as expected. Then, I try to call adopt() in truffle console: truffle(development)> const adoption = Adoption.deployed() // undefined truffle

In Ethereum, what is a private testnet, why would I want it, and how do I set it up?

懵懂的女人 提交于 2019-12-11 03:34:34
问题 I've seen/heard developers talk about Ethereum test nets, but I've just been publishing to the public block chain. What is a private test net and how do I set one up? 回答1: A private testnet is your own personal, local-to-your-machine blockchain to mess around with. Publishing to the public chain is slow and creates bloat. Plus, you have to use real ether to do anything. A private test net avoids these issues. Setting up a private testnet is easier than you’d think. geth --rpc --rpcaddr "127.0

Solidity: Can a Parent contract see data updates from a Child contract?

妖精的绣舞 提交于 2019-12-11 01:44:45
问题 I have a premature implementation of an Ethereum game. I have divided my code in two contracts, separating "game" functions from functions called by the Admin. Admin.sol inherits from Game.sol as seen below. A struct object is created in Admin, but Game cannot see it. (Getter function returns nothing) import "./Game.sol"; contract Admin is Game The same code, if not divided in two contracts, works perfectly. Header of function in Admin.sol that creates the object: function createJob(string

How to connect web3 to ethereum network using flutter?

丶灬走出姿态 提交于 2019-12-10 23:36:28
问题 i am getting error while connecting with ethereum node this line ==> print(client.getBlockNumber()); returns error E/flutter (22015): [ERROR:flutter/lib/ui/ui_dart_state.cc(148)] Unhandled Exception: SocketException: Failed host lookup: 'localhost:8545' (OS Error: No address associated with hostname, errno = 7) import 'package:flutter/material.dart'; import 'package:http/http.dart'; import 'package:web3dart/web3dart.dart'; import 'dart:async'; const String url = 'https://mainnet.infura.io'; /