示例#1
0
 def pubfeed(self, price):
     if self.locked():
         self.unlock_wallet()
     w = Witness(self.conf.d['owner'])
     if w.feed_publish(base=price, quote="1.000 STEEM"):
         logstr = "Feed published: {:.3f} SBD/STEEM".format(price)
         self.log.log(logstr, 1)
示例#2
0
 def pubfeed(self, price):
     if not self.__wallet_hook():
         return False
     w = Witness(self.conf.d['owner'])
     if w.feed_publish(base=price, quote="1.000 STEEM"):
         logstr = "Feed published: {:.3f} SBD/STEEM".format(price)
         self.log.log(logstr, 1)
         return True
示例#3
0
 def test_feed_publish(self, node_param):
     if node_param == "non_appbase":
         bts = self.bts
     else:
         bts = self.appbase
     bts.txbuffer.clear()
     w = Witness("gtg", steem_instance=bts)
     tx = w.feed_publish("4 SBD", "1 STEEM")
     self.assertEqual((tx["operations"][0][0]), "feed_publish")
     op = tx["operations"][0][1]
     self.assertIn("gtg", op["publisher"])
示例#4
0
 def test_feed_publish(self, node_param):
     if node_param == "normal":
         bts = self.bts
     else:
         bts = self.steemit
     bts.txbuffer.clear()
     w = Witness("gtg", steem_instance=bts)
     tx = w.feed_publish("4 %s" % bts.backed_token_symbol,
                         "1 %s" % bts.token_symbol)
     self.assertEqual((tx["operations"][0][0]), "feed_publish")
     op = tx["operations"][0][1]
     self.assertIn("gtg", op["publisher"])
示例#5
0
    else:
        blk_auths_public[role] = str(account.json()[role]["key_auths"][0][0])

    if publickey == blk_auths_public[role]:
        return True
    else:
        return False

parser = ArgumentParser()
parser.add_argument('witness', help="Name of the Pulsar Witness", type=str, nargs=1)
parser.add_argument('privateactivekey', help="Private active key of the Witness", type=str, nargs=1)
parser.add_argument('baseprice', help="New feed price in EUR to publish for a 1.000 Pulsar quote. E.G.: \"4.700\"", type=float, nargs=1)
args = parser.parse_args()

if checkwit(args.witness[0]):
    if not checkkey(args.witness[0], args.privateactivekey[0], "active"): sys.exit("Private active key " + args.privateactivekey[0] + " doesn't prove authority for Witness " + args.witness[0])
    #Witness exists
    stm = Steem(node=["https://apidev.blkcc.xyz"])
    set_shared_steem_instance(stm)

    my_feed = "{:.3f} EUR".format(args.baseprice[0])
    wit = Witness(args.witness[0])

    output = wit.feed_publish(my_feed)
    print(json.dumps(output, indent=4))

else:
     sys.exit("The account provided is not a valid witness in the Pulsar Blockchain. Wrong witness " + args.account[0])

# vim: set filetype=sh ts=4 sw=4 tw=0 wrap et:
示例#6
0
    for account in accounts:
        keys.append(account["private_key"])
    
    if node is not None:
        node.run_hive_node(["--enable-stale-production"])
    try:
        if node is not None and node.is_running():
            logger.info("Connecting to testnet...")
            node_client = Hive(node = [node_url], no_broadcast = False, 
                keys = keys
            )

            logger.info("Publishing feed...")
            from beem.witness import Witness
            w = Witness("initminer", hive_instance=node_client)
            w.feed_publish(1000.000, account="initminer")
            hive_utils.common.wait_n_blocks(node_client.rpc.url, 5)

            logger.info("Chain prefix is: {}".format(node_client.prefix))
            logger.info("Chain ID is: {}".format(node_client.get_config()["HIVE_CHAIN_ID"]))

            # create accounts
            test_utils.create_accounts(node_client, args.creator, accounts)
            # tranfer to vesting
            test_utils.transfer_to_vesting(node_client, args.creator, accounts, "3000000.000", "TESTS")
            # transfer assets to accounts
            test_utils.transfer_assets_to_accounts(node_client, args.creator, accounts, "10000.000", "TESTS")
            test_utils.transfer_assets_to_accounts(node_client, args.creator, accounts, "10000.000", "TBD")

            logger.info("Balances for accounts after initial transfer")
            test_utils.print_balance(node_client, accounts)