Created
August 29, 2013 09:36
-
-
Save justmoon/6376099 to your computer and use it in GitHub Desktop.
Watching for transactions with ripple-lib
This file contains hidden or 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 ripple = require('ripple-lib'); | |
| var remote = ripple.Remote.from_config({ | |
| // "trace" : true, | |
| "websocket_ip" : "122.70.133.11", | |
| "websocket_port" : 5006, | |
| "websocket_ssl" : false | |
| }); | |
| remote.connect(); | |
| // This would watch all transactions on the whole network | |
| // | |
| //remote.on('transaction_all', function (e) { | |
| // console.log("TRANSACTION", e.transaction.TransactionType, e.transaction.hash); | |
| //}); | |
| // This watches for new ledgers | |
| remote.on('ledger_closed', function (e) { | |
| console.log("LEDGER", e.ledger_hash); | |
| }); | |
| // This watches for any transactions that relate to Bitstamp (rvYAf...) | |
| // | |
| var account = remote.account('rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B'); | |
| account.on('transaction', function (e) { | |
| console.log("BITSTAMP TRANSACTION", e.transaction.TransactionType, e.transaction.hash); | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment