INNER CODE UNIT · Go
createJob
smartcontractkit/chainlink · core/scripts/common/vrf/setup-envs/main.go:348
func createJob(jobSpec string, client *clcmd.Shell, app *cli.App, output *bytes.Buffer) {
if err := os.WriteFile("job-spec.toml", []byte(jobSpec), 0600); err != nil {
helpers.PanicErr(err)
}
job := presenters.JobResource{}
flagSet := flag.NewFlagSet("blah", flag.ExitOnError)
err := flagSet.Parse([]string{"./job-spec.toml"})
helpers.PanicErr(err)
err = client.CreateJob(cli.NewContext(app, flagSet, nil))
helpers.PanicErr(err)
helpers.PanicErr(json.Unmarshal(output.Bytes(), &job))
output.Reset()
}
func exportVRFKey(client *clcmd.Shell, app *cli.App, vrfKey presenters.VRFKeyResource, output *bytes.Buffer) {
if err := os.WriteFile("vrf-key-password.txt", []byte("twochains"), 0600); err != nil {
helpers.PanicErr(err)
}