Bitcoin Forum
May 21, 2024, 04:03:32 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: « 1 [2]  All
  Print  
Author Topic: is it possible to calculate total confirmed transactions till a block ?  (Read 1550 times)
achow101
Moderator
Legendary
*
Offline Offline

Activity: 3402
Merit: 6641


Just writing some code


View Profile WWW
March 06, 2016, 10:40:41 PM
 #21

it's part of a bitcoin prized game in Turkish

LOL

So the OP is trying to get someone else give him the answer to a contest that will win bitcoins for himself, but is unwilling to share the prize with the person that gives him the answer?

Well, not entirely.
This is just a step of it, this answer will be used on next step.
There're more steps to get the prize Smiley
Well if this is for a prize, then I think that he should figure it out himself instead of asking for others to do it for him.

shorena
Copper Member
Legendary
*
Offline Offline

Activity: 1498
Merit: 1520


No I dont escrow anymore.


View Profile WWW
March 06, 2016, 10:44:32 PM
Last edit: March 06, 2016, 11:20:35 PM by shorena
 #22

Well they told me via PM that it was for a riddle and there would be reward. Be that as it may, here is a quick and dirty (2 beer) solution in ruby:

Code:
  total_count = 0
  h = BitcoinRPC.new('http://rpcuser:rpcpass@rpc_ip:rpc_port')
  for i in 0..399000
    hash = h.getblockhash i
    block = h.getblock hash
    #puts block
    txs = block["tx"].size
    total_count = total_count + txs
    puts "block #{i}: #{total_count}"
  end #for
  puts total_count

its still running (~block 260k) will update with the result.

Edit: 110863024 so its a different number than the one posted.

Im not really here, its just your imagination.
cakir
Legendary
*
Offline Offline

Activity: 1274
Merit: 1000


★ BitClave ICO: 15/09/17 ★


View Profile WWW
March 06, 2016, 11:24:44 PM
 #23

Well they told me via PM that it was for a riddle and there would be reward. Be that as it may, here is a quick and dirty (2 beer) solution in ruby:

Code:
  total_count = 0
  h = BitcoinRPC.new('http://rpcuser:rpcpass@rpc_ip:rpc_port')
  for i in 0..399000
    hash = h.getblockhash i
    block = h.getblock hash
    #puts block
    txs = block["tx"].size
    total_count = total_count + txs
    puts "block #{i}: #{total_count}"
  end #for
  puts total_count

its still running (~block 260k) will update with the result.

Edit: 110863024 so its a different number than the one posted.
There's reward & yes this is correct number. But you can get the reward if only you know Turkish.
Also you didn't have to run this program to find it Smiley (This value is stored on Core's debug.log).


                  ,'#██+:                 
              ,█████████████'             
            +██████████████████           
          ;██████████████████████         
         ███████:         .███████`       
        ██████               ;█████'      
      `█████                   #████#     
      ████+                     `████+    
     ████:                        ████,   
    ████:    .#              █     ████   
   ;███+     ██             ███     ████  
   ████     ███'            ███.    '███, 
  +███     #████           ,████     ████ 
  ████     █████ .+██████: █████+    `███.
 ,███     ███████████████████████     ████
 ████     ███████████████████████'    :███
 ███:    +████████████████████████     ███`
 ███     █████████████████████████`    ███+
,███     ██████████████████████████    #███
'███    '██████████████████████████    ;███
#███    ███████████████████████████    ,███
████    ███████████████████████████.   .███
████    ███████████████████████████'   .███
+███    ███████████████████████████+   :███
:███    ███████████████████████████'   +███
 ███    ███████████████████████████.   ███#
 ███.   #██████████████████████████    ███,
 ████    █████████████████████████+   `███
 '███    '████████████████████████    ████
  ███;    ███████████████████████     ███;
  ████     #████████████████████     ████ 
   ███#     .██████████████████     `███+ 
   ████`      ;██████████████       ████  
    ████         '███████#.        ████.  
    .████                         █████   
     '████                       █████    
      #████'                    █████     
       +█████`                ██████      
        ,██████:           `███████       
          ████████#;,..:+████████.        
           ,███████████████████+          
             .███████████████;            
                `+███████#,               
