services

package
v1.13.5 Latest Latest
Warning

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

Go to latest
Published: Jun 29, 2021 License: GPL-3.0 Imports: 40 Imported by: 0

Documentation

Overview

Package services implements the APIs for the Rosetta Server.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Router

func Router(node *p2pserver.P2PServer, store *Store, offline bool) (http.Handler, error)

Router creates an http.Handler for Rosetta API requests.

Types

type IndexConfig

type IndexConfig struct {
	Done      chan bool
	ExitEarly bool
	WaitTime  time.Duration
}

IndexConfig represents the options for the IndexBlocks method on Store.

type OEP4Token

type OEP4Token struct {
	Contract common.Address
	Decimals int32
	Symbol   string
	Wasm     bool
}

OEP4Token defines the currency information for an OEP4 token.

type Store

type Store struct {
	// contains filtered or unexported fields
}

Store aggregates the blockchain data for Rosetta API calls.

func NewStore

func NewStore(dir string, oep4 []*OEP4Token, offline bool) (*Store, error)

func (*Store) Close

func (s *Store) Close() error

Close closes the store database. It must be called to ensure all pending writes are written to disk.

func (*Store) IndexBlocks

func (s *Store) IndexBlocks(ctx context.Context, cfg IndexConfig)

IndexBlocks polls the node for new blocks and indexes the block data.

Jump to

Keyboard shortcuts

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