Bitcoin Forum
November 07, 2024, 08:02:30 PM *
News: Latest Bitcoin Core release: 28.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: This message was too old and has been purged  (Read 1359 times)
Evil-Knievel (OP)
Legendary
*
Offline Offline

Activity: 1260
Merit: 1168



View Profile
March 15, 2014, 09:37:13 PM
Last edit: April 17, 2016, 10:44:42 PM by Evil-Knievel
 #1

This message was too old and has been purged
roslinpl
Legendary
*
Offline Offline

Activity: 2212
Merit: 1199


View Profile WWW
March 15, 2014, 10:47:32 PM
 #2

1btc to create best blockchain is not a lot Smiley
Because there is much more work than like for 1btc.

good luck anyway!
regards!
tsume90
Newbie
*
Offline Offline

Activity: 21
Merit: 0


View Profile WWW
March 15, 2014, 10:55:22 PM
 #3

Wouldn't mind jumping on this wagon. What language is it written in(if there's a requirement), also where's the source?
roslinpl
Legendary
*
Offline Offline

Activity: 2212
Merit: 1199


View Profile WWW
March 15, 2014, 11:02:12 PM
 #4

Wouldn't mind jumping on this wagon. What language is it written in(if there's a requirement), also where's the source?

cool Smiley seems like I was wrong about the price.
 Regards!
tsume90
Newbie
*
Offline Offline

Activity: 21
Merit: 0


View Profile WWW
March 20, 2014, 03:31:00 PM
 #5

Wouldn't mind jumping on this wagon. What language is it written in(if there's a requirement), also where's the source?

Well, all you need is HTML and JavaScript  Wink
We just need to query the API server with javascript, and display the results in HTML.
You could check out the main page html to see that it is not that complicated.

Here is the javascript file, which displays the live block/tx info on the main page. This can be adapted/extended/etc.


Code:
(function ($) {
var defaults = {
rowSpeed: 300,
newRow: null,
addTop: true,
removeTop: true
};
var newClasses = "newRow"
var options = $.extend(defaults, options);
$.fn.addRow = function (options) {
opts = $.extend(defaults, options);
var $table = $(this);
var $tableBody = $("tbody", $table);
var t = $(opts.newRow)
console.log("ADDING: " + t);
if (opts.addTop) t.appendTo($tableBody);
else t.prependTo($tableBody);

// make sure we do not have more than x elements in table
    var rowCount = $('tbody tr', this).length;
    console.log("ROWCOUNT: " + rowCount);
    if(rowCount>10)
      $('tbody tr:last', this).remove();
  

var lin = $table.find('tbody tr:first');
lin.find("td").effect("highlight", {}, 1000);
return false;
};

$.fn.removeRow = function (options) {
opts = $.extend(defaults, options);
var $table = $(this);
var t
if (opts.removeTop) t = $table.find('tbody tr:last')
else t = $table.find('tbody tr:first');
t.find("td")
.wrapInner("<div style='DISPLAY: block'/>")
.parent().find("td div")
.slideUp(opts.rowSpeed, function () {
$(this).parent().parent().remove();
});
return false;
};
return this;
})(jQuery);

function formatLTC(Amount){
  var DecimalSeparator = Number("1.5").toLocaleString().substr(1,1);

  var AmountWithCommas = Amount.toLocaleString();
  var arParts = String(AmountWithCommas).split(DecimalSeparator);
  var intPart = arParts[0];
  var decPart = (arParts.length > 1 ? arParts[1] : '');
  decPart = (decPart + '00000').substr(0,5);

  return intPart + DecimalSeparator + decPart + " LTC";
}

function getSubscribeTX(){
  var jsonData={};
  jsonData['id']=-1;
  jsonData['method']="blockchain.tx.subscribe";
  return JSON.stringify(jsonData) + "\n";
}
function getLastTX(){
  var jsonData={};
  jsonData['id']=-1;
  jsonData['method']="blockchain.last.tx";
  return JSON.stringify(jsonData) + "\n";
}
function getLastBlocks(){
  var jsonData={};
  jsonData['id']=-1;
  jsonData['method']="blockchain.last.blocks";
  return JSON.stringify(jsonData) + "\n";
}
function getSubscribeBlocks(){
  var jsonData={};
  jsonData['id']=-1;
  jsonData['method']="blockchain.blocks.subscribe";
  return JSON.stringify(jsonData) + "\n";
}

function addTxRow(txid, amount, timestamp){
  txid=txid.substr(0,12);
  var amtLTC = amount / 100000000;
  $("#txa").addRow({
  newRow: '<tr><td><a href="/tx/' + txid + '">' + txid + '</a><font color=gray>[...]</font></td><td data-livestamp="' + timestamp + '">few seconds ago</td><td class="hidden-phone"></td><td class="right-col"><button class="btn btn-success btn-large"><span>' + formatLTC(amtLTC) + '</span></button></td></tr>',
  addTop: false,
  removeTop: false
  });
}


