From 2554e2e52cec9c3ec3e4edcda37f350f057d2c8f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 18 Oct 2023 08:38:02 +0330 Subject: [PATCH 1/7] chore(deps): bump regex from 1.10.1 to 1.10.2 (#29) Bumps [regex](https://github.com/rust-lang/regex) from 1.10.1 to 1.10.2. - [Release notes](https://github.com/rust-lang/regex/releases) - [Changelog](https://github.com/rust-lang/regex/blob/master/CHANGELOG.md) - [Commits](https://github.com/rust-lang/regex/compare/1.10.1...1.10.2) --- updated-dependencies: - dependency-name: regex dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 8 ++++---- Cargo.toml | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 50a07f7..d4fe6b5 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -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..42a8170 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -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" From fb492752213ef17c514628cedcb6283f0d3f9271 Mon Sep 17 00:00:00 2001 From: Milad Nekofar Date: Wed, 18 Oct 2023 08:36:08 +0330 Subject: [PATCH 2/7] chore: add configurations for multiple environments in `wrangler.toml` This commit extends the wrangler.toml file by including detailed project, worker, build, triggers, and environment settings. An array of KV namespaces is added with the binding name, "CACHE", and corresponding id. New section for global variables is included with the configurations for Ethereum, Link generator, Lil Nouns, Meta Gov, Prop House, Prop Lot, and KV Store. Similar settings are duplicated and distinctly enabled for the 'dev' environment. --- wrangler.toml | 85 ++++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 78 insertions(+), 7 deletions(-) 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" From 0e59654b1a1d1946fdb937a03047067d5cc0c390 Mon Sep 17 00:00:00 2001 From: Milad Nekofar Date: Wed, 18 Oct 2023 08:41:10 +0330 Subject: [PATCH 3/7] chore: improve dev vars example for better readability This commit is aimed at improving the readability and understanding of the .dev.vars.example file. Comments were introduced to separate variable groups and the assignment operation was completed for each variable to make it clear where the value should be input. This change will make it easier for new developers to set up their environment. --- .dev.vars.example | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) 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="" From 2978d4ed0c4165f79b707345f924e38e82adeb46 Mon Sep 17 00:00:00 2001 From: Milad Nekofar Date: Wed, 18 Oct 2023 08:44:26 +0330 Subject: [PATCH 4/7] chore: add wrangler vars files to `.gitignore` This commit adds any .*vars to the .gitignore file. The change is necessary to prevent accidentally committing sensitive environment variables to the repository. --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 7b46c1d..3f9b90e 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,4 @@ /report.* /node_modules /.wrangler +/.*.vars From 46b88e3a07597385203ea0c0ce05ca2d7f4ff899 Mon Sep 17 00:00:00 2001 From: Milad Nekofar Date: Wed, 18 Oct 2023 09:26:07 +0330 Subject: [PATCH 5/7] docs: update README with better project information Modified README.md to better describe the project and encourage community contributions. The 'Overview' section was added to provide brief information about the source code and its primary focus. The 'Contributing' section was also added, instead of the experimental phase warning, to remove potential hesitation for new contributors. --- README.md | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) 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: From 7e226bd8d9d4240ae58253c5c5f2c721c92f561d Mon Sep 17 00:00:00 2001 From: Milad Nekofar Date: Wed, 18 Oct 2023 09:48:15 +0330 Subject: [PATCH 6/7] docs: create `CONTRIBUTING.md` for project guidelines Introduced a CONTRIBUTING.md guide to direct collaborators in their interactions with the project. This guide includes instructions for raising queries, reporting bugs and submitting feature requests. The significance of this guide lies in offering a clear path for potential contributors and standardize the contribution process. --- CONTRIBUTING.md | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 CONTRIBUTING.md 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. From 687a584aaba377c6e131d898aecca75f9584cde7 Mon Sep 17 00:00:00 2001 From: Milad Nekofar Date: Wed, 18 Oct 2023 09:58:13 +0330 Subject: [PATCH 7/7] chore(release): prepare for version 1.0.0 --- CHANGELOG.md | 13 +++++++++++++ Cargo.lock | 2 +- Cargo.toml | 2 +- 3 files changed, 15 insertions(+), 2 deletions(-) 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/Cargo.lock b/Cargo.lock index d4fe6b5..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", diff --git a/Cargo.toml b/Cargo.toml index 42a8170..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."