Created
July 29, 2017 22:19
-
-
Save stiv-yakovenko/26994bbe32457bb69ef7694e98a5e7cf to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var Web3 = require('web3'); | |
var web3 = new Web3(); | |
web3.setProvider(new web3.providers.HttpProvider('http://localhost:8545')); | |
var abi = [{ | |
"constant": false, | |
"inputs": [{"name": "jsn", "type": "string"}], | |
"name": "deposit", | |
"outputs": [{"name": "", "type": "int256"}], | |
"payable": false, | |
"type": "function" | |
}, { | |
"anonymous": false, | |
"inputs": [{"indexed": true, "name": "_sender", "type": "address"}, { | |
"indexed": false, | |
"name": "jsn", | |
"type": "string" | |
}], | |
"name": "Evt", | |
"type": "event" | |
}]; | |
var medApi = {MAIN_CONTRACT_ID: "0x5cb023C894D7838Ee7C0eE43AFD8D10D75Cd89bd"}; | |
medApi.contract = new web3.eth.Contract(abi, medApi.MAIN_CONTRACT_ID); | |
medApi.contract.events.Evt({fromBlock: 0, toBlock: 'latest'},function () { | |
}).on('data',function (evt) { | |
console.log("evt",evt); | |
}); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment