Skip to content
Snippets Groups Projects
Select Git revision
  • afaee6e99a4a7738ec77eb83f756b30b9972e5ae
  • release default protected
  • master protected
  • hotfix/GrpcParameters
  • XX-4441
  • tls-websockets
  • hotfix/allow-web-creds
  • hotfix/nilCert
  • XX-3566_const_time_token_compare
  • AceVentura/AccountBackup
  • dev
  • waitingRoundsRewrite
  • fullRateLimit
  • XX-3564/TlsCipherSuite
  • XX-3563/DisableTlsCheck
  • notls
  • url-repo-rename
  • perftuning
  • Anne/CI2
  • AddedGossipLogging
  • hotfix/connectionReduction
  • v0.0.6
  • v0.0.4
  • v0.0.5
  • v0.0.3
  • v0.0.2
  • v0.0.1
27 results

connection_test.go

Blame
  • init.go 1.34 KiB
    ///////////////////////////////////////////////////////////////////////////////
    // Copyright © 2020 xx network SEZC                                          //
    //                                                                           //
    // Use of this source code is governed by a license that can be found in the //
    // LICENSE file                                                              //
    ///////////////////////////////////////////////////////////////////////////////
    
    // Package cmd initializes the CLI and config parsers as well as the logger.
    package cmd
    
    import (
    	"github.com/spf13/cobra"
    	jww "github.com/spf13/jwalterweatherman"
    	"github.com/spf13/viper"
    )
    
    // initCmd creates a new user object with the given NDF
    var initCmd = &cobra.Command{
    	Use:   "init",
    	Short: "Initialize a user ID but do not connect to the network",
    	Args:  cobra.NoArgs,
    	Run: func(cmd *cobra.Command, args []string) {
    		_, receptionIdentity := initCmix()
    
    		jww.INFO.Printf("User: %s", receptionIdentity.ID)
    		writeContact(receptionIdentity.GetContact())
    	},
    }
    
    func init() {
    	initCmd.Flags().StringP("userid-prefix", "", "",
    		"Desired prefix of userID to brute force when running init command. Prepend (?i) for case-insensitive. Only Base64 characters are valid.")
    	_ = viper.BindPFlag("userid-prefix", initCmd.Flags().Lookup("userid-prefix"))
    
    	rootCmd.AddCommand(initCmd)
    }