shorena
Copper Member
Legendary
*
Offline Offline

Activity: 1498
Merit: 1520


No I dont escrow anymore.


View Profile WWW
March 06, 2016, 11:45:42 PM
 #24

Well they told me via PM that it was for a riddle and there would be reward. Be that as it may, here is a quick and dirty (2 beer) solution in ruby:

Code:
  total_count = 0
  h = BitcoinRPC.new('http://rpcuser:rpcpass@rpc_ip:rpc_port')
  for i in 0..399000
    hash = h.getblockhash i
    block = h.getblock hash
    #puts block
    txs = block["tx"].size
    total_count = total_count + txs
    puts "block #{i}: #{total_count}"
  end #for
  puts total_count

its still running (~block 260k) will update with the result.

Edit: 110863024 so its a different number than the one posted.
There's reward & yes this is correct number. But you can get the reward if only you know Turkish.
Also you didn't have to run this program to find it Smiley (This value is stored on Core's debug.log).

Interesting, well its not in all of my debug.log files, only in one test VM. I guess it was already trimmed from the other files.

Im not really here, its just your imagination.
cakir
Legendary
*
Offline Offline

Activity: 1274
Merit: 1000


★ BitClave ICO: 15/09/17 ★


View Profile WWW
March 06, 2016, 11:56:30 PM
 #25

Well they told me via PM that it was for a riddle and there would be reward. Be that as it may, here is a quick and dirty (2 beer) solution in ruby:

Code:
  total_count = 0
  h = BitcoinRPC.new('http://rpcuser:rpcpass@rpc_ip:rpc_port')
  for i in 0..399000
    hash = h.getblockhash i
    block = h.getblock hash
    #puts block
    txs = block["tx"].size
    total_count = total_count + txs
    puts "block #{i}: #{total_count}"
  end #for
  puts total_count

its still running (~block 260k) will update with the result.

Edit: 110863024 so its a different number than the one posted.
There's reward & yes this is correct number. But you can get the reward if only you know Turkish.
Also you didn't have to run this program to find it Smiley (This value is stored on Core's debug.log).

Interesting, well its not in all of my debug.log files, only in one test VM. I guess it was already trimmed from the other files.
Well, if you open debug.log (I suggest notepad++) and look for (ctrl+h) 399000
you'll find this line;
2016-02-18 14:12:13 UpdateTip: new best=000000000000000003d2548d4c19a5e91a8762c764f3195a7cb4be189bb1da48  height=399000  log2_work=84.137116  tx=110863024  date=2016-02-18 11:41:04 progress=0.999923  cache=53.4MiB(14531tx)

"tx=110863024"  this one is the total confirmed transaction count till block height 399000.


                  ,'#██+:                 
              ,█████████████'             
            +██████████████████           
          ;██████████████████████         
         ███████:         .███████`       
        ██████               ;█████'      
      `█████                   #████#     
      ████+                     `████+    
     ████:                        ████,   
    ████:    .#              █     ████   
   ;███+     ██             ███     ████  
   ████     ███'            ███.    '███, 
  +███     #████           ,████     ████ 
  ████     █████ .+██████: █████+    `███.
 ,███     ███████████████████████     ████
 ████     ███████████████████████'    :███
 ███:    +████████████████████████     ███`
 ███     █████████████████████████`    ███+
