Documentation ¶
Overview ¶
Package node defines the concept of a Aurora node by bootstrapping and injecting all necessary dependencies.
Index ¶
- Variables
- func CheckOverlayWithStore(overlay boson.Address, storer storage.StateStorer) error
- func CheckTimeouts(timeouts *rpc.HTTPTimeouts, log logging.Logger)
- func InitChain(ctx context.Context, logger logging.Logger, endpoint string, ...) (chain.Resolver, settlement.Interface, traffic.ApiInterface, chain.Common, ...)
- func InitStateStore(log logging.Logger, dataDir string) (ret storage.StateStorer, err error)
- func InitTraffic(store storage.StateStorer, address common.Address, ...) (*traffic.Service, error)
- func NewHTTPHandlerStack(srv http.Handler, cors []string, vhosts []string) http.Handler
- type Aurora
- type Config
- type Node
- func (n *Node) Attach() (*rpc.Client, error)
- func (n *Node) Close() error
- func (n *Node) Config() Config
- func (n *Node) HTTPEndpoint() string
- func (n *Node) IPCEndpoint() string
- func (n *Node) RPCHandler() (*rpc.Server, error)
- func (n *Node) RegisterAPIs(apis []rpc.API)
- func (n *Node) RegisterHandler(name, path string, handler http.Handler)
- func (n *Node) Start() error
- func (n *Node) WSEndpoint() string
- func (n *Node) Wait()
- type Options
Constants ¶
This section is empty.
Variables ¶
var ( ErrNodeStopped = errors.New("node not started") ErrNodeRunning = errors.New("node already running") )
Functions ¶
func CheckOverlayWithStore ¶
func CheckOverlayWithStore(overlay boson.Address, storer storage.StateStorer) error
CheckOverlayWithStore checks the overlay is the same as stored in the statestore
func CheckTimeouts ¶ added in v1.2.4
func CheckTimeouts(timeouts *rpc.HTTPTimeouts, log logging.Logger)
CheckTimeouts ensures that timeout values are meaningful
func InitChain ¶
func InitChain( ctx context.Context, logger logging.Logger, endpoint string, oracleContractAddress string, stateStore storage.StateStorer, signer crypto.Signer, trafficEnable bool, trafficContractAddr string, p2pService *libp2p.Service, subPub subscribe.SubPub, ) (chain.Resolver, settlement.Interface, traffic.ApiInterface, chain.Common, error)
InitChain will initialize the Ethereum backend at the given endpoint and set up the Transacton Service to interact with it using the provided signer.
func InitStateStore ¶
InitStateStore will initialize the stateStore with the given path to the data directory. When given an empty directory path, the function will instead initialize an in-memory state store that will not be persisted.
func InitTraffic ¶ added in v1.2.0
func InitTraffic(store storage.StateStorer, address common.Address, trafficChainService chain.Traffic, transactionService chain.Transaction, logger logging.Logger, p2pService *libp2p.Service, signer crypto.Signer, chainID int64, trafficContractAddr string, subPub subscribe.SubPub) (*traffic.Service, error)
Types ¶
type Config ¶ added in v1.2.4
type Config struct { EnableApiTLS bool TlsCrtFile string TlsKeyFile string DebugAPIAddr string APIAddr string DataDir string IPCPath string HTTPAddr string HTTPCors []string HTTPVirtualHosts []string HTTPModules []string HTTPTimeouts rpc.HTTPTimeouts HTTPPathPrefix string WSAddr string WSPathPrefix string WSOrigins []string WSModules []string }
type Node ¶ added in v1.2.4
type Node struct {
// contains filtered or unexported fields
}
Node is a container on which services can be registered.
func (*Node) Attach ¶ added in v1.2.4
Attach creates an RPC client attached to an in-process API handler.
func (*Node) Close ¶ added in v1.2.4
Close stops the Node and releases resources acquired in Node constructor New.
func (*Node) HTTPEndpoint ¶ added in v1.2.4
HTTPEndpoint returns the URL of the HTTP server. Note that this URL does not contain the JSON-RPC path prefix set by HTTPPathPrefix.
func (*Node) IPCEndpoint ¶ added in v1.2.4
IPCEndpoint retrieves the current IPC endpoint used by the protocol stack.
func (*Node) RPCHandler ¶ added in v1.2.4
RPCHandler returns the in-process RPC request handler.
func (*Node) RegisterAPIs ¶ added in v1.2.4
RegisterAPIs registers the APIs a service provides on the node.
func (*Node) RegisterHandler ¶ added in v1.2.4
RegisterHandler mounts a handler on the given path on the canonical HTTP server.
The name of the handler is shown in a log message when the HTTP server starts and should be a descriptive term for the service provided by the handler.
func (*Node) WSEndpoint ¶ added in v1.2.4
WSEndpoint returns the current JSON-RPC over WebSocket endpoint.
type Options ¶
type Options struct { DataDir string CacheCapacity uint64 DBDriver string DBPath string HTTPAddr string WSAddr string APIAddr string DebugAPIAddr string ApiBufferSizeMul int NATAddr string EnableWS bool EnableQUIC bool WelcomeMessage string Bootnodes []string ChainEndpoint string OracleContractAddress string CORSAllowedOrigins []string Logger logging.Logger Standalone bool IsDev bool TracingEnabled bool TracingEndpoint string TracingServiceName string // GlobalPinningEnabled bool // PaymentThreshold string // PaymentTolerance string // PaymentEarly string ResolverConnectionCfgs []multiresolver.ConnectionConfig GatewayMode bool TrafficEnable bool TrafficContractAddr string KadBinMaxPeers int LightNodeMaxPeers int AllowPrivateCIDRs bool Restricted bool TokenEncryptionKey string AdminPasswordHash string RouteAlpha int32 Groups interface{} EnableApiTLS bool TlsCrtFile string TlsKeyFile string }