code.vegaprotocol.io/vega@v0.79.0/cmd/vega/commands/query.go (about)

     1  // Copyright (C) 2023 Gobalsky Labs Limited
     2  //
     3  // This program is free software: you can redistribute it and/or modify
     4  // it under the terms of the GNU Affero General Public License as
     5  // published by the Free Software Foundation, either version 3 of the
     6  // License, or (at your option) any later version.
     7  //
     8  // This program is distributed in the hope that it will be useful,
     9  // but WITHOUT ANY WARRANTY; without even the implied warranty of
    10  // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    11  // GNU Affero General Public License for more details.
    12  //
    13  // You should have received a copy of the GNU Affero General Public License
    14  // along with this program.  If not, see <http://www.gnu.org/licenses/>.
    15  
    16  package commands
    17  
    18  import (
    19  	"context"
    20  
    21  	"code.vegaprotocol.io/vega/cmd/vega/commands/query"
    22  
    23  	"github.com/jessevdk/go-flags"
    24  )
    25  
    26  type QueryCmd struct {
    27  	Accounts          query.AccountsCmd          `command:"accounts"                   description:"Query a vega node to get the state of accounts"`
    28  	Assets            query.AssetsCmd            `command:"assets"                     description:"Query a vega node to get the list of available assets"`
    29  	NetworkParameters query.NetworkParametersCmd `command:"netparams"                  description:"Query a vega node to get the list network parameters"`
    30  	Parties           query.PartiesCmd           `command:"parties"                    description:"Query a vega node to get the list of parties"`
    31  	Validators        query.ValidatorsCmd        `command:"validators"                 description:"Query a vega node to get the list of the validators"`
    32  	Markets           query.MarketsCmd           `command:"markets"                    description:"Query a vega node to get the list of all markets"`
    33  	Proposals         query.ProposalsCmd         `command:"proposals"                  description:"Query a vega node to get the list of all proposals"`
    34  	Help              bool                       `description:"Show this help message" long:"help"                                                         short:"h"`
    35  }
    36  
    37  var queryCmd QueryCmd
    38  
    39  func Query(ctx context.Context, parser *flags.Parser) error {
    40  	queryCmd = QueryCmd{}
    41  
    42  	_, err := parser.AddCommand("query", "query state from a vega node", "", &queryCmd)
    43  	return err
    44  }