ecosystem/indexer-grpc/README.md
Indexer GRPC efficiently serves on-chain data for low-latency indexing
In production, Indexer GRPC currently requires access to a GCS bucket for cold storage, and thus is best run in GCP.
Object Owner and Bucket Owner.
Object Owner is to raed and write to each file.Bucket Owner is to verify the bucket existence.The implementation is up to the operator, but in general:
indexer-grpc-cache-worker)
indexer-grpc-file-store).indexer-grpc-data-service).These instructions set up the Indexer GRPC locally on your machine, using a local redis and file store.
grpcurl: https://github.com/fullstorydev/grpcurl#installationredis: https://redis.io/docs/getting-started/installation/Run a single aptos-node in test mode:
mkdir test_indexer_grpccargo run -p aptos-node -- --test --test-dir test_indexer_grpccrtl-ctest_indexer_grpc/0/node.yaml:
indexer_grpc:
enabled: true
address: 0.0.0.0:50051
processor_task_count: 10
processor_batch_size: 100
output_batch_size: 100```
cargo run -p aptos-node -- --test --test-dir test_indexer_grpcgrpcurlgrpcurl installedgrpcurl -max-msg-sz 10000000 -d '{ "starting_version": 0 }' -import-path crates/aptos-protos/proto -proto aptos/internal/fullnode/v1/fullnode_data.proto -plaintext 127.0.0.1:50051 aptos.internal.fullnode.v1.FullnodeData/GetTransactionsFromNodeOn MacOS, you can follow this setup in its entirety: https://redis.io/docs/getting-started/installation/install-redis-on-mac-os/
redis-serverInstead of using a cloud storage bucket, you can use a local directory to store all the data in the file-store.
mkdir test_indexer_grpc_filestore
Each of these services requires its own config file, though there are some shared fields. Connection configs for redis and the fullnode should be the same.
Particularly, the health_check_port must be different for each config, to avoid clashing on ports on the same machine.
For the file_store, use the local type such as:
...
file_store:
file_store_type: LocalFileStore
local_file_store_path: test_indexer_grpc_filestore
At this point, redis and the fullnode should already be running. Then start the following in order:
Clean up all the persistence layers:
redis-cli -p 6379 flushallrm -rf test_indexer_grpcrm -rf test_indexer_grpc_filestore