Exemplo n.º 1
0
def do(args):
    # if args.id == "":
    # args.id = network.config.get_random_name()

    # 1. Create dir to store network info
    network.config.create_dir(args.id)

    # 2. Save network info for future reference
    network.config.save(args)
    config = network.config.load(args.id)

    # 3. Create the network in terraform
    tf.create(config)

    # 4. Install sawtooth and configure
    genesis_hostname = tf.get_node_name(0, config)
    ansible.playbook(
        "setup_sawtooth",
        config, [
            "sawtooth_packages='{}'".format(config['sawtooth_packages']),
            "sawtooth_validator_transaction_families='{}'".format(",".join(
                config['sawtooth_transaction_families'])),
            "genesis_node='{}'".format(genesis_hostname),
            "sawtooth_validator_ledger_type='{}'".format(
                config['sawtooth_ledger_type']),
            "sawtooth_local_validation='{}'".format(
                config['sawtooth_local_validation']),
            "sawtooth_logging_syslog_ip='{}'".format(
                config['sawtooth_syslog_ip']),
            "sawtooth_logging_syslog_facility='{}'".format(
                config['sawtooth_syslog_facility']),
        ],
        retries=5,
        delay=60)
Exemplo n.º 2
0
def do(args):
    config = network.config.load(args.id)
    print(config)
    ansible.playbook("install_pr",
                     config,
                     playbook_args=["pr_number='{}'".format(args.pr)],
                     retries=5,
                     delay=60)
Exemplo n.º 3
0
def do(args):

    config = network.config.load(args.id)

    genesis_hostname = tf.get_node_name(0, config)
    ansible.playbook("upgrade_sawtooth", config, [
        "sawtooth_packages='{}'".format(
            config['sawtooth_packages']),
    ], retries=5, delay=60)
Exemplo n.º 4
0
def do(args):
    config = network.config.load(args.id)

    ansible.playbook("start_sawtooth", config, [
        "genesis_tag='{}'".format(ansible.get_name_tag(0,
                                                       config['network_id'])),
        "sawtooth_validator_ledger_type='{}'".format(
            config['sawtooth_ledger_type']),
    ])
Exemplo n.º 5
0
def do(args):
    # 1. Create dir to store network info
    network.config.create_dir(args.id)

    # 2. Save network info for future reference
    network.config.save(args)
    config = network.config.load(args.id)

    # 3. Create the network in terraform
    tf.create(config)

    # 4. Install sawtooth and configure
    time.sleep(3)
    ansible.playbook("setup_sawtooth", config, retries=5, delay=60)
Exemplo n.º 6
0
def do(args):
    config = network.config.load(args.id)

    ansible.playbook("stop_sawtooth", config)
Exemplo n.º 7
0
def do(args):
    config = network.config.load(args.id)

    playbook = ansible.playbook("reset_sawtooth", config)
Exemplo n.º 8
0
def do(args):
    config = network.config.load(args.id)
    ansible.playbook("setup_sawtooth", config, retries=5, delay=60)
Exemplo n.º 9
0
def do(args):
    config = network.config.load(args.id)
    print(config)
    ansible.playbook("upgrade_sawtooth", config, retries=5, delay=60)