diff --git a/.dev.vars.example b/.dev.vars.example index 4d6f45b..1a2747e 100644 --- a/.dev.vars.example +++ b/.dev.vars.example @@ -1,11 +1,17 @@ -LIL_NOUNS_DISCORD_WEBHOOK_URL= -LIL_NOUNS_WARP_CAST_TOKEN= +# Discord Webhook and Warp Cast Token Settings -META_GOV_DISCORD_WEBHOOK_URL= -META_GOV_WARP_CAST_TOKEN= +# Lil Nouns Settings +LIL_NOUNS_DISCORD_WEBHOOK_URL="" +LIL_NOUNS_WARP_CAST_TOKEN="" -PROP_HOUSE_DISCORD_WEBHOOK_URL= -PROP_HOUSE_WARP_CAST_TOKEN= +# Meta Gov Settings +META_GOV_DISCORD_WEBHOOK_URL="" +META_GOV_WARP_CAST_TOKEN="" -PROP_LOT_DISCORD_WEBHOOK_URL= -PROP_LOT_WARP_CAST_TOKEN= +# Prop House Settings +PROP_HOUSE_DISCORD_WEBHOOK_URL="" +PROP_HOUSE_WARP_CAST_TOKEN="" + +# Prop Lot Settings +PROP_LOT_DISCORD_WEBHOOK_URL="" +PROP_LOT_WARP_CAST_TOKEN="" diff --git a/.gitignore b/.gitignore index 7b46c1d..3f9b90e 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,4 @@ /report.* /node_modules /.wrangler +/.*.vars diff --git a/CHANGELOG.md b/CHANGELOG.md index 4b10d01..15f0158 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,19 @@ All notable changes to this project will be documented in this file. +## [1.0.0] - 2023-10-18 + +### Documentation + +- Update README with better project information +- Create `CONTRIBUTING.md` for project guidelines + +### Miscellaneous Tasks + +- Add configurations for multiple environments in `wrangler.toml` +- Improve dev vars example for better readability +- Add wrangler vars files to `.gitignore` + ## [1.0.0-beta.0] - 2023-10-18 ### Refactor diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..b3f055f --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,23 @@ +# Contributing + +Thank you for considering contributing! Your efforts are highly valued. + +## Questions + +Use the [Issues](https://github.com/lilnouns/lilnouns-bots/issues) section for questions after checking existing issues +and +online resources. + +## Contributions + +Legal Notice: Ensure you have the rights to your contributions and agree to license them under this project's terms. + +### Bug Reports + +Before reporting, ensure you're using the latest version and check +existing [bug reports](https://github.com/lilnouns/lilnouns-bots/issues?q=label%3Abug). +Provide details like stack trace, OS, and how to reproduce the issue. + +### Feature Requests + +Make a strong case for the utility of the feature to most users. diff --git a/Cargo.lock b/Cargo.lock index 50a07f7..3a5266e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1553,7 +1553,7 @@ checksum = "b4668fb0ea861c1df094127ac5f1da3409a82116a4ba74fca2e58ef927159bb3" [[package]] name = "lilnouns-bots" -version = "1.0.0-beta.0" +version = "1.0.0" dependencies = [ "anyhow", "async-trait", @@ -2069,9 +2069,9 @@ dependencies = [ [[package]] name = "regex" -version = "1.10.1" +version = "1.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aaac441002f822bc9705a681810a4dd2963094b9ca0ddc41cb963a4c189189ea" +checksum = "380b951a9c5e80ddfd6136919eef32310721aa4aacd4889a8d39124b026ab343" dependencies = [ "aho-corasick", "memchr", @@ -2081,9 +2081,9 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.4.2" +version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5011c7e263a695dc8ca064cddb722af1be54e517a280b12a5356f98366899e5d" +checksum = "5f804c7828047e88b2d32e2d7fe5a105da8ee3264f01902f796c8e067dc2483f" dependencies = [ "aho-corasick", "memchr", diff --git a/Cargo.toml b/Cargo.toml index 918804d..5bf281f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "lilnouns-bots" -version = "1.0.0-beta.0" +version = "1.0.0" authors = ["Milad Nekofar "] edition = "2021" description = "Our bots are designed to keep the Lil Nouns DAO community informed and engaged." @@ -31,7 +31,7 @@ ethers = { version = "2.0.10", default-features = false } getrandom = { version = "0.2.10", features = ["js"] } graphql_client = { version = "0.13.0", features = ["reqwest"] } log = "0.4.20" -regex = "1.10.1" +regex = "1.10.2" reqwest = "0.11.22" serde = { version = "1.0.189", features = ["derive"] } serde_json = "1.0.107" diff --git a/README.md b/README.md index 88d8b37..723e348 100644 --- a/README.md +++ b/README.md @@ -6,16 +6,21 @@ [![X (formerly Twitter) Follow](https://img.shields.io/badge/follow-%40nekofar-ffffff?logo=x&style=flat)](https://x.com/nekofar) [![Donate](https://img.shields.io/badge/donate-nekofar.crypto-a2b9bc?logo=ko-fi&logoColor=white)](https://ud.me/nekofar.crypto) +## Overview -> [!WARNING] -> Please note that the project is currently in an experimental phase and it is subject to significant changes as it -> progresses. +This repository contains the source code for various bots, primarily focused on the LilNouns DAO. The codebase is +written in Rust and utilizes several libraries for web scraping, data fetching, and Discord and Farcaster bot +functionalities. -## Development Guide +## Contributing + +If you wish to contribute to this project, please follow the [contribution guidelines](CONTRIBUTING.md). + +## Development This is a quick start instructions for the project development environment setup. -### Software Requirements +### Requirements Before starting, ensure you have the following software installed: diff --git a/wrangler.toml b/wrangler.toml index 81053de..83d5d24 100644 --- a/wrangler.toml +++ b/wrangler.toml @@ -1,53 +1,124 @@ +# Project Identification name = "lilnouns-bots" main = "build/worker/shim.mjs" compatibility_date = "2023-03-22" +# Worker Settings workers_dev = false logpush = true usage_model = "unbound" +# Build Settings [build] command = "cargo install -q -f worker-build && worker-build --release" +# Trigger Settings [triggers] crons = ["*/5 * * * *"] +# Default KV Namespace +[[kv_namespaces]] +binding = "CACHE" +id = "6456908fdbcf4ce1b89b3028a5bbbe87" + +# Global Variables +[vars] +# Ethereum Settings +ETHEREUM_MAINNET_RPC_URL = "https://eth.llamarpc.com" + +# Link Generator Settings +LINK_GENERATOR_ENDPOINT = "https://lilnouns.click" + +# Lil Nouns Settings +LIL_NOUNS_ENABLED = "false" +LIL_NOUNS_DISCORD_ENABLED = "true" +LIL_NOUNS_FARCASTER_ENABLED = "false" +LIL_NOUNS_BASE_URL = "https://lilnouns.wtf/vote" +LIL_NOUNS_GRAPHQL_URL = "https://api.goldsky.com/api/public/project_cldjvjgtylso13swq3dre13sf/subgraphs/lil-nouns-subgraph/1.0.4/gn" +LIL_NOUNS_WARP_CAST_CHANNEL = "" + +# Meta Gov Settings +META_GOV_ENABLED = "false" +META_GOV_DISCORD_ENABLED = "true" +META_GOV_FARCASTER_ENABLED = "false" +META_GOV_BASE_URL = "https://lilnouns.wtf/vote/nounsdao" +META_GOV_SNAPSHOT_GRAPHQL_URL = "https://hub.snapshot.org/graphql" +META_GOV_SNAPSHOT_SPACE_ID = "leagueoflils.eth" +META_GOV_WARP_CAST_CHANNEL = "" + +# Prop House Settings +PROP_HOUSE_ENABLED = "true" +PROP_HOUSE_DISCORD_ENABLED = "true" +PROP_HOUSE_FARCASTER_ENABLED = "false" +PROP_HOUSE_BASE_URL = "https://prop.house/lil-nouns" +PROP_HOUSE_COMMUNITY_ID = "2" +PROP_HOUSE_GRAPHQL_URL = "https://prod.backend.prop.house/graphql" +PROP_HOUSE_WARP_CAST_CHANNEL = "" + +# Prop Lot Settings +PROP_LOT_ENABLED = "true" +PROP_LOT_DISCORD_ENABLED = "true" +PROP_LOT_FARCASTER_ENABLED = "false" +PROP_LOT_BASE_URL = "https://lilnouns.proplot.wtf" +PROP_LOT_GRAPHQL_URL = "https://lilnouns.proplot.wtf/api/graphql" +PROP_LOT_WARP_CAST_CHANNEL = "" + +# KV Store Settings +KV_STORE_NAME = "CACHE" + +# Environment: Development [env.dev] +# KV Namespaces for Development [[env.dev.kv_namespaces]] binding = "CACHE" id = "c193c4943cd5475196cd5bdd3298a8ff" +# Variables for Development [env.dev.vars] -KV_STORE_NAME = "CACHE" +# Ethereum Settings +ETHEREUM_MAINNET_RPC_URL = "https://eth.llamarpc.com" + +# Link Generator Settings +LINK_GENERATOR_ENDPOINT = "https://lilnouns.click" + +# Lil Nouns Settings LIL_NOUNS_ENABLED = "true" LIL_NOUNS_DISCORD_ENABLED = "true" LIL_NOUNS_FARCASTER_ENABLED = "true" -LIL_NOUNS_WARP_CAST_CHANNEL = "" LIL_NOUNS_BASE_URL = "https://lilnouns.wtf/vote" LIL_NOUNS_GRAPHQL_URL = "https://api.goldsky.com/api/public/project_cldjvjgtylso13swq3dre13sf/subgraphs/lil-nouns-subgraph/1.0.4/gn" +LIL_NOUNS_WARP_CAST_CHANNEL = "" + +# Meta Gov Settings META_GOV_ENABLED = "true" META_GOV_DISCORD_ENABLED = "true" META_GOV_FARCASTER_ENABLED = "true" -META_GOV_WARP_CAST_CHANNEL = "" META_GOV_BASE_URL = "https://lilnouns.wtf/vote/nounsdao" META_GOV_SNAPSHOT_GRAPHQL_URL = "https://hub.snapshot.org/graphql" META_GOV_SNAPSHOT_SPACE_ID = "leagueoflils.eth" +META_GOV_WARP_CAST_CHANNEL = "" + +# Prop House Settings PROP_HOUSE_ENABLED = "true" PROP_HOUSE_DISCORD_ENABLED = "true" PROP_HOUSE_FARCASTER_ENABLED = "true" -PROP_HOUSE_WARP_CAST_CHANNEL = "" PROP_HOUSE_BASE_URL = "https://prop.house/lil-nouns" PROP_HOUSE_COMMUNITY_ID = "2" PROP_HOUSE_GRAPHQL_URL = "https://prod.backend.prop.house/graphql" +PROP_HOUSE_WARP_CAST_CHANNEL = "" + +# Prop Lot Settings PROP_LOT_ENABLED = "true" PROP_LOT_DISCORD_ENABLED = "true" PROP_LOT_FARCASTER_ENABLED = "true" -PROP_LOT_WARP_CAST_CHANNEL = "" PROP_LOT_BASE_URL = "https://lilnouns.proplot.wtf" PROP_LOT_GRAPHQL_URL = "https://lilnouns.proplot.wtf/api/graphql" -ETHEREUM_MAINNET_RPC_URL = "https://eth.llamarpc.com" -LINK_GENERATOR_ENDPOINT = "https://lilnouns.click" +PROP_LOT_WARP_CAST_CHANNEL = "" + +# KV Store Settings +KV_STORE_NAME = "CACHE" +# Analytics Engine Datasets for Development [[env.dev.analytics_engine_datasets]] binding = "METRICS"