Documentation ¶
Index ¶
- Constants
- Variables
- func ActivateGrpcServer(smApp *SpacemeshApp)
- func GracefulShutdown(apps []*SpacemeshApp)
- func LoadConfigFromFile() (*cfg.Config, error)
- func StartMultiNode(numOfinstances, layerAvgSize int, runTillLayer uint32, dbPath string)
- type HareService
- type ManualClock
- func (t *ManualClock) AwaitLayer(layerId types.LayerID) chan struct{}
- func (t ManualClock) Close()
- func (t ManualClock) GetCurrentLayer() types.LayerID
- func (t ManualClock) GetGenesisTime() time.Time
- func (lc ManualClock) LayerToTime(id types.LayerID) time.Time
- func (t *ManualClock) StartNotifying()
- func (t *ManualClock) Subscribe() timesync.LayerTimer
- func (t *ManualClock) Tick()
- func (t *ManualClock) Unsubscribe(ch timesync.LayerTimer)
- type Network
- type Service
- type SpacemeshApp
- func (app *SpacemeshApp) Cleanup(cmd *cobra.Command, args []string) (err error)
- func (app *SpacemeshApp) HareFactory(mdb *mesh.MeshDB, swarm service.Service, sgn hare.Signer, nodeID types.NodeId, ...) HareService
- func (app *SpacemeshApp) Initialize(cmd *cobra.Command, args []string) (err error)
- func (app *SpacemeshApp) LoadOrCreateEdSigner() (*signing.EdSigner, error)
- func (app *SpacemeshApp) ParseConfig() error
- func (app *SpacemeshApp) SetLogLevel(name, loglevel string) error
- func (app *SpacemeshApp) Start(cmd *cobra.Command, args []string)
- type TickProvider
Constants ¶
const ( AppLogger = "app" P2PLogger = "p2p" PostLogger = "post" StateDbLogger = "stateDbStore" StateLogger = "state" AtxDbStoreLogger = "atxDbStore" PoetDbStoreLogger = "poetDbStore" StoreLogger = "store" PoetDbLogger = "poetDb" MeshDBLogger = "meshDb" TrtlLogger = "trtl" AtxDbLogger = "atxDb" BlkEligibilityLogger = "blkElgValidator" MeshLogger = "mesh" SyncLogger = "sync" BlockOracle = "blockOracle" HareBeaconLogger = "hareBeacon" HareOracleLogger = "hareOracle" HareLogger = "hare" BlockBuilderLogger = "blockBuilder" BlockListenerLogger = "blockListener" PoetListenerLogger = "poetListener" NipstBuilderLogger = "nipstBuilder" AtxBuilderLogger = "atxBuilder" )
Variables ¶
var Cmd = &cobra.Command{ Use: "node", Short: "start node", Run: func(cmd *cobra.Command, args []string) { app := NewSpacemeshApp() defer app.Cleanup(cmd, args) app.Initialize(cmd, args) app.Start(cmd, args) }, }
var VersionCmd = &cobra.Command{ Use: "version", Short: "Show version info", Run: func(cmd *cobra.Command, args []string) { fmt.Print(cmdp.Version) if cmdp.Commit != "" { fmt.Printf("+%s", cmdp.Commit) } fmt.Println() }, }
VersionCmd returns the current version of spacemesh
Functions ¶
func ActivateGrpcServer ¶
func ActivateGrpcServer(smApp *SpacemeshApp)
ActivateGrpcServer starts a grpc server on the provided node
func GracefulShutdown ¶
func GracefulShutdown(apps []*SpacemeshApp)
GracefulShutdown stops the current services running in apps
func LoadConfigFromFile ¶
func StartMultiNode ¶
Starts the run of a number of nodes, running in process consensus between them. this also runs a single transaction between the nodes.
Types ¶
type HareService ¶
type ManualClock ¶
type ManualClock struct {
// contains filtered or unexported fields
}
func NewManualClock ¶
func NewManualClock(genesisTime time.Time) *ManualClock
func (*ManualClock) AwaitLayer ¶
func (t *ManualClock) AwaitLayer(layerId types.LayerID) chan struct{}
func (ManualClock) Close ¶
func (t ManualClock) Close()
func (ManualClock) GetCurrentLayer ¶
func (t ManualClock) GetCurrentLayer() types.LayerID
func (ManualClock) GetGenesisTime ¶
func (t ManualClock) GetGenesisTime() time.Time
func (ManualClock) LayerToTime ¶ added in v0.1.6
func (lc ManualClock) LayerToTime(id types.LayerID) time.Time
LayerToTime returns the time of the provided layer
func (*ManualClock) StartNotifying ¶
func (t *ManualClock) StartNotifying()
func (*ManualClock) Subscribe ¶
func (t *ManualClock) Subscribe() timesync.LayerTimer
func (*ManualClock) Tick ¶
func (t *ManualClock) Tick()
func (*ManualClock) Unsubscribe ¶
func (t *ManualClock) Unsubscribe(ch timesync.LayerTimer)
type SpacemeshApp ¶
type SpacemeshApp struct { *cobra.Command P2P p2p.Service Config *cfg.Config // contains filtered or unexported fields }
SpacemeshApp is the cli app singleton
func InitSingleInstance ¶
func InitSingleInstance(cfg config.Config, i int, genesisTime string, rng *amcl.RAND, storePath string, rolacle *eligibility.FixedRolacle, poetClient *activation.HTTPPoetClient, fastHare bool, clock TickProvider, net Network) (*SpacemeshApp, error)
InitSingleInstance initializes a node instance with given configuration and parameters, it does not stop the instance.
func NewSpacemeshApp ¶
func NewSpacemeshApp() *SpacemeshApp
NewSpacemeshApp creates an instance of the spacemesh app
func (*SpacemeshApp) Cleanup ¶
func (app *SpacemeshApp) Cleanup(cmd *cobra.Command, args []string) (err error)
Post Execute tasks
func (*SpacemeshApp) HareFactory ¶
func (app *SpacemeshApp) HareFactory(mdb *mesh.MeshDB, swarm service.Service, sgn hare.Signer, nodeID types.NodeId, syncer *sync.Syncer, msh *mesh.Mesh, hOracle hare.Rolacle, idStore *activation.IdentityStore, clock TickProvider, lg log.Log) HareService
func (*SpacemeshApp) Initialize ¶
func (app *SpacemeshApp) Initialize(cmd *cobra.Command, args []string) (err error)
this is what he wants to execute Initialize app starts this is my persistent pre run that involves parsing the toml config file
func (*SpacemeshApp) LoadOrCreateEdSigner ¶
func (app *SpacemeshApp) LoadOrCreateEdSigner() (*signing.EdSigner, error)
func (*SpacemeshApp) ParseConfig ¶
func (app *SpacemeshApp) ParseConfig() error
ParseConfig unmarshal config file into struct
func (*SpacemeshApp) SetLogLevel ¶
func (app *SpacemeshApp) SetLogLevel(name, loglevel string) error