我正在尝试在BigchainDB(测试网络)上发布交易。但这给了我以下回应:
{
message: 'HTTP Error: Requested page not reachable',
status: '400 BAD REQUEST',
requestURI: 'https://test.bigchaindb.com/api/v1/transactions?mode=commit'
}
这是我发布交易的方式:
conn.postTransactionCommit(txTransferBobSigned)
.then(res => {
console.log(res);
})
.catch(err => {
console.log(err)
})
这是我准备交易的方式:
const txTransferBob = driver.Transaction.makeTransferTransaction(
// signedTx to transfer and output index
[{ tx: txCreateAliceSimpleSigned, output_index: 0 }],
[driver.Transaction.makeOutput(driver.Transaction.makeEd25519Condition(bob.public))],
{ price: '100 Euros' }
);
而且,这是我签署交易的方式:
var txTransferBobSigned = driver.Transaction.signTransaction(txTransferBob, alice.private);
此外,这是我已签名的交易的样子:
{id:"507186bb75bfe89c244290ac9e11db9e8bc97cf797a2270aa6293042436e3fda",operation:"TRANSFER",outputs:[{condition:{details:{type:"ed25519-sha-256",public_key:"9fuQDKaHk2M5CKHcXpXc6n7eYgZ4pVKhuY2kLdmq4oyt"},uri:"ni:///sha-256;fDMKa1W90-WuMI9BwHQC--AVWmLsv4ZCXMMV2VTqddc?fpt=ed25519-sha-256&cost=131072"},amount:"1",public_keys:["9fuQDKaHk2M5CKHcXpXc6n7eYgZ4pVKhuY2kLdmq4oyt"]}],inputs:[{fulfillment:"pGSAIFz8zOXXf3iBI5rikpfgoC33xgQ3pIFXYrMrnKX9TrQVgUDTLTkkLoi6oGuuLChcDN_3hFpUJ5dn-4XgYVBHMgfrr1Zkn8tIKw9Ppoyp87vH_E9Et_v0eOQsmQfThw-sTckO",fulfills:{output_index:0,transaction_id:"740ee2dbd6641e048c76ef5f07d034a0f326afba105865bac5b7b17215b8bb44"},owners_before:["3GxRGM6RpNsuy9HVWEWWeHhkdq2CLQg7tKAqYKtVQXDw"]}],metadata:{price:"100 Euros"},asset:{id:"740ee2dbd6641e048c76ef5f07d034a0f326afba105865bac5b7b17215b8bb44"},version:"2.0"}
其他信息:
尽管我可以成功创建公钥/私钥对,创建数字资产,对其进行签名并查询资产和元数据,但是postTransactionCommit
是唯一无法使用的密钥对。我了解状态400
表示我提供给该函数的数据有问题,但我无法弄清楚。