{"id":13696115,"url":"https://github.com/sleepdefic1t/Ark-NODEifier","last_synced_at":"2025-05-03T14:30:57.169Z","repository":{"id":129350912,"uuid":"120498427","full_name":"sleepdefic1t/Ark-NODEifier","owner":"sleepdefic1t","description":"ARK-(NODE)ifier | Ark Ecosystem Delegate Node Notifier for ESP8266 / Arduino","archived":true,"fork":false,"pushed_at":"2018-02-12T18:49:33.000Z","size":22,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-11-12T23:36:30.858Z","etag":null,"topics":["adafruit","arduino","arkecosystem","blockchain","crypto","cryptocurrency","esp8266","iot"],"latest_commit_sha":null,"homepage":null,"language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sleepdefic1t.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2018-02-06T17:43:18.000Z","updated_at":"2023-01-28T02:25:37.000Z","dependencies_parsed_at":"2023-03-13T09:00:38.445Z","dependency_job_id":null,"html_url":"https://github.com/sleepdefic1t/Ark-NODEifier","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sleepdefic1t%2FArk-NODEifier","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sleepdefic1t%2FArk-NODEifier/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sleepdefic1t%2FArk-NODEifier/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sleepdefic1t%2FArk-NODEifier/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sleepdefic1t","download_url":"https://codeload.github.com/sleepdefic1t/Ark-NODEifier/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252203166,"owners_count":21710901,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["adafruit","arduino","arkecosystem","blockchain","crypto","cryptocurrency","esp8266","iot"],"created_at":"2024-08-02T18:00:36.408Z","updated_at":"2025-05-03T14:30:56.812Z","avatar_url":"https://github.com/sleepdefic1t.png","language":"C++","funding_links":[],"categories":["Delegate Tools"],"sub_categories":["Mobile"],"readme":"# Ark-NODEifier\nARK-(NODE)ifier | Ark Ecosystem Delegate Node Notifier for ESP8266 / Arduino\n\nPOC using Ark-Cpp (https://github.com/ark-iot/ark-cpp)\n\n\n\n# What is this?\n\n  A simple template for making your own Ark Delegate Node notifier.  \n  You can set it up and tweak this however you'd like;  \n  but this example provides an entry point for alerts on missed blocks,  \n  if your delegate rank changes, or is voted in or out of the top 51.\n\n\n\n## Hardware \u0026 Software\n\n  Testing and Development was done using the following:  \n    - [Adafruit Feather ESP8266](https://www.adafruit.com/product/2821) (Development Board)  \n    - [Ark-Cpp](https://github.com/Ark-IoT/Ark-Cpp) (Ark Ecosystem Arduino/C++ Wrapper)  \n    - [Arduino IDE](https://www.arduino.cc/en/Main/Software)  \n    - [ESP8266 Arduino Core](https://github.com/esp8266/Arduino)  \n    - [VSCode](https://code.visualstudio.com/)  \n\n\n\n## NODEifier.ino Configuration\n\n\n\nSet your WiFi SSID and Password.\n```cpp\n/********************************************************************************/\n/*  WiFi Configuration  */\nconst char* ssid = \"yourWiFiSSID\";\nconst char* password = \"yourWiFiPassword\";\n/********************************************************************************/\n\nSet your Delegate/Nodes Username and Publickey\n/********************************************************************************/\n/*  Ark Delegate Username \u0026 Publickey */\n#define DELEGATE_USERNAME \"yourDelegateUsername\"\n#define DELEGATE_PUBLICKEY \"yourDelegatePublickey\"\n/********************************************************************************/\n```\n\n\nBelow are example templates of paramters you might need to RollYourOwn notification service:\n```cpp\n/********************************************************************************/\n/*  SMS GATEWAY EXAMPLES\n      555-555-5555  AT\u0026T  5555555555@txt.att.net\n      555-555-5555  MetroPCS  5555555555@mymetropcs.com\n      555-555-5555  Sprint  5555555555@messaging.sprintpcs.com\n      555-555-5555  T-Mobile  5555555555@tmomail.net\n      555-555-5555  Verizon 5555555555@vtext.com\n*/\n#define SMS \"5555555555@myCarriersSMSGateway.com\"\n\n#define SUBJECT \"Ark-(Node)ifier Demo\"\n\n#define SMTP_PORT 465\n#define SMTP_SERVER \"smtp.gmail.com\"\n#define SMTP_EMAIL: \"yourGmailAddress\"\n#define SMTP_PASSWORD \"yourGmailPassword\"\n/********************************************************************************/\n```\n\n\n\n## Interesting Parts\n\n\n\n```cpp\nenum AlertType { MissedBlocks, RankChanged, VotedOut, VotedIn, TEST };\n```\n\n\n\n```cpp\n/********************************************************************************/\n/********************************************************************************\n*\n*   @method:  getDelegateStatusFrom(arkManager)\n*   @parameter: ARK::API::Manager\n*   @out:  doAlert(oftype)\n*    \n*       Uses arkManager instance to get delegate info from Ark Blockchain.\n*      \n*********************************************************************************/\nvoid getDelegateStatusFrom(ARK::API::Manager\u0026 arkManager) {\n\n  ARK::Delegate delegate = arkManager.delegate(DELEGATE_USERNAME);\n  \n  Serial.print(\"Ark Delegate: \");\n  Serial.print(DELEGATE_USERNAME);\n  Serial.print(\"\\nCurrent Rank: \");\n  Serial.print(delegate.rate);\n  Serial.print(\"\\nCurrent productivity: \");\n  Serial.print(delegate.productivity);\n  Serial.print(\"%\\n\");\n\n\n  if (needsUpdate) {\n    needsUpdate = false;\n    lastMissedBlocksCount = delegate.missedblocks;\n    lastRank = delegate.rate;    \n  }\n\n  currentMissedBlocksCount = delegate.missedblocks;\n  currentRank = delegate.rate;\n\n  if (currentMissedBlocksCount \u003c lastMissedBlocksCount)\n    doAlert(MissedBlocks);\n\n  if (currentRank != lastRank)\n    doAlert(RankChanged);\n    \n  if (currentRank \u003e 51 \u0026\u0026 lastRank \u003c= 51)\n    doAlert(VotedOut);\n\n  if (currentRank \u003c= 51 \u0026\u0026 lastRank \u003e 51)\n    doAlert(VotedIn);\n\n  if (isTest)\n    doAlert(TEST);\n    \n}\n/********************************************************************************/\n```\n\n\n\n```cpp\n/********************************************************************************\n*\n*   @method:  doAlert(ofType)\n*   @parameter: Alert Type\n*               enum { MissedBlocks, RankChanged, VotedOut, VotedIn, TEST }\n*   @out:  sendNotificationWith(message)\n*    \n*       Handles and prepares the kind of alert to be sent\n*      \n*********************************************************************************/\nvoid doAlert(AlertType ofType) {\n\n  String message;\n  \n  switch (ofType) {\n\n    case MissedBlocks:\n      message += DELEGATE_USERNAME;\n      message += \" is missing \";\n      message += (currentMissedBlocksCount - lastMissedBlocksCount);\n      message += (\" blocks\\n\");\n      break;\n      \n    case RankChanged:\n      message += DELEGATE_USERNAME;\n      message += \" rank changed to \";\n      message += currentRank;\n      message += \"\\n\";\n      break;\n\n    case VotedOut:\n      message += DELEGATE_USERNAME;\n      message += \" no longer in top 51,\\n currently ranked # \";\n      message += currentRank;\n      message += \"\\n\";\n      break;\n\n    case VotedIn:\n      message += DELEGATE_USERNAME;\n      message += \" is now in top 51,\\n currently ranked # \";\n      message += currentRank;\n      message += \"\\n\";\n      break;\n\n      \n    case TEST:\n      message += \"Testing for Delegate: \";\n      message += DELEGATE_USERNAME;\n      message += \"\\n currently ranked # \";\n      message += currentRank;\n      message += \"\\n\";\n      break;\n  }\n\n  sendNotificationWith(message);\n  needsUpdate = true;\n\n}\n/********************************************************************************/\n```\n\n\n\nThis is the entry point for making your own notification handling.\n```cpp\n/********************************************************************************/\n/********************************************************************************\n*\n*   @method:  sendNotificationWith(message)\n*   @parameter: String message\n*   @out:  doAlert(oftype)\n*    \n*       Entry for RYO notification handling (e.g. SMS, email, etc.).\n*      \n*********************************************************************************/\nvoid sendNotificationWith(String message)\n{\n  Serial.println(message);\n  // do something | SMS / EMAIL\n}\n```\n\n\n\n## What now?\n\nTry it out. Tweak it. Port it. Share it.. Whatever you'd like.\n```cpp\n  do\n    hack();\n  while (breath);\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsleepdefic1t%2FArk-NODEifier","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsleepdefic1t%2FArk-NODEifier","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsleepdefic1t%2FArk-NODEifier/lists"}