-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathRequestNetwork.py
executable file
·28 lines (26 loc) · 1.18 KB
/
RequestNetwork.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
class RequestNetwork:
def __init__(self, useIpfsPublic=True, provider=None, networkId=None):
"""
creates a RequestNetwork instance that provides the public interface to
RequestNetwork.py
:param useIpfsPublic:
use public Ipfs if true, else the private one
specified in src/config.json
:param provider:
the Web3 instance one wishes RequestNetwork to use in
its interactions with the Ethereum network
:param networkId:
the Ethereum network ID
"""
if provider and not networkId:
raise ValueError('If provider is given, networkId must be given '
'as well')
# Will assume that the Singletons are initialized in the typical way
# not the "singleton.init(...)" like in the .ts source
# Initializing Web3 & Ipfs wrapper singletons
Web3Single(provider, networkId)
Ipfs(useIpfsPublic)
self.requestCoreService = RequestCoreService()
self.requestEthereumService = RequestEthereumService()
self.requestSynchroneExtensionEscrowService = \
RequestSynchroneExtensionEscrowService()