def setup(): hiss.rattle('Register peeers') reg_all_peer()
def delete(): hiss.rattle('Delete register orderers job') del_all_reg_orderer()
def delete(): hiss.rattle('Delete explorer DB') del_explorer_db() hiss.rattle('Delete explorer') del_explorer()
def setup(): hiss.rattle('Setup Root CA Server') setup_rca()
def terminate(): hiss.rattle('Terminate Root CA Server') terminate_rca()
def delete(): hiss.rattle('Delete job generate connection profiles') delete_all_ccp()
def delete(): hiss.rattle('Delete Orderer') delete_all_orderer()
def delete(): hiss.rattle('Delete register organizations job') del_all_reg_org()
def setup(): hiss.rattle('Setup Kafka') setup_kafka()
def env(): hiss.rattle('Create environment for network') os.system('./k8s/environment/setup.sh') return True
def setup(): hiss.rattle('Register organizations') reg_all_org()
def delete(): hiss.rattle('Delete prometheus') del_prometheus()
def setup(): hiss.rattle('Setup prometheus') setup_prometheus()
def delete(): hiss.rattle('Delete register peers job') del_all_reg_peer()
def delete(): hiss.rattle('Delete job channel artifact') del_gen_channel_artifact()
def delete(): hiss.rattle('Delete Kafka') delete_kafka()
def generate(): hiss.rattle('Generate connection profiles') generate_all_ccp()
def terminate(): hiss.rattle('Terminate Kafka') terminate_kafka()
def setup(): hiss.rattle('Setup orderers') setup_all_orderer()
def setup(): hiss.rattle('Generate application artifacts') generate_artifact()
def terminate(): hiss.rattle('Terminate Orderer') terminate_all_orderer()
def delete(): hiss.rattle('Delete job gen artifact') del_generate_artifact()
def delete(): hiss.rattle('Delete Root CA Server') delete_rca()
def setup(): hiss.rattle('Generate channel.tx, genesis.block') bootstrap_network()
def setup(): hiss.rattle('Register orderers') reg_all_orderer()
def delete(): hiss.rattle('Delete job channel artifact') del_bootstrap_network()
def setup(): hiss.rattle('Setup explorer DB') setup_explorer_db() hiss.rattle('Setup explorer') setup_explorer()
def setup(): hiss.rattle('Generate channel.tx, genesis.block') gen_channel_artifact()
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
def terminate(): hiss.rattle('Terminate Intermediate CA Server') terminate_all_ica()