Skip to content

Refactoring source code to be fully a bot#21

Open
apentori wants to merge 13 commits into
masterfrom
module-refactoring
Open

Refactoring source code to be fully a bot#21
apentori wants to merge 13 commits into
masterfrom
module-refactoring

Conversation

@apentori
Copy link
Copy Markdown
Contributor

@apentori apentori commented May 20, 2026

Description

Refactoring the source code to be fully a Bot and not just a monitoring tools

  • Module for allowing more usage
  • API to interact with the messages
  • Metrics, because all correct application have metrics.

Left to do

  • Fix the monitoring part - issue with the coingechko interraction during test.
  • API interraction with the communities.
  • Add correct versioning.
  • Improve metrics
  • Add more modules like basic webhook interraction

Warning: part is AI generated, so it might be ugly / stupid, but that's a start
Note: I will squash all commit later

apentori added 10 commits May 15, 2026 19:18
Signed-off-by: apentori <pentori.alexis@proton.me>
Signed-off-by: apentori <pentori.alexis@proton.me>
Signed-off-by: apentori <pentori.alexis@proton.me>
Signed-off-by: apentori <pentori.alexis@proton.me>
Signed-off-by: apentori <pentori.alexis@proton.me>
Signed-off-by: apentori <pentori.alexis@proton.me>
Signed-off-by: apentori <pentori.alexis@proton.me>
Signed-off-by: apentori <pentori.alexis@proton.me>
Signed-off-by: apentori <pentori.alexis@proton.me>
    Renaming configuration for lisibility

Signed-off-by: apentori <pentori.alexis@proton.me>
@apentori apentori requested review from nickninov and siddarthkay May 20, 2026 20:23
@apentori apentori self-assigned this May 20, 2026
@apentori apentori changed the title Refactoring to setup api, metrics and allow modules to be loaded Refactoring source code to be fully a bot May 20, 2026
Comment thread bot/config.py
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems an overkill for the project. Looks like a Dagster Config.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well that;s just a proper config management

@nickninov
Copy link
Copy Markdown
Member

The purpose of ./bot/ folder is to convert it to a PyPi library. At the moment there are things that are related to community monitoring and status-bot.

Comment thread bot/modules/messaging.py
@nickninov
Copy link
Copy Markdown
Member

It seems like we are reinventing the wheel (with the help of AI) with so many new modules that are completely unnecessary. At the end of the day community monitoring is a batch processing / micro batch processing problem. The most maintainable and simple thing is to convert monitor.py to a pipeline with currently available tools. All of these abstractions are handled for us and we can just focus on the data. class Account can be turned into an Airbyte connector that communicates with status-go.

account.py is still under development and should not be touched until it is stable and reusable. We want to keep it as easy as possible for developers. The idea of a script per use case was to showcase how account.py can be used in different scenarios.

Comment thread bot/postgres.py Outdated
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This code was copied from another Postgres instance. We should actually centralize a class like Postgres for overall code consistency.

Comment thread bot/signal.py
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

At the moment this is unnecessary. listen is still in early development stages. Please revert to previous version

Comment thread docs/development/account.md
Comment thread docs/development/modules.md
Comment thread docs/usage/monitoring.md
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This information was in the main README.md to make users aware of what we are doing. At the moment it just seems hidden and people have to look for this.

Comment thread config.yaml
Comment on lines -13 to -15
# Public information for the bot
public_key: "0x041658626a9e1303b631f6d0fb1e047211d5603b977454f7d5d29fe583c3d6c1bd3d8e395d67f6c44b5bc659aae912040e9dd8164b5107368a29029cb53389d8b0"
compressed_key: "zQ3shNv1tnajHo5FvCvP662cWcbBfS5ZejB4TWaH9iAuFCZZe"
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This information is crucial and should not be deleted. This makes the bot in the communities as transparent. Users can verify if they are communicating with the official Status bot.

Comment thread main.py
Comment thread bot/modules/base.py
Comment thread bot/modules/monitoring.py
Comment thread main.py
Comment on lines +20 to +46
if display_name in available_accounts:
account.logger.info(f"Logging in with display name: {display_name}")
account.login(
display_name=display_name,
password=password,
infura_token=config.bot.infura_token,
coingecko_api_key=config.bot.coingecko_api_key
)
elif config.bot.init_account:
mnemonic = config.bot.mnemonic_phrase
if not mnemonic:
raise ValueError(
"init_account is true but no mnemonic_phrase provided"
)
account.logger.info(f"Creating/restoring account: {display_name}")
account.login(
display_name=display_name,
password=password,
mnemonic=mnemonic,
infura_token=config.bot.infura_token,
coingecko_api_key=config.bot.coingecko_api_key
)
else:
raise ValueError(
f"Account '{display_name}' not found and init_account is false. "
f"Available accounts: {[a['display_name'] for a in available_accounts]}"
)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is reinventing account.login. These checks are already implemented in the method.

Comment thread bot/account.py
@nickninov
Copy link
Copy Markdown
Member

API interraction with the communities.

Please refer to status-im/status-python-sdk#5. As described in the issue, there are blockers.

@apentori
Copy link
Copy Markdown
Contributor Author

It seems like we are reinventing the wheel (with the help of AI) with so many new modules that are completely unnecessary. At the end of the day community monitoring is a batch processing / micro batch processing problem.

This repo is not just for monitoring the community, else the repo would be call status-community-monitoring

@nickninov
Copy link
Copy Markdown
Member

@apentori we can keep the repository as it is and just migrate bot and its documentation. Can make a repo like status-python-sdk.

@nickninov
Copy link
Copy Markdown
Member

SDK functionality has been moved to status-im/status-python-sdk.

apentori added 3 commits May 27, 2026 19:35
Signed-off-by: apentori <pentori.alexis@proton.me>
Signed-off-by: apentori <pentori.alexis@proton.me>
Signed-off-by: apentori <pentori.alexis@proton.me>
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.

2 participants