lua - How can I fix this erroring Lua BTC Miner? (
问题描述
Im trying to fix the scripts below, in order to mine btc through a roblox game server. However I have hit an error:
You can find all the code here, for reference i included the script names: https://github.com/Jody7/Lua-Bitcoin-Miner
Script (Part of "Main"):
local PreviousBlock = require(game.ServerScriptService.BTC.GetLastBlock)()
local b = Block(PreviousBlock["data"]["hash"], --local b = Block(PreviousBlock["data"]["hash"],
Transactions,
"201893210853",
MerkleRoot,
0)
It requires the script "GetLastBlock", which is the script below. Ive tried multiple API's because the original one was deleted, and none seemed to fix the error. Im not sure if its caused by the API or not.
--[[
Returns the last block mined.
--]]
local hs = game:GetService("HttpService")
local url = "https://api-r.bitcoinchain.com/v1/blocks/10"
return function()
local data = hs:GetAsync(url, true)
return hs:JSONDecode(data)
end
Anyone know how to fix this?? If you need any more info let me know. Thanks!
List of tested API's:
https://api.blockcypher.com/v1/btc/main
https://blockchain.info/latestblock?format=json
http://btc.blockr.io/api/v1/block/info/last (This was the original APi, but the site is down now.
解决方案
推荐阅读
- python - 如何从 BrowserMobProxy 的 har 中解码请求内容?
- php - Yii2 xml文件响应
- javascript - 如果其他输入为空,则防止条带结帐
- laravel - laravel - 按ID和用户ID删除评论不起作用
- php - 我如何在 PHP 上修复 mail() 函数?
- google-apps-script - 我可以根据某个单元格中的数据在谷歌表格中创建多个条件格式吗?
- python - 如何使用 opencv 读取 RGBA
- clojure - Clojure 集和哈希集返回无序值
- r - 有没有办法在 R 中定义“原始”字符串?
- vba - 如何使用vba从数据表中检索特定记录