答案 0 :(得分:0)
您不需要节点sdk来连接Hyperledger。您可以轻松地通过node与hyperledger composer连接。比您可以轻松编写节点代码轻松连接两个Peers
var request = require('request');
var headers = {
'Content-Type': 'application/json',
'Accept': 'application/json'
};
var dataString = '{ \
"$class": "test.User", \
"uid": "01", \
"firstName": "Prateek", \
"lastName": "Tiwari", \
"emailAddress": "prat%40", \
"contactNo": "789", \
"password": "7596.." \
}';
var options = {
url: 'http://localhost:3000/api/test.User',
method: 'POST',
headers: headers,
body: dataString
};
function callback(error, response, body) {
if (!error && response.statusCode == 200) {
console.log(body);
}
}
request(options, callback);