jsup 2.1 - investor's relief (experiment on separation of investment and SNS)

by joviansummer original STEEMIT post: https://steemit.com/blog/@joviansummer/jsup-2-1-investor-s-relief-experiment-on-separation-of-investment-and-sns Hello, this is @joviansummer(witness: @jswit). I'm starting a new experiment regarding my @jsup vote service. The purpose of this experiment is to separate STEEM investment and social interaction(posting/commenting). For many people, writing a post daily(literally 365 posts per year) is not easy. It's not fun, and mandatory daily post only written for self-voting delegation service tends to result in useless low-quality content. I hope this new function of @jsup will reduce those posts, and also make it a bit more easy to invest in STEEM without worrying about daily posting. I think pressure of daily posting significantly undermines Steem as SNS. It's not fun. This is how it works: From 11:45 PM to 11:50 PM every night(reference time zone is GMT+9), @jsup checks if eligible delegators wrote something and received daily v...

파이썬 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포스팅 강박에서 벗어나기