在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称:zoernert/edichain开源软件地址:https://github.com/zoernert/edichain开源编程语言:JavaScript 81.3%开源软件介绍:EDIchainProvides a basic integration for ipfs (storage/distribution) and ethereum blockchain (validation/authorization) based EDI message exchange. All messages are transactions represented within the blockchain. Message data is always encrypted an is not part of the blockchain transaction. Instead a hash of the encrypted content is published into the blockchain. Message data/content is distributed via ipfs.
DemoThere is a cloud demo available at http://139.59.212.222:8088/ - However this is an unprotected environment to quickly see what this package/module is about. Installation
RequirementRequires ipfs daemon to be started.
Requires geth to be started and synced blockchain.
UsageAs moduleBasic var cb = function() {
// YOUR Code to interact
}
var config = {
bootstrap_callback:cb
}
var echain = new edichain.bootstrap(config);
As JSON-RPC2 serviceNamespace: edichain Exposed Methods
Configuration Options
Known Limitations
ExamplesSending Data to (registered) Ethereum Account edichain.sendData("0x9707F3C9ca3C554A6E6d31B71A3C03d7017063F4","Some Data you like to send to me :)"); What happens in the background:
Checking and updating inbox edichain.updateInbox(); // Checks Blockchain for updates
// edichain.messages[] holds all messages received (inc. data)
// Sample on how to use messages array
setInterval(function() {
var old_inbox_length=0;
if(edichain.messages.length!=old_inbox_length) {
var isEncrypted=true;
for(var i=edichain.messages.length-1;i>old_inbox_length-1;i--) {
if(!edichain.messages[i].data) isEncrypted=false; else {
console.log(edichain.messages[i]);
}
}
if(isEncrypted) old_inbox_length=edichain.messages.length;
}
},1000); How messages get processed:
Transaction LogIn EDI it is all about securing transactions. In this aspect all operations this script does are visible within the blockchain. edichain.txlog.stream({ start: -1 }).on('log', function(log) {
console.log(log);
}); Internally this script is using winston as logger and creates a tx.log file containing all transactions for auditing. ContributingRelease History
|
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论