,███     ██████████████████████████    #███
'███    '██████████████████████████    ;███
#███    ███████████████████████████    ,███
████    ███████████████████████████.   .███
████    ███████████████████████████'   .███
+███    ███████████████████████████+   :███
:███    ███████████████████████████'   +███
 ███    ███████████████████████████.   ███#
 ███.   #██████████████████████████    ███,
 ████    █████████████████████████+   `███
 '███    '████████████████████████    ████
  ███;    ███████████████████████     ███;
  ████     #████████████████████     ████ 
   ███#     .██████████████████     `███+ 
   ████`      ;██████████████       ████  
    ████         '███████#.        ████.  
    .████                         █████   
     '████                       █████    
      #████'                    █████     
       +█████`                ██████      
        ,██████:           `███████       
          ████████#;,..:+████████.        
           ,███████████████████+          
             .███████████████;            
                `+███████#,               
shorena
Copper Member
Legendary
*
Offline Offline

Activity: 1498
Merit: 1520


No I dont escrow anymore.


View Profile WWW
March 07, 2016, 12:00:26 AM
 #26

Well they told me via PM that it was for a riddle and there would be reward. Be that as it may, here is a quick and dirty (2 beer) solution in ruby:

Code:
  total_count = 0
  h = BitcoinRPC.new('http://rpcuser:rpcpass@rpc_ip:rpc_port')
  for i in 0..399000
    hash = h.getblockhash i
    block = h.getblock hash
    #puts block
    txs = block["tx"].size
    total_count = total_count + txs
    puts "block #{i}: #{total_count}"
  end #for
  puts total_count

its still running (~block 260k) will update with the result.

Edit: 110863024 so its a different number than the one posted.
There's reward & yes this is correct number. But you can get the reward if only you know Turkish.
Also you didn't have to run this program to find it Smiley (This value is stored on Core's debug.log).

Interesting, well its not in all of my debug.log files, only in one test VM. I guess it was already trimmed from the other files.
Well, if you open debug.log (I suggest notepad++) and look for (ctrl+h) 399000
you'll find this line;
2016-02-18 14:12:13 UpdateTip: new best=000000000000000003d2548d4c19a5e91a8762c764f3195a7cb4be189bb1da48  height=399000  log2_work=84.137116  tx=110863024  date=2016-02-18 11:41:04 progress=0.999923  cache=53.4MiB(14531tx)

"tx=110863024"  this one is the total confirmed transaction count till block height 399000.

Yeah, not on all systems though. Block 401263 is the oldest on my windows box.

Code:
2016-03-05 11:02:08 UpdateTip: new best=000000000000000002d84ebbcf33e8951cfdb3234768de5026e399c79f92f987  height=401263  log2_work=84.24007  tx=114496141  date=2016-03-05 11:01:37 progress=1.000000  cache=57.1MiB(21671tx)

The log file is trimmed from time to time, at 10 MB IIRC.

Im not really here, its just your imagination.
cakir
Legendary
*
Offline Offline

Activity: 1274
Merit: 1000


★ BitClave ICO: 15/09/17 ★


View Profile WWW
March 07, 2016, 12:17:40 PM
 #27

-snip-

Yeah, not on all systems though. Block 401263 is the oldest on my windows box.

Code:
2016-03-05 11:02:08 UpdateTip: new best=000000000000000002d84ebbcf33e8951cfdb3234768de5026e399c79f92f987  height=401263  log2_work=84.24007  tx=114496141  date=2016-03-05 11:01:37 progress=1.000000  cache=57.1MiB(21671tx)

