首页 > 解决方案 > 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:

1

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.

标签: luabitcoinroblox

解决方案


推荐阅读