示例#1
0
 def setUpClass(cls):
     nodelist = NodeList()
     nodelist.update_nodes(steem_instance=Steem(node=nodelist.get_nodes(
         normal=True, appbase=True),
                                                num_retries=10))
     cls.bts = Steem(
         node=nodelist.get_nodes(normal=True, appbase=False),
         nobroadcast=True,
         bundle=False,
         unsigned=True,
         # Overwrite wallet to use this list of wifs only
         keys={"active": wif},
         num_retries=10)
     cls.appbase = Steem(
         node=nodelist.get_nodes(normal=False, appbase=True, dev=False),
         nobroadcast=True,
         bundle=False,
         unsigned=True,
         # Overwrite wallet to use this list of wifs only
         keys={"active": wif},
         num_retries=10)
     cls.account = Account("beembot", full=True, steem_instance=cls.bts)
     cls.account_appbase = Account("beembot",
                                   full=True,
                                   steem_instance=cls.appbase)
     set_shared_steem_instance(cls.bts)
 def setUpClass(cls):
     nodelist = NodeList()
     stm = Steem(node=nodelist.get_nodes(),
                 nobroadcast=True,
                 num_retries=10,
                 expiration=120)
     set_shared_steem_instance(stm)
示例#3
0
 def setUpClass(cls):
     steem = Steem(
         node=get_hive_nodes(),
         nobroadcast=True,
         num_retries=10
     )
     set_shared_steem_instance(steem)
