Пример #1
0
 def db_name_firstupdate(self, name, jsonString=""):
     first = True        
     while (((self.db[name]["name_new_height"] + params.BLOCKWAITTIME) > pnc.getblockcount()) and
           ((self.db[name]["name_new_time"] + params.BLOCKWAITTIME * 15 * 60 )> time.time())):  # conservative guess
         if first:
             print "Too early for name_firstupdate - wait at least 12 blocks after name_new (~2 hours)"
             print "Waiting for previous name_new to settle...",
             first = False
         else:
             print ".",
         time.sleep(60)
     jsonString = pnc.escape(jsonString)
     print "name_firstupdate:", name,
     try:
         pnc.name_firstupdate(name, self.db[name]["name_new"][1], self.db[name]["name_new"][0],
                                  jsonString)
         print "done"
     except pnc.BitcoinError, e:
         print "failed"
         raise
Пример #2
0
 def db_name_firstupdate(self, name, jsonString=""):
     first = True
     while (
         ((self.db[name]["name_new_height"] + params.BLOCKWAITTIME) >
          pnc.getblockcount()) and
         ((self.db[name]["name_new_time"] + params.BLOCKWAITTIME * 15 * 60)
          > time.time())):  # conservative guess
         if first:
             print "Too early for name_firstupdate - wait at least 12 blocks after name_new (~2 hours)"
             print "Waiting for previous name_new to settle...",
             first = False
         else:
             print ".",
         time.sleep(60)
     jsonString = pnc.escape(jsonString)
     print "name_firstupdate:", name,
     try:
         pnc.name_firstupdate(name, self.db[name]["name_new"][1],
                              self.db[name]["name_new"][0], jsonString)
         print "done"
     except pnc.BitcoinError, e:
         print "failed"
         raise
Пример #3
0
    nameDictList = nameDictListSoon

updateCost = len(nameDictList) * 0.005
print "Updating will cost at most %.6f namecoins" % updateCost
if info["balance"] < updateCost:
    print "Balance too low to update all domains. Quitting."
    raise Exception("Balance too low.")
print "random delay between updates: %d seconds" % randomDelayMax
print "press enter to proceed; ctrl-c to stop"
try:
    raw_input()
except KeyboardInterrupt:
    raise SystemExit("manual interruption")

print "updating..."

for nd in nameDictList:
    print nd["name"], pnc.escape(nd["value"])
    try:
        r = pnc.name_update(nd["name"], pnc.quote(pnc.escape(nd["value"])))
    except pynamecoin.BitcoinError as e:
        message = e.args[0]
        if "pending operations" in message:
            print "Pending operations on %s - skipping." % nd["name"]
            pass
        raise
    print r
    print
    time.sleep(random.randint(0, randomDelayMax))
print "done. remember it will take 1 block until the update will be reflected."
Пример #4
0
    nameDictList = nameDictListSoon

updateCost = len(nameDictList) * 0.005
print "Updating will cost at most %.6f namecoins" % updateCost
if info["balance"] < updateCost:
    print "Balance too low to update all domains. Quitting."
    raise Exception("Balance too low.")
print "random delay between updates: %d seconds" % randomDelayMax
print "press enter to proceed; ctrl-c to stop"
try:
    raw_input()
except KeyboardInterrupt:
    raise SystemExit("manual interruption")

print "updating..."

for nd in nameDictList:
    print nd["name"], pnc.escape(nd["value"])
    try:
        r = pnc.name_update(nd["name"], pnc.quote(pnc.escape(nd["value"])))
    except pynamecoin.BitcoinError as e:
        message = e.args[0]
        if "pending operations" in message:
            print "Pending operations on %s - skipping." % nd["name"]
            pass
        raise
    print r
    print
    time.sleep(random.randint(0, randomDelayMax))
print "done. remember it will take 1 block until the update will be reflected."