簡體   English   中英

無法與 bitcore 測試網連接,出現以下錯誤 525 Origin SSL 握手錯誤

[英]Unable to connect with bitcore testnet getting following error 525 Origin SSL Handshake Error

我正在嘗試在比特幣測試網絡上創建一個交易。 當我運行 insight.getUnspentUtxos() 時,它返回一個錯誤。

var bitcore = require('bitcore-lib');

var explorers = require('bitcore-explorers');
var insight = new explorers.Insight('testnet');

var value = Buffer.from('I am trying to create new private key');
var hash = bitcore.crypto.Hash.sha256(value);
var BN = bitcore.crypto.BN.fromBuffer(hash);
var privateKeyNew = bitcore.PrivateKey(BN, 'testnet')
var myAddress = privateKeyNew.toAddress()
console.log(myAddress);

var newValue = Buffer.from('I am trying to create new private key but that can be risky');
var newhash = bitcore.crypto.Hash.sha256(newValue);
var newBN = bitcore.crypto.BN.fromBuffer(newhash);
var privateKey = bitcore.PrivateKey(newBN, 'testnet')
var address = privateKey.toAddress();
console.log(address);

insight.getUnspentUtxos(myAddress, ( err, utxo ) => {
    if(err) {
        console.log(err);
        return err;
    } else {
        let tx = bitcore.Transaction()
        tx.from(utxo);
        tx.to(address,10000);
        tx.fee(50000);
        tx.change(myAddress);
        tx.sign(privateKeyNew);
        tx.serialize();

        insight.broadcast(tx.toString(), (error, txid) => {
            if(error) {
                return error;
            } else { 
                console.log(txid);
        }
    })
}

})

當 UnspentUtxos() 執行時,它會產生一些長期的大量錯誤。 其中描述了錯誤 525 Origin SSL Hanshake 錯誤

bitcore使用bitpay作為默認的提供商服務器,由於某種原因,它無法正常工作。 他們還建議更改文檔中的默認服務器。 嘗試將提供程序更改為zelcore ,如下所示:

const explorers = require("bitcore-explorers");
const insight = new explorers.Insight("https://explorer.btc.zelcore.io");

更多解釋在這里

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM