agent

package
v0.0.0-...-e03aae4 Latest Latest
Warning

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

Go to latest
Published: May 6, 2022 License: GPL-3.0 Imports: 20 Imported by: 0

Documentation

Overview

Contains the Bibon constant definitions

Index

Constants

View Source
const (
	ProtocolVersionStr = "1.0.0"       // The same, as agent string
	ProtocolName       = "bitbonagent" // Nickname of the protocol in geth

	DefaultJournalName    = ".bitbon.agent.journal.LDB"
	DefaultJournalTimeout = 10 * time.Minute
	DefaultConfirmTimeout = 10 * time.Second
	DefaultPublishTimeout = 3 * time.Second
)

Bitbon constants

Variables

This section is empty.

Functions

func IsAllowed

func IsAllowed() bool

Types

type API

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

API provides the bitbon bitbon RPC service

func NewAPI

func NewAPI(a *Agent) *API

NewAPI create agent new RPC bitbon agent service.

func (*API) GetJournal

func (api *API) GetJournal() ([]*amqp.Publishing, error)

func (*API) Version

func (api *API) Version(_ context.Context) string

Version returns version.

type Agent

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

func New

func New(ctx *node.ServiceContext, cfg *Config) (*Agent, error)

func (*Agent) APIs

func (a *Agent) APIs() []rpc.API

APIs is agent meaningless implementation of node.Service.

func (*Agent) GetJournal

func (a *Agent) GetJournal() *bitbonAmqp.PublishJournal

func (*Agent) Protocols

func (a *Agent) Protocols() []p2p.Protocol

Protocols is agent meaningless implementation of node.Service.

func (*Agent) Start

func (a *Agent) Start(_ *p2p.Server) (err error)

func (*Agent) Stop

func (a *Agent) Stop() error

func (*Agent) Stopped

func (a *Agent) Stopped() bool

type Config

type Config struct {
	Enabled        bool
	AmqpConnStrs   []string
	AmqpExchange   string
	JournalName    string
	JournalTimeout time.Duration
}

Config represents the configuration state of agent bitbon agent service.

Jump to

Keyboard shortcuts

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