(receiptFilename: string, config: Config, timestamp: string, success: boolean)
| 17 | } |
| 18 | |
| 19 | export function writeReceiptFile(receiptFilename: string, config: Config, timestamp: string, success: boolean) { |
| 20 | const mnemonic = config.nodeSettings.airnodeWalletMnemonic; |
| 21 | const airnodeAddress = deriveAirnodeAddress(mnemonic); |
| 22 | const { stage, nodeVersion } = config.nodeSettings; |
| 23 | const cloudProvider = config.nodeSettings.cloudProvider as CloudProvider; |
| 24 | const receipt: receipt.Receipt = { |
| 25 | airnodeWallet: { |
| 26 | airnodeAddress, |
| 27 | airnodeXpub: deriveAirnodeXpub(mnemonic), |
| 28 | }, |
| 29 | deployment: { |
| 30 | deploymentId: deriveDeploymentId(cloudProvider, airnodeAddress, stage, nodeVersion), |
| 31 | cloudProvider, |
| 32 | stage, |
| 33 | nodeVersion, |
| 34 | timestamp, |
| 35 | }, |
| 36 | success, |
| 37 | }; |
| 38 | |
| 39 | logger.debug('Writing receipt.json file'); |
| 40 | fs.writeFileSync(receiptFilename, JSON.stringify(receipt, null, 2)); |
| 41 | logger.info(`Outputted ${receiptFilename}\n` + ' This file does not contain any sensitive information.'); |
| 42 | } |
| 43 | |
| 44 | export function parseReceiptFile(receiptFilename: string) { |
| 45 | logger.debug('Parsing receipt file'); |
no test coverage detected