Skip to content

elbraulio/clcert-beacon-observer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

License codebeat badge Java CI with Maven

CLCERT Beacon Observer

This is the unofficial Java SDK to consume the CLCERT Beacon service.

Install

Step 1: Add the JitPack repository to your build file

<repositories>
    <repository>
        <id>jitpack.io</id>
        <url>https://jitpack.io</url>
    </repository>
</repositories>

Step 2: Add the dependency

<dependency>
    <groupId>com.github.elbraulio</groupId>
    <artifactId>clcert-beacon-observer</artifactId>
    <version>0.2.0</version>
</dependency>

How to use

Pretty simple to use:

// get an observer.
BeaconObserver beaconObserver = BeaconFactory.observer();

// ask for randomness.
PulseContainer pulseContainer = beaconObserver.lastPulse();

You can ask for specific times as well. Always remember to use UTC.

Instant instant = Instant
                    .now()
                    .atOffset(ZoneOffset.UTC)
                    .toInstant()
                    .truncatedTo(ChronoUnit.MINUTES);
PulseContainer pulseContainer = beaconObserver.pulseBefore(instant);

See the response structure in:

See the supported calls in BeaconObserver here .