{"id":19297954,"url":"https://github.com/cidgravity/slackbot","last_synced_at":"2025-07-23T12:36:09.270Z","repository":{"id":114216227,"uuid":"387482446","full_name":"CIDgravity/Slackbot","owner":"CIDgravity","description":null,"archived":false,"fork":false,"pushed_at":"2021-07-19T13:57:26.000Z","size":104,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-24T01:12:49.643Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/CIDgravity.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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,"publiccode":null,"codemeta":null}},"created_at":"2021-07-19T13:56:01.000Z","updated_at":"2021-08-19T16:59:46.000Z","dependencies_parsed_at":"2023-05-30T17:30:30.290Z","dependency_job_id":null,"html_url":"https://github.com/CIDgravity/Slackbot","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/CIDgravity/Slackbot","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CIDgravity%2FSlackbot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CIDgravity%2FSlackbot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CIDgravity%2FSlackbot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CIDgravity%2FSlackbot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/CIDgravity","download_url":"https://codeload.github.com/CIDgravity/Slackbot/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CIDgravity%2FSlackbot/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266680402,"owners_count":23967793,"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","status":"online","status_checked_at":"2025-07-23T02:00:09.312Z","response_time":66,"last_error":null,"robots_txt_status":null,"robots_txt_updated_at":null,"robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":[],"created_at":"2024-11-09T23:06:34.344Z","updated_at":"2025-07-23T12:36:09.243Z","avatar_url":"https://github.com/CIDgravity.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n### Get started with TwinQuasar SlackBot\n\nFirst you need to download all required libraries (listed in go module)\n\n```\ngo mod download\n```\n\nIf needed, you can change the Node Filecoin endpoint edit details inside ```backend/filecoin/filecoin.go```\n\n* Change the addresse on line 26\n* You can also add an auth token inside headers (if applicable)\n\n\n### Run the watchdogs (check update from the chain and treat blocks)\nThis script is used to track height changed from the chain, treat blocks (decode message, get rewards, decode actor ...) and send all informations in a remote (or local) database\n\n```\ngo run main_filecoin_watchdogs.go\n```\n\n### Run the notifier\nThis script is used as a database trigger: when new block is treated by the watchdog, it will get the database record to check if Slack notification need to be send to the miner\n\nToday two notifications are available:\n* When a miner mine a block, the associated reward will be send as a Slack message\n* When a miner passed is PoST, he will receive a Slack message\n* When a miner failed is PoST, he will also receive a Slack notification\n\n```\ngo run main_trigger_notifiers.go\n```\n\n### Install and use local PostgreSQL engine / database\n\nFirst you need to install PostgreSQL engine and setup users and databases\n\nTo install PostgreSQL\n\n```\nsudo apt update\nsudo apt install postgresql postgresql-contrib\n```\n\nBy default, a new user is available with username postgres (and a default detabase with name postgres also). To make our server more secure, we will create a new user without the superuser rights. To make it, we can use the folowing commands :\n\n```\nsudo -u postgres createuser --interactive\n```\n\nWhen you have answers all the questions, we need to create a UNIX user with exactly same name of our new PostgreSQL user\n\n```\nsudo adduser twinquasar\n```\n\nNow, we need to create a database (this command means create the database slackbot under superuser postgres)\n\n```\nsudo -u postgres createdb slackbot\n```\n\nChange UNIX user and connect to the new created database\n\n```\nsudo -i -u twinquasar\npsql -d slackbot\n```\n\nThe last step to do, is to import the project database schema, for this, we can use the following commands\nFor now, the best way to achieve this, is using pgAdmin4, to install it, do :\n\n```\ncurl https://www.pgadmin.org/static/packages_pgadmin_org.pub | sudo apt-key add\nsudo sh -c 'echo \"deb https://ftp.postgresql.org/pub/pgadmin/pgadmin4/apt/$(lsb_release -cs) pgadmin4 main\" \u003e /etc/apt/sources.list.d/pgadmin4.list \u0026\u0026 apt update'\nsudo apt install pgadmin4\nsudo /usr/pgadmin4/bin/setup-web.sh\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcidgravity%2Fslackbot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcidgravity%2Fslackbot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcidgravity%2Fslackbot/lists"}