ogmigo
is a go client for ogmios.
This library is under heavy development, use at your own risk.
package example
import (
"context"
"github.com/thuannguyen2010/ogmigo"
)
func example(ctx context.Context) error {
var callback ogmigo.ChainSyncFunc = func(ctx context.Context, data []byte) error {
// do work
return nil
}
client := ogmigo.New(ogmigo.WithEndpoint("ws://example.com:1337"))
closer, err := client.ChainSync(ctx, callback)
if err != nil {
return err
}
if err := closer.Close(); err != nil {
return err
}
return nil
}
ogmigo
imports ogmios
as a submodule for testing purposes. To fetch the submodules,
git submodule update --init --recursive