Ejemplo n.º 1
0
def write_static_nodes(build_dir, static_nodes, static_nodes_docker):
    write_build_file(build_dir + '/static-nodes.json', static_nodes)
    docker_dir = build_dir + '/docker'
    if not os.path.exists(docker_dir):
        os.mkdir(docker_dir)
    write_build_file(build_dir + '/docker/static-nodes.json',
                     static_nodes_docker)
Ejemplo n.º 2
0
def generate_envs(build_dir, config, genesis_json):
    wrkchain_validators = []
    nodes = config['wrkchain']['nodes']
    mainchain_web3_provider = config['mainchain']['web3_provider']
    mainchain_network_id = config['mainchain']['network_id']
    wrkchain_network_id = config['wrkchain']['wrkchain_network_id']

    for node in nodes:
        if node['is_validator']:
            wrkchain_validators.append(node['address'])

    truffle_env = generate_truffle_env(mainchain_network_id,
                                       mainchain_web3_provider, genesis_json,
                                       wrkchain_network_id,
                                       wrkchain_validators)

    write_build_file(build_dir + '/truffle.env', truffle_env)
Ejemplo n.º 3
0
def write_composition(build_dir, composition):
    write_build_file(build_dir + '/docker-compose.yml', composition)
Ejemplo n.º 4
0
def write_documentation(build_dir, documentation):
    write_build_file(build_dir + '/documentation.md', documentation['md'])
    write_build_file(build_dir + '/documentation.html', documentation['html'])
Ejemplo n.º 5
0
def write_genesis(build_dir, genesis_json):
    write_build_file(build_dir + '/genesis.json', genesis_json)
Ejemplo n.º 6
0
def write_generated_config(build_dir, config):
    rendered_config = json.dumps(config, indent=2, separators=(',', ':'))
    write_build_file(build_dir + '/generated_config.json', rendered_config)