Changeset View
Changeset View
Standalone View
Standalone View
contrib/seeds/generate-seeds.py
Show First 20 Lines • Show All 113 Lines • ▼ Show 20 Lines | for line in f: | ||||
(host, port) = parse_spec(line, defaultport) | (host, port) = parse_spec(line, defaultport) | ||||
hoststr = ','.join(('0x{:02x}'.format(b)) for b in host) | hoststr = ','.join(('0x{:02x}'.format(b)) for b in host) | ||||
g.write(' {{{{{}}}, {}}}'.format(hoststr, port)) | g.write(' {{{{{}}}, {}}}'.format(hoststr, port)) | ||||
g.write('\n};\n') | g.write('\n};\n') | ||||
def main(): | def main(): | ||||
if len(sys.argv) < 2: | if len(sys.argv) < 2: | ||||
print('Usage: {} <path_to_nodes_txt>'.format(sys.argv[0]), file=sys.stderr) | print( | ||||
'Usage: {} <path_to_nodes_txt>'.format( | |||||
sys.argv[0]), | |||||
file=sys.stderr) | |||||
sys.exit(1) | sys.exit(1) | ||||
g = sys.stdout | g = sys.stdout | ||||
indir = sys.argv[1] | indir = sys.argv[1] | ||||
g.write('#ifndef BITCOIN_CHAINPARAMSSEEDS_H\n') | g.write('#ifndef BITCOIN_CHAINPARAMSSEEDS_H\n') | ||||
g.write('#define BITCOIN_CHAINPARAMSSEEDS_H\n') | g.write('#define BITCOIN_CHAINPARAMSSEEDS_H\n') | ||||
g.write('/**\n') | g.write('/**\n') | ||||
g.write(' * List of fixed seed nodes for the bitcoin network\n') | g.write(' * List of fixed seed nodes for the bitcoin network\n') | ||||
g.write(' * @{} by contrib/seeds/generate-seeds.py\n'.format('generated')) | g.write(' * @{} by contrib/seeds/generate-seeds.py\n'.format('generated')) | ||||
Show All 15 Lines |