def random_invoke_impl(context, name, args, length, peer):
    payload = ''.join(
        random.choice(string.ascii_letters) for _ in range(length))
    random_key = str(random.randint(0, sys.maxint))
    context.payload = {"payload": payload, "len": length}
    context.random_key = random_key
    chaincode = {
        "args": args.format(random_value=payload, random_key=random_key),
        "name": name
    }
    orderers = endorser_util.get_orderers(context)
    context.result = endorser_util.invoke_chaincode(
        context, chaincode, orderers, peer, endorser_util.TEST_CHANNEL_ID)
Esempio n. 2
0
def invokes_impl(context, numInvokes, channel, name, args, component):
    chaincode = {"args": args, "name": name}
    orderers = endorser_util.get_orderers(context)
    for count in range(int(numInvokes)):
        context.result = endorser_util.invoke_chaincode(
            context, chaincode, orderers, component, channel)
Esempio n. 3
0
def invokes_impl(context, numInvokes, channel, name, args, component):
    chaincode = {"args": args,
                 "name": name}
    orderers = endorser_util.get_orderers(context)
    for count in range(int(numInvokes)):
        context.result = endorser_util.invoke_chaincode(context, chaincode, orderers, component, channel)