-
Notifications
You must be signed in to change notification settings - Fork 16
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Summary
Some web3 libraries such as https://www.npmjs.com/package/ethers and other projects have the necessity to filter Lightchain logs.
The web3 method is called getLogs()
and translates to Geth API as eth_getLogs
.
ethers/providers/json-rpc-provider.ts
case 'getLogs':
if (params.filter && params.filter.address != null) {
params.filter.address = getLowerCase(params.filter.address);
}
return this.send('eth_getLogs', [params.filter]);
Steps to resolve
- Implement
func (api *PublicFilterAPI) GetLogs(ctx context.Context, crit FilterCriteria) ([]*types.Log, error) {
From: go-ethereum/eth/filters/api.go
Something like this should work as fix:
lightchain/database/database.go
if _, ok := v.Service.(*filters.PublicFilterAPI); ok {
v.Service = filters.NewPublicFilterAPI(
db.eth.APIBackend,
false,
)
}
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working