파이썬 beem을 이용해서 현재 블럭 번호 조회

by joviansummer
original STEEMIT post: https://steemit.com/blog/@joviansummer/607dba-beem


파이썬 beem을 이용해서 스팀 블럭체인의 현재 블럭 번호를 조회할 수 있습니다. Blockchain 객체의 get_current_block_num() 함수를 이용합니다.

조회되는 블럭 번호는 정수(int) 형식이며 가장 최근의 블럭에 할당된 번호입니다. 예제 코드는 아래와 같습니다.

from beem.steem import Steem
from beem.blockchain import Blockchain

steem_nodes = ["https://api.steemit.com"]

steem = Steem(node=steem_nodes)

bc = Blockchain(blockchain_instance=steem)

# 현재 블럭 번호를 변수 bn에 할당
bn = bc.get_current_block_num()

print("현재 블럭 번호:", str(bn))

@joviansummer의 스팀 프로젝트

스팀 증인노드를 운영중입니다. @jswit에 증인투표해 주시면 감사하겠습니다.
(https://steemitwallet.com/~witnesses)

jswit 증인 노드 프로젝트를 시작합니다.

jsup 업보팅(upvoting) 서비스 소개

jsup 수혜자 지정 기능 추가

jsup 서비스에 큐레이션 보상 분배 기능이 추가되었습니다.

jSTEEM 프로젝트 - 텔레그램 챗봇으로 구현하는 스팀 블럭체인 탐색기

STEEM.NFT - 디지털 아트 보존 프로젝트

Posted through the AVLE Dapp (https://avle.io)

Comments

Popular posts from this blog

GentBG - why bother to burn STEEM?

GentBG will continue to burn STEEM, with reduced posting frequency

스티미언의 영향력 지수 계산