ethereum

Is it secure to run public ethereum node?

萝らか妹 提交于 2019-12-21 21:22:20
问题 I'm creating my first Ethereum contract with truffle. I want the web application to be usable without MetaMask so I was wondering if it is a good idea to run my own private node and to connect from the frontend like this: this.web3 = new Web3(new Web3.providers.HttpProvider('http://my-public-ip:8545')); Are there any security risks with this approach ? 回答1: I'm answering my own question because it seems that a lot of people are doinig the same mistake that I did and lose their ether ! I did

What is blockchain and Ethereum? Where is it used?

限于喜欢 提交于 2019-12-20 11:17:20
问题 I just got chance to work on Ethereum, block-chain based platform. But I don't have a clear idea in which scenarios this is used, any real life use of this.Could anybody help me understand blockchain based platform and its real life uses? 回答1: Welcome to blockchain world.Don't get demotivated, Blockchain area is relatively new & hard to find good tutorials.I also started learning blockchain related technologies a month ago & I would like to share some ideas about Blockchain & Ethereum.Since

Handling user profiles in Ethereum DApps

依然范特西╮ 提交于 2019-12-20 09:21:18
问题 I'm in the process of creating an Ethereum DApp. The DApp consists of users who have associated data like email, name, and a profile picture. I would like to store the contents of the user within IPFS as a JSON object and reference this on chain using the IPFS hash. How could I go about associating this data with a particular user? In the sense, that subsequent interactions with the DApp connect the user with the data stored in IPFS. Is this done using the users account hash with a password

Solidity Source Files Requires different compiler version

好久不见. 提交于 2019-12-20 04:15:40
问题 pragma solidity ^0.5.3; contract Inbox { string public message; function Inbox(string initialMessage) public { message = initialMessage; } function setMessage(string newMessage) public { message = newMessage; } function getMessage() public view returns (string) { return getMessage; } } Error : browser/Untitled.sol:3:1: ParserError: Source file requires different compiler version (current compiler is 0.5.3-nightly.2019.1.15+commit.6146c59a.Emscripten.clang - note that nightly builds are

How to get a value from a “Promise” object

二次信任 提交于 2019-12-20 03:56:21
问题 I started learning ethereum and web3js and noticed some functions on Web3js are asynchronous. What i want to achieve is get the account balance of a wallet and use the data for something else. My code below function getAccountBalance2(address){ var wei, balance //address = document.getElementById("addy").value return new Promise(function(resolve, reject){ web3.eth.getBalance(address, function(error, wei){ if(error){ console.log("Error with address"); }else{ var balance = web3.fromWei(wei,

RuntimeError: Can not reuse socket after connection was closed using docker

给你一囗甜甜゛ 提交于 2019-12-20 03:54:10
问题 I am following this tutorial to run Ethereum crawler using Docker on window 10 using docker after executing $ MYSQL_DATA_PATH="$HOME/indexer-data/mysql" GETH_DATA_PATH="$HOME/indexer-data/geth"docker-compose up in this line i got error 409 Client Error: Conflict for url: http+docker://localnpipe/v1.25/containers/ee2b46142bae704d4963853e22a77ba896a8f841120ecf5ac97befca91847672/attach?logs=0&stdout=1&stderr=1&stream=1 During handling of the above exception, another exception occurred: Traceback

How can I return an array of struct in solidity?

佐手、 提交于 2019-12-18 06:48:11
问题 I am designing a solution for an ethereum smart contract that does bidding . The use-case includes reserving a name eg. "myName" and assigning to an address. And then, people can bid for that name (in this case myName). There can be multiple such biddings happening for multiple names . struct Bid { address bidOwner; uint bidAmount; bytes32 nameEntity; } mapping(bytes32 => Bid[]) highestBidder; So, as you can see above, Bid struct holds data for one bidder, similarly, the key (eg. myName) in

How to await a json return value (the return takes at least 30 seconds) before logging it? javascript/react/express

隐身守侯 提交于 2019-12-14 04:06:09
问题 This is a follow up to these threads: How to set state of a react component with a specific item from a returned json object? How to return json data to a react state? I am using web3 to sign a transaction on Ethereum , which then sends a json object with transaction data. The json takes at least 30 seconds to return. I am trying to console.log() the data with the following code: axios.post( "http://compute.amazonaws.com:3000/users", { value: "value", fileName: "fileName", hash: "hash" } )

How to connect to Ethereum URLs created using AWS blockchain template

白昼怎懂夜的黑 提交于 2019-12-13 08:55:58
问题 I've just finished setting up a Ethereum Stack using the AWS Blockchain Template according to the docs here I've sshed to the EC2 instance (bastion host) from my local machine and I can hit the EthStats URL via curl from the bastion host but when I try to go tot he url from chrome, it gives 'This site can’t be reached' error, even though I've setup a FireProxy as per the instructions in the docs. How do I connect to the Ethereum URLs given in outputs of my Ethereum stack in the AWS

geth never stop syncing on rinkeby testnet

自作多情 提交于 2019-12-13 03:57:39
问题 when the currentBlock becomes close to the highestBlock, it stop growing, and the highestBlock begin to grow. A while later, the currentBlock begin growing again. I run geth with command geth --rinkeby --fast . the highestBlock on my geth is very close to the actual number on https://www.rinkeby.io/#faucet. > eth.syncing { currentBlock: 2401750, highestBlock: 2401826, knownStates: 14219701, pulledStates: 14205841, startingBlock: 2401554 } > eth.blockNumber 0 logs below, seems normal: INFO [06