def main():
    if (len(sys.argv) < 2):
        print(('Usage: %s <path_to_nodes_txt>' % sys.argv[0]), file=sys.stderr)
        sys.exit(1)
    g = sys.stdout
    indir = sys.argv[1]
    g.write('#ifndef BITCOIN_CHAINPARAMSSEEDS_H\n')
    g.write('#define BITCOIN_CHAINPARAMSSEEDS_H\n')
    g.write('/**\n')
    g.write(' * List of fixed seed nodes for the bitcoin network\n')
    g.write(' * AUTOGENERATED by contrib/seeds/generate-seeds.py\n')
    g.write(' *\n')
    g.write(' * Each line contains a 16-byte IPv6 address and a port.\n')
    g.write(' * IPv4 as well as onion addresses are wrapped inside an IPv6 address accordingly.\n')
    g.write(' */\n')
    with open(os.path.join(indir, 'nodes_main.txt'), 'r', encoding='utf8') as f:
        process_nodes(g, f, 'pnSeed6_main', 17771)
    g.write('\n')
    with open(os.path.join(indir, 'nodes_test.txt'), 'r', encoding='utf8') as f:
        process_nodes(g, f, 'pnSeed6_test', 27771)
    g.write('#endif // BITCOIN_CHAINPARAMSSEEDS_H\n')
def main():
    if (len(sys.argv) < 2):
        print(('Usage: %s <path_to_nodes_txt>' % sys.argv[0]), file=sys.stderr)
        sys.exit(1)
    g = sys.stdout
    indir = sys.argv[1]
    g.write('#ifndef BITCOIN_CHAINPARAMSSEEDS_H\n')
    g.write('#define BITCOIN_CHAINPARAMSSEEDS_H\n')
    g.write('/**\n')
    g.write(' * List of fixed seed nodes for the bitcoin network\n')
    g.write(' * AUTOGENERATED by contrib/seeds/generate-seeds.py\n')
    g.write(' *\n')
    g.write(' * Each line contains a 16-byte IPv6 address and a port.\n')
    g.write(' * IPv4 as well as onion addresses are wrapped inside an IPv6 address accordingly.\n')
    g.write(' */\n')
    with open(os.path.join(indir, 'nodes_main.txt'), 'r', encoding='utf8') as f:
        process_nodes(g, f, 'pnSeed6_main', 17771)
    g.write('\n')
    with open(os.path.join(indir, 'nodes_test.txt'), 'r', encoding='utf8') as f:
        process_nodes(g, f, 'pnSeed6_test', 27771)
    g.write('#endif // BITCOIN_CHAINPARAMSSEEDS_H\n')