Indexer for real world assets, facilitating the integration and management of real-world financial assets on the blockchain.
-
Indexer: A background system processing messages from a Messenger, parsing accounts with Parsers to store in a Postgres database.
-
API: Provides access to RWA accounts via a JSON RPC API.
-
Asset Management: For asset issuers to create rules for asset management, leveraging Token-Extensions for transfer controls and privacy.
-
Policy Engine Program: Enables on-chain management of token transfer policies, including transaction size, count, and velocity.
-
Identity Registry: Allows asset issuers to manage wallet-to-identity relationships, crucial for the Asset Management program.
-
Asset Data Registry: For managing naive asset data like ownership (titles, deeds, audits), legal (filings, liens), and informational data.
The indexer captures account data from RWA programs through geyser, utilizing the digital-asset-validator plugin to forward accounts to Redis. The data is then serialized and inserted into a database for API retrieval.
More about RWA can be found here.
To get the indexer up and running on your local machine, follow these steps:
-
Start Local Services: Ensure you have Postgres and Redis instances running locally.
-
Environment Variables: Set the necessary environment variables:
export INDEXER_DATABASE_CONFIG='{listener_channel="backfill_item_added", url="postgres://postgres@localhost/rwa"}' export INDEXER_RPC_CONFIG='{url="http://localhost:8899", commitment="finalized"}' export INDEXER_MESSENGER_CONFIG='{messenger_type="Redis", connection_config={ batch_size=1, redis_connection_str="redis://localhost" } }' export INDEXER_METRICS_HOST=127.0.0.1 export INDEXER_METRICS_PORT=8125
The above assumes a local postgres database
rwa
-
Run the Indexer: Navigate to the
indexer
directory and start the indexer:cargo run -p indexer
-
API Environment Variable: Configure the environment for the API:
export APP_DATABASE_URL=postgres://postgres@localhost/rwa export APP_SERVER_PORT=9090
-
Run the API: In the
api
folder, initiate the API service:cargo run -p rwa_api
-
Account Forwarder Tool: Use the account forwarder to process RWA accounts for a specific token mint:
cargo run -- --redis-url 'redis://localhost:6379' --rpc-url '<RPC_URL>' mint --mint <MINT_ADDRESS>
Ensure all changes to the indexer or API are covered by integration tests:
-
Refer to
tests.README.md
for detailed testing instructions. -
Execute tests from the
tests
directory:cargo test