MCPcopy
hub / github.com/subquery/subql / getSubqlNodeService

Function getSubqlNodeService

packages/cli/src/controller/add-chain-controller.ts:150–168  ·  view source on GitHub ↗
(dockerCompose: Document)

Source from the content-addressed store, hash-verified

148}
149
150function getSubqlNodeService(dockerCompose: Document): DockerComposeService | undefined {
151 const services = dockerCompose.get('services');
152 if (services && services instanceof YAMLMap) {
153 const service = services.items.find((item) => {
154 const image = item.value.get('image') as string;
155 return image?.startsWith('onfinality/subql-node');
156 });
157
158 if (service && service.value instanceof YAMLMap) {
159 const commands = service.value.get('command') as YAMLSeq<string>;
160 if (!(commands.toJSON() as string[]).includes('--multi-chain')) {
161 commands.add('--multi-chain');
162 }
163 return service.value.toJSON() as DockerComposeService;
164 }
165 }
166
167 return undefined;
168}
169
170async function getDefaultServiceConfiguration(
171 chainManifestPath: string,

Callers 1

updateDockerComposeFunction · 0.85

Calls 4

toJSONMethod · 0.80
addMethod · 0.80
getMethod · 0.65
findMethod · 0.65

Tested by

no test coverage detected