Exemplo n.º 1
0
class TestMinerSupr(unittest.TestCase):
    def setUp(self):
        self.minerSupr = MinerSupr('')

    def tearDown(self):
        pass

    def test_tick(self):
        self.minerSupr.tick()
Exemplo n.º 2
0
    def test_post(self):
        url = 'http://192.168.207.130:8080/reward'
        minerSupr = MinerSupr('')
        data = {}

        gensig = '1C532145697A8B6F'
        string = 'abcdefgh'
        bys = bytes(string, encoding="utf8")
        proof = str(bys, encoding="utf8")
        bag = minerSupr.bag()

        data['gensig'] = gensig
        data['proof'] = proof
        data['bag'] = bag

        newUrl = Http.newUrl(url, {'requestType': 'participateinTaiSai'})
        resp = Http.post(newUrl, data)
        print('resp: %s' % resp)
Exemplo n.º 3
0
class TestMinerSupr(unittest.TestCase):
    def setUp(self):
        self.minerSupr = MinerSupr('')

    def tearDown(self):
        pass

    def test_bag(self):
        bag = self.minerSupr.bag()
        print(bag)
Exemplo n.º 4
0
def runMiner(argv):
    action = argv[1]

    if action == 'generate':
        minerSupr = MinerSupr('')
        bgStr = minerSupr.bag()

        bgDict = json.loads(bgStr)
        address = bgDict['address']

        if len(argv) > 2:
            plotSize = int(argv[2])
        else:
            plotSize = 1
        genParams = GenParams(address, 1, plotSize, 1)

        genSupervisor = GenSupervisor(genParams)
        genSupervisor.init()
    elif action == 'mine':
        minerSupr = MinerSupr('')
        minerSupr.tick()
Exemplo n.º 5
0
 def setUp(self):
     self.minerSupr = MinerSupr('')