MCPcopy Create free account
hub / github.com/ambianic/peerfetch / _loadPeerId

Function _loadPeerId

python/src/peerfetch/proxy.py:91–102  ·  view source on GitHub ↗

Load and reuse saved peer ID if there is one.

()

Source from the content-addressed store, hash-verified

89
90
91def _loadPeerId():
92 """Load and reuse saved peer ID if there is one."""
93 global savedPeerId
94 conf_file = Path(PEERID_FILE)
95 if conf_file.exists():
96 conf = {}
97 with conf_file.open() as infile:
98 conf = yaml.load(infile, Loader=yaml.SafeLoader)
99 if conf is not None:
100 savedPeerId = conf.get('peerId', None)
101 else:
102 savedPeerId = None
103
104def _loadConfig():
105 logger.info('Loading configuration')

Callers 1

mainFunction · 0.85

Calls 1

getMethod · 0.80

Tested by

no test coverage detected