Giveth / giv-supply-function

1 stars 0 forks source link

cannot find module when running CMC lambda function #4

Closed divine-comedian closed 3 months ago

divine-comedian commented 4 months ago

While trying to run the node lambda-run script for index.js for updating the CMC related files i get an error related to "cannot find module"

image

cc: @laurenluz

divine-comedian commented 3 months ago

@aminlatifi - for you!

aminlatifi commented 3 months ago

@divine-comedian I switched to coingecko directory and it worked

image
divine-comedian commented 3 months ago

@divine-comedian I switched to coingecko directory and it worked image

Yes it worked for me too on coingecko but AFAIK we need to run the function on both folders - CMC and coingecko then upload the files to the repo

aminlatifi commented 3 months ago

@divine-comedian please look at this https://github.com/Giveth/giv-supply-function/pull/6 event.json is the default event passed to lambda function. As I understood, it simulates the event parameter passed to the function when it's called. The two valid event to call coinmarketcap are

{
  "queryStringParameters": {
    "q": "circulating"
  }
}

and

{
  "queryStringParameters": {
    "q": "totalcoins"
  }
}

you can run it with either of events depending on your need.

divine-comedian commented 3 months ago

OK - please let me know when it can be tested it again - I see the pending PR

divine-comedian commented 3 months ago

I just re-tested this with using node-lambda run for both coingecko and CMC and I did not encounter any errors!