I am trying to deploy multiple contract using the relayer, but i got stuck when trying to run the relayer, i don't know how to go about creating the autotask for the different contracts
Environment
Relayer and Autotask
Details
Code to reproduce
Current this is the code to create the autotask for VoteChain contract:
const { AutotaskClient } = require("defender-autotask-client")
const { readFileSync, appendFileSync } = require("fs")
async function main() {
require("dotenv").config()
const {
relayer: { relayerId },
} = JSON.parse(readFileSync("./relay.json"))
const { TEAM_API_KEY: apiKey, TEAM_API_SECRET: apiSecret } = process.env
const client = new AutotaskClient({ apiKey, apiSecret })
const { autotaskId } = await client.create({
name: "VoteChain Autotask",
encodedZippedCode: await client.getEncodedZippedCodeFromFolder(
"./build/relay"
),
relayerId: relayerId,
trigger: {
type: "webhook",
},
paused: false,
})
console.log("Autotask created with ID ", autotaskId)
appendFileSync(".env", `\nAUTOTASK_ID="${autotaskId}"`, function (err) {
if (err) throw err
})
}
if (require.main === module) {
main()
.then(() => process.exit(0))
.catch((error) => {
console.error(error)
process.exit(1)
})
}