Content pfp
Content
@
0 reply
0 recast
3 reactions

jtgi - mostly offline 23 -> 05 pfp
jtgi - mostly offline 23 -> 05
@jtgi
A thread of snippets from automod codebase that may be of interest to ppl building on farcaster. ––––– 1. Server driven config that made it possible to add rules in minutes w/o writing any ui code. Sample config: https://github.com/jtgi/automod/blob/main/app/lib/validations.server.ts#L309-L360 Field generator: https://github.com/jtgi/automod/blob/main/app/components/curation-form.tsx#L777
17 replies
151 recasts
293 reactions

jtgi - mostly offline 23 -> 05 pfp
jtgi - mostly offline 23 -> 05
@jtgi
2. A farcaster multi-select user picker with auto-complete. Example uses react-hook-form, customized react-select w/debouncing and @neynar’s query username api. https://github.com/jtgi/automod/blob/main/app/components/user-picker.tsx [@moxie.eth fan token variant as well: https://github.com/jtgi/automod/blob/main/app/components/moxie-picker.tsx]
1 reply
0 recast
8 reactions

jtgi - mostly offline 23 -> 05 pfp
jtgi - mostly offline 23 -> 05
@jtgi
3. Login with Farcaster in remix.run with a customized login button. login button: https://github.com/jtgi/automod/blob/main/app/routes/_index.tsx#L321 login route: https://github.com/jtgi/automod/blob/main/app/routes/auth.farcaster.tsx remix-auth farcaster strategy: https://github.com/jtgi/automod/blob/main/app/lib/farcaster-strategy.ts
2 replies
0 recast
6 reactions

jtgi - mostly offline 23 -> 05 pfp
jtgi - mostly offline 23 -> 05
@jtgi
4. A scrappy queuing implementation with BullMQ thats free and works in-process on the same host as your api node. Sharing the process obv has downsides but was fine for Automods scale of 1-10rps, 550 channels (including most high vol ones) with 100 or so concurrent workers. https://github.com/jtgi/automod/blob/main/app/lib/bullish.server.ts
1 reply
0 recast
5 reactions

jtgi - mostly offline 23 -> 05 pfp
jtgi - mostly offline 23 -> 05
@jtgi
5. Checking a Moxie Fan Token balance, including fetching the user’s vesting contract. actual check: https://github.com/jtgi/automod/blob/main/app/lib/validations.server.ts#L1938 moxie gql lookups: https://github.com/jtgi/automod/blob/main/app/lib/airstack.server.ts#L29
1 reply
0 recast
4 reactions

jtgi - mostly offline 23 -> 05 pfp
jtgi - mostly offline 23 -> 05
@jtgi
6. Using a @hypersub to validate paid tiers for your sass Includes checking for tier (which afaict neynar's subscription api doesn't expose yet) and abi. https://github.com/jtgi/automod/blob/main/app/lib/subscription.server.ts#L28
1 reply
0 recast
7 reactions

jtgi - mostly offline 23 -> 05 pfp
jtgi - mostly offline 23 -> 05
@jtgi
7. 25+ of automod’s rules, including validating @hypersub, @paragraph, @openrank, ERC721/1155/20 token ownership and whatever else. https://github.com/jtgi/automod/blob/main/app/lib/validations.server.ts#L1496-L2555
1 reply
0 recast
6 reactions

jtgi - mostly offline 23 -> 05 pfp
jtgi - mostly offline 23 -> 05
@jtgi
8. Programmatically updating @neynar webhooks. Useful for anyone thinking to do channel moderation that doesn’t want to run their own node. I thought i may eventually need to but it webhooks worked just fine in the end. https://github.com/jtgi/automod/blob/main/app/lib/neynar.server.ts#L12
1 reply
0 recast
2 reactions

jtgi - mostly offline 23 -> 05 pfp
jtgi - mostly offline 23 -> 05
@jtgi
9. Using @neynar managed signers to like casts from different automod accounts. Reactions are limited per storage unit of each account, this was required to make sure some very high volume channels didn't wipe out reactions for others. 1. Approving signer access for the account [some awkwardness req'd due to how the lib initializes as soon as it mounts]: https://github.com/jtgi/automod/blob/main/app/routes/signer.tsx 2. Storing the signer uuid: https://github.com/jtgi/automod/blob/main/app/routes/api.signer.tsx 3. Using to like a cast: https://github.com/jtgi/automod/blob/main/app/lib/validations.server.ts#L1496-L1509
0 reply
0 recast
2 reactions