示例#4
0
    def setUpClass(cls):
        nodelist = NodeList()
        cls.bts = Steem(node=nodelist.get_nodes(appbase=False),
                        nobroadcast=True,
                        keys={"active": wif},
                        num_retries=10)
        cls.appbase = Steem(node=nodelist.get_nodes(normal=False,
                                                    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")

        acc = Account("holger80", steem_instance=cls.bts)
        votes = acc.get_account_votes()
        last_vote = votes[0]

        cls.authorpermvoter = '@' + last_vote['authorperm'] + '|' + acc["name"]
        [author, permlink,
         voter] = resolve_authorpermvoter(cls.authorpermvoter)
        cls.author = author
        cls.permlink = permlink
        cls.voter = voter
        cls.authorperm = construct_authorperm(author, permlink)
示例#5
0
 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()
示例#6
0
 def test_price(self, node_param):
     if node_param == "instance":
         set_shared_steem_instance(self.bts)
         o = Price(
             10.0, "%s/%s" %
             (self.bts.token_symbol, self.bts.backed_token_symbol))
         self.assertIn(o.blockchain.rpc.url, self.urls)
         with self.assertRaises(RPCConnection):
             Price(10.0,
                   "%s/%s" %
                   (self.bts.token_symbol, self.bts.backed_token_symbol),
                   steem_instance=Steem(node="https://abc.d",
                                        autoconnect=False,
                                        num_retries=1))
     else:
         set_shared_steem_instance(
             Steem(node="https://abc.d", autoconnect=False, num_retries=1))
         stm = self.bts
         o = Price(10.0,
                   "%s/%s" %
                   (self.bts.token_symbol, self.bts.backed_token_symbol),
                   steem_instance=stm)
         self.assertIn(o.blockchain.rpc.url, self.urls)
         with self.assertRaises(RPCConnection):
             Price(
                 10.0, "%s/%s" %
                 (self.bts.token_symbol, self.bts.backed_token_symbol))
示例#7
0
def cli(node, dry_run, verbosity):
    numeric_loglevel = getattr(logging, verbosity.upper(), None)
    if not isinstance(numeric_loglevel, int):
        raise ValueError('Invalid log level: %s' % verbosity)
    logger.setLevel(numeric_loglevel)
    stm = Steem(node=node, nobroadcast=dry_run)
    set_shared_steem_instance(stm)
def steemstem_vote_finder(user):
    stm = Steem(node=[
        'https://rpc.steemviz.com', 'https://api.steem.house',
        'https://gtg.steem.house:8090', 'wss://gtg.steem.house:8090',
        'https://steemd-appbase.steemit.com', 'wss://steemd.privex.io',
        'https://steemd.privex.io', 'wss://anyx.io', 'https://anyx.io',
        'wss://rpc.curiesteem.com', 'https://rpc.buildteam.io',
        'https://rpc.steemliberator.com', 'https://appbasetest.timcliff.com',
        'wss://rpc.steemviz.com', 'https://steemd.minnowsupportproject.org'
    ])
    set_shared_steem_instance(stm)

    steemstem_user = user
    acc = Account(steemstem_user)
    for post in acc.blog_history():
        if post['parent_author'] == '' and post['author'] == steemstem_user:
            p_link = post['author'] + '/' + post['permlink']
            com_link = Comment(p_link)
            if 'steemstem' in com_link.get_votes():

                html_link = '<a href= \"https://steemit.com/' + '@' + p_link + '\"' + '>' + unidecode(
                    post['title']) + '</a>'
                print(html_link)
                f = open(user + "_" + "steemstem.txt", "a")
                f.write(html_link + '\n')
                f.close()
示例#9
0
文件: test_vote.py 项目: oldas1/beem
    def setUpClass(cls):
        nodelist = NodeList()
        nodelist.update_nodes(steem_instance=Steem(node=nodelist.get_nodes(hive=True), num_retries=10))
        cls.bts = Steem(
            node=nodelist.get_nodes(hive=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")

        acc = Account("fullnodeupdate", steem_instance=cls.bts)
        n_votes = 0
        index = 0
        entries = acc.get_blog_entries(limit=30)[::-1]
        while n_votes == 0:
            comment = Comment(entries[index], steem_instance=cls.bts)
            votes = comment.get_votes()
            n_votes = len(votes)
            index += 1

        last_vote = votes[0]

        cls.authorpermvoter = construct_authorpermvoter(last_vote['author'], last_vote['permlink'], last_vote["voter"])
        [author, permlink, voter] = resolve_authorpermvoter(cls.authorpermvoter)
        cls.author = author
        cls.permlink = permlink
        cls.voter = voter
        cls.authorperm = construct_authorperm(author, permlink)
示例#10
0
 def setUpClass(cls):
     nodelist = NodeList()
     nodelist.update_nodes(steem_instance=Steem(
         node=nodelist.get_nodes(normal=True, appbase=True), num_retries=3))
     cls.nodes = nodelist.get_nodes(https=False, appbase=False)
     cls.nodes_https = nodelist.get_nodes(wss=False, appbase=False)
     cls.nodes_appbase = nodelist.get_nodes(normal=False)
     cls.test_list = nodelist.get_nodes()
     cls.bts = Steem(node=cls.nodes,
                     nobroadcast=True,
                     keys={
                         "active": wif,
                         "owner": wif,
                         "memo": wif
                     },
                     num_retries=10)
     cls.appbase = Steem(node=cls.nodes_appbase,
                         nobroadcast=True,
                         keys={
                             "active": wif,
                             "owner": wif,
                             "memo": wif
                         },
                         num_retries=10)
     cls.rpc = SteemNodeRPC(urls=cls.test_list)
     # from getpass import getpass
     # self.bts.wallet.unlock(getpass())
     set_shared_steem_instance(cls.bts)
     cls.bts.set_default_account("test")
示例#11
0
    def setUpClass(cls):
        nodelist = NodeList()
        nodelist.update_nodes(steem_instance=Steem(node=nodelist.get_nodes(
            normal=True, appbase=True),
                                                   num_retries=10))
        cls.bts = Steem(node=nodelist.get_nodes(),
                        nobroadcast=True,
                        keys={"active": wif},
                        num_retries=10)
        b = Blockchain(steem_instance=cls.bts)
        num = b.get_current_block_num()
        cls.start = num - 25
        cls.stop = num

        cls.testnet = Steem(node="https://testnet.steemitdev.com",
                            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")
        b = Blockchain(steem_instance=cls.testnet)
        num = b.get_current_block_num()
        cls.start_testnet = num - 25
        cls.stop_testnet = num
示例#12
0
文件: test_wallet.py 项目: svitx/beem
    def setUpClass(cls):
        stm = shared_steem_instance()
        stm.config.refreshBackup()
        nodelist = NodeList()
        nodelist.update_nodes(steem_instance=Steem(node=nodelist.get_nodes(
            normal=True, appbase=True),
                                                   num_retries=10))

        cls.stm = Steem(
            node=nodelist.get_nodes(),
            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.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)
示例#13
0
def profiling(name_list):
    stm = Steem()
    set_shared_steem_instance(stm)
    del stm
    print("start")
    for name in name_list:
        print("account: %s" % (name))
        acc = Account(name)
        max_index = acc.virtual_op_count()
        print(max_index)
        stopTime = datetime(2018, 4, 22, 0, 0, 0)
        hist_elem = None
        for h in acc.history_reverse(stop=stopTime):
            hist_elem = h
        print(hist_elem)
    print("blockchain")
    blockchain_object = Blockchain()
    current_num = blockchain_object.get_current_block_num()
    startBlockNumber = current_num - 20
    endBlockNumber = current_num
    block_elem = None
    for o in blockchain_object.ops(start=startBlockNumber, stop=endBlockNumber):
        print("block %d" % (o["block_num"]))
        block_elem = o
    print(block_elem)
示例#14
0
def main():
    load_config()
    load_users()

    stm = Steem(wif=config['wif'])
    set_shared_steem_instance(stm)

    do_airdrop(stm)
 def setUpClass(cls):
     nodelist = NodeList()
     nodelist.update_nodes(steem_instance=Steem(
         node=nodelist.get_nodes(exclude_limited=False), num_retries=10))
     cls.bts = Steem(node=nodelist.get_nodes(exclude_limited=True),
                     nobroadcast=True,
                     num_retries=10)
     set_shared_steem_instance(cls.bts)
示例#16
0
def steem():
    nodes = NodeList()
    nodes.update_nodes()
    stm = Steem(node=nodes.get_nodes(), nobroadcast=config.test)
    set_shared_steem_instance(stm)
    stm.wallet.unlock(config.default_passphrase)
    account = Account(config.default_stmacct, steem_instance=stm)
    return stm, account
示例#17
0
 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)
示例#18
0
 def setUpClass(cls):
     nodelist = NodeList()
     cls.bts = Steem(
         node=nodelist.get_nodes(),
         nobroadcast=True,
         num_retries=10
     )
     set_shared_steem_instance(cls.bts)
示例#19
0
 def setUpClass(cls):
     stm = shared_steem_instance()
     stm.config.refreshBackup()
     stm.set_default_nodes("")
     del stm
     cls.url = "https://api.steemitdev.com"
     bts = Steem(node=[cls.url], nobroadcast=True, num_retries=10)
     set_shared_steem_instance(bts)
示例#20
0
 def setUpClass(cls):
     nodelist = NodeList()
     nodelist.update_nodes(steem_instance=Steem(node=nodelist.get_nodes(
         normal=True, appbase=True),
                                                num_retries=10))
     cls.bts = Steem(node=nodelist.get_nodes(),
                     nobroadcast=True,
                     num_retries=10)
     set_shared_steem_instance(cls.bts)
示例#21
0
 def setUpClass(cls):
     cls.bts = Steem(node=get_hive_nodes(),
                     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")
示例#22
0
    def setUpClass(cls):
        nodelist = NodeList()
        stm = Steem(node=nodelist.get_nodes())
        stm.config.refreshBackup()
        stm.set_default_nodes(["xyz"])
        del stm

        cls.urls = nodelist.get_nodes()
        cls.bts = Steem(node=cls.urls, nobroadcast=True, num_retries=10)
        set_shared_steem_instance(cls.bts)
示例#23
0
 def setUpClass(cls):
     nodelist = NodeList()
     nodelist.update_nodes(steem_instance=Hive(node=nodelist.get_hive_nodes(), num_retries=10))
     cls.bts = Hive(
         node=nodelist.get_nodes(exclude_limited=True),
         nobroadcast=True,
         keys=[wif],
         num_retries=10
     )
     set_shared_steem_instance(cls.bts)
示例#24
0
    def test_default_connection(self):
        nodelist = NodeList()
        nodelist.update_nodes(steem_instance=Steem(node=nodelist.get_nodes(normal=True, appbase=True), num_retries=10))

        b2 = Steem(
            node=nodelist.get_nodes(),
            nobroadcast=True,
        )
        set_shared_steem_instance(b2)
        bts = Account("beem")
        self.assertEqual(bts.steem.prefix, "STM")
示例#25
0
    def test_default_connection(self):
        nodelist = NodeList()
        nodelist.update_nodes(steem_instance=Hive(node=nodelist.get_hive_nodes(), num_retries=10))

        b2 = Hive(
            node=nodelist.get_hive_nodes(),
            nobroadcast=True,
        )
        set_shared_steem_instance(b2)
        bts = Account("beem")
        self.assertEqual(bts.blockchain.prefix, "STM")
示例#26
0
    def setUpClass(cls):
        node_list = get_hive_nodes()

        cls.bts = Steem(node=node_list,
                        use_condenser=False,
                        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")
示例#27
0
 def __init__(self,
              con: Configuration,
              log: Logger,
              nobroadcast=True,
              active=''):
     self.conf = con
     self.stm = Steem(node="https://appbasetest.timcliff.com",
                      nobroadcast=nobroadcast,
                      unsigned=nobroadcast)
     self.stm.set_default_nodes(NODE_LIST)
     self.log = log
     set_shared_steem_instance(self.stm)
示例#28
0
 def setUpClass(cls):
     nodelist = NodeList()
     nodelist.update_nodes(steem_instance=Steem(
         node=nodelist.get_steem_nodes(), num_retries=10))
     cls.bts = Steem(node=nodelist.get_steem_nodes(),
                     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")
示例#29
0
 def setUpClass(cls):
     cls.bts = Steem(
         node=get_hive_nodes(),
         nobroadcast=True,
         num_retries=10
     )
     cls.steemit = Steem(
         node="https://api.steemit.com",
         nobroadcast=True,
         num_retries=10
     )
     set_shared_steem_instance(cls.bts)
示例#30
0
文件: test_amount.py 项目: E-D-A/beem
 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")