博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
以太坊 获取合约返回值_从命令行获取以太坊值
阅读量:2512 次
发布时间:2019-05-11

本文共 2428 字,大约阅读时间需要 8 分钟。

以太坊 获取合约返回值

Ethereum

Last year I got big into Bitcoin; today I own a few dozen bitcoin and am loving my return.  Recently I've been hearing big things about Ethereum, another cryptocurrency.  Ethereum is in its infancy and has recently due to a hack but hey -- at its roughly $10 value now, if it ever hits bitcoin-type heights, you could be in for a great return on investment.  A while back I wrote a few scripts to so I thought I'd repeat that post for getting Ether value!

去年,我热衷于比特币。 今天,我拥有几十个比特币,并且热爱我的回报。 最近,我听到了关于另一种加密货币以太坊的大事。 以太坊处于起步阶段,由于黑客攻击,最近 ,但嘿-以其现在的约10美元的价值,如果它达到了比特币的高度,您可能会获得巨大的投资回报率。 前一阵子我写了一些脚本来所以我想我会重复文章来获得以太价值!

从命令行获取以太值 (Get Ether Value from Command Line)

I use a snippet of python to to grab the value of ether from command line:

我使用一小段python从命令行获取ether的值:

curl -s https://coinmarketcap-nexuist.rhcloud.com/api/eth | python -c "import json, sys; print(json.load(sys.stdin)['price']['usd']")

Since you buy ether with bitcoin, getting its bitcoin value may be more of value:

由于您购买了带有比特币的以太币,因此获取其比特币价值可能更有价值:

curl -s https://coinmarketcap-nexuist.rhcloud.com/api/eth | python -c "import json, sys; print(json.load(sys.stdin)['price']['btc'])"

通过Node.js获得任何价值 (Get Either Value with Node.js)

You can use a library like Request for making the API request but to avoid dependency you can use the base Node.js API:

您可以使用诸如Request之类的库来发出API请求,但为避免依赖,可以使用基本的Node.js API:

var http = require('http');http.get({        host: 'coinmarketcap-nexuist.rhcloud.com',        path: '/api/eth'        },        function(response) {                // Continuously update stream with data                var body = '';                response.on('data', function(d) { body += d; });                response.on('end', function() {                        // Data reception is done, do whatever with it!                        var parsed = JSON.parse(body);                        console.log(parsed.price.usd);                });        });

Cryptocurrency lovers will hate on me for talking about bitcoin and ether in terms of USD dollar price but I still see these cryptocurrencies as a short term investment right now.  Many online stores don't accept bitcoin yet so I don't see a great application right now.  Whatever your reason for wanting to know the price of ether, these scripts will be what you need!

加密货币爱好者会讨厌我谈论以美元价格表示的比特币和以太坊,但我现在仍将这些加密货币视为短期投资。 许多在线商店还不接受比特币,所以我现在看不到一个很好的应用程序。 无论您想知道以太币价格的原因是什么,这些脚本都是您所需要的!

翻译自:

以太坊 获取合约返回值

转载地址:http://zbvwd.baihongyu.com/

你可能感兴趣的文章
数据企业IBM段仰圣:大数据关键是“分析”
查看>>
Objective C中的札记--字符串连接,@selector中的冒号,时间转换,局部变量
查看>>
Set和存储顺序
查看>>
(function(){}).call(window) 严格模式匿名函数的this指向undefined
查看>>
eclipse运行servlet 时,内嵌浏览器地址错误——加入了包路径的解决方法
查看>>
HIbernate Y映射 Map、list、set
查看>>
Ubuntu双系统启动卡死
查看>>
代码之密
查看>>
XDM、GDM和KDM
查看>>
Java并发编程
查看>>
导致“mysql has gone away”的两种情况
查看>>
DTRACE -MYSQL
查看>>
autoScroll不显示滚动条
查看>>
LabVIEW动态添加控件
查看>>
Azure SQL 数据库与新的数据库吞吐量单位
查看>>
VC++2012编程演练数据结构《13》单链表
查看>>
Yii2简单的 yii2-phpexcel导出
查看>>
ubuntu/deepin 下下载wxpython
查看>>
A011 Activiti工作流程开发的一些统一规则和实现原理(完整版)
查看>>
Apache JServ protocol服务 怎么关闭?
查看>>