[ENG] STEEM Security update - added power down alert

by joviansummer original STEEMIT post: https://steemit.com/blog/@joviansummer/eng-steem-security-update-added-power-down-alert STEEM Security - receive STEEM alert messages via Discord Hello, this is @joviansummer(witness: @jswit). STEEM Security code has been revised. Previously, STEEM Security was sending alert message via discord for the following 3 kinds of operations: sending STEEM/SBD to another account changing SP delegation account update Now, power down operation has been added. If there is a power down operation, you will also receive alert message. Please check the original post of the above link for detailed information on how to use the service. Thank you for reading, and have a wonderful day! @joviansummer's STEEM projects @jswit witness: I'm running a STEEM witness node. I'd really appreciate it if you vote for my witness account @jswit. ( https://steemitwallet.com/~witnesses ) [ENG] Introducing @jswit witness project @jsup curation: [ENG] Int...

파이썬에서 스팀잇 ID 및 포스팅 키 유효성 확인

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


파이썬에서 스팀잇 ID와 포스팅 키가 유효한지 확인하는 방법입니다. steem-python 모듈을 활용합니다.

steem-python

먼저 포스팅 키가 유효한지 확인하는 과정은 아래의 코드로 가능합니다.

import steem

STEEMIT_ID="joviansummer"
POSTING_KEY="my_posting_key"

# 포스팅 키 유효성 확인
try:
  user = steem.Steem(keys=[POSTING_KEY])
except:
  print("포스팅 키가 유효하지 않습니다.")
print("유효한 포스팅 키입니다.")

포스팅 키가 유효한지 확인이 되었으면 이제 이 포스팅 키의 주인이 스팀잇 ID와 일치하는지 확인합니다. 위의 코드에 이어서 아래의 코드로 가능합니다. (인터넷에서 발견하고 적어 두었는데 어디에서 찾았었는지 기억이 안 나네요.)

from steembase.account import PrivateKey

# 포스팅 키에 대응하는 공개키(public key)
pubkey = PrivateKey(POSTING_KEY).pubkey

# 스팀잇 ID에 대응하는 공개키
account = user.get_account(STEEM_ID)
pubkey2 = account['posting']['key_auths'][0][0]

# 양쪽 공개키가 일치하는지 확인
if str(pubkey) == str(pubkey2):
  print("스팀잇ID와 포스팅 키가 일치합니다.")
else:
  print("스팀잇ID와 포스팅 키가 일치하지 않습니다.")

오토보팅 서비스 개발은 주중에 틈틈이 설계하고 구상하면서 메모해 놓은 아이디어를 주말에 시간을 내서 구체적으로 시험하고 보완하는 식으로 진행중입니다. 시작한지 얼마 안되어서 그런지 일단 아직까지는 순조롭게 나아가고 있습니다.

Comments

Popular posts from this blog

[ENG] jsup 2.0 - make your upvote great again

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

Nuitka - 파이썬 스크립트를 바이너리 실행 파일로 변환