예제 #1
0
def startForging():
    url = 'http://'+ip+':8888/shareschain?requestType=startForging'
    data = {"secretPhrase":secretPhrase}
    obj = req.post(url, data)

    if obj['hitTime'] != '':
        print('启动锻造器成功!')
    else:
        print('启动锻造器失败!')
예제 #2
0
def sendMoney():
    url = "http://"+ip+":8888/shareschain?requestType=sendMoney"
    data = {'chain':'SCTK',
            'amountKER':1000000000,
            'recipient':'dYGNW7A8GMoHqcbkH4n3xmVjFy2',
            'secretPhrase':secretPhrase}
    obj = req.post(url, data)
    print("发起交易:")
    print(obj)
    return obj
예제 #3
0
def stopForging():
    url = 'http://'+ip+':8888/shareschain?requestType=stopForging'
    data = {"secretPhrase": secretPhrase}
    obj = req.post(url, data)
    if obj['foundAndStopped']:
        print('结束锻造器成功!')
    else:
        findobj = findForgingBySecrePhrase();
        if findobj['errorCode'] == 5:
            print('该账户未启动锻造器,或锻造器已停止!')
        else:
            print('结束锻造其失败!')
예제 #4
0
def getBlockchainStatus():
    url = 'http://' + ip + ':8888/shareschain?requestType=getBlockchainStatus'
    data = {}
    obj = req.post(url, data)
    print obj
    return obj
예제 #5
0
def getBlockchainTransactions(account):
    url = "http://"+ip+":8888/shareschain?requestType=getTransaction"
    data = {'chain': 'SCTK', 'account': account}
    obj = req.post(url, data)
    return obj
예제 #6
0
def getTransaction(fullHash):
    url = "http://"+ip+":8888/shareschain?requestType=getTransaction"
    data = {'chain':'SCTK','fullHash':fullHash}
    obj = req.post(url, data)
    return obj
예제 #7
0
def getUnconfirmedTransactionIds():
    url = "http://"+ip+":8888/shareschain?requestType=getUnconfirmedTransactionIds"
    data = {}
    obj = req.post(url, data)
    return obj
예제 #8
0
def getSmcTransaction(transaction,fullHash):
    url = "http://"+ip+":8888/shareschain?requestType=getSmcTransaction"
    data = {'transaction':transaction,'fullHash':fullHash}
    obj = req.post(url, data)
    return obj
예제 #9
0
def getNextBlockGenerators():
    url = 'http://'+ip+':8888/shareschain?requestType=getNextBlockGenerators'
    data = {}
    obj = req.post(url, data)
    return obj
예제 #10
0
def findForgingBySecrePhrase():
    url = 'http://'+ip+':8888/shareschain?requestType=getForging'
    data = {"secretPhrase": secretPhrase}
    obj = req.post(url, data)
    return obj
예제 #11
0
파일: Peer.py 프로젝트: joinyhl/shareschain
def getNodes():
    url = "http://" + ip + ":8888/shareschain?requestType=getNodes"
    data = {}
    obj = req.post(url, data)
    return obj
예제 #12
0
파일: Peer.py 프로젝트: joinyhl/shareschain
def addNode(nodeIP):
    url = "http://" + ip + ":8888/shareschain?requestType=addNode"
    data = {'node': nodeIP}
    obj = req.post(url, data)
    return obj