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