ethereum

How to deploy truffle contract to dev network when using inheritance?

自闭症网瘾萝莉.ら 提交于 2020-01-05 07:35:35
问题 I have been attempting to deploy a contract using the Truffle framework, I have recently been testing these contracts on the development network. My contract was very large and when I attempted to deploy it to a test net, I was instructed to split it up so that the contract wouldn't exceed the gas limit. Although, bearing in mind this contract did deploy onto the development network with the default gas limit. So I took out parts of the contract and derived another contract from the base and

以太坊Ethereum存储和数据结构 图示

白昼怎懂夜的黑 提交于 2020-01-04 23:39:11
下图表示以太坊的世界状态前缀树。实现源码可以在这里下载:https://github.com/liangyihuai/understanding_ethereum_trie 这个链接的readme文件还有一个油管视频的链接,推荐观看。 谢谢 reference https://ethereum.stackexchange.com/questions/268/ethereum-block-architecture 来源: CSDN 作者: 梁义怀 链接: https://blog.csdn.net/liangyihuai/article/details/103837566

Private Network : web3.eth.getAccounts() always send empty array

白昼怎懂夜的黑 提交于 2020-01-02 09:58:16
问题 I am running a private Ethereum network. I do use https://aws.amazon.com/blockchain/templates/ The entire setup has been done. Things look setup properly on AWS. Now, I am trying to create the account and retrieve all those accounts. For that, I am using methods as below. Web3Service.js var Web3 = require('web3'); var web3 = new Web3(new Web3.providers.HttpProvider(process.env.NETWORK_URL)); exports.getAccounts = function () { return web3.eth.getAccounts(); }; exports.createAccount = function

Solidity - Solidity code to Input JSON Description

我是研究僧i 提交于 2020-01-02 09:52:41
问题 I want to compile my ehtereum HelloWorld.sol smart contract. In all the tutorials is that you do it like this: var solc = require('solc'); var compiledContract = solc.compile(fs.readFileSync('HelloWorld.sol').toString(); where HelloWorld.sol is: pragma solidity ^0.5.1; contract HelloWorld { bytes32 message; constructor(bytes32 myMessage) public { message = myMessage; } function getMessage() public view returns(bytes32){ return message; } } In other words I put my raw Solidity contract code

Ethereum overview

自闭症网瘾萝莉.ら 提交于 2019-12-28 00:25:12
以太坊综述Ethereum 为什么要学习以太坊? • 庞大的开发者社区,目前最大的区块链开发平台 • 相对较成熟,有代表性,资料众多 • 以应用入手,学习曲线不那么陡峭 • 与JavaScript结合紧密,方便开发人员上手 主要内容 学习目标 • 掌握以太坊的基本概念和工作原理 • 理解以太坊与比特币的联系和区别 • 掌握以太坊客户端的使用 • 深入理解智能合约 • 掌握 Solidity 语法,并能够写出复杂的合约 • 掌握 web3.js 的调用,并能够实现具体的 DApp • 综合运用各种工具,完成较复杂的项目 主要参考资料 《 精通以太坊》( Mastering Ethereum ) 《 以太坊白皮书》 ( A Next-Generation Smart Contract and DecentralizedApplication Platform ) 《以太坊黄皮书》(《以太坊:一种安全去中心化的通用交易账本 拜占庭版本》) 以太坊官方文档 ( Ethereum Homestead Documentation ) Solidity官方文档 涉及工具 • MetaMask - 浏览器插件钱包 • Remix - 基于浏览器的 Solidity 在线编辑器 • Geth -以太坊客户端(go语言) • web3.js – 以太坊 javascipt API库 • Ganache

以太坊

北城余情 提交于 2019-12-27 10:53:56
以太坊是什么? 以太坊(英语:Ethereum)是一个开源的有智能合约功能的公共区块链平台[1][2]。通过其专用加密货币以太币(Ether,又称“乙太币”)提供去中心化的虚拟机(称为“以太虚拟机”Ethereum Virtual Machine)来处理点对点合约。 相较于较大多数其他加密货币或区块链技术,以太坊的特点包括下列: 智能合约(smart contract):存储在区块链上的程序,由各节点运行,需要运行程序的人支付手续费给结点的矿工或权益人。 叔块(uncle block):将因为速度较慢而未及时被收入母链的较短区块链并入。使用的是有向无环图的相关技术。 权益证明(proof-of-stake):相较于工作量证明,可节省大量在挖矿时浪费的电脑资源,并避免特殊应用集成电路造成网络中心化。(尚未实现) 闪电网络(lightning network):可提升交易速度、降低区块链的负担,提高可扩展性。(尚未实现) 开发社区稳固,不断成长,勇于使用硬分叉(hard fork)。 以太坊最初由 Vitalik Buterin 在2013年提出。Vitalik 本是一名参与比特币社区的程序员,曾向比特币核心开发人员主张比特币平台应该要有个更完善的编程语言让人开发程序,但未得到他们的同意,因此决定开发一个新的平台作此用途。Buterin

docker+geth运行以太坊私有链

霸气de小男生 提交于 2019-12-26 23:59:26
以太坊 基本介绍 ​ 官方文档 ​ 以太坊(Ethereum)是将比特币中的一些技术和概念运用于计算领域的一项创新。 ​ 以太坊利用了很多跟比特币类似的机制(比如区块链技术和 P2P 网络),来维护一个共享的计算平台,这个平台可以灵活且安全地运行用户想要的任何程序(当然也包括类似比特币的区块链程序)。 geth+docker运行以太坊私有链 geth项目地址:https://github.com/ethereum/go-ethereum 1. 拉取geth镜像 go pull ethereum/client-go [ devops@gen dapp ] $ docker images REPOSITORY TAG IMAGE ID CREATED SIZE ethereum/client-go latest dafcf40ec9c0 6 days ago 41.3MB 2. 新建挂载目录及部分文件 [ devops@gen dapp ] $ pwd /home/devops/docker-instances/geth/dapp [ devops@gen dapp ] $ ls data debug.log genesis.json init.sh miner init.sh文件内容: #!/bin/sh #初始化创世区块 geth -datadir /workspace/dapp

My ethereum balance returns 0 when checked via geth, but according to etherchain it has a value

给你一囗甜甜゛ 提交于 2019-12-25 08:48:19
问题 I have the exact same problem as described here but the solution doesn't help (so don't flag this post). Instead of the other post, I think my connectivity works fine. At least I get a number higher than 0 when I enter net.peerCount . Furthermore I waited 24h+ connected to the ether network. What am I missing? What am I doing wrong? When I type geth attach it tells me that the parameter at block: 0 (Thu, 01 Jan 1970 01:00:00 CET)... maybe this is the problem? My OS time is correct. 回答1: If

how to use json rpc with curl on java

霸气de小男生 提交于 2019-12-25 03:24:29
问题 i set the private ethereum on my local computer and run as geth --bootnodes="enode://b115ff8b97f67a6bd8294a4ea277930bf7825e755705e809442885aba85e397313e46528fb662a3828cd4356f600c10599b77822ebd192199b6e5b8cfdb530c4@127.0.0.1:30303" --networkid 15 console --datadir "private-data" --rpcport "8545" --rpc --rpccorsdomain "*" --rpcapi "eth,web3,personal" --rpcaddr 192.168.44.114 and then i connect here with the remote computer's blockchain nodes i want to use ethereum json rpc with curl on java . i

Error: new BigNumber() not a number: [object Object]

馋奶兔 提交于 2019-12-24 21:05:59
问题 Getting BigNumber Error .. tried almost everything This is the web3js function call creditPoints: function() { var self = this; alert("Credit Coins"); this.setStatus("Initiating transaction... (please wait)"); var meta; MetaCoin.deployed().then(function(instance) { meta = instance; //alert("credit Points"); alert(account); return meta.creditCoin( account, {from: account,gas: 300000}); }).then(function() { console.log("Transaction complete"); self.setStatus("Transaction complete!"); // self