answerstu

blockchain - Transfer function not working as expected in solidity

Considering below code mapping (address => uint256) public balanceOf;event Transfer(address indexed from, address indexed to, uint256 value);function _transfer(address _from, address _to, uint _value) internal { require(_to != 0x0); require(balanceOf[_from] >= _value); balanceOf[_from] -= _value; balanceOf[_to] += _value; Transfer(_from, _to, _value);}function sell(uint256 amount) public { require(this.balance >= amount * sellPrice); _transfer(msg.sender, this, amount); msg.sender.transfer(amount *...Read more

blockchain - Gas required exceeds limit: 3000000.

pragma solidity ^0.4.16;contract createNewToken { uint256 total_ether_to_send; address private owner; //constructor function createNewToken() public{ owner = msg.sender; } // client request for tokens by sending ether. function requestForToken() public payable{ address sender = msg.sender; uint value = msg.value; total_ether_to_send = value; require(sender.balance >= total_ether_to_send); owner.transfer(total_ether_to_send); total_ether_to_send = value / 2; require(...Read more

IPFS, blockchain and file searching questions

I'm an absolute beginner in the field and had a couple of questions that I'm really looking forward to having answers to.Is IPFS a distributed or a decentralized file system? Which one of these options is more suitable to file systems in general?Is there a record of all the hashes on the ipfs network? How does my request travel through the network?How could blockchain fit in with IPFS? Has it been implemented already?...Read more

blockchain - IPFS only connect with specified Nodes

we know we can connect and disconnect with specified nodes in IPFS i.eipfs swarm connect /ip4/104.236.176.52/tcp/4001/ipfs/QmSoLnSGccFuZQJzRadHn95W2CrSFmZuTdDWP8HXaHca9zBut what i want to look into is that i only specified or some sort of authorized nodes. Because i want to share my data with only some specified nodes....Read more

blockchain - What are detailed differences between IPFS vs Storj vs Sia vs Filecoin vs Maidsafe? And which one is the best to use for dapps?

I found lots of decentralized data storage out there but I am a little bit confused about these services. I am not able to figure out which service is best in which scenario? If anyone knows any examples related these then please give. I have found two examples: IPFS is used by steemit dapps(like dtube).Swarm is used by ethereum based projects with the help of web3 API.Sorry If I have asked any silly thing. I am the beginner of it and I have just started exploring blockchain stuff.Thanks...Read more

blockchain - What contract is used in Istanbul consensus mechanism in JP Morgan Quorum?

In "7nodes" installation example from JPMorgan Quorum github is used such a genesis file ("istanbul-genesus.json"):{"alloc": { "0x0000000000000000000000000000000000000020": { "code": "0x606060405236156100c45760e060020a60003504631290948581146100c9578063284d163c146100f957806342169e4814610130578063488099a6146101395780634fe437d514610154578063559c390c1461015d57806368bb8bb61461025d57806372a571fc146102c857806386c1ff681461036957806398ba676d146103a0578063a7771ee31461040b578063adfaa72e14610433578063cf5289851461044e578063de8fa43114610457578063e814d1c7...Read more

blockchain - Run solidity/deploy ethereum smart contract on a website

Does anyone know if I can deploy my own smart contract or run/host a solidity code via my own website? I am following this Youtube tutorial by Decypher Media.If I'm correct, the testrpc address localhost:8545 means that I am deploying the contract as being part of a private blockchain that is only local to my pc, right? This is the case for development. So if I would want to actually deploy the contract as an actual Ethereum node or to the Ethereum blockchain itself, would I just have to replace the localhost:8545 with the actual URL? I am not ...Read more

blockchain - Handling user profiles in Ethereum DApps

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 of some sort?For example, user A is interested in usin...Read more

Blockchain/IPFS for data sharing between applications

I am going deploy multiple(30+) applications for multiple customers in different cloud environments (AWS, Azure, google cloud, etc) and let them share data with each other. My plan is to use Blockchain/IPFS sort of technology where each customer keeps a copy of the data, and any changes to those data are propagated to all the nodes.The data can be categorized into two types:Public data of each customer are shared and accessed by all applications directly.Private data of each customer are encrypted with the customer's public key before stored an...Read more

Is private token-free blockchains valid solution for one-off services?

We have a customer who thinks that blockchains might help solve his industry-specific problem. To avoid disclosing the business idea, I'll have to be abstract here and use an analogy from healthcare industry, which has very similar specifics. Disclaimer: I'm very new to blockchains, so feel free to correct me.Let's imagine, there exists a drug to treat some specific kind of seizures that might occur for some people. This drug can be prescribed only by certified companies. The customer must receive only one dosage of the drug each time he/she ha...Read more

How do clients of a distributed blockchain know about consensus?

I have a basic blockchain I wrote to explore and learn more about the technology. The only real world experience I have with them is in a one-to-one transaction from client to server, as a record of transactions. I'm interested in distributed blockchains now.In its simplest, most theoretical form, how is consensus managed? How do peers know to begin writing transactions on the next block? You have to know when >50% of the entire pool has accepted some last block written. But p2p systems can be essentially unbounded, and you can't trust a third ...Read more

Blockchain Ethereum applications

I'm trying to develop a simple decentralized application on windows, using the tutorial of Ethereum-"DAPPS for beginners". It needs three pieces of software: Alethzero, Mist and Mix. I'm having a lot of problems in different levels because apparently, they stopped working with Alethzero and Mix. Are there any alternatives? Is there a solution to develop a good Dapp, where I can see the most important parts of a blockchain? For instance the mining and the security system?...Read more