Memahami Bitcoin PoW (BTCW) Melalui Lensa Whitepapernya

ED
Senin, 15 April 2024 | 10:24 WIB
Bagikan
Memahami Bitcoin PoW (BTCW) Melalui Lensa Whitepapernya

from bitcoinrpc.authproxy import AuthServiceProxy, JSONRPCException from pprint import pprint import time import re

if __name__ == '__main__':

# rpc_user and rpc_password are set in the bitcoin-pow.conf file rpc_user = "PUT_YOUR_USER_HERE" rpc_pass = "PUT_YOUR_PASS_HERE" rpc_host = "127.0.0.1"

prevHeight = 0 block_count = 0 while 1:

rpc_connection = AuthServiceProxy(f"http://{rpc_user}:{rpc_pass}@{rpc_host}:9332", timeout=240)

commands = [["getblockcount"]] height = rpc_connection.batch_(commands) if prevHeight != height: prevHeight = height print(height)

block_count = block_count + 1

if block_count > 25: break

Halaman :

Komentar (0)

Tulis Komentar

Belum ada komentar untuk artikel ini. Jadilah yang pertama memberikan tanggapan!

VisiNews Club

Nikmati Berita Tanpa Batas & Benefit Eksklusif!

Dapatkan Kaos & Merchandise eksklusif setiap bulan dengan berlangganan Visi News.