def setUpClass(cls): cls.bts = Steem( node=get_node_list(appbase=False), nobroadcast=True, keys={"active": wif}, num_retries=10 ) cls.appbase = Steem( node=get_node_list(appbase=True), nobroadcast=True, keys={"active": wif}, num_retries=10 ) cls.authorperm = "@gtg/ffdhu-gtg-witness-log" [author, permlink] = resolve_authorperm(cls.authorperm) cls.author = author cls.permlink = permlink cls.category = 'witness-category' cls.title = 'gtg witness log' # from getpass import getpass # self.bts.wallet.unlock(getpass()) set_shared_steem_instance(cls.bts) cls.bts.set_default_account("test") cnt = 0 title = '' while cnt < 5 and title == '': c = Comment(cls.authorperm, steem_instance=cls.bts) title = c["title"] cls.bts.rpc.next()
def setUpClass(cls): stm = shared_steem_instance() stm.config.refreshBackup() cls.stm = Steem( node=get_node_list(appbase=False), nobroadcast=True, # We want to bundle many operations into a single transaction bundle=True, num_retries=10 # Overwrite wallet to use this list of wifs only ) cls.appbase = Steem(node=get_node_list(appbase=True), nobroadcast=True, bundle=True, num_retries=10) cls.stm.set_default_account("test") set_shared_steem_instance(cls.stm) # self.stm.newWallet("TestingOneTwoThree") cls.wallet = Wallet(steem_instance=cls.stm) cls.wallet.wipe(True) cls.wallet.newWallet(pwd="TestingOneTwoThree") cls.wallet.unlock(pwd="TestingOneTwoThree") cls.wallet.addPrivateKey(wif)
def setUpClass(cls): cls.bts = Steem(node=get_node_list(appbase=False), nobroadcast=True, num_retries=10) cls.appbase = Steem(node=get_node_list(appbase=True), nobroadcast=True, num_retries=10) set_shared_steem_instance(cls.bts)
def setUpClass(cls): cls.bts = Steem(node=get_node_list(appbase=False), nobroadcast=True, num_retries=10) cls.appbase = Steem(node=get_node_list(appbase=True), nobroadcast=True, num_retries=10) set_shared_steem_instance(cls.bts) cls.asset = Asset("SBD") cls.symbol = cls.asset["symbol"] cls.precision = cls.asset["precision"] cls.asset2 = Asset("STEEM")
def setUpClass(cls): cls.bts = Steem(node=get_node_list(appbase=True), use_condenser=True, nobroadcast=True, keys={"active": wif}, num_retries=10) cls.appbase = Steem(node=get_node_list(appbase=True), nobroadcast=True, keys={"active": wif}, num_retries=10) # from getpass import getpass # self.bts.wallet.unlock(getpass()) set_shared_steem_instance(cls.bts) cls.bts.set_default_account("test")
def setUpClass(cls): cls.bts = Steem(node=get_node_list(appbase=True), use_condenser=True, nobroadcast=True, keys={"active": wif}, num_retries=10) cls.appbase = Steem(node=get_node_list(appbase=True), nobroadcast=True, keys={"active": wif}, num_retries=10) cls.authorperm = "@gtg/ffdhu-gtg-witness-log" [author, permlink] = resolve_authorperm(cls.authorperm) cls.author = author cls.permlink = permlink cls.category = 'witness-category' cls.title = 'gtg witness log'
def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) self.bts = Steem( node=get_node_list(appbase=False), nobroadcast=True, num_retries=10 )
def setUpClass(cls): cls.stm = Steem(node=get_node_list(appbase=False), keys={ "active": wif, "owner": wif, "memo": wif }, nobroadcast=True, num_retries=10) cls.appbase = Steem(node=get_node_list(appbase=True), nobroadcast=True, keys={ "active": wif, "owner": wif, "memo": wif }, num_retries=10) set_shared_steem_instance(cls.stm) cls.stm.set_default_account("test")
def setUpClass(cls): cls.bts = Steem(node=get_node_list(appbase=False), nobroadcast=True, keys={"active": wif}, num_retries=10) cls.appbase = Steem(node=get_node_list(appbase=True), nobroadcast=True, keys={"active": wif}, num_retries=10) # from getpass import getpass # self.bts.wallet.unlock(getpass()) set_shared_steem_instance(cls.bts) cls.bts.set_default_account("test") cls.authorpermvoter = u"@gtg/ffdhu-gtg-witness-log|gandalf" [author, permlink, voter] = resolve_authorpermvoter(cls.authorpermvoter) cls.author = author cls.permlink = permlink cls.voter = voter cls.authorperm = construct_authorperm(author, permlink)
def setUpClass(cls): cls.bts = Steem( node=get_node_list(appbase=False), nobroadcast=True, bundle=False, # Overwrite wallet to use this list of wifs only keys={"active": wif}, num_retries=10) cls.appbase = Steem( node=get_node_list(appbase=True, testing=True), nobroadcast=True, bundle=False, # Overwrite wallet to use this list of wifs only keys={"active": wif}, num_retries=10) cls.account = Account("test", full=True, steem_instance=cls.bts) cls.account_appbase = Account("test", full=True, steem_instance=cls.appbase) set_shared_steem_instance(cls.bts)
def test_stm1stm2(self): b1 = Steem( node=["wss://testnet.steem.vc"], nobroadcast=True, num_retries=10 ) b2 = Steem( node=get_node_list(appbase=False), nobroadcast=True, num_retries=10 ) self.assertNotEqual(b1.rpc.url, b2.rpc.url)
def test_Transfer_broadcast_appbase(self): stm = Steem(node=get_node_list(appbase=True), keys=[wif], num_retries=10) tx = TransactionBuilder(expiration=10, steem_instance=stm) tx.appendOps( Transfer( **{ "from": "test", "to": "test1", "amount": Amount("1 STEEM", steem_instance=stm), "memo": "" })) tx.appendSigner("test", "active") tx.sign() with self.assertRaises(exceptions.MissingRequiredActiveAuthority): tx.broadcast()
def setUpClass(cls): cls.bts = Steem( node=get_node_list(appbase=True, testing=False), nobroadcast=True, num_retries=10, keys={"active": wif}, ) # from getpass import getpass # self.bts.wallet.unlock(getpass()) set_shared_steem_instance(cls.bts) cls.bts.set_default_account("test") b = Blockchain(steem_instance=cls.bts) num = b.get_current_block_num() cls.start = num - 25 cls.stop = num cls.max_batch_size = 1 # appbase does not support batch rpc calls at the momement (internal error)
def test_default_connection(self): b1 = Steem( node=["wss://testnet.steem.vc"], nobroadcast=True, ) set_shared_steem_instance(b1) test = Account("test") b2 = Steem( node=get_node_list(appbase=False), nobroadcast=True, ) set_shared_steem_instance(b2) bts = Account("test") self.assertEqual(test.steem.prefix, "STX") self.assertEqual(bts.steem.prefix, "STM")
def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) set_shared_steem_instance(None) self.stm = Steem( node=get_node_list(appbase=False), nobroadcast=True, bundle=False, # Overwrite wallet to use this list of wifs only wif={"active": wif}, num_retries=10) self.bts = Steem(node=["wss://ws.golos.io"], keys={ "active": wif, "owner": wif, "posting": wif }, nobroadcast=True, num_retries=10)
def setUpClass(cls): cls.bts = Steem( node=get_node_list(appbase=False), nobroadcast=True, keys={"active": wif}, num_retries=10 ) cls.appbase = Steem( node=nodes_appbase, nobroadcast=True, keys={"active": wif}, num_retries=10 ) cls.test_block_id = 19273700 # from getpass import getpass # self.bts.wallet.unlock(getpass()) set_shared_steem_instance(cls.bts) cls.bts.set_default_account("test")
from beem.blockchain import Blockchain from beem.account import Account from beem.block import Block from beem.steem import Steem from beem.utils import parse_time, formatTimedelta, get_node_list from beemgrapheneapi.rpcutils import NumRetriesReached log = logging.getLogger(__name__) logging.basicConfig(level=logging.INFO) if __name__ == "__main__": how_many_minutes = 10 how_many_virtual_op = 10000 max_batch_size = None threading = False thread_num = 16 nodes = get_node_list(appbase=False) + get_node_list(appbase=True) t = PrettyTable([ "node", "10 blockchain minutes", "10000 virtual account op", "version" ]) t.align = "l" for node in nodes: print("Current node:", node) try: stm = Steem(node=node, num_retries=3) blockchain = Blockchain(steem_instance=stm) account = Account("gtg", steem_instance=stm) virtual_op_count = account.virtual_op_count() blockchain_version = stm.get_blockchain_version() last_block_id = 19273700 last_block = Block(last_block_id, steem_instance=stm)
def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) stm = Steem(node=get_node_list(appbase=False)) self.ws = SteemWebsocket(urls=stm.rpc.urls, num_retries=10)