Skip to content

Instantly share code, notes, and snippets.

@epexa
Last active March 7, 2018 20:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save epexa/43ed4bfa5b26b9354a54d512d58ae6f5 to your computer and use it in GitHub Desktop.
Save epexa/43ed4bfa5b26b9354a54d512d58ae6f5 to your computer and use it in GitHub Desktop.
get_transaction from blockchain Golos on NodeJS
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