파이썬(steem-python)에서 api 서버 설정
steem-python에서 통신할 api 서버를 직접 지정할 수 있습니다. 기본값은 api.steemit.com입니다만, 실행할 파이썬 프로세스에서 특정 api 서버를 사용할 수 있도록 직접 설정이 가능합니다.
아래의 예시와 같이 할 수 있습니다.
from steem.steemd import Steemd
from steem.instance import set_shared_steemd_instance
steemd_nodes = ['https://api.steemit.com','api.steemyy.com']
set_shared_steemd_instance(Steemd(nodes=steemd_nodes))
위의 코드에서 steemd_nodes 리스트에 사용할 api 서버를 지정해 줍니다. 리스트 형태이므로 2개 이상을 지정할 수 있습니다. 여기서는 api.steemit.com과 api.steemyy.com을 사용하도록 설정하였습니다.
코드 처음 부분에 이렇게 설정하고 작성을 하면 steem-python의 api 요청을 처리할 때 지정된 api 서버와 통신을 하게 됩니다.
공개된 서버 목록은 스팀 개발자 웹사이트에 나와 있습니다. 아래의 링크에서 public nodes 항목을 보면 됩니다.
Sort: Trending
[-]
successgr.with (74) 4 years ago