-
Notifications
You must be signed in to change notification settings - Fork 108
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' of https://github.com/zeta-chain/node into ref…
…actor-integrate-base-observer
- Loading branch information
Showing
123 changed files
with
1,938 additions
and
1,539 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
package main | ||
|
||
import ( | ||
"encoding/json" | ||
"fmt" | ||
"os" | ||
"time" | ||
|
||
"github.com/binance-chain/tss-lib/ecdsa/keygen" | ||
"github.com/spf13/cobra" | ||
) | ||
|
||
func init() { | ||
RootCmd.AddCommand(GenPrePramsCmd) | ||
} | ||
|
||
var GenPrePramsCmd = &cobra.Command{ | ||
Use: "gen-pre-params <path>", | ||
Short: "Generate pre parameters for TSS", | ||
Args: cobra.ExactArgs(1), | ||
RunE: func(cmd *cobra.Command, args []string) error { | ||
startTime := time.Now() | ||
preParams, err := keygen.GeneratePreParams(time.Second * 300) | ||
if err != nil { | ||
return err | ||
} | ||
|
||
file, err := os.OpenFile(args[0], os.O_RDWR|os.O_CREATE, 0600) | ||
if err != nil { | ||
return err | ||
} | ||
defer file.Close() | ||
err = json.NewEncoder(file).Encode(preParams) | ||
if err != nil { | ||
return err | ||
} | ||
fmt.Printf("Generated new pre-parameters in %v\n", time.Since(startTime)) | ||
return nil | ||
}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.