Datahalowallett (DXT)项目和其他类似的项目有什么不同?

Datawallet和新互联网的兴起(第一部分)
自我主权的钱包如何开启互联网的未来,这对社会意味着什么  Datawallet是对当下数据经纪人制度具有划时代意义的替代产品,是区块链技术的突破性应用,可为数据的创造者和消费者提供变革性的服务。
随着对数据需求量的急剧增加,以及由摩尔定律驱动的加速计算能力,机器学习和人工智能等新兴领域将彻底改变我们生活的方方面面——从自动驾驶汽车到AI oracles。然而,由于人工智能产品的功能很大程度上依赖于系统中输入的数据的质量和数量,现在的人工智能产品尚未达到最大潜能。目前,人工智能系统需要用户完成繁重的数据创建过程,从而建立系统对每个特定用户的数据集。这种粗糙的用户体验对于强大的人工智能系统而言是一个巨大的阻碍。用户不愿花费大量的时间,且该服务提供的好处也不是立竿见影的。Datawallet打破了这些繁琐的阻碍。
但Datawallet究竟是什么?它凭借什么变成了一个家喻户晓的名字?在接下来的两部分内容中,我们将全面详细地向你介绍Datawallet。
Datawallet究竟是什么?
  Datawallet的用户授权数据交换
Datawallet是以区块链技术为基础的数据交换,用户可以对自己创造的数据进行管理并从中获利。这可以通过货币化的方式,即赚取专有的网络代币DXT,也可以通过非货币化的方式,即通过数据分享换取个性化的服务。Datawallet给予了用户完全的数据自主权,同时开发商和数据消费者可以获得高质量数据。在Datawallet的市场中,数据消费者使用数据交换代币(DXT)及智能化数据加密合约,直接从数据创造者那里购买数据,保证了交易双方的安全性和透明度。DXT将驱动整个销售市场,作为数字化资产,它的价格将会反应数据的价值。Datawallet也将会提供一个数据API,使开发商可以充分利用新数据的价值来创造行业领先的应用程序。Datawallet是一个催化剂,改变数据经济的基本原理,永远改变人们对日常生活中使用数据的看法。
在接下来的章节中,我们将重点关注我们究竟为什么需要Datawallet。
我们在讨论的数据有多少?
  网络用户YOY vs. 数据创造和消费总量
答案是非常多,而且每天都在增加。数据在高速膨胀式地增长,同时变得越来越值钱。到2022年,数据将成为地球上最有价值的资源。和大部分的资源不同,数据是完全私人化的:它的所有权明显归属于数据的创造者。我们创造数据的速度很慢,但可以肯定的是这些数据将会成为我们拥有的最值钱的资产。令人震惊的是,90%的数据都是在过去两年中创造的,且数据市场每年在以27%的速度扩张。2012年,参议院科学、商业及交通委员会估计数据经纪市场价值1560亿美元。这是美国当年赌场业收入的四倍,比世界上70%的国家GDP都高。
这些数据值钱吗?
  家庭入息中位数vs. 数据价值对于家庭入息中位数的占比
答案是:非常值钱。基于2012年以来对数据经纪市场预测的不断增长,我们发现,当下美国国民每年的平均个人数据价值大约是1600美元。这意味着对于家庭入息中位数,是2.8%的增长。由于美国18到20岁的千禧一代的高互联网消费,如果自己进行数据经纪业务,他们每年能创造2600美元。到2022年,这个数字预计将增长到平均每人每年6700美元,而千禧一代的人均收入为10900美元。
这些钱的去向是哪里?
  图片来源:《纽约客》
数据经纪商。当下的数据经纪市场是一个每年产生数十亿美元的行业,但数据创造者们不会因为他们创造的价值而获得金钱收益。他们需要通过冗长而复杂的条款来获得收益。数据创造者们不能查看自己的资料,他们几乎不知道别人从他们那里收集了什么数据,也不知道数据收集者对他们的行为、特征和个性做出了什么推断。Datawallet将帮助创作者更好地理解他们自己的数据,同时为他们提供安全的市场,让他们可以愉悦地销售这些数据。此外,当下的市场还有明显的安全和隐私方面的隐患。尽管提供了一个广泛的安全表面区域,云托管仍是物联网和社交媒体存储的默认设置。为了确保数据的安全性和隐私性,用户需要一个合适的需求工程框架。
至少目前购买数据的人非常开心满足!
并非如此。从以下三个方面而言,数据共享经济对于数据消费者而言也具有一定功能性的障碍:
  孤岛问题
