Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New logger, free calls for certain users, update tests #586

Merged
merged 5 commits into from
Jul 16, 2024

Conversation

semyon-dev
Copy link
Member

@semyon-dev semyon-dev commented Jul 15, 2024

  • New parameter in the free_calls_users config: now you can select a specific number of free calls for a specific userID. Example:
"free_calls_users": {
"[email protected] ": 5,
"[email protected] ": 20,
"[email protected] ": 30
},
  • A new logger in the entire project (for logging operations, a performance increase of more than 1000%, memory allocation is 10+ times less compared to the old logger).

  • Logs can now be written to multiple sources at once. You can now pass an array in the type field. Example:

"log": {
"output": {
      "type": ["file", "stdout"]
    }
  }
  • The rotation_time_in_sec and max_age_in_sec parameters have been removed. Instead, they are now max_size_in_mb and max_age_in_days. Example:
"log": {
"level": "info",
"timezone": "UTC",
"formatter": {
      "type": "text",
      "timestamp_format": "2006-01-02T15:04:05.999Z07:00"
    },
    "output": {
      "type": ["file", "stdout"],
      "file_pattern": "./snet-daemon.%Y%m%d.log",
      "current_link": "./snet-daemon.log",
      "max_size_in_mb": 10,
      "max_age_in_days": 7,
      "rotation_count": 0
    },
    "hooks": []
  }
  • Logs for the embedded etcd can now be controlled separately using the log_level and log_outputs parameters. Example:
    "payment_channel_storage_server": {
      // ...
      "log_level": "info",
      "log_outputs": "./etcd-server.log"
    }
  • The connection_timeout and request_timeout parameters are now used (instead of ipfs) if they are explicitly specified in the config in the payment_channel_storage_client section.
  • The daemon will now output understandable logs if it is not possible to connect to etcd.
  • Completely redesigned hooks. Now you can send errors via telegram & email. Example:
 "log": {
   "output": {
     "type": "stdout"
   },
   "hooks": ["tg","email"],
   "tg": {
     "telegram_api_key": "7358436601:AAFlMm9gIGIqDUEv3lb2ip3CuB5YTR9-TiE",
     "telegram_chat_id": -4203213974,
     "disable_notification": false,
     "type": "telegram_bot",
     "levels": ["warn","error","fatal","panic"]
   },
   "email": {
     "host": "smtp.gmail.com",
     "port": 587,
     "from": "[email protected]",
     "username": "[email protected]",
     "to": "[email protected]",
     "password": "**** **** **** ****",
     "application_name": "",
     "type": "email",
     "levels": ["fatal", "panic"]
   }
 },
  • The init command now generates the simplest possible config file
{
"blockchain_enabled": true,
  "blockchain_network_selected": "sepolia",
  "passthrough_endpoint":"YOUR_SERVICE_ENDPOINT",
  "service_id": "YOUR_SERVICE_ID", 
  "organization_id": "YOUR_ORG_ID",
  "daemon_end_point": "127.0.0.1:8080",
  "daemon_group_name":"default_group",
  "passthrough_enabled": true,
  "payment_channel_storage_type": "etcd",
  "ipfs_end_point": "http://ipfs.singularitynet.io:80",
  "log": {
    "output": {
      "type": ["file", "stdout"]
    }
  }}
  • Fixing tests and errors in the daemon documentation
  • The log level will be colored in the console if the type field has a value other than file.

@semyon-dev semyon-dev merged commit e3f3a7a into singnet:master Jul 16, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant