Skip to content

antpool/eosio-mongodb-queries-java

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

EOSIO MongoDB Queries

using Java create MongoDB Queries for the EOSIO blockchain, impl eosio-mongodb-queries API.

Quickstart

MongoClient mongoClient = MongoClients.create("mongodb://host1:27017");
BlockService service = new BlockServiceImpl(mongoClient);

BlockParam param = BlockParam.builder()
        .blockNum(2L)
        .limit(1)
        .build();
AggregateIterable<Block> actions = service.getBlocks(param);

API

Examples

ActionParam param = ActionParam.builder()
        .accounts(Lists.newArrayList("eosio"))
        .names(Lists.newArrayList("delegatebw", "undelegatebw"))
        .match(ImmutableMap.of("data.from", "eosnationftw", "data.receiver", "eosnationftw"))
        .irreversible(true)
        .sort(new SortParam("block_num", SortDirection.DESC))
        .build();
AggregateIterable<Action> actions = service.getActions(param);
for (Action action : actions) {
    System.out.println(action);
}

Returns AggregateIterable<Action> MongoDB Aggregation Iterable

Examples

BlockParam param = BlockParam.builder()
        .match(ImmutableMap.of("block.producer", "eoscanadacom"))
        .sort(new SortParam("block_num", SortDirection.ASC))
        .limit(5)
        .skip(5)
        .build();
AggregateIterable<Block> actions = service.getBlocks(param);
for (Block block : actions) {
    System.out.println(block);
}

Returns AggregateIterable<Block> MongoDB Aggregation Iterable

About

using Java create MongoDB Queries for the EOSIO blockchain

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages