Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add eslint and configuration #893

Merged
merged 21 commits into from
Apr 10, 2023
Merged

Add eslint and configuration #893

merged 21 commits into from
Apr 10, 2023

Conversation

wirednkod
Copy link
Contributor

No description provided.

@pepoviola
Copy link
Collaborator

Looks good! I think we need to order the prs since this one modify several files that are pending to merge in others prs.
Thanks!

@wirednkod
Copy link
Contributor Author

PR is not done yet. I prefer to merge this last, as it changes a HUGE amount of files (plus I need to add the log as discussed), so I would not worry at this point. Once it is done we can align on when to merge

@l0r1s
Copy link
Contributor

l0r1s commented Apr 4, 2023

PR is not done yet. I prefer to merge this last, as it changes a HUGE amount of files (plus I need to add the log as discussed), so I would not worry at this point. Once it is done we can align on when to merge

How about letting this PR with console log and setup the logger/console log rule in a new PR ?

@wirednkod wirednkod marked this pull request as ready for review April 4, 2023 08:10
javascript/packages/cli/src/cli.ts Outdated Show resolved Hide resolved
javascript/packages/utils/src/fs.ts Show resolved Hide resolved
javascript/packages/utils/src/fs.ts Show resolved Hide resolved
javascript/packages/utils/src/fs.ts Outdated Show resolved Hide resolved
javascript/packages/utils/src/fs.ts Outdated Show resolved Hide resolved
javascript/packages/utils/src/net.ts Show resolved Hide resolved
@wirednkod wirednkod requested a review from l0r1s April 4, 2023 09:39
Comment on lines 347 to 576
localFilePath: parachainSpecPath,
remoteFilePath: `${client.remoteDir}/${node.chain}-${paraId}.json`,
});
parachainSpecId = await getChainIdFromSpec(parachainSpecPath);
}
for (const override of node.overrides) {
finalFilesToCopyToNode.push({
localFilePath: override.local_path,
remoteFilePath: `${client.remoteDir}/${override.remote_name}`,
});
}

let keystoreLocalDir;
if (node.accounts) {
// check if the node directory exists if not create (e.g for k8s provider)
let nodeFilesPath = tmpDir.path;
if (parachain && parachain.name) nodeFilesPath += `/${parachain.name}`;
nodeFilesPath += `/${node.name}`;

await makeDir(nodeFilesPath, true);

const isStatemint = parachain && parachain.chain?.includes("statemint");
const keystoreFiles = await generateKeystoreFiles(
node,
nodeFilesPath,
isStatemint,
);
keystoreLocalDir = path.dirname(keystoreFiles[0]);
}

// replace all network references in command
replaceNetworkRef(podDef, network);

await client.spawnFromDef(
podDef,
finalFilesToCopyToNode,
keystoreLocalDir,
parachainSpecId || client.chainId,
node.dbSnapshot,
);

const [nodeIp, nodePort] = await client.getNodeInfo(podDef.metadata.name);
const nodeMultiAddress = await generateBootnodeString(
node.key!,
node.args,
nodeIp,
nodePort,
true,
node.p2pCertHash,
);
multiAddressByNode[podDef.metadata.name] = nodeMultiAddress;

if (node.addToBootnodes) {
bootnodes.push(nodeMultiAddress);
await addBootNodes(chainSpecFullPath, bootnodes);
}

let networkNode: NetworkNode;

const endpointPort = RPC_WS_PORT;
if (options?.inCI) {
const nodeIp = await client.getNodeIP(podDef.metadata.name);
networkNode = new NetworkNode(
node.name,
WS_URI_PATTERN.replace("{{IP}}", nodeIp).replace(
"{{PORT}}",
endpointPort.toString(),
),
METRICS_URI_PATTERN.replace("{{IP}}", nodeIp).replace(
"{{PORT}}",
PROMETHEUS_PORT.toString(),
),
nodeMultiAddress,
userDefinedTypes,
);
} else {
const nodeIdentifier = `${podDef.kind}/${podDef.metadata.name}`;
const fwdPort = await client.startPortForwarding(
endpointPort,
nodeIdentifier,
);
const nodePrometheusPort = await client.startPortForwarding(
PROMETHEUS_PORT,
nodeIdentifier,
);

const listeningIp = networkSpec.settings.local_ip || LOCALHOST;

networkNode = new NetworkNode(
node.name,
WS_URI_PATTERN.replace("{{IP}}", listeningIp).replace(
"{{PORT}}",
fwdPort.toString(),
),
METRICS_URI_PATTERN.replace("{{IP}}", listeningIp).replace(
"{{PORT}}",
nodePrometheusPort.toString(),
),
nodeMultiAddress,
userDefinedTypes,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where all this code went ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤔 Isnt this the code that @pepoviola moved to spawner through the PR #879 ?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, is part of the spawner now.

@pepoviola pepoviola requested a review from l0r1s April 10, 2023 22:34
@pepoviola pepoviola merged commit 647dec0 into main Apr 10, 2023
@pepoviola pepoviola deleted the nik-fix-log-to-silent branch April 10, 2023 22:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants