Skip to content

Commit df4dc2a

Browse files
authored
script for generating workflow owners (#1977)
1 parent b1f4aeb commit df4dc2a

1 file changed

Lines changed: 30 additions & 0 deletions

File tree

  • pkg/workflows/cmd/gen_owners
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
// gen_owners derives workflow owner addresses from org IDs.
2+
// Usage: go run ./pkg/workflows/cmd/gen_owners org_abc org_def org_xyz
3+
package main
4+
5+
import (
6+
"encoding/hex"
7+
"fmt"
8+
"os"
9+
10+
"github.com/smartcontractkit/chainlink-common/pkg/workflows"
11+
)
12+
13+
func main() {
14+
orgIDs := os.Args[1:]
15+
if len(orgIDs) == 0 {
16+
fmt.Fprintln(os.Stderr, "usage: gen_owners <orgID>...")
17+
os.Exit(1)
18+
}
19+
20+
fmt.Printf("%-40s %s\n", "orgID", "workflowOwner")
21+
fmt.Printf("%-40s %s\n", "-----", "-------------")
22+
for _, orgID := range orgIDs {
23+
addr, err := workflows.GenerateWorkflowOwnerAddress("1", orgID)
24+
if err != nil {
25+
fmt.Fprintf(os.Stderr, "error for %s: %v\n", orgID, err)
26+
continue
27+
}
28+
fmt.Printf("%-40s 0x%s\n", orgID, hex.EncodeToString(addr))
29+
}
30+
}

0 commit comments

Comments
 (0)