Skip to content

Commit

Permalink
update trigger script (#14707)
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidOrchard authored Oct 9, 2024
1 parent 72e1643 commit 64eb3cf
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion core/capabilities/webapi/trigger.go
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ func (h *triggerConnectorHandler) UnregisterTrigger(ctx context.Context, req cap

func (h *triggerConnectorHandler) Start(ctx context.Context) error {
return h.StartOnce("GatewayConnectorServiceWrapper", func() error {
return h.connector.AddHandler([]string{"web_trigger"}, h)
return h.connector.AddHandler([]string{"web_api_trigger"}, h)
})
}
func (h *triggerConnectorHandler) Close() error {
Expand Down
6 changes: 4 additions & 2 deletions core/scripts/gateway/web_api_trigger/invoke_trigger.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ import (
"io"
"net/http"
"os"
"strconv"
"time"

"github.com/ethereum/go-ethereum/crypto"
"github.com/joho/godotenv"
Expand Down Expand Up @@ -53,7 +55,7 @@ func main() {
gatewayURL := flag.String("gateway_url", "http://localhost:5002", "Gateway URL")
privateKey := flag.String("private_key", "65456ffb8af4a2b93959256a8e04f6f2fe0943579fb3c9c3350593aabb89023f", "Private key to sign the message with")
messageID := flag.String("id", "12345", "Request ID")
methodName := flag.String("method", "web_trigger", "Method name")
methodName := flag.String("method", "web_api_trigger", "Method name")
donID := flag.String("don_id", "workflow_don_1", "DON ID")

flag.Parse()
Expand All @@ -78,7 +80,7 @@ func main() {
payload := `{
"trigger_id": "[email protected]",
"trigger_event_id": "action_1234567890",
"timestamp": 1234567890,
"timestamp": ` + strconv.Itoa(int(time.Now().Unix())) + `,
"topics": ["daily_price_update"],
"params": {
"bid": "101",
Expand Down

0 comments on commit 64eb3cf

Please sign in to comment.