A service that listens to smart contract events and executes computational tasks.
This service acts as an operator/validator that monitors smart contract events and performs requested computations. Currently supports JavaScript execution on Anvil networks, with more language support planned.
![image](https://private-user-images.githubusercontent.com/183743440/400925674-86de438c-b37c-4559-bda8-660fec7cf4d5.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkyODc3NzMsIm5iZiI6MTczOTI4NzQ3MywicGF0aCI6Ii8xODM3NDM0NDAvNDAwOTI1Njc0LTg2ZGU0MzhjLWIzN2MtNDU1OS1iZGE4LTY2MGZlYzdjZjRkNS5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjUwMjExJTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI1MDIxMVQxNTI0MzNaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT00NmU0NmZiOTU2MzliNDRmNTZlYjQxMDhjYWMyZDcwMTBlOWZhYTZhY2JiNWQxN2FmZGI0NzM2MTdjMGE4NmFjJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCJ9.FfSXvflyzv0GdKnzwjWnG3hl9AfrxCGqLaxxgrr7rxs)
Now, for now the above works
later on, the experience of calling a function, will not require arURI or anything, it would be as easy as maybe
- calling the name of the function,
- providing the inputs
- payment for the execution
- number of responses (from validators, how many validotrs should submit the inference)
below is how we can create a registry of commonly used function,
- Rust (for running the validator)
- Node.js (for JavaScript execution)
- Anvil (for local blockchain)
- Start an Anvil node:
anvil --chain-id 31337 --fork-url https://eth.drpc.org -p 3001
- Run the validator:
cargo run
The validator will now listen for computation requests from the smart contract and execute them automatically.
- Event monitoring for computation requests
- JavaScript code execution
I welcome contributions! Here's how you can help:
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature
) - Commit your changes (
git commit -m 'Add some amazing feature'
) - Push to the branch (
git push origin feature/amazing-feature
) - Open a Pull Request
- Follow the existing code style
- Add tests for new features
- Update documentation as needed
- Ensure all tests pass before submitting PRs
twitter: @askwhyharsh