neoneo-go/pkg/core/blockchainer/services/oracle.go
Evgenii Stratonikov 43e4d3af88 oracle: integrate module in core and RPC
1. Initialization is performed via `Blockchain` methods.
2. Native Oracle contract updates list of oracle nodes
  and in-fly requests in `PostPersist`.
3. RPC uses Oracle module directly.
2021-01-28 13:00:58 +03:00

20 lines
568 B
Go

package services
import (
"github.com/nspcc-dev/neo-go/pkg/core/state"
"github.com/nspcc-dev/neo-go/pkg/crypto/keys"
)
// Oracle specifies oracle service interface.
type Oracle interface {
// AddRequests processes new requests.
AddRequests(map[uint64]*state.OracleRequest)
// RemoveRequests removes already processed requests.
RemoveRequests([]uint64)
// UpdateOracleNodes updates oracle nodes.
UpdateOracleNodes(keys.PublicKeys)
// Run runs oracle module. Must be invoked in a separate goroutine.
Run()
// Shutdown shutdowns oracle module.
Shutdown()
}