GentBG x PUSSTEEM - burning both STEEM and PUSS

Image
by joviansummer original STEEMIT post: https://steemit.com/blog/@joviansummer/gentbg-x-pussteem-burning-both-steem-and-puss Hello, this is @joviansummer(witness: @jswit), developer of GentBG project. I registered @gentbg account to PUSSTEEM about a week ago and donated some of my own PUSS token to @gentbg's EPUSS account. Now, @gentbg will burn STEEM and EPUSS at the same time. PUSSTEEM's boosting upvotes will help increasing baseline burning significantly. @gentbg's SP reward is delegate to @jsup to get automated upvotes, forming a baseline burning of liquid reward independent of other people's upvotes. Some may argue 100%(both liquid and SP reward) burning is much better, but I chose this approach to prevent @gentbg from becoming a spamming account. Constantly asking for upvotes via mentioning and commenting every week may eventually become a big annoyance to curators. That being said, anyone is welcome to participate in countering STEEM inflation by giving upvotes ...

파이썬 beem을 이용한 블러트 계정 정보 확인

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


파이썬 beem 모듈을 활용해서 블러트 계정에 대한 각종 정보를 확인할 수 있습니다. Account 객체를 이용하며, json 형식의 데이터를 딕셔너리(dict) 형식으로 가져와서 사용할 수 있습니다.

from beem import Blurt
from beem.account import Account

# 블러트 rpc 노드
blurt_node = ["https://rpc.blurt.world"]

# 블러트 객체 생성
blurt = Blurt(node=blurt_node)

# @joviansummer의 계정 정보 가져오기
account = Account('joviansummer', blockchain_instance=blurt)

# 데이터를 딕셔너리 형식으로 변수 acc_data에 할당
acc_data =  account.json()

# 전체 데이터 출력
print(acc_data)

Account 객체를 생성할 때 blockchain_instance에서 블러트 체인을 지정해 주어야 합니다. 계정 데이터는 json() 함수를 이용해서 딕셔너리 형식으로 가져옵니다. 이렇게 가져온 데이터로부터 필요한 부분을 가져와 활용하면 되겠습니다. 예를 들어 현재 보유하고 있는 가용 블러트가 얼만큼인지 보려면 아래와 같이 할 수 있습니다.

# 가용(available) 블러트 보유량 출력
available_blurt = float(acc_data['balance']['amount'])/1000
print('보유한 블러트:", available_blurt, "BLURT")

블러트 보유량은 소수점 3자리까지 표시되는데, 블럭체인에 있는 정보는 이 값에 1000을 곱한 형태로, 즉 실수가 아니라 정수로 되어 있습니다. 따라서 이를 실수( float)로 변환하여 1000으로 나누면 블러트 보유량이 됩니다.

Comments

Popular posts from this blog

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

jsup/avle code update - you don't have to write post everyday

jsup/avle 보팅 코드 갱신 - 1일1포스팅 강박에서 벗어나기