@@ -59,6 +59,7 @@ class Agent {
5959 indexer : Indexer
6060 network : Network
6161 networkSubgraph : NetworkSubgraph
62+ allocateOnNetworkSubgraph : boolean
6263 registerIndexer : boolean
6364 offchainSubgraphs : SubgraphDeploymentID [ ]
6465 receiptCollector : ReceiptCollector
@@ -69,6 +70,7 @@ class Agent {
6970 indexer : Indexer ,
7071 network : Network ,
7172 networkSubgraph : NetworkSubgraph ,
73+ allocateOnNetworkSubgraph : boolean ,
7274 registerIndexer : boolean ,
7375 offchainSubgraphs : SubgraphDeploymentID [ ] ,
7476 receiptCollector : ReceiptCollector ,
@@ -78,6 +80,7 @@ class Agent {
7880 this . indexer = indexer
7981 this . network = network
8082 this . networkSubgraph = networkSubgraph
83+ this . allocateOnNetworkSubgraph = allocateOnNetworkSubgraph
8184 this . registerIndexer = registerIndexer
8285 this . offchainSubgraphs = offchainSubgraphs
8386 this . receiptCollector = receiptCollector
@@ -580,8 +583,11 @@ class Agent {
580583 ...activeAllocations . map ( allocation => allocation . subgraphDeployment . id ) ,
581584 ] )
582585
583- // Ensure the network subgraph is never allocated towards
584- if ( this . networkSubgraph . deployment ?. id . bytes32 ) {
586+ // Ensure the network subgraph is never allocated towards unless explicitly allowed
587+ if (
588+ ! this . allocateOnNetworkSubgraph &&
589+ this . networkSubgraph . deployment ?. id . bytes32
590+ ) {
585591 const networkSubgraphDeploymentId = this . networkSubgraph . deployment . id
586592 targetDeployments = targetDeployments . filter (
587593 deployment =>
@@ -919,6 +925,7 @@ export const startAgent = async (config: AgentConfig): Promise<Agent> => {
919925 config . indexer ,
920926 config . network ,
921927 config . networkSubgraph ,
928+ config . allocateOnNetworkSubgraph ,
922929 config . registerIndexer ,
923930 config . offchainSubgraphs ,
924931 config . receiptCollector ,
0 commit comments