Example #1
0
 def display_wallet_info(self):
     info = pnc.getinfo()
     for k in ["blocks", "difficulty", "version", "balance"]:
         print ("%s: " % k) + str(info[k])
Example #2
0
    def run(self):
        self.name_new_all()
        self.name_firstupdate_all()

    def run_save(self):
        try:
            self.run()
        except:
            self.db_save()
            raise
        

if __name__ == "__main__":
    print "Namecoin Stock Control v0.1beta"
    info = pnc.getinfo()
    for k in ["blocks", "difficulty", "version", "balance"]:
        print ("%s: " % k) + str(info[k])
    print

    cost = params.PIECES * (0.005 + 0.01) * 2

    if cost <= info["balance"]:
        ncscIssue = NcscIssue(prefix=params.PREFIX, stockName=params.stockName,
                              jsonStringIssuer=params.jsonStringIssuer)
        print
        print "About to register " + str(params.PIECES) + " + 2 namecoin names. Approximate maximum cost %.3fNMC" % cost
        print "This can easily take a couple of hours (at least two)!"
        print "Proceed? <enter> / <ctrl-c>"
        raw_input()
        ncscIssue.run_save()
Example #3
0
"""
nmcautoupdate v0.2
phelix / 2012 / nx.bit
MIT License - no guarantees
"""

randomDelayMax = 10  # make it a little more difficult to recognize the domains are from one wallet

updateAll = False  # update all or only soon expiring
soonDays = 62

import pynamecoin as pnc
import time
import random

info = pnc.getinfo()
for k in info:
    print("%s: " % k) + str(info[k])
print

print "Getting list of own domains. May take a while."
nameDictList = pnc.name_list()

print "Total number of own domains in wallet: ", len(nameDictList)

earliest = 999999
earliestNd = {}
for nd in nameDictList:
    if nd["expires_in"] < earliest:
        earliest = nd["expires_in"]
        earliestNd = nd