In Hyperledger Fabric v2.5, the peer connects to the StateDB through configuration settings in the core.yaml file. The state database provider is initialized in kv_ledger_provider.initStateDBProvider, and the implementation files are located within the statedb package. To implement a custom database, you need to create a provider that adheres to the state database interface and update the configuration accordingly