Namespace NetworkGenealogies
Functions
process
- process(options: { networks: (Pick<Resource<"networks">, "id" | "historicBlock"> | undefined)[]; settings?: { disableIndex?: boolean } }): Process<IdObject<"networkGenealogies">[]>
-
Parameters
-
options: { networks: (Pick<Resource<"networks">, "id" | "historicBlock"> | undefined)[]; settings?: { disableIndex?: boolean } }
-
networks: (Pick<Resource<"networks">, "id" | "historicBlock"> | undefined)[]
-
Optional settings?: { disableIndex?: boolean }
-
Optional disableIndex?: boolean
Returns Process<IdObject<"networkGenealogies">[]>
Load NetworkGenealogy records for a given set of networks while connected to a blockchain with a provider.
We take, as a precondition, that all relevant networks are actually part of the same blockchain; i.e., that networks with later historic blocks do in fact descend from networks with earlier historic blocks in the list.
Using this assumption, the process is as follows:
Sort input networks by block height, filtering out missing values (since input array can be sparse)
Find up to three existing networks in the system that are valid for the currently connected blockchain ("anchors"):
a. the ancestor of the earliest input network b. the ancestor of the latest input network c. the descendant of the latest input network
If 2.a. and 2.b. are different, find the existing networks between those (i.e., all of 2.b.'s ancestors back to *2.a.**).
***: _2.a.** is guaranteed to be an ancestor of 2.b. because of the above precondition._
Merge the following networks into a sorted list:
For each pair of networks in this list, generate a corresponding [[[DataModel.NetworkGenealogyInput | NetworkGenealogyInput] whose ancestor/descendant are Networks from the earlier/later item in the pair, respectively.
Load these genealogy inputs.