Options for constructing a Network abstraction, required by
initialize()
.
These options must include either:
db
, a Db instance and provider
, JSON-RPC provider
(for normal use), orrun
, a provider-enabled Process.ProcessorRunner function, e.g. one
instantiated via Process.Run.forDb (for internal/special-case use).In addition, these options must contain network
with name
information,
as per the Network input specification.
Optionally this may include settings
to specify IncludeSettings.
Construct a Network abstraction for given InitializeOptions.
Example:
import type { Provider } from "web3/providers";
import { db, Network } from "@truffle/db";
declare const provider: Provider; // obtain this somehow
const db = connect({
// ...
});
const network = await Network.initialize({
db,
provider,
network: {
name: "mainnet"
}
});
As described in the documentation for
Network.includeBlocks()
, these
settings may help mitigate unforeseen problems with large data sets.
Force the underlying persistence adapter to disable use of certain database indexes. This option exists for purposes of testing fallback behavior for persistence query generation failure. You probably don't need to use this, but it may help diagnose problems when using the SQLite adapter if you see errors about excessive SQL query parameters.
Skip final query at end of this operation that determines canonical known latest after the operation completes.
If set to true
, this operation will update Network.knownLatest
using only information already present in the abstraction instance as well
as information passed as input.
Generated using TypeDoc
Network abstraction for @truffle/db
This provides a TypeScript (or JavaScript) interface for loading blockchain network information into a running Db.
See the Network abstraction section of this documentation's index page for an overview of the purpose this abstraction serves, or see the
Network.includeBlocks()
method documentation for a bit more detail.