{"size": 1049, "ext": "js", "max_stars_repo_path": "__tests/send-recvdata.js", "max_stars_repo_name": "fakecoinbase/gettocatslashfriday", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "__tests/send-recvdata.js", "max_issues_repo_name": "fakecoinbase/gettocatslashfriday", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "__tests/send-recvdata.js", "max_forks_repo_name": "fakecoinbase/gettocatslashfriday", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 31.7878787879, "max_line_length": 111, "alphanum_fraction": 0.6558627264}
const DAPP = require("../index");
let app = new DAPP(require('../config.json'));

process.on('uncaughtException', function (err) {
    console.log('UNCAUGHT EXCEPTION:', err);
});

app.on("app.debug", function (data) {
    console.log("[" + new Date().toLocaleTimeString() + "]", "< " + data.level + " >", data.module, data.text);
});

app.on("ready", () => {
    console.log('ready', app.chain.index.getLatest()['DATA']);

    let keystore1 = app.wallet.getAccount('test/ecdh/1');
    let keystore2 = app.wallet.getAccount('test/ecdh/2');
    
    let X1 = app.crypto.createECDHsecret(keystore1.publicKey, keystore2);
    let X2 = app.crypto.createECDHsecret(keystore2.publicKey, keystore1);
    console.log(X1, X2);

    app.send(keystore2, keystore1.publicKey, new Buffer("test"));   
})

app.on("data", function (tx) {
    //transaction have data for this-instance keystore (one of public key of wallet)
    console.log('recived transaction with linked data', tx.toJSON());
});

app.init();
app.connect([
    "morty.node.orwellscan.org:19840"
])