github.com/vchain-us/vcn@v0.9.11-0.20210921212052-a2484d23c0b3/pkg/cmd/sign/unsupport.go (about)

     1  /*
     2   * Copyright (c) 2018-2020 vChain, Inc. All Rights Reserved.
     3   * This software is released under GPL3.
     4   * The full license information can be found under:
     5   * https://www.gnu.org/licenses/gpl-3.0.en.html
     6   *
     7   */
     8  
     9  package sign
    10  
    11  import (
    12  	"github.com/spf13/cobra"
    13  	"github.com/spf13/viper"
    14  	"github.com/vchain-us/vcn/pkg/meta"
    15  )
    16  
    17  // NewUnsupportCommand returns the cobra command for `vcn unsupport`
    18  func NewUnsupportCommand() *cobra.Command {
    19  	cmd := makeCommand()
    20  	cmd.Use = "unsupport"
    21  	cmd.Aliases = []string{"us"}
    22  	cmd.Short = "Unsupport an asset"
    23  	cmd.PreRunE = func(cmd *cobra.Command, args []string) error {
    24  		return viper.BindPFlags(cmd.Flags())
    25  	}
    26  	cmd.RunE = func(cmd *cobra.Command, args []string) error {
    27  		return runSignWithState(cmd, args, meta.StatusUnsupported)
    28  	}
    29  	cmd.Long = `
    30  Change an asset's status so it is equal to UNSUPPORTED.
    31  
    32  Unsupport command calculates the SHA-256 hash of a digital asset
    33  (file, directory, container's image).
    34  The hash (not the asset) and the desired status of UNSUPPORTED are then
    35  cryptographically signed by the signer's secret (private key).
    36  Next, these signed objects are sent to the blockchain where the signer’s
    37  trust level and a timestamp are added.
    38  When complete, a new blockchain entry is created that binds the asset’s
    39  signed hash, signed status, level, and timestamp together.
    40  
    41  Note that your assets will not be uploaded. They will be processed locally.
    42  
    43  Assets are referenced by passed ARG(s) with unsupport command only accepting
    44  1 ARG at a time.
    45  
    46  ` + helpMsgFooter
    47  	
    48  	return cmd
    49  }