Last active
March 7, 2018 20:26
-
-
Save epexa/43ed4bfa5b26b9354a54d512d58ae6f5 to your computer and use it in GitHub Desktop.
get_transaction from blockchain Golos on NodeJS
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
const golos = require('golos-js'); | |
// switch to testnet | |
golos.config.set('websocket', 'wss://ws.testnet3.golos.io'); | |
golos.config.set('chain_id', '5876894a41e6361bde2e73278f07340f2eb8b41c2facd29099de9deef6cdb679'); | |
let trx = { | |
ref_block_num: 49191, | |
ref_block_prefix: 2024493436 | |
}; | |
// https://github.com/GolosChain/golos-js/blob/master/doc/README.md#get-transaction-hex | |
golos.api.getTransactionHex(trx, function(err, transaction) { | |
console.log(err, 'getTransactionHex: ' + transaction); | |
// https://github.com/GolosChain/golos-js/blob/master/doc/README.md#get-transaction | |
let transaction_id = 'e3aa587c665c222061694ece21deb1910c35f75b'; | |
golos.api.getTransaction(transaction_id, function(err, result) { | |
console.log(err, 'getTransaction: ', result); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment