- user clicks on the
get my data
button - the app receives a POST to
/followers
with thefid
of the user - we hit the gRPC API of a Farcaster hub and makes a
LinksByTargetRequest
with the user'sfid
- we receive a list of messages and increment the follower count for every
MESSAGE_TYPE_LINK_ADD
and decrement it for everyMESSAGE_TYPE_LINK_REMOVE
- we create a
pandas.Series
object using thetimestamp
of the messages and the follower count - we plot the series using
seaborn
/matplotlib
- we render the graph as a png and return it
# separately check out hub-monorepo
git clone https://github.com/farcasterxyz/hub-monorepo path/to/hub-monorepo
# copy the updated protobufs in our repo
cp -R path/to/hub-monorepo/protobufs farcaster-followers-frame/protobufs
# generate the client code
python -m grpc_tools.protoc -I./protobufs/schemas/ \
--python_out=./src/fff/grpc --grpc_python_out=./src/fff/grpc protobufs/schemas/*.proto
# fix the darn imports generated by protoc
rye run protol --in-place --python-out src/fff/grpc protoc --proto-path=protobufs/schemas protobufs/schemas/*.proto
To configure the RPC host, create a .env
file and point it at your hub gRPC host and port:
HUB_RPC=hostname:2283