sandbox-oracle

command
v0.0.0-...-403735f Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 17, 2024 License: BSD-3-Clause Imports: 1 Imported by: 0

README

Oracle Middleware

The sandbox oracle serves the application's JSON API, abstracting the details of interacting with smart contracts from API consumers.

A blockchain oracle is a service that provides smart contracts with information from the outside world.

Directory Structure

cmd:
	Program subcommand and command line argument definitions.
oracle:
	Code implementing the oracle service
version:
	A machanism for the oracle to know its build vesrion

Making Changes

Testing Changes

The oracle defines tests in files with names like oracle/*_test.go. These are functional tests which test application API and the code paths connecting the oracle to the phylum. The functional tests can be run with the following command:

make test

From the project's top level make oraclegotest will run the same tests.

Running Tests Outside of Docker

To run tests directly using go test there are environment variables needed to for the tests to set up an in-memory copy of the platform to run tests on.

eval $(make host-go-env)
go test ./...

This can be faster than running the tests in docker and has some additional benefits. For example, the following command runs only the tests related to the CreateAccount API endpoint:

go test -run=CreateAccount ./...

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
Package oracle defines a simple system for http middleware built around functions with the following signature:
Package oracle defines a simple system for http middleware built around functions with the following signature:

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL