Configuration¶
In DagAccount() the network is configured by calling DagAccount().connect(...).
This calls DagTokenNetwork().config(...) that validates the parameter values, sets the network variable (self.connected_network)
and emits an event stored in the variable self._network_change as a RxPy BehaviorSubject().
DAG Token Network¶
from pypergraph import DagTokenNetwork()
network = DagTokenNetwork(network_id="mainnet")
network.config("testnet") # Change network
DagTokenNetwork is configurable with the following parameters:
Parameter |
Value |
Description |
|---|---|---|
network_id |
|
Specify the connected network by setting this value. |
l0_host |
|
Set a custom layer 0 API URL for |
currency_l1_host |
|
Set a custom layer 1 currency API URL for |
block_explorer_url |
|
Set a custom block explorer API URL for |
|
REST client dependency can be injected here. |
Metagraph Token Network¶
from pypergraph import MetagraphTokenNetwork()
metagraph_network = MetagraphTokenNetwork(...)
MetagraphTokenNetwork is configurable with the following parameters:
Parameter |
Value |
Description |
|---|---|---|
network_id |
|
Specify the connected network by setting this value. |
l0_host |
|
Set a custom layer 0 API URL for |
currency_l1_host |
|
Set a custom layer 1 currency API URL for |
data_l1_host |
|
Set a custom layer 1 currency API URL for |
block_explorer_url |
|
Set a custom block explorer API URL for |
|
REST client dependency can be injected here. |