Ejemplo n.º 1
0
def getBurstData():
    addy = burstAddress
    poolSelect = poolAddress
    if addy == "":
        pendingAmount = "0"
        effectiveCapacity = "0"
    else:
        channel = grpc.insecure_channel(str(poolSelect))
        stub = api_pb2_grpc.ApiStub(channel)
        addy = convert(addy)
        addy2 = int(addy)
        miner1 = (stub.GetMinerInfo(api_pb2.MinerRequest(ID=addy2)))
        pend = (int(miner1.pending) / float(100000000))
        cap = Decimal(miner1.effectiveCapacity)
        cap = round(cap, 4)
        historic = (miner1.historicalShare)
        historic = round((historic * 100), 3)
        blocks = (miner1.nConf)
        balance = getBal(addy)
        pendingAmount = (str(pend) + " Burst")
        effectiveCapacity = (str(cap) + " TB")
        historicalShare = (str(historic) + "%")
        validDl = (str(blocks))
        bal = (str(balance) + " BURST")
        return (pendingAmount, effectiveCapacity, historicalShare, validDl,
                bal)
Ejemplo n.º 2
0
def save(args):
    imgs = list(getFiles(args.inputDir))
    channel = grpc.insecure_channel(args.apiUrl)
    stub = api_pb2_grpc.ApiStub(channel)
    response = stub.AddFaces(
        api_pb2.AddFacesRequest(name='uncategorized', images=imgs))
    print(response)
Ejemplo n.º 3
0
def infer(args):
    imgs = list(getFiles(args.inputDir))
    channel = grpc.insecure_channel(args.apiUrl)
    stub = api_pb2_grpc.ApiStub(channel)
    response = stub.Infer(
        api_pb2.InferRequest(images=imgs, isAligned=args.preAligned))
    for img in response.predictions:
        print("Predict {} with {:.2f} confidence.".format(
            img.name, img.confidence))
Ejemplo n.º 4
0
import grpc
import api_pb2
import api_pb2_grpc

channel = grpc.insecure_channel('0-100-pool.burst.cryptoguru.org:8008')
stub = api_pb2_grpc.ApiStub(channel)

pool_stats = stub.GetPoolStatsInfo(api_pb2.Void())
print(pool_stats)

block_info = stub.GetBlockInfo(api_pb2.Void())
print(block_info)

channel = grpc.insecure_channel('100-0-pool.burst.cryptoguru.org:8008')
stub = api_pb2_grpc.ApiStub(channel)

pool_stats = stub.GetPoolStatsInfo(api_pb2.Void())
print(pool_stats)

block_info = stub.GetBlockInfo(api_pb2.Void())
print(block_info)

channel = grpc.insecure_channel('50-50-pool.burst.cryptoguru.org:8008')
stub = api_pb2_grpc.ApiStub(channel)

pool_stats = stub.GetPoolStatsInfo(api_pb2.Void())
print(pool_stats)

block_info = stub.GetBlockInfo(api_pb2.Void())
print(block_info)
Ejemplo n.º 5
0
def reloadModel(args):
    channel = grpc.insecure_channel(args.apiUrl)
    stub = api_pb2_grpc.ApiStub(channel)
    response = stub.Reload(api_pb2.ReloadRequest())