go-node

command module
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2019 License: AGPL-3.0 Imports: 1 Imported by: 0

README

Stratumn Node

GoDoc Build Status codecov Go Report Card

Stratumn Node is virtual infrastructure for interoperable P2P services.

Project Status

The current focus is to build a solid architecture to develop P2P services and run Stratumn's products.

Current features
  • powered by IPFS's go-libp2p library
  • core services (P2P, NAT, DHT routing, relay, etc...)
  • P2P bootstrapping from seed nodes
  • P2P bootstrapping for private networks (with a coordinator node)
  • gRPC API
  • CLI with gRPC command reflection
  • neat and powerful inner-process service based architecture
  • raft support for replicated state machine (non-BFT)
  • system test framework
  • monitoring
Next
  • private networks without coordinator
  • layer 2 private networks
  • BFT consensus mechanisms
  • a simple, script-less, digital asset
  • third-party applications/ecosystem

Installation

Install Go. On macOS, you can install using homebrew:

brew install go

Install Go dependencies:

make deps

Compile and install stratumn-node:

make install

Usage

Create a new directory for your node. Open a terminal in that directory then create configuration files using stratumn-node init:

stratumn-node init

Now you can launch a node (from the same directory):

stratumn-node up

Open another terminal and connect to the node (from the same directory):

stratumn-node cli

The auto-completion should help you explore available APIs easily.

Logs And Metrics

To view streaming logs (from the same directory):

stratumn-node log -f log.jsonld

To view metrics you need to install Prometheus. On macOS:

brew install prometheus

Then copy monitoring/prometheus/prometheus.yml and launch Prometheus:

prometheus

By default, Prometheus is available at http://localhost:9090.

Dashboards and Graphs

To create dashboards, check out grafana.

To install on macOS:

brew install grafana

We provide some useful graph definitions in monitoring/grafana.

Copy the monitoring/grafana folder and launch Grafana:

export GF_PATHS_PROVISIONING=./grafana/provisioning
grafana-server

Traces

Distributed tracing is available in Stratumn Node but disabled by default.

You can configure it in the monitoring section in stratumn_node.core.config.

We recommend using Jaeger to collect traces locally (during development).

We recommend using Stackdriver on AWS or GCP.

To view traces locally, set monitoring.jaeger.endpoint = "/ip4/127.0.0.1/tcp/14268" in stratumn_node.core.config and run:

docker run -p 14268:14268 -p 16686:16686 jaegertracing/all-in-one:latest

Then visit http://localhost:16686/ to view your traces.

To use Stackdriver in a Cloud deployment, set monitoring.stackdriver.project_id to your Stackdriver project ID, and traces and metrics should be collected automatically.

Documentation

For more information, read the documentation.

Documentation

Overview

Command stratumn-node manages a Stratumn Node.

Stratumn Node is virtual infrastructure for interoperable P2P services.

Directories

