forked from CityOfZion/neo-python
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbootstrap.py
28 lines (20 loc) · 869 Bytes
/
bootstrap.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
from neo.Settings import settings
from neo.Prompt.Commands.Bootstrap import BootstrapBlockchain
import argparse
def main():
parser = argparse.ArgumentParser()
parser.add_argument("-m", "--mainnet", action="store_true", default=False,
help="use MainNet instead of the default TestNet")
parser.add_argument("-c", "--config", action="store", help="Use a specific config file")
args = parser.parse_args()
if args.mainnet and args.config:
print("Cannot use both --config and --mainnet parameters, please use only one.")
exit(1)
# Setup depending on command line arguments. By default, the testnet settings are already loaded.
if args.config:
settings.setup(args.config)
elif args.mainnet:
settings.setup_mainnet()
BootstrapBlockchain()
if __name__ == "__main__":
main()