Files
hub-monorepo/generate-protos.sh
Aditi Srinivasan 206eb72f28 feat: support storage lending (#2650)
## Why is this change needed?

All the changes required to submit storage lending messages to the
protocol.

## Merge Checklist

_Choose all relevant options below by adding an `x` now or at any time
before submitting for review_

- [x] PR title adheres to the [conventional
commits](https://www.conventionalcommits.org/en/v1.0.0/) standard
- [x] PR has a
[changeset](https://github.com/farcasterxyz/hub-monorepo/blob/main/CONTRIBUTING.md#35-adding-changesets)
- [x] PR has been tagged with a change label(s) (i.e. documentation,
feature, bugfix, or chore)
- [ ] PR includes
[documentation](https://github.com/farcasterxyz/hub-monorepo/blob/main/CONTRIBUTING.md#32-writing-docs)
if necessary.

<!-- start pr-codex -->

---

## PR-Codex overview
This PR introduces support for storage lending in the system, including
new message types and validation for lending operations.

### Detailed summary
- Added support for `LendStorage` message type in
`packages/shuttle/src/utils.ts`.
- Introduced `LendStorageData` and `LendStorageMessage` types in
`packages/core/src/protobufs/types.ts`.
- Updated `StoreType` to include `STORAGE_LENDS`.
- Implemented validation for lending storage in
`packages/core/src/validations.ts`.
- Enhanced `ContactInfoBody` to include `announceRpcAddress` in multiple
files.
- Updated related protobufs and message handling for `MergeMessage`
events.

> The following files were skipped due to too many changes:
`packages/core/src/protobufs/generated/request_response.ts`,
`packages/hub-web/src/generated/message.ts`,
`packages/hub-nodejs/src/generated/message.ts`,
`packages/core/src/protobufs/generated/message.ts`

>  Ask PR-Codex anything about this PR by commenting with `/codex {your
question}`

<!-- end pr-codex -->
2025-09-29 22:42:00 -04:00

32 lines
1.5 KiB
Bash
Executable File

PROTO_REPO=https://github.com/farcasterxyz/snapchain
PROTO_PATH=src/proto
PROTO_REV=32fa4b1fa7e5ed32e271777d6854ee637678f4a9 # Update this if you want to generate off updated snapchain protos
TMPDIR=tmp-protogen
git clone $PROTO_REPO $TMPDIR
cd $TMPDIR
git checkout $PROTO_REV
cd ..
# Determine which files you care about
if [[ "$LIBRARY" == "core" ]]; then
RELEVANT_PROTOS="/defs/request_response.proto /defs/rpc.proto /defs/admin_rpc.proto /defs/message.proto /defs/hub_event.proto /defs/onchain_event.proto /defs/username_proof.proto"
OUT_PATH=src/protobufs/generated
CUSTOM_TS_PROTO_OPTS="outputServices=false"
elif [[ "$LIBRARY" == "hub-nodejs" ]]; then
RELEVANT_PROTOS="/defs/rpc.proto /defs/admin_rpc.proto"
OUT_PATH=src/generated
CUSTOM_TS_PROTO_OPTS="outputServices=grpc-js"
elif [[ "$LIBRARY" == "hub-web" ]]; then
RELEVANT_PROTOS="/defs/rpc.proto /defs/admin_rpc.proto"
OUT_PATH=src/generated
CUSTOM_TS_PROTO_OPTS="outputClientImpl=grpc-web,lowerCaseServiceMethods=true"
fi
echo "Generating relevant protos: $RELEVANT_PROTOS"
echo "Outputting generated files to: $OUT_PATH"
docker run --rm --user $(id -u):$(id -g) -v $(pwd)/../../node_modules:/node_modules -v $(pwd)/$TMPDIR/$PROTO_PATH:/defs -v $(pwd)/$OUT_PATH:/out namely/protoc:1.50_1 --plugin=/node_modules/ts-proto/protoc-gen-ts_proto --ts_proto_out=/out --ts_proto_opt=esModuleInterop=true,exportCommonSymbols=false,useOptionals=none,unrecognizedEnum=false,removeEnumPrefix=true,$CUSTOM_TS_PROTO_OPTS --proto_path=/defs $RELEVANT_PROTOS
rm -rf $TMPDIR