options.ts 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. import { Options } from "yargs";
  2. export const priceServiceEndpoint = {
  3. "price-service-endpoint": {
  4. description:
  5. "Endpoint URL for the hermes client. e.g: https://endpoint/example",
  6. type: "string",
  7. required: true,
  8. } as Options,
  9. };
  10. export const pythContractAddress = {
  11. "pyth-contract-address": {
  12. description:
  13. "Pyth contract address. Provide the network name on which Pyth is deployed " +
  14. "or the Pyth contract address if you use a local network.",
  15. type: "string",
  16. required: true,
  17. } as Options,
  18. };
  19. export const priceConfigFile = {
  20. "price-config-file": {
  21. description: "Path to price configuration YAML file.",
  22. type: "string",
  23. required: true,
  24. } as Options,
  25. };
  26. export const pollingFrequency = {
  27. "polling-frequency": {
  28. description:
  29. "The frequency to poll price info data from the network if the RPC is not a websocket.",
  30. type: "number",
  31. required: false,
  32. default: 5,
  33. } as Options,
  34. };
  35. export const pushingFrequency = {
  36. "pushing-frequency": {
  37. description:
  38. "The frequency to push prices to the RPC. " +
  39. "It is better that the value be greater than the block time of the network, so this program confirms " +
  40. "it is updated and does not push it twice.",
  41. type: "number",
  42. required: false,
  43. default: 10,
  44. } as Options,
  45. };
  46. export const mnemonicFile = {
  47. "mnemonic-file": {
  48. description: "Path to payer mnemonic (private key) file.",
  49. type: "string",
  50. required: true,
  51. } as Options,
  52. };
  53. export const logLevel = {
  54. "log-level": {
  55. description: "Log level",
  56. type: "string",
  57. required: false,
  58. default: "info",
  59. choices: ["trace", "debug", "info", "warn", "error"],
  60. } as Options,
  61. };
  62. export const controllerLogLevel = {
  63. "controller-log-level": {
  64. description: "Log level for the controller.",
  65. type: "string",
  66. required: false,
  67. default: "info",
  68. choices: ["trace", "debug", "info", "warn", "error"],
  69. } as Options,
  70. };
  71. export const enableMetrics = {
  72. "enable-metrics": {
  73. description: "Enable Prometheus metrics server",
  74. type: "boolean",
  75. required: false,
  76. default: true,
  77. } as Options,
  78. };
  79. export const metricsPort = {
  80. "metrics-port": {
  81. description: "Port for the Prometheus metrics server",
  82. type: "number",
  83. required: false,
  84. default: 9090,
  85. } as Options,
  86. };