首先,单个用户生产的数据分散在多个不同的平台上,并且没有标准化的标识符将它们绑定到一起并链接到用户。因此,数据经纪人会使用概率模型来估计某项数据属于某个给定用户的可能性。这些高度易错的模型导致了使用者对目标受众的误解、广告传递的错误,以及数百万美元的浪费。这就是我们所说的孤岛问题。
  Facebook隐私设置按年计
其次,数据经纪人销售的数据要么是公开的,要么是通过第三方协议授权给他们的。然而,这些数据只占所有个人在线数据非常小的一部分。这种质量问题导致他们提供的数据集缺乏关键的信息维度,从而使得使用数据的企业结论高度一致且洞察力不准确。
第三,当前的数据经纪模式会受道德问题影响。个人用户不知道是谁在购买他们数据,买他们数据的哪一部分——即谁买了数据以及为什么要买数据,同时他们也不被包含在价值链中,不能从他们创造的数据获得经济补偿。虽然这不是一个公开的普遍争论的话题,但正是因为道德规范问题,数据经纪成为了我们现代社会最紧迫的社会经济问题之一。
而这正是Datawallet所要解决的问题。
  在这一看法的基础上,我们可以改变当前有缺陷的数据生态系统——数据交换应该建立在用户同意的基础上。在此基础上,我们开发了一种数据生态系统,它可以给予用户数据自主权,并为数据消费者提供更好的数据——从而实现双赢!
