iotaledger / chronicle.rs

A framework for building IOTA permanodes
Apache License 2.0
73 stars 15 forks source link

Support query with multiple parameters #91

Closed sobolev-alexey closed 1 year ago

sobolev-alexey commented 3 years ago

Please add support for queries with combination of multiple parameters like tag + timestamp + address + any other common transaction parameter.

We discussed this feature request in the engineering meeting this Tuesday.

DaughterOfMars commented 3 years ago

Can you provide a few example queries as well as what structure you would expect to receive?

sobolev-alexey commented 3 years ago

Can you provide a few example queries as well as what structure you would expect to receive?

Hey @Alexandcoats this is just a suggestion:

Query with multiple parameters:

chronicle.findBy({
    address: 'aaaabbbbb',
    tag: 'ABCD',
    timestampStart: 1620812305077
    timestampEnd: 1620832305077 
})

Probably some other query parameters could be added as well, like nonce, parentMessage1-4, isSolid, payloadType, payload. Basically any parameter of the current message and metadata object.

Query with a range of values:

chronicle.findBy({
    addresses: ['aaaabbbbb', 'ccccccddddddd', 'eeeeeeeefffffff'],
    tags: ['ABCD', 'EFGH'],
    timestampStart: 1620812305077 // optional
    timestampEnd: 1620832305077   // optional
})

Please note that the second query parameters are in plural (addresses, tags) , indication that you will supply multiple values and want to get results for all/any of them.