The log file is trimmed from time to time, at 10 MB IIRC.
Well, Yes it's trimmed but When I posted this game online 17 days ago, this line was very below of the debug.log. It should be recently deleted.
(If your node relays tx'es then it should has more lines than mine).


                  ,'#██+:                 
              ,█████████████'             
            +██████████████████           
          ;██████████████████████         
         ███████:         .███████`       
        ██████               ;█████'      
      `█████                   #████#     
      ████+                     `████+    
     ████:                        ████,   
    ████:    .#              █     ████   
   ;███+     ██             ███     ████  
   ████     ███'            ███.    '███, 
  +███     #████           ,████     ████ 
  ████     █████ .+██████: █████+    `███.
 ,███     ███████████████████████     ████
 ████     ███████████████████████'    :███
 ███:    +████████████████████████     ███`
 ███     █████████████████████████`    ███+
,███     ██████████████████████████    #███
'███    '██████████████████████████    ;███
#███    ███████████████████████████    ,███
████    ███████████████████████████.   .███
████    ███████████████████████████'   .███
+███    ███████████████████████████+   :███
:███    ███████████████████████████'   +███
 ███    ███████████████████████████.   ███#
 ███.   #██████████████████████████    ███,
 ████    █████████████████████████+   `███
 '███    '████████████████████████    ████
  ███;    ███████████████████████     ███;
  ████     #████████████████████     ████ 
   ███#     .██████████████████     `███+ 
   ████`      ;██████████████       ████  
    ████         '███████#.        ████.  
    .████                         █████   
     '████                       █████    
      #████'                    █████     
       +█████`                ██████      
        ,██████:           `███████       
          ████████#;,..:+████████.        
           ,███████████████████+          
             .███████████████;            
                `+███████#,               
shorena
Copper Member
Legendary
*
Offline Offline

Activity: 1498
Merit: 1520


No I dont escrow anymore.


View Profile WWW
March 07, 2016, 01:20:33 PM
 #28

-snip-

Yeah, not on all systems though. Block 401263 is the oldest on my windows box.

Code:
2016-03-05 11:02:08 UpdateTip: new best=000000000000000002d84ebbcf33e8951cfdb3234768de5026e399c79f92f987  height=401263  log2_work=84.24007  tx=114496141  date=2016-03-05 11:01:37 progress=1.000000  cache=57.1MiB(21671tx)

The log file is trimmed from time to time, at 10 MB IIRC.
Well, Yes it's trimmed but When I posted this game online 17 days ago, this line was very below of the debug.log. It should be recently deleted.
(If your node relays tx'es then it should has more lines than mine).

Probably, its configured to allow as much TX as possible to be relayed. When I shut it down recently it had ~900MB worth of TX in memory. Just out of curiosity, can you link me to the riddle/puzzle?

Im not really here, its just your imagination.
cakir
Legendary
*
Offline Offline

Activity: 1274
Merit: 1000


★ BitClave ICO: 15/09/17 ★


View Profile WWW
March 07, 2016, 02:46:56 PM
 #29

-snip-

Yeah, not on all systems though. Block 401263 is the oldest on my windows box.

Code:
2016-03-05 11:02:08 UpdateTip: new best=000000000000000002d84ebbcf33e8951cfdb3234768de5026e399c79f92f987  height=401263  log2_work=84.24007  tx=114496141  date=2016-03-05 11:01:37 progress=1.000000  cache=57.1MiB(21671tx)

The log file is trimmed from time to time, at 10 MB IIRC.
Well, Yes it's trimmed but When I posted this game online 17 days ago, this line was very below of the debug.log. It should be recently deleted.
(If your node relays tx'es then it should has more lines than mine).

Probably, its configured to allow as much TX as possible to be relayed. When I shut it down recently it had ~900MB worth of TX in memory. Just out of curiosity, can you link me to the riddle/puzzle?
Puzzle is this: (in Turkish of course)
http://www.bitcoinavi.com/oyun-4-kac-islem-kac/

So far I've published 5 puzzles, 4 was solved.


                  ,'#██+:                 
              ,█████████████'             
            +██████████████████           
          ;██████████████████████         
         ███████:         .███████`       
        ██████               ;█████'      
      `█████                   #████#     
      ████+                     `████+    
     ████:                        ████,   
    ████:    .#              █     ████   
   ;███+     ██             ███     ████  
   ████     ███'            ███.    '███, 
  +███     #████           ,████     ████ 
  ████     █████ .+██████: █████+    `███.
 ,███     ███████████████████████     ████
 ████     ███████████████████████'    :███
 ███:    +████████████████████████     ███`
 ███     █████████████████████████`    ███+
,███     ██████████████████████████    #███
'███    '██████████████████████████    ;███
#███    ███████████████████████████    ,███
████    ███████████████████████████.   .███
████    ███████████████████████████'   .███
+███    ███████████████████████████+   :███
:███    ███████████████████████████'   +███
 ███    ███████████████████████████.   ███#
 ███.   #██████████████████████████    ███,
 ████    █████████████████████████+   `███
 '███    '████████████████████████    ████
  ███;    ███████████████████████     ███;
  ████     #████████████████████     ████ 
   ███#     .██████████████████     `███+ 
   ████`      ;██████████████       ████  
    ████         '███████#.        ████.  
    .████                         █████   
     '████                       █████    
      #████'                    █████     
       +█████`                ██████      
        ,██████:           `███████       
          ████████#;,..:+████████.        
           ,███████████████████+          
             .███████████████;            
                `+███████#,               
shorena
Copper Member
Legendary
*
Offline Offline

Activity: 1498
Merit: 1520


No I dont escrow anymore.


View Profile WWW
March 07, 2016, 02:59:52 PM
 #30

-snip-

Yeah, not on all systems though. Block 401263 is the oldest on my windows box.

Code:
2016-03-05 11:02:08 UpdateTip: new best=000000000000000002d84ebbcf33e8951cfdb3234768de5026e399c79f92f987  height=401263  log2_work=84.24007  tx=114496141  date=2016-03-05 11:01:37 progress=1.000000  cache=57.1MiB(21671tx)

The log file is trimmed from time to time, at 10 MB IIRC.
Well, Yes it's trimmed but When I posted this game online 17 days ago, this line was very below of the debug.log. It should be recently deleted.
(If your node relays tx'es then it should has more lines than mine).

Probably, its configured to allow as much TX as possible to be relayed. When I shut it down recently it had ~900MB worth of TX in memory. Just out of curiosity, can you link me to the riddle/puzzle?
Puzzle is this: (in Turkish of course)
http://www.bitcoinavi.com/oyun-4-kac-islem-kac/

So far I've published 5 puzzles, 4 was solved.

Thanks, they look very interesting, esp. the doge one and the one with the QR code. Looks like all 5 are solved. Would I be allowed to join future games even if Im not turkish, e.g. by using a google translator or asking a friend?

Im not really here, its just your imagination.
cakir
Legendary
*
Offline Offline

Activity: 1274
Merit: 1000


★ BitClave ICO: 15/09/17 ★


View Profile WWW
March 07, 2016, 03:18:28 PM
 #31

-snip-

Yeah, not on all systems though. Block 401263 is the oldest on my windows box.

Code:
2016-03-05 11:02:08 UpdateTip: new best=000000000000000002d84ebbcf33e8951cfdb3234768de5026e399c79f92f987  height=401263  log2_work=84.24007  tx=114496141  date=2016-03-05 11:01:37 progress=1.000000  cache=57.1MiB(21671tx)

The log file is trimmed from time to time, at 10 MB IIRC.
Well, Yes it's trimmed but When I posted this game online 17 days ago, this line was very below of the debug.log. It should be recently deleted.
(If your node relays tx'es then it should has more lines than mine).

Probably, its configured to allow as much TX as possible to be relayed. When I shut it down recently it had ~900MB worth of TX in memory. Just out of curiosity, can you link me to the riddle/puzzle?
Puzzle is this: (in Turkish of course)
http://www.bitcoinavi.com/oyun-4-kac-islem-kac/

So far I've published 5 puzzles, 4 was solved.

Thanks, they look very interesting, esp. the doge one and the one with the QR code. Looks like all 5 are solved. Would I be allowed to join future games even if Im not turkish, e.g. by using a google translator or asking a friend?
Well, This game's purpose is not just give away money to people who has knowledge.
It's main purpose is to teach Turkish people how to deal with Bitcoin & Crypto Universe, best way to practice bitcoin is "apply & learn" so Game solvers are trying to solve riddles & learn more stuff about Bitcoin.

You already know lots of stuff about bitcoin. I prefer you not to join, But you're wellcomed anyway. But trust me, they're already hard. Not only knowing Turkish is enough but also you need to know Turkic language, Math etc Smiley


                  ,'#██+:                 
              ,█████████████'             
            +██████████████████           
          ;██████████████████████         
         ███████:         .███████`       
        ██████               ;█████'      
      `█████                   #████#     
      ████+                     `████+    
     ████:                        ████,   
    ████:    .#              █     ████   
   ;███+     ██             ███     ████  
   ████     ███'            ███.    '███, 
  +███     #████           ,████     ████ 
  ████     █████ .+██████: █████+    `███.
 ,███     ███████████████████████     ████
 ████     ███████████████████████'    :███
 ███:    +████████████████████████     ███`
 ███     █████████████████████████`    ███+
,███     ██████████████████████████    #███
'███    '██████████████████████████    ;███
#███    ███████████████████████████    ,███
████    ███████████████████████████.   .███
████    ███████████████████████████'   .███
+███    ███████████████████████████+   :███
:███    ███████████████████████████'   +███
 ███    ███████████████████████████.   ███#
 ███.   #██████████████████████████    ███,
 ████    █████████████████████████+   `███
 '███    '████████████████████████    ████
  ███;    ███████████████████████     ███;
  ████     #████████████████████     ████ 
   ███#     .██████████████████     `███+ 
   ████`      ;██████████████       ████  
    ████         '███████#.        ████.  
    .████                         █████   
     '████                       █████    
      #████'                    █████     
       +█████`                ██████      
        ,██████:           `███████       
          ████████#;,..:+████████.        
           ,███████████████████+          
             .███████████████;            
                `+███████#,               
sonerbo (OP)
Copper Member
Hero Member
*****
Offline Offline

Activity: 1358
Merit: 523


View Profile
March 07, 2016, 04:06:25 PM
 #32

-snip-

Yeah, not on all systems though. Block 401263 is the oldest on my windows box.

Code:
2016-03-05 11:02:08 UpdateTip: new best=000000000000000002d84ebbcf33e8951cfdb3234768de5026e399c79f92f987  height=401263  log2_work=84.24007  tx=114496141  date=2016-03-05 11:01:37 progress=1.000000  cache=57.1MiB(21671tx)

The log file is trimmed from time to time, at 10 MB IIRC.
Well, Yes it's trimmed but When I posted this game online 17 days ago, this line was very below of the debug.log. It should be recently deleted.
(If your node relays tx'es then it should has more lines than mine).

Probably, its configured to allow as much TX as possible to be relayed. When I shut it down recently it had ~900MB worth of TX in memory. Just out of curiosity, can you link me to the riddle/puzzle?
ty for your help  Smiley Now ı have to find ; what is " personal homepage " hint. As ı promised ı will send you the prize if ı can solve it Smiley

shorena
Copper Member
Legendary
*
Offline Offline

Activity: 1498
Merit: 1520


No I dont escrow anymore.


View Profile WWW
March 07, 2016, 05:25:05 PM
 #33

-snip-
ty for your help  Smiley Now ı have to find ; what is " personal homepage " hint. As ı promised ı will send you the prize if ı can solve it Smiley

Ah, yes about that. Dont send me everything. Good luck with the rest.

-snip-
Well, This game's purpose is not just give away money to people who has knowledge.
It's main purpose is to teach Turkish people how to deal with Bitcoin & Crypto Universe, best way to practice bitcoin is "apply & learn" so Game solvers are trying to solve riddles & learn more stuff about Bitcoin.

You already know lots of stuff about bitcoin. I prefer you not to join, But you're wellcomed anyway. But trust me, they're already hard. Not only knowing Turkish is enough but also you need to know Turkic language, Math etc Smiley

Np, I will stay out of it unless I get asked to help. Smiley

I like the idea though.

Im not really here, its just your imagination.
Pages: « 1 [2]  All
  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!