在下一个推送中,我们将会具体介绍数据生态系统是如何实现双赢。币风 - 为你连接一万个节点
币风,是全球领先的区块链价值链接平台!致力于让区块链行业的全球雇主与全球人才实现无缝合作,让更多的区块链项目与全球资源得到高效的精准对接。
快速众测响应,提升用户体验
定量定点定位投放糖果促进转化
最大化提升信息曝光度和精准度
精准拉新,使用户呈指数型增长
特定加粉,真实粉丝留存率高
在线答题互动,直接筛选目标用户
高效数据采集,让调查更明确
安全有效快速提高人气吸引流量
独创的智能系统
基于场景和用户导向的定制化、模块化的任务接入,搭配AI引擎制动。
去中心化模式
基于区块链技术实现点对点价值服务,自主灵活,交易安全,运营高效
数据质量精准
多重数据审核质检机制、人工智能+算法参与,确保数据质量有效
海量资源智选
智能推荐引擎实现资源高效精准匹配,跨终端全服务价值链条
节点价值服务
首创价值网络节点的动态评价体系,节点密切,穿透式追溯,价值互联
处理流程高效
强大的平台功能和多样化工具,千万级数据标注处理能力,7*24小时服务
BTCTRADE.IM
OKCoin币行
众包合作:
咨询合作:
电报群:t.me/coinwind
客服邮箱:
币风公众号
币风小程序
友情链接:
Copyright (C) 2016 北京钒钛氪国际文化限公司 | 京ICP备号1.3k 次阅读
标签:至少1个,最多5个
本文通过宏观和微观两个层面窥探以太坊底层执行逻辑。宏观层面描述创建并运行一个小型带钱包的发币APP的过程,微观层面是顺藤摸瓜从http api深入go-ethereum源码执行过程。
分析思路:自上而下,从APP深入EVM。
从应用入手,如果一头扎进ethereum,收获的可能是纯理论的东西,要想有所理解还得结合以后的实践才能恍然大悟。所以我始终坚持从应用入手、自上而下是一种正确、事半功倍的方法论。
我在讲解以太坊基础概念的那篇专题文章里,用的是从整体到局部的方法论,因为研究目标就是一个抽象的理论的东西,我对一个全然未知的东西的了解总是坚持从整体到局部的思路。
项目创建、部署合约到私链
之前用truffle框架做项目开发,这个框架封装了合约的创建、编译、部署过程,为了研究清楚自上至下的架构,这里就不用truffle构建项目了。
项目前端基于vue,后端是geth节点,通过web3 http api通信。
开发vue、solidity等前端IDE还是webstorm好,Atom和goland就免了不太好用!
1、全局安装vue-cli
npm i -g vue-cli
2、初始化一个基于webpack的vue项目
vue init webpack XXXProject
3、项目里安装web3依赖
web3.js是ethereum的javascript api库,通过rpc方式与以太坊节点交互。
npm install --save web3@1.0.0-beta.34
尽量用npm安装,不要用cnpm,有时候是个坑玩意,会生成“_”开头的很多垃圾还要求各种install。也可以写好了package.json,删除node_modules文件夹,再执行npm i。web3版本用1.0以上,和1.0以下语法有很大不同。
4、项目里创建全局web3对象
用vuex有点啰嗦,这里就写个vue插件,提供全局的web3对象。
import Web3 from "web3"
export default {
install: function (Vue, options) {
var web3 = window.web3
if (typeof web3 !== 'undefined') {
web3 = new Web3(web3.currentProvider)
web3 = new Web3(new Web3.providers.HttpProvider('http://localhost:8545'))
Vue.prototype.$web3 = web3
在main.js里启用该插件,以后就可以这样使用this.$web3这个全局对象了。
Vue.use(插件名)
5、写一个ERC20合约
项目全部代码地址:\
6、编译&部署合约
有必要说明一下编译和部署方式的选择,它严重关系到你实际项目的开发:
1)使用Remix,把自己写好的合约拷贝到Remix里进行编译和部署。这种方式最方便。\2)使用truffle这类的框架,这种方式是需要项目基于框架开发了,编译和部署也是在truffle控制台进行。\3)基于web3和solc依赖,写编译(solc)和部署(web3)程序,这些代码就独立(vue是前端,nodejs是后端,运行环境不同)于项目了,用node单独运行。\4)本地安装solidity进行编译,部署的话也需要自己想办法完成。\5)使用geth钱包、mist等编译部署。\……
从geth1.6.0开始,剥离了solidity编译函数,所以web3也不能调用编译方法了。可以本地安装solidity带编译器,也可以在项目里依赖solc进行编译。
编译部署的方式眼花缭乱,这里选择方式3。
编译部署参考代码(web3的1.0及以上版本):token_deploy.js
const Web3 = require('web3')
const fs = require('fs')
const solc = require('solc')
const web3 = new Web3(new Web3.providers.HttpProvider("http://localhost:8545"));
const input = fs.readFileSync('../contracts/Token.sol');
const output = solc.compile(input.toString(), 1);
fs.writeFile('../abi/Token.abi', output.contracts[':Token'].interface, err =& {
if (err) {
console.log(err)
const bytecode = output.contracts[':Token'].
const abi = JSON.parse(output.contracts[':Token'].interface);
const tokenContract = new web3.eth.Contract(abi);
let log = {
time: new Date(Date.now()),
transactionHash: '',
contractAddress: ''
// 部署合约
tokenContract.deploy({
data: '0x' + bytecode,
arguments: ['', '魔法币', 'MFC'] // Token.sol构造参数
from: '0x2d2afb7d0ef71f85dfbdc89d288cb3ce8e049e10', //写你自己的矿工(发币)地址
gas: 5000000, // 这个值很微妙
}, (err, transactionHash) =& {
if (err) {
console.log(err);
log.transactionHash = transactionHash
.on('error', error =& {
console.log(error);
// 不是总能成功获取newContractInstance, 包括监听receipt也可能发生异常,原因是receipt获取时机可能发生在交易未完成前。
.then(function (newContractInstance) {
if(newContractInstance){
log.contractAddress = newContractInstance.options.address
fs.appendFile('Token_deploy.log',JSON.stringify(log) + '\r\n', err =& {
if (err) {
console.log(err)
7、在执行部署脚本前,需要有一个账户并解锁,在geth控制台执行以下命令:
personal.newAccount('密码')
personal.unlockAccount(eth.coinbase,'密码','20000')
8、发布合约是需要eth币的,所以先挖矿弄点以太币:
miner.start()
9、现在可以执行编译部署脚本了:
node token_deploy.js
如果前面miner.stop()过,那么在执行部署的时候,要确保miner.start(),有矿工打包才能出块。\这里还要知道,因为就是本矿工账户创建合约,所以交易费又回到了本账户,因此余额看起来总是没有减少。
至此,我们已经在私链上部署了一个合约,产生了一笔交易(即创建合约本身这个交易)、一个矿工账户、一个合约账户。
Error: insufficient funds for gas * price + value
意思是账户里没有足够的eth币,给创建合约的账户里弄些比特币。
Error: intrinsic gas too low
调高以下发布合约时的gas值。
Error: Invalid number of parameters for "undefined". Got 0 expected 3! (类似这样的)
没有传入合约构造函数参数
调用链上合约
合约部署成功,就有了合约地址,根据合约地址构建合约实例。
let tokenContract = new this.$web3.eth.Contract(JSON.parse(abi),'合约地址')
tokenContract.methods.myMethod.
call()调用的都是abi里的constant方法,即合约里定义的状态属性,EVM里不会发送交易,不会改变合约状态。
send()调用的是合约里定义的函数,是要发送交易到合约并执行合约方法的,会改变合约状态。
以上就简单说一下,不写太多了。看官可以自行下载本项目源码(上面第5步有github链接),自己运行起来看看界面和发币/转账操作。
源码交易过程分析
当我们在项目中创建一个合约的时候,发生了什么?\geth节点默认开放了8545 RPC端口,web3通过连接这个rpc端口,以http的方式调用geth开放的rpc方法。从这一web3与以太坊节点交互基本原理入手,先分析web3源码是怎样调用rpc接口,对应的geth接口是否同名,再看geth源码该接口又是怎么执行的。
new web3.eth.Contract(jsonInterface[, address][, options])
这个函数,jsonInterface就是abi,不管传不传options,options.data属性总是abi的编码。\这个web3接口源码中调用eth.sendTransaction,options.data编码前面加了签名,options.to赋值一个地址,最后返回这笔交易的hash。
再返回上面第6步看一下部署脚本,代码截止到deploy都是在构造web3里的对象,首次与本地geth节点通信的方法是send,它是web3的一个接口方法。
deploy返回的是个web3定义的泛型TransactionObject&Contract&。\Contract对send接口方法的实现如下:
var sendTransaction = (new Method({
name: 'sendTransaction',
call: 'eth_sendTransaction',
params: 1,
inputFormatter: [formatters.inputTransactionFormatter],
requestManager: _this._parent._requestManager,
accounts: Contract._ethAccounts, // is eth.accounts (necessary for wallet signing)
defaultAccount: _this._parent.defaultAccount,
defaultBlock: _this._parent.defaultBlock,
extraFormatters: extraFormatters
})).createFunction();
return sendTransaction(args.options, args.callback);
这个send最终由XMLHttpRequest2的request.send(JSON.stringify(payload))与节点通信。
var sendSignedTx = function(sign){
payload.method = 'eth_sendRawTransaction';
payload.params = [sign.rawTransaction];
method.requestManager.send(payload, sendTxCallback);
所以send方法对应的节点api是eth_sendRawTransaction。
go-ethereum/ethclient/ethclient.go
func (ec *Client) SendTransaction(ctx context.Context, tx *types.Transaction) error {
data, err := rlp.EncodeToBytes(tx)
if err != nil {
return err
return ec.c.CallContext(ctx, nil, "eth_sendRawTransaction", common.ToHex(data))
找到该api执行入口\go-ethereum/internal/ethapi.SendTransaction
func (s *PublicTransactionPoolAPI) SendTransaction(ctx context.Context, args SendTxArgs) (common.Hash, error) {
// Look up the wallet containing the requested signer
account := accounts.Account{Address: args.From}
wallet, err := s.b.AccountManager().Find(account)
if err != nil {
return common.Hash{}, err
return submitTransaction(ctx, s.b, signed)
我们在这个函数处打一个断点!然后执行部署脚本(可以多次执行),运行到断点处:
要调试geth需要对其重新编译,去掉它原来编译的优化,参见下面“调试源码”一节。
(dlv) p args
github.com/ethereum/go-ethereum/internal/ethapi.SendTxArgs {
From: github.com/ethereum/go-ethereum/common.Address [45,42,251,125,14,247,31,133,223,189,200,157,40,140,179,206,142,4,158,16],
To: *github.com/ethereum/go-ethereum/common.Address nil,
Gas: *5000000,
GasPrice: *github.com/ethereum/go-ethereum/common/hexutil.Big {
neg: false,
abs: math/big.nat len: 1, cap: 1, [],},
Value: *github.com/ethereum/go-ethereum/common/hexutil.Big nil,
Nonce: *github.com/ethereum/go-ethereum/common/hexutil.Uint64 nil,
Data: *github.com/ethereum/go-ethereum/common/hexutil.Bytes len: 2397, cap: 2397, [96,96,96,64,82,96,2,128,84,96,255,25,22,96,18,23,144,85,52,21,97,0,28,87,96,0,128,253,91,96,64,81,97,8,125,56,3,128,97,8,125,131,57,129,1,96,64,82,128,128,81,145,144,96,32,1,128,81,130,1,145,144,96,32,...+2333 more],
Input: *github.com/ethereum/go-ethereum/common/hexutil.Bytes nil,}
(dlv) p wallet
github.com/ethereum/go-ethereum/accounts.Wallet(*github.com/ethereum/go-ethereum/accounts/keystore.keystoreWallet) *{
account: github.com/ethereum/go-ethereum/accounts.Account {
Address: github.com/ethereum/go-ethereum/common.Address [45,42,251,125,14,247,31,133,223,189,200,157,40,140,179,206,142,4,158,16],
URL: (*github.com/ethereum/go-ethereum/accounts.URL)(0xc),},
keystore: *github.com/ethereum/go-ethereum/accounts/keystore.KeyStore {
storage: github.com/ethereum/go-ethereum/accounts/keystore.keyStore(*github.com/ethereum/go-ethereum/accounts/keystore.keyStorePassphrase) ...,
cache: *(*github.com/ethereum/go-ethereum/accounts/keystore.accountCache)(0xc),
changes: chan struct {} {
qcount: 0,
dataqsiz: 1,
buf: *[1]struct struct {} [
elemsize: 0,
closed: 0,
elemtype: *runtime._type {
ptrdata: 0,
fieldalign: 1,
kind: 153,
alg: *(*runtime.typeAlg)(0x59e69d0),
gcdata: *1,
str: 67481,
ptrToThis: 601472,},
recvq: waitq&struct {}& {
first: *(*sudog&struct {}&)(0xc42006ed20),
last: *(*sudog&struct {}&)(0xc42006ed20),},
sendq: waitq&struct {}& {
first: *sudog&struct {}& nil,
last: *sudog&struct {}& nil,},
lock: runtime.mutex {key: 0},},
unlocked: map[github.com/ethereum/go-ethereum/common.Address]*github.com/ethereum/go-ethereum/accounts/keystore.unlocked [...],
wallets: []github.com/ethereum/go-ethereum/accounts.Wallet len: 2, cap: 2, [
updateFeed: (*github.com/ethereum/go-ethereum/event.Feed)(0xc),
updateScope: (*github.com/ethereum/go-ethereum/event.SubscriptionScope)(0xc),
updating: true,
mu: (*sync.RWMutex)(0xc4202c40cc),},}
(dlv) p s.b
github.com/ethereum/go-ethereum/internal/ethapi.Backend(*github.com/ethereum/go-ethereum/eth.EthApiBackend) *{
eth: *github.com/ethereum/go-ethereum/eth.Ethereum {
config: *(*github.com/ethereum/go-ethereum/eth.Config)(0xc),
chainConfig: *(*github.com/ethereum/go-ethereum/params.ChainConfig)(0xc),
shutdownChan: chan bool {
qcount: 0,
dataqsiz: 0,
buf: *[0]bool [],
elemsize: 1,
closed: 0,
elemtype: *runtime._type {
ptrdata: 0,
fieldalign: 1,
kind: 129,
alg: *(*runtime.typeAlg)(0x59e69e0),
gcdata: *1,
str: 21072,
ptrToThis: 452544,},
recvq: waitq&bool& {
first: *(*sudog&bool&)(0xc),
last: *(*sudog&bool&)(0xc),},
sendq: waitq&bool& {
first: *sudog&bool& nil,
last: *sudog&bool& nil,},
lock: runtime.mutex {key: 0},},
stopDbUpgrade: nil,
txPool: *(*github.com/ethereum/go-ethereum/core.TxPool)(0xc),
blockchain: *(*github.com/ethereum/go-ethereum/core.BlockChain)(0xc),
protocolManager: *(*github.com/ethereum/go-ethereum/eth.ProtocolManager)(0xc),
lesServer: github.com/ethereum/go-ethereum/eth.LesServer nil,
chainDb: github.com/ethereum/go-ethereum/ethdb.Database(*github.com/ethereum/go-ethereum/ethdb.LDBDatabase) ...,
eventMux: *(*github.com/ethereum/go-ethereum/event.TypeMux)(0xc),
engine: github.com/ethereum/go-ethereum/consensus.Engine(*github.com/ethereum/go-ethereum/consensus/ethash.Ethash) ...,
accountManager: *(*github.com/ethereum/go-ethereum/accounts.Manager)(0xc),
bloomRequests: chan chan *github.com/ethereum/go-ethereum/core/bloombits.Retrieval {
qcount: 0,
dataqsiz: 0,
buf: *[0]chan *github.com/ethereum/go-ethereum/core/bloombits.Retrieval [],
elemsize: 8,
closed: 0,
elemtype: *runtime._type {
ptrdata: 8,
fieldalign: 8,
alg: *(*runtime.typeAlg)(0x59e6a10),
gcdata: *1,
str: 283111,
ptrToThis: 0,},
recvq: waitq&chan *github.com/ethereum/go-ethereum/core/bloombits.Retrieval& {
first: *(*sudog&chan *github.com/ethereum/go-ethereum/core/bloombits.Retrieval&)(0xc),
last: *(*sudog&chan *github.com/ethereum/go-ethereum/core/bloombits.Retrieval&)(0xc),},
sendq: waitq&chan *github.com/ethereum/go-ethereum/core/bloombits.Retrieval& {
first: *sudog&chan *github.com/ethereum/go-ethereum/core/bloombits.Retrieval& nil,
last: *sudog&chan *github.com/ethereum/go-ethereum/core/bloombits.Retrieval& nil,},
lock: runtime.mutex {key: 0},},
bloomIndexer: unsafe.Pointer(0xc),
ApiBackend: *(*github.com/ethereum/go-ethereum/eth.EthApiBackend)(0xc),
miner: *(*github.com/ethereum/go-ethereum/miner.Miner)(0xc),
gasPrice: *(*math/big.Int)(0xc),
etherbase: github.com/ethereum/go-ethereum/common.Address [45,42,251,125,14,247,31,133,223,189,200,157,40,140,179,206,142,4,158,16],
networkId: 13,
netRPCService: *(*github.com/ethereum/go-ethereum/internal/ethapi.PublicNetAPI)(0xc42007feb0),
lock: (*sync.RWMutex)(0xc),},
gpo: *github.com/ethereum/go-ethereum/eth/gasprice.Oracle {
backend: github.com/ethereum/go-ethereum/internal/ethapi.Backend(*github.com/ethereum/go-ethereum/eth.EthApiBackend) ...,
lastHead: github.com/ethereum/go-ethereum/common.Hash [139,147,220,247,224,227,136,250,220,62,217,102,160,96,23,182,90,90,108,254,82,158,234,95,150,120,163,5,61,248,168,168],
lastPrice: *(*math/big.Int)(0xc),
cacheLock: (*sync.RWMutex)(0xc),
fetchLock: (*sync.Mutex)(0xc),
checkBlocks: 20,
maxEmpty: 10,
maxBlocks: 100,
percentile: 60,},}
// submitTransaction is a helper function that submits tx to txPool and logs a message.
func submitTransaction(ctx context.Context, b Backend, tx *types.Transaction) (common.Hash, error) {
if err := b.SendTx(ctx, tx); err != nil {
return common.Hash{}, err
if tx.To() == nil {
signer := types.MakeSigner(b.ChainConfig(), b.CurrentBlock().Number())
from, err := types.Sender(signer, tx)
if err != nil {
return common.Hash{}, err
addr := crypto.CreateAddress(from, tx.Nonce())
log.Info("Submitted contract creation", "fullhash", tx.Hash().Hex(), "contract", addr.Hex())
log.Info("Submitted transaction", "fullhash", tx.Hash().Hex(), "recipient", tx.To())
return tx.Hash(), nil
(dlv) p tx
*github.com/ethereum/go-ethereum/core/types.Transaction {
data: github.com/ethereum/go-ethereum/core/types.txdata {
AccountNonce: 27,
Price: *(*math/big.Int)(0xc),
GasLimit: 5000000,
Recipient: *github.com/ethereum/go-ethereum/common.Address nil,
Amount: *(*math/big.Int)(0xc),
Payload: []uint8 len: 2397, cap: 2397, [96,96,96,64,82,96,2,128,84,96,255,25,22,96,18,23,144,85,52,21,97,0,28,87,96,0,128,253,91,96,64,81,97,8,125,56,3,128,97,8,125,131,57,129,1,96,64,82,128,128,81,145,144,96,32,1,128,81,130,1,145,144,96,32,...+2333 more],
V: *(*math/big.Int)(0xc),
R: *(*math/big.Int)(0xc),
S: *(*math/big.Int)(0xc),
Hash: *github.com/ethereum/go-ethereum/common.Hash nil,},
hash: sync/atomic.Value {
noCopy: sync/atomic.noCopy {},
v: interface {} nil,},
size: sync/atomic.Value {
noCopy: sync/atomic.noCopy {},
v: interface {} nil,},
from: sync/atomic.Value {
noCopy: sync/atomic.noCopy {},
v: interface {} nil,},}
0xd9248 in github.com/ethereum/go-ethereum/internal/ethapi.submitTransaction
at ./go/src/github.com/ethereum/go-ethereum/internal/ethapi/api.go:1130
0xd9bd1 in github.com/ethereum/go-ethereum/internal/ethapi.(*PublicTransactionPoolAPI).SendTransaction
at ./go/src/github.com/ethereum/go-ethereum/internal/ethapi/api.go:1176
(dlv) frame 0 l
& github.com/ethereum/go-ethereum/internal/ethapi.submitTransaction() ./go/src/github.com/ethereum/go-ethereum/internal/ethapi/api.go:1130 (PC: 0x48d9248)
Warning: debugging optimized function
if err := b.SendTx(ctx, tx); err != nil {
return common.Hash{}, err
if tx.To() == nil {
signer := types.MakeSigner(b.ChainConfig(), b.CurrentBlock().Number())
from, err := types.Sender(signer, tx)
if err != nil {
return common.Hash{}, err
addr := crypto.CreateAddress(from, tx.Nonce())
log.Info("Submitted contract creation", "fullhash", tx.Hash().Hex(), "contract", addr.Hex())
(dlv) frame 1 l
Goroutine 3593 frame 1 at /Users/jiang/go/src/github.com/ethereum/go-ethereum/internal/ethapi/api.go:1176 (PC: 0x48d9bd1)
signed, err := wallet.SignTx(account, tx, chainID)
if err != nil {
return common.Hash{}, err
return submitTransaction(ctx, s.b, signed)
// SendRawTransaction will add the signed transaction to the transaction pool.
// The sender is responsible for signing the transaction and using the correct nonce.
func (s *PublicTransactionPoolAPI) SendRawTransaction(ctx context.Context, encodedTx hexutil.Bytes) (common.Hash, error) {
先把调试结果展示出来,通过对一个交易的内部分析,可以了解EVM执行的大部分细节,此处需要另开篇幅详述。请关注后续专题。
1、重新强制编译geth,去掉编译内联优化,方便跟踪调试。
cd path/go-ethereum
sudo go install -a -gcflags '-N -l' -v ./cmd/geth
编译后的geth执行文件就在$gopath/bin下。
2、在datadir下启动这个重新编译后的geth
geth --datadir "./" --rpc --rpccorsdomain="*" --networkid 13
console 2&&00.glog
3、调试这个进程
dlv attach &gethPid&
4、给交易api入口函数设置断点
b ethapi.(*PublicTransactionPoolAPI).SendTransaction
下面是一个区块链小程序,供大家参考。
2 收藏&&|&&4
分享到微博?
我要该,理由是:
在 SegmentFault,学习技能、解决问题
每个月,我们帮助 1000 万的开发者解决各种各样的技术问题。并助力他们在技术能力、职业生涯、影响力上获得提升。

我要回帖

更多关于 苹果手机wallet在哪里 的文章

 

随机推荐