machinefi / w3bstream-examples

14 stars 2 forks source link

walk2earn - claim/data fn is not imported #5

Open tw0l1 opened 1 year ago

tw0l1 commented 1 year ago

Hello,

I've deployed walk2earn instance and tried to send a test event with some fake JSON data - the event is published but in the logs I see that the handler function is not imported

My test JSON: { "payload": "\"message\": {\"steps\" : \"160\",\"timestamp\" :100000\}, \"signature\": \"3fba9429bb35dc1bf968fc54168fd59cf7d4099142b482a71784e9b711c486fc\",\"device_id\": \"b687e298ad52eec4fe32b27af45247f365906259\",\"public_key\": \"04MIGeMA0GCSqGSIb3DQEBAQUAA4GMADCBiAKBgG84avXP0Zo16NhhuHbJ21OZAm7Nc3HQ18B76Fc7XkFZahxcTwS02C+oh5plDwT6O3HDGREU99UMtYLTVrpILE9tH6+H3vcxTSNPRieW5EmvAUJfts0suuIs4iMPfrJS5bsm4jKjJUjBpPi+xVWQFCLNOPVNGZebL+HrtXkcHuCnAgMBAAE=\"", "header" : { "event_type": "ANY", "pub_id": "stepcounter", "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJQYXlsb2FkIjoiNjc2NzQ1OTY2NTM0NDUxOCIsImlzcyI6InczYnN0cmVhbSIsImV4cCI6MTY3NzQ1MTM4Nn0.SITOfOeUvPKde20LUgo0Ilq-_ztlBqDjkogOAghfuaQ", "pub_time": 100000 }

I configured strategy with event type ANY and handler function name to "claim" or "data" but none of this works and in the w3bstream logs I see:

{"@lv":"info","@prj":"srv-applet-mgr","@ts":"20230323-225438.893Z","event_type":"ANY","msg":"matched strategies: 1","project_name":"project_01"} {"@lv":"info","@prj":"srv-applet-mgr","@ts":"20230323-225438.893Z","msg":"","subject":"HandleEvent","task_id":"HandleEvent::11273274954170368::"} {"@lv":"error","@prj":"srv-applet-mgr","@ts":"20230323-225438.893Z","msg":"runtime: claim fn is not imported"} or {"@lv":"info","@prj":"srv-applet-mgr","@ts":"20230323-225536.748Z","event_type":"ANY","msg":"matched strategies: 1","project_name":"project_01"} {"@lv":"info","@prj":"srv-applet-mgr","@ts":"20230323-225536.748Z","msg":"","subject":"HandleEvent","task_id":"HandleEvent::11273274954170368::"} {"@lv":"error","@prj":"srv-applet-mgr","@ts":"20230323-225536.748Z","msg":"runtime: data fn is not imported"}

When I set in the strategy event type: CLICK and send JSON with CLICK event there are no matched strategies:

{"@lv":"info","@prj":"srv-applet-mgr","@ts":"20230323-231700.508Z","event_type":"ANY","msg":"matched strategies: 0","project_name":"project_01"} {"@agent":"Mozilla/5.0 (X11; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/111.0","@cst":2,"@lv":"info","@mtd":"POS","@prj":"srv-applet-mgr","@rmt":"172.19.0.6","@status":201,"@tag":"access","@ts":"20230323-231700.509Z","@url":"/srv-applet-mgr/v0/event/project_01","msg":""}