function addBlockRow(height, hash, numtx, amount, tmpstmp){
  amount = formatLTC(amount);
  $("#blocks").addRow({
  newRow: '<tr><td><a href="/block/' + hash + '">' + height + '</a></td><td data-livestamp="' + tmpstmp + '">few seconds ago</td><td class="hidden-phone">' + numtx + '</td><td class="hidden-phone right-col"><button class="btn btn-warning btn-large"><span>' + amount + '</span></button></td></tr>',
  addTop: false,
  removeTop: false
  });
}

$(document).ready(function() {
    var config = {
      relayURL: "wss://litemonitor.com:2109"
    };
 

   var connected = false;
 
    var socket = new WebSocket(config.relayURL, ['binary']);
 
    socket.onopen = function() {
      socket.send(getLastTX());
      socket.send(getLastBlocks());
      socket.send(getSubscribeTX());
      socket.send(getSubscribeBlocks());
    };
 
    socket.onmessage = function(event) {
      if (!connected && event.data == 'connected') {
        connected = true;
        return;
      }

      var fr = new FileReader();
      fr.onloadend = function(f){

        var mySplitResult = f.target.result.split("\n");
        
        for (ent in mySplitResult) {
          if(mySplitResult[ent].length<5) continue;
          var data = JSON.parse(mySplitResult[ent]);
          if(data['method'] == "blockchain.blocks.subscribe" || data['method'] == "blockchain.last.blocks"){
            data = data['params'][0];
              var height = data['block_height'];
              var numtx = data['num_tx'];
              var hash = data['block_hash'];
              var amount = data['sum_out'];
              var tmpstmp = data['timestamp'];
              addBlockRow(height,hash,numtx,amount,tmpstmp);
          }
          else if(data['method'] == "blockchain.tx.subscribe"){
            var hash = data['tx_id'];
            var timestamp = data['timestamp'];
            var outputs = data['params'][0]['outputs'];
            var totalOut = 0;
            for (var key in outputs) {
                totalOut += outputs[key]['value'];
            }
            addTxRow(hash,totalOut,timestamp);
          }
        }
      };
      fr.readAsBinaryString(event.data);
      

    }



  });

Most magic happens in socket.onmessage = function(event) { where the responses from the API server are handled.

I'm going to do "Block Overview Page".
Could you send me what's done so far?

Also, when you say block overview page, do you mean this? https://blockchain.info/block-index/376347/0000000000000000499aafcd5b6b4dd805576301d91e938e1d6c49bc872f7580
weex
Legendary
*
Offline Offline

Activity: 1102
Merit: 1014



View Profile
March 20, 2014, 04:13:58 PM
 #6

This is great to see. I wonder if you all have considered using BitPay's insight explorer? http://live.bitcore.io/ I'm not sure how it gets data from the Bitcoin network but most of it should be portable to Litecoin.

By the way, I run LitecoinScout.com and have struggled majorly with Abe. The site is not functional now and I've lost patience maintaining that package. I would definitely be interested in getting it up and running with another solution. Sad thing is, I was also doing network difficulty graphs which would likely need an overhaul to work with another explorer solution but I would definitely do it.

Good luck!

Edit: Just took a look at what you have running and it looks great. It actually looks quite similar to insight. Either way, thanks for doing this and let us know how we can help.
pembo210
Member
**
Offline Offline

Activity: 74
Merit: 10



View Profile
⇾ Re: na
January 25, 2015, 05:13:22 AM
 #7

Is this still live??

http://www.moonblocks.com:3000/

https://github.com/pembo210/Litesight

https://www.reddit.com/r/litecoin/comments/2tehxu/litesight_block_explorer_ready_to_go_full_install

b!z
Legendary
*
Offline Offline

Activity: 1582
Merit: 1010



View Profile
January 25, 2015, 06:42:37 AM
 #8

Is this still live??

It doesn't matter because Litecoin is dead.
pembo210
Member
**
Offline Offline

Activity: 74
Merit: 10



View Profile
January 25, 2015, 07:40:43 AM
 #9

k
josef2000
Sr. Member
****
Offline Offline

Activity: 280
Merit: 250


Bro, you need to try http://dadice.com


View Profile WWW
January 25, 2015, 11:28:40 AM
 #10

Maybe you could add AMOUNT SEARCH, no ther explorer has this feature. With this you can search transactions by amount easily!
Love the design, but cant go onto it, just saw the screenshot

███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████
█   ⚂⚄⚀⚃⚅⚁    ██  d a d i c e  ██    Next Generation Dice Game
• Low 1% house edge. • Provably Fair.  
███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████
AT101ET
Legendary
*
Offline Offline

Activity: 3178
Merit: 1348


View Profile
January 27, 2015, 06:12:05 PM
 #11

This was posted almost a year ago.
Looks great. Any news with the development? This would be very handy!
guitarplinker
Legendary
*
Offline Offline

Activity: 1694
Merit: 1024



View Profile WWW
January 27, 2015, 07:44:40 PM
 #12

This was posted almost a year ago.
Looks great. Any news with the development? This would be very handy!
Looks like the project is dead, the site doesn't exist anymore.
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!