Example #1
0
def setup():
    hiss.rattle('Register peeers')
    reg_all_peer()
Example #2
0
def delete():
    hiss.rattle('Delete register orderers job')
    del_all_reg_orderer()
Example #3
0
def delete():
    hiss.rattle('Delete explorer DB')
    del_explorer_db()

    hiss.rattle('Delete explorer')
    del_explorer()
Example #4
0
def setup():
    hiss.rattle('Setup Root CA Server')
    setup_rca()
Example #5
0
def terminate():
    hiss.rattle('Terminate Root CA Server')
    terminate_rca()
Example #6
0
def delete():
    hiss.rattle('Delete job generate connection profiles')

    delete_all_ccp()
Example #7
0
def delete():
    hiss.rattle('Delete Orderer')
    delete_all_orderer()
Example #8
0
def delete():
    hiss.rattle('Delete register organizations job')
    del_all_reg_org()
Example #9
0
def setup():
    hiss.rattle('Setup Kafka')
    setup_kafka()
Example #10
0
def env():
    hiss.rattle('Create environment for network')
    os.system('./k8s/environment/setup.sh')
    return True
Example #11
0
def setup():
    hiss.rattle('Register organizations')
    reg_all_org()
Example #12
0
def delete():

    hiss.rattle('Delete prometheus')
    del_prometheus()
Example #13
0
def setup():

    hiss.rattle('Setup prometheus')
    setup_prometheus()
Example #14
0
def delete():
    hiss.rattle('Delete register peers job')
    del_all_reg_peer()
Example #15
0
def delete():
    hiss.rattle('Delete job channel artifact')

    del_gen_channel_artifact()
Example #16
0
def delete():
    hiss.rattle('Delete Kafka')
    delete_kafka()
Example #17
0
def generate():
    hiss.rattle('Generate connection profiles')

    generate_all_ccp()
Example #18
0
def terminate():
    hiss.rattle('Terminate Kafka')
    terminate_kafka()
Example #19
0
def setup():
    hiss.rattle('Setup orderers')
    setup_all_orderer()
Example #20
0
def setup():
    hiss.rattle('Generate application artifacts')

    generate_artifact()
Example #21
0
def terminate():
    hiss.rattle('Terminate Orderer')
    terminate_all_orderer()
Example #22
0
def delete():
    hiss.rattle('Delete job gen artifact')

    del_generate_artifact()
Example #23
0
def delete():
    hiss.rattle('Delete Root CA Server')
    delete_rca()
Example #24
0
def setup():
    hiss.rattle('Generate channel.tx, genesis.block')

    bootstrap_network()
Example #25
0
def setup():
    hiss.rattle('Register orderers')
    reg_all_orderer()
Example #26
0
def delete():
    hiss.rattle('Delete job channel artifact')

    del_bootstrap_network()
Example #27
0
def setup():
    hiss.rattle('Setup explorer DB')
    setup_explorer_db()

    hiss.rattle('Setup explorer')
    setup_explorer()
Example #28
0
def setup():
    hiss.rattle('Generate channel.tx, genesis.block')

    gen_channel_artifact()
Example #29
0
def copy_scripts():
    hiss.rattle('Copy scripts to EFS')

    # Find efs pod
    pods = settings.k8s.find_pod(namespace="default", keyword="test-efs")
    if not pods:
        return hiss.hiss('cannot find tiller pod')

    # Check empty folder
    exec_command = [
        '/bin/bash', '-c',
        'test -d %s && echo "1" || echo "0"' % (settings.EFS_ROOT)
    ]

    result_get_folder = settings.k8s.exec_pod(podName=pods[0],
                                              namespace="default",
                                              command=exec_command)
    if int(result_get_folder.data) < 1:
        hiss.sub_echo('Folder %s not found. Creating...' % settings.EFS_ROOT)
        exec_command = [
            '/bin/bash', '-c',
            'mkdir -p %s/admin; mkdir -p %s/akc-ca-data' %
            (settings.EFS_ROOT, settings.EFS_ROOT)
        ]

        # Create folder in efs
        result_create_folder = settings.k8s.exec_pod(podName=pods[0],
                                                     namespace="default",
                                                     command=exec_command)
        if result_create_folder.success == False:
            return hiss.hiss('cannot create folders in %s: %s' %
                             (pods[0], result_create_folder.msg))

    # Copy config to scripts/env
    hiss.sub_echo('Copy config to scripts/env')
    config_file = os.path.abspath(os.path.join(__package__, "../config/.env"))
    env_script_File = os.path.abspath(
        os.path.join(__package__, "../blockchain/scripts/env-scripts.sh"))
    copyfile(config_file, env_script_File)

    # Remove old script folder in efs
    hiss.sub_echo('Remove old script folder in efs')
    exec_command = [
        '/bin/bash', '-c',
        'rm -rf %s/akc-ca-scripts/*' % (settings.EFS_ROOT)
    ]

    result_create_folder = settings.k8s.exec_pod(podName=pods[0],
                                                 namespace="default",
                                                 command=exec_command)
    if result_create_folder.success == False:
        return hiss.hiss('cannot remove folders in %s' % pods[0])

    # Copy scripts folder to efs
    hiss.sub_echo('Copy scripts folder to efs')
    script_path = os.path.abspath(
        os.path.join(__package__, "../blockchain/scripts"))
    if not settings.k8s.cp_to_pod(
            podName=pods[0],
            namespace='default',
            source=script_path,
            target='%s/akc-ca-scripts' % settings.EFS_ROOT):
        return hiss.hiss('connot copy scripts folder to pod %s' % pods[0])

    exec_command = [
        '/bin/bash', '-c',
        ('test -d ' + settings.EFS_ROOT + '/akc-ca-scripts/akc-ca-scripts'
         ' && mv ' + settings.EFS_ROOT + '/akc-ca-scripts/akc-ca-scripts/* ' +
         settings.EFS_ROOT + '/akc-ca-scripts || echo "ok"')
    ]

    result_create_folder = settings.k8s.exec_pod(podName=pods[0],
                                                 namespace="default",
                                                 command=exec_command)
    if result_create_folder.success == False:
        return hiss.hiss('cannot remove folders in %s' % pods[0])

    # Copy test chaincode to efs
    hiss.sub_echo('Copy test chaincode to efs')
    artifacts_path = os.path.abspath(
        os.path.join(__package__, "../blockchain/artifacts"))
    if not settings.k8s.cp_to_pod(
            podName=pods[0],
            namespace='default',
            source=artifacts_path,
            target='%s/admin/artifacts' % settings.EFS_ROOT):
        return hiss.hiss('connot copy test chaincode to pod %s' % pods[0])

    return True
Example #30
0
def terminate():
    hiss.rattle('Terminate Intermediate CA Server')
    terminate_all_ica()