Skip to content

Commit

Permalink
chore: migrate from btc-pk to eots-pk in fpd related commands and doc…
Browse files Browse the repository at this point in the history
…s (#524)

Only modifies naming of flags, no logic is modified
  • Loading branch information
RafilxTenfen authored Jul 18, 2024
1 parent aab192d commit 3a82e96
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 16 deletions.
10 changes: 5 additions & 5 deletions docs/finality-provider.md
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ this value and specify a custom address using the `--rpc-listener` flag.
This will also start all the registered finality provider instances except for
slashed ones added in [step](#5-create-and-register-a-finality-provider). To start
the daemon with a specific finality provider instance, use the
`--btc-pk` flag followed by the hex string of the BTC public key of the finality
`--eots-pk` flag followed by the hex string of the BTC public key of the finality
provider (`btc_pk_hex`) obtained
in [step](#5-create-and-register-a-finality-provider).

Expand Down Expand Up @@ -175,7 +175,7 @@ the hash of the Babylon finality provider registration transaction.

```bash
fpd register-finality-provider \
--btc-pk d0fc4db48643fbb4339dc4bbf15f272411716b0d60f18bdfeb3861544bf5ef63
--eots-pk d0fc4db48643fbb4339dc4bbf15f272411716b0d60f18bdfeb3861544bf5ef63
{
"tx_hash": "800AE5BBDADE974C5FA5BD44336C7F1A952FAB9F5F9B43F7D4850BA449319BAA"
}
Expand Down Expand Up @@ -219,11 +219,11 @@ fpd list-finality-providers
After the creation of the finality provider in the local db, it is possible
to export the finality provider information through the `fpd export-finality-provider` command.
This command connects with the `fpd` daemon to retrieve the finality
provider previously created using the flag `--btc-pk` as key.
provider previously created using the flag `--eots-pk` as key.

This command also has several flag options:

- `--btc-pk` the hex string of the BTC public key.
- `--eots-pk` the hex string of the BTC public key.
- `--daemon-address` the RPC server address of `fpd` daemon.
- `--signed` signs the finality provider with the chain key of the PoS
chain secured as a proof of untempered exported data.
Expand All @@ -235,7 +235,7 @@ passphrase is required.
- `--hd-path` the hd derivation path of the private key.

```shell
$ fpd export-finality-provider --btc-pk 02face5996b2792114677604ec9dfad4fe66eeace3df92dab834754add5bdd7077 \
$ fpd export-finality-provider --eots-pk 02face5996b2792114677604ec9dfad4fe66eeace3df92dab834754add5bdd7077 \
--home ./export-fp/fpd --key-name finality-provider --signed
```

Expand Down
6 changes: 3 additions & 3 deletions finality-provider/cmd/fpd/daemon/daemon_commands.go
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ func runCommandLsFP(cmd *cobra.Command, args []string) error {
// CommandInfoFP returns the finality-provider-info command by connecting to the fpd daemon.
func CommandInfoFP() *cobra.Command {
var cmd = &cobra.Command{
Use: "finality-provider-info [fp-pk-btc-hex]",
Use: "finality-provider-info [fp-eots-pk-hex]",
Aliases: []string{"fpi"},
Short: "List finality providers stored in the database.",
Example: fmt.Sprintf(`fpd finality-provider-info --daemon-address %s`, defaultFpdDaemonAddress),
Expand Down Expand Up @@ -257,7 +257,7 @@ func runCommandInfoFP(cmd *cobra.Command, args []string) error {
// CommandRegisterFP returns the register-finality-provider command by connecting to the fpd daemon.
func CommandRegisterFP() *cobra.Command {
var cmd = &cobra.Command{
Use: "register-finality-provider [fp-pk-btc-hex]",
Use: "register-finality-provider [fp-eots-pk-hex]",
Aliases: []string{"rfp"},
Short: "Register a created finality provider to Babylon.",
Example: fmt.Sprintf(`fpd register-finality-provider --daemon-address %s`, defaultFpdDaemonAddress),
Expand Down Expand Up @@ -305,7 +305,7 @@ func runCommandRegisterFP(cmd *cobra.Command, args []string) error {
// CommandAddFinalitySig returns the add-finality-sig command by connecting to the fpd daemon.
func CommandAddFinalitySig() *cobra.Command {
var cmd = &cobra.Command{
Use: "add-finality-sig [fp-pk-btc-hex] [block-height]",
Use: "add-finality-sig [fp-eots-pk-hex] [block-height]",
Aliases: []string{"afs"},
Short: "Send a finality signature to the consumer chain. This command should only be used for presentation/testing purposes",
Example: fmt.Sprintf(`fpd add-finality-sig --daemon-address %s`, defaultFpdDaemonAddress),
Expand Down
4 changes: 2 additions & 2 deletions finality-provider/cmd/fpd/daemon/export.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ type FinalityProviderSigned struct {
// CommandExportFP returns the export-finality-provider command by loading the fp and export the data.
func CommandExportFP() *cobra.Command {
var cmd = &cobra.Command{
Use: "export-finality-provider [fp-btc-pk-hex]",
Use: "export-finality-provider [fp-eots-pk-hex]",
Aliases: []string{"exfp"},
Short: "It exports the finality provider by the given BTC public key.",
Short: "It exports the finality provider by the given EOTS public key.",
Example: fmt.Sprintf(`fpd export-finality-provider --daemon-address %s`, defaultFpdDaemonAddress),
Args: cobra.NoArgs,
RunE: fpcmd.RunEWithClientCtx(runCommandExportFP),
Expand Down
2 changes: 1 addition & 1 deletion finality-provider/cmd/fpd/daemon/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package daemon

const (
forceFlag = "force"
fpPkFlag = "btc-pk"
fpEotsPkFlag = "eots-pk"
rpcListenerFlag = "rpc-listener"
fpdDaemonAddressFlag = "daemon-address"
keyNameFlag = "key-name"
Expand Down
2 changes: 1 addition & 1 deletion finality-provider/cmd/fpd/daemon/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ func runInitCmd(ctx client.Context, cmd *cobra.Command, args []string) error {
homePath = util.CleanAndExpandPath(homePath)
force, err := cmd.Flags().GetBool(forceFlag)
if err != nil {
return fmt.Errorf("failed to read flag %s: %w", fpPkFlag, err)
return fmt.Errorf("failed to read flag %s: %w", fpEotsPkFlag, err)
}

if util.FileExists(homePath) && !force {
Expand Down
6 changes: 3 additions & 3 deletions finality-provider/cmd/fpd/daemon/start.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ func CommandStart() *cobra.Command {
Args: cobra.NoArgs,
RunE: fpcmd.RunEWithClientCtx(runStartCmd),
}
cmd.Flags().String(fpPkFlag, "", "The public key of the finality-provider to start")
cmd.Flags().String(fpEotsPkFlag, "", "The EOTS public key of the finality-provider to start")
cmd.Flags().String(passphraseFlag, "", "The pass phrase used to decrypt the private key")
cmd.Flags().String(rpcListenerFlag, "", "The address that the RPC server listens to")
return cmd
Expand All @@ -43,9 +43,9 @@ func runStartCmd(ctx client.Context, cmd *cobra.Command, args []string) error {
homePath = util.CleanAndExpandPath(homePath)
flags := cmd.Flags()

fpStr, err := flags.GetString(fpPkFlag)
fpStr, err := flags.GetString(fpEotsPkFlag)
if err != nil {
return fmt.Errorf("failed to read flag %s: %w", fpPkFlag, err)
return fmt.Errorf("failed to read flag %s: %w", fpEotsPkFlag, err)
}

rpcListener, err := flags.GetString(rpcListenerFlag)
Expand Down
2 changes: 1 addition & 1 deletion finality-provider/service/fp_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ func (fpm *FinalityProviderManager) StartAll() error {
for _, fp := range storedFps {
if fp.Status == proto.FinalityProviderStatus_CREATED || fp.Status == proto.FinalityProviderStatus_SLASHED {
fpm.logger.Info("the finality provider cannot be started with status",
zap.String("btc-pk", fp.GetBIP340BTCPK().MarshalHex()),
zap.String("eots-pk", fp.GetBIP340BTCPK().MarshalHex()),
zap.String("status", fp.Status.String()))
continue
}
Expand Down

0 comments on commit 3a82e96

Please sign in to comment.