-
Notifications
You must be signed in to change notification settings - Fork 4
whale watcher guide #464
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
base: main
Are you sure you want to change the base?
whale watcher guide #464
Conversation
| ## Prerequisites | ||
|
|
||
| - Ensure you have `auto_dev` installed and set up | ||
| - Access to an Ethereum RPC endpoint (you'll need to set this in your environment variables) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lets add a reference to validation.station.codes?
| ```bash | ||
| adev scaffold repo some_agent | ||
| ``` | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
missing steps to enter into the new repo youve created!
| ### 4. Eject the Metrics Skill | ||
|
|
||
| ```bash | ||
| aea -s eject skill eightballer/metrics |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldnt this be adev?
|
|
||
| ### 5. Create the FSM Configuration | ||
|
|
||
| Create a file named `your_fsm.yaml` with the following content: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Create this file !
in our case we can reference the fsm from the data file.
| # Store Web3 instance in shared state | ||
| self.context.shared_state["w3"] = self.w3 | ||
|
|
||
| self.threshold = float(os.getenv('WHALE_THRESHOLD', '1000')) # Default 1000 ETH |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should set this as part of the settings for the component.
| self.context.logger.info("Successfully connected to Web3") | ||
|
|
||
| # Store Web3 instance in shared state | ||
| self.context.shared_state["w3"] = self.w3 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Scaffold the contract and you can just use the helper functions
| def act(self) -> None: | ||
| """Wait for new blocks and get block data via RPC.""" | ||
| self.context.logger.info("IdleRound.act() called") | ||
| try: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no need to do any of this parsing
|
|
||
| def decode_transfer_log(self, log): | ||
| """Decode ERC20 transfer event log.""" | ||
| try: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
see above
| self.context.logger.info(f"\n{alert_content['message']}") | ||
|
|
||
| # Create proper Message object | ||
| alert_msg = Message( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sooo again can improve a lot this
|
|
||
| ```env | ||
| RPC_URL=your_ethereum_rpc_endpoint | ||
| WHALE_THRESHOLD=1000 # Threshold in ETH to consider an address a whale |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sure as env var, but we then pass that to the agent config.
TODO: add instructions on installation commands
as workflows get simpler add more to the guides page