Path Synopsis
app
chat
Package chat is a simple application that allows two peers to exchange messages.
Package chat is a simple application that allows two peers to exchange messages.
chat/grpc/mockchat
Package mockchat is a generated GoMock package.
Package mockchat is a generated GoMock package.
chat/protocol
Package protocol defines types for the chat protocol.
Package protocol defines types for the chat protocol.
chat/service
Package service defines types for the chat service.
Package service defines types for the chat service.
clock
Package clock is a simple application that sends the local time to a peer every time it receives a byte from that peer.
Package clock is a simple application that sends the local time to a peer every time it receives a byte from that peer.
clock/protocol
Package protocol defines types for the clock protocol.
Package protocol defines types for the clock protocol.
clock/service
Package service defines types for the clock service.
Package service defines types for the clock service.
coin
Package coin is an experimental Proof-Of-Work token.
Package coin is an experimental Proof-Of-Work token.
coin/grpc/mockcoin
Package mockcoin is a generated GoMock package.
Package mockcoin is a generated GoMock package.
coin/protocol/chain/mockchain
Package mockchain is a generated GoMock package.
Package mockchain is a generated GoMock package.
coin/protocol/engine/mockengine
Package mockengine is a generated GoMock package.
Package mockengine is a generated GoMock package.
coin/protocol/gossip/mockgossip
Package mockgossip is a generated GoMock package.
Package mockgossip is a generated GoMock package.
coin/protocol/p2p/mockencoder
Package mockencoder is a generated GoMock package.
Package mockencoder is a generated GoMock package.
coin/protocol/p2p/mockp2p
Package mockp2p is a generated GoMock package.
Package mockp2p is a generated GoMock package.
coin/protocol/processor/mockprocessor
Package mockprocessor is a generated GoMock package.
Package mockprocessor is a generated GoMock package.
coin/protocol/state/mockstate
Package mockstate is a generated GoMock package.
Package mockstate is a generated GoMock package.
coin/protocol/synchronizer/mocksynchronizer
Package mocksynchronizer is a generated GoMock package.
Package mocksynchronizer is a generated GoMock package.
coin/protocol/trie
Package trie implements a Patricia Merkle Trie.
Package trie implements a Patricia Merkle Trie.
coin/protocol/validator/mockvalidator
Package mockvalidator is a generated GoMock package.
Package mockvalidator is a generated GoMock package.
coin/service
Package service is a service to interact with Stratumn coins.
Package service is a service to interact with Stratumn coins.
contacts
Package contacts is an application to manage contacts.
Package contacts is an application to manage contacts.
contacts/grpc/mockcontacts
Package mockcontacts is a generated GoMock package.
Package mockcontacts is a generated GoMock package.
contacts/service
Package service defines types for the contacts service.
Package service defines types for the contacts service.
raft
Package raft is an application to create RAFT networks.
Package raft is an application to create RAFT networks.
raft/protocol/lib/mocklib
Package mocklib is a generated GoMock package.
Package mocklib is a generated GoMock package.
raft/service
Package service wraps coreos/raft library.
Package service wraps coreos/raft library.
storage
Package storage is a simple application that allows one peer to share a file to another peer.
Package storage is a simple application that allows one peer to share a file to another peer.
storage/grpc/mockstorage
Package mockstorage is a generated GoMock package.
Package mockstorage is a generated GoMock package.
storage/protocol
Package protocol defines types for the storage protocol.
Package protocol defines types for the storage protocol.
storage/protocol/file/mockhandler
Package mockhandler is a generated GoMock package.
Package mockhandler is a generated GoMock package.
storage/protocol/p2p/mockencoder
Package mockencoder is a generated GoMock package.
Package mockencoder is a generated GoMock package.
storage/service
Package service defines types for the storage service.
Package service defines types for the storage service.
cli
Package cli defines types for Stratumn Node's command line interface.
Package cli defines types for Stratumn Node's command line interface.
mockcli
Package mockcli is a generated GoMock package.
Package mockcli is a generated GoMock package.
Package cmd defines the commands of the stratumn-node executable.
Package cmd defines the commands of the stratumn-node executable.
Package core defines Stratumn Node's core functionality.
Package core defines Stratumn Node's core functionality.
app/bootstrap
Package bootstrap defines a core service that bootstraps a host from a set of well known peers or from a private network.
Package bootstrap defines a core service that bootstraps a host from a set of well known peers or from a private network.
app/bootstrap/protocol
Package protocol implements the network bootstrapping protocols.
Package protocol implements the network bootstrapping protocols.
app/bootstrap/protocol/mockprotocol
Package mockprotocol is a generated GoMock package.
Package mockprotocol is a generated GoMock package.
app/bootstrap/protocol/proposal
Package proposal implements a store for network update proposals.
Package proposal implements a store for network update proposals.
app/bootstrap/protocol/proposal/mocks
Package mockproposal is a generated GoMock package.
Package mockproposal is a generated GoMock package.
app/bootstrap/service
Package service defines the bootstrap service implementation.
Package service defines the bootstrap service implementation.
app/bootstrap/service/mockservice
Package mockservice is a generated GoMock package.
Package mockservice is a generated GoMock package.
app/connmgr/service
Package service defines a service that manages the number of connections kept open.
Package service defines a service that manages the number of connections kept open.
app/event/grpc/mockgrpc
Package mockgrpc is a generated GoMock package.
Package mockgrpc is a generated GoMock package.
app/event/service/mockservice
Package mockservice is a generated GoMock package.
Package mockservice is a generated GoMock package.
app/grpcapi/service
Package service defines a service that exposes a gRPC API.
Package service defines a service that exposes a gRPC API.
app/grpcapi/service/mockservice
Package mockservice is a generated GoMock package.
Package mockservice is a generated GoMock package.
app/grpcweb/service
Package service wraps the grpcapi server to implement the gRPC-Web spec
Package service wraps the grpcapi server to implement the gRPC-Web spec
app/host/grpc/mockgrpc
Package mockgrpc is a generated GoMock package.
Package mockgrpc is a generated GoMock package.
app/host/service
Package service defines a service the wraps a P2P host.
Package service defines a service the wraps a P2P host.
app/identify/service
Package service defines a service that identifies peers on the network.
Package service defines a service that identifies peers on the network.
app/identify/service/mockservice
Package mockservice is a generated GoMock package.
Package mockservice is a generated GoMock package.
app/kaddht/service
Package service defines a service that runs an instance of a Kademlia distributed hash table server or client that can be used to route peer IDs to network addresses.
Package service defines a service that runs an instance of a Kademlia distributed hash table server or client that can be used to route peer IDs to network addresses.
app/kaddht/service/mockservice
Package mockservice is a generated GoMock package.
Package mockservice is a generated GoMock package.
app/monitoring/service
Package service defines a service to configure monitoring for your Stratumn Node.
Package service defines a service to configure monitoring for your Stratumn Node.
app/mssmux/service
Package service defines a service that routes transport protocols to stream multiplexers.
Package service defines a service that routes transport protocols to stream multiplexers.
app/natmgr/service
Package service defines a service that deals with setting NAT port mappings to allow nodes to connect to a node behind a firewall.
Package service defines a service that deals with setting NAT port mappings to allow nodes to connect to a node behind a firewall.
app/natmgr/service/mockservice
Package mockservice is a generated GoMock package.
Package mockservice is a generated GoMock package.
app/ping/grpc/mockgrpc
Package mockgrpc is a generated GoMock package.
Package mockgrpc is a generated GoMock package.
app/ping/service
Package service defines a service that handles ping requests and responses.
Package service defines a service that handles ping requests and responses.
app/pruner/service
Package service defines a service that periodically prunes the service manager.
Package service defines a service that periodically prunes the service manager.
app/pruner/service/mockservice
Package mockservice is a generated GoMock package.
Package mockservice is a generated GoMock package.
app/pubsub/service
Package pubsub provides publish-subscribe capabilities that other apps can leverage.
Package pubsub provides publish-subscribe capabilities that other apps can leverage.
app/relay/service
Package service defines a service for the P2P relay circuit, which enables nodes to send traffic through intermediary nodes in order to reach otherwise inaccessible nodes.
Package service defines a service for the P2P relay circuit, which enables nodes to send traffic through intermediary nodes in order to reach otherwise inaccessible nodes.
app/signal/service
Package service defines a service that deals with exit signals.
Package service defines a service that deals with exit signals.
app/signal/service/mockservice
Package mockservice is a generated GoMock package.
Package mockservice is a generated GoMock package.
app/swarm/grpc/mockgrpc
Package mockgrpc is a generated GoMock package.
Package mockgrpc is a generated GoMock package.
app/swarm/service
Package service defines a service that maintains a swarm of connections between this node and its peers.
Package service defines a service that maintains a swarm of connections between this node and its peers.
app/yamux/service
Package service defines a service for the Yamux stream multiplexer.
Package service defines a service for the Yamux stream multiplexer.
cfg
Package cfg provides a simple mechanism for creating and loading configuration files.
Package cfg provides a simple mechanism for creating and loading configuration files.
db
httputil
Package httputil provides an utility method to start an HTTP server in the context of a Stratumn Node service.
Package httputil provides an utility method to start an HTTP server in the context of a Stratumn Node service.
httputil/mockhttputil
Package mockhttputil is a generated GoMock package.
Package mockhttputil is a generated GoMock package.
log
Package log deals with logging.
Package log deals with logging.
manager
Package manager deals with managing services.
Package manager deals with managing services.
manager/grpc/mockgrpc
Package mockgrpc is a generated GoMock package.
Package mockgrpc is a generated GoMock package.
manager/mockmanager
Package mockmanager is a generated GoMock package.
Package mockmanager is a generated GoMock package.
manager/testservice
Package testservice defines types to help test services.
Package testservice defines types to help test services.
monitoring
Package monitoring contains thin wrappers around the monitoring libraries used.
Package monitoring contains thin wrappers around the monitoring libraries used.
netutil
Package netutil defines useful networking types.
Package netutil defines useful networking types.
p2p
Package p2p defines types for P2P networking.
Package p2p defines types for P2P networking.
protector
Package protector contains implementations of the github.com/libp2p/go-libp2p-interface-pnet/ipnet.Protector interface.
Package protector contains implementations of the github.com/libp2p/go-libp2p-interface-pnet/ipnet.Protector interface.
protector/mocks
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.
streamutil
Package streamutil provides utility functions to make handling streams easier.
Package streamutil provides utility functions to make handling streams easier.
streamutil/mockstream
Package mockstream is a generated GoMock package.
Package mockstream is a generated GoMock package.
Package release contains variables describing the current release and are overriden during compilation.
Package release contains variables describing the current release and are overriden during compilation.
Package script defines types to implement a simple script interpreter with Lisp-like syntax.
Package script defines types to implement a simple script interpreter with Lisp-like syntax.
Package test contains a collection of test helpers.
Package test contains a collection of test helpers.
benchmark
Package benchmark defines integration benchmarks for Stratumn Node.
Package benchmark defines integration benchmarks for Stratumn Node.
mocks
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.
session
Package session defines types for doing system tests.
Package session defines types for doing system tests.
system
Package system defines system tests for Stratumn Node.
Package system defines system tests for Stratumn Node.

Jump to

Keyboard shortcuts

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