51 lines
1.6 KiB
Go
51 lines
1.6 KiB
Go
|
// Copyright (c) 2014 Conformal Systems LLC.
|
||
|
// Use of this source code is governed by an ISC
|
||
|
// license that can be found in the LICENSE file.
|
||
|
|
||
|
// NOTE: This file is intended to house the RPC commands that are supported by
|
||
|
// a chain server with btcd extensions.
|
||
|
|
||
|
package btcjson
|
||
|
|
||
|
// DebugLevelCmd defines the debuglevel JSON-RPC command. This command is not a
|
||
|
// standard Bitcoin command. It is an extension for btcd.
|
||
|
type DebugLevelCmd struct {
|
||
|
LevelSpec string
|
||
|
}
|
||
|
|
||
|
// NewDebugLevelCmd returns a new DebugLevelCmd which can be used to issue a
|
||
|
// debuglevel JSON-RPC command. This command is not a standard Bitcoin command.
|
||
|
// It is an extension for btcd.
|
||
|
func NewDebugLevelCmd(levelSpec string) *DebugLevelCmd {
|
||
|
return &DebugLevelCmd{
|
||
|
LevelSpec: levelSpec,
|
||
|
}
|
||
|
}
|
||
|
|
||
|
// GetBestBlockCmd defines the getbestblock JSON-RPC command.
|
||
|
type GetBestBlockCmd struct{}
|
||
|
|
||
|
// NewGetBestBlockCmd returns a new instance which can be used to issue a
|
||
|
// getbestblock JSON-RPC command.
|
||
|
func NewGetBestBlockCmd() *GetBestBlockCmd {
|
||
|
return &GetBestBlockCmd{}
|
||
|
}
|
||
|
|
||
|
// GetCurrentNetCmd defines the getcurrentnet JSON-RPC command.
|
||
|
type GetCurrentNetCmd struct{}
|
||
|
|
||
|
// NewGetCurrentNetCmd returns a new instance which can be used to issue a
|
||
|
// getcurrentnet JSON-RPC command.
|
||
|
func NewGetCurrentNetCmd() *GetCurrentNetCmd {
|
||
|
return &GetCurrentNetCmd{}
|
||
|
}
|
||
|
|
||
|
func init() {
|
||
|
// No special flags for commands in this file.
|
||
|
flags := UsageFlag(0)
|
||
|
|
||
|
MustRegisterCmd("debuglevel", (*DebugLevelCmd)(nil), flags)
|
||
|
MustRegisterCmd("getbestblock", (*GetBestBlockCmd)(nil), flags)
|
||
|
MustRegisterCmd("getcurrentnet", (*GetCurrentNetCmd)(nil), flags)
|
||
|
}
|