Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
async function makeMetadata(testnet: string, address: string, index: number) {
const attestationServiceClaim = createAttestationServiceURLClaim(
getAttestationServiceUrl(testnet, index)
)
const nameClaim = createNameClaim(`Validator ${index} on ${testnet}: ${address}`)
const fileName = `validator-${testnet}-${address}-metadata.json`
const filePath = `/tmp/${fileName}`
const metadata = IdentityMetadataWrapper.fromEmpty()
metadata.addClaim(nameClaim)
metadata.addClaim(attestationServiceClaim)
writeFileSync(filePath, metadata.toString())
await uploadFileToGoogleStorage(
filePath,
CLABS_VALIDATOR_METADATA_BUCKET,
`${testnet}/${fileName}`,
false,
'application/json'
)
modifyMetadata(res.args.file, (metadata) => {
const claim = createNameClaim(res.flags.name)
metadata.addClaim(claim)
})
}