Skip to content

Commit

Permalink
[Utility] Local Proof of Stake CLI - Issue #112 (#169)
Browse files Browse the repository at this point in the history
## Description
This PR aims at introducing CLI commands relative to the Utility module: 

- Send
- Stake
- EditStake
- Unstake
- Unpause
- ChangeParameter

Consequently, it introduces an RPC server (HTTP) and the ability to "point" the CLI at specific nodes via flags 

Fixes [issue/112](#112)

## Type of change
Please mark the options that are relevant.

- [x] New feature (non-breaking change which adds functionality)

## How Has This Been Tested?

- [x] `make test_all`
- [x] [LocalNet](https://github.com/pokt-network/pocket/blob/main/docs/development/README.md)

## Checklist
- [x] I have performed a self-review of my own code
- [x] I have commented my code, particularly in hard-to-understand areas
- [x] I have tested my changes using the available tooling
- [x] If applicable, I have made corresponding changes to related or global README
- [x] If applicable, I have added added new diagrams using [mermaid.js](https://mermaid-js.github.io)
- [x] If applicable, I have added tests that prove my fix is effective or that my feature works

* fix(config.proto): updated timeout type

* feat(RPC): basic RPC server with naive sync TX broadcast

* fix(RPC): fixed HTTP method for Health and Version routes

* chore(go.mod): tidy

* style(RPC): format

* chore(go.mod): tidy + vendor

* feat(Utility): CLI RPC client function

* feat(Utility): RPC defaults const

* feat(Utility): GetSignBytes

* feat(Utility): CLI utils

* feat(Utility): stake cmd scaffolding

* refactor(Utility): RPC server RoutesMap for CLI/client use

* refactor(Utility): RPC server exporting RouteKey and RoutesMap

for CLI/client use

* feat(Utility): CLI

calling updated QueryRPC to point at route from map

* refactor(Utility): RPC server exporting RouteKey and RoutesMap

for CLI/client use

* chore(Utility): Removed TODO

* fix(Utility): CLI: making use of the pwd flag

* fix(Utility): CLI: code review feedback

* fix(Utility): CLI custodial stake command: OutputAddr = fromAddr

* refactor(Utility): CLI: refactor command bindings

Also added missing functionality in commands other than Stake

* fix(Utility): Fix route after merge

* refactor(Utility): CLI: named return values fix

* test(Utility): CLI: simplified tests for PK parsing from file

* feat(Utility): RPC OpenApi spec and code generation

* refactor(Utility): RPC server refactoring using code generation

RPC server refactoring with code generation from openapi spec

* feat(Utility): RPC OpenApi spec and code generation

* feat(Utility): Updated RPC spec

* feat(Utility): Regenerated RPC boilerplate and updates

* docs(Utility): RPC and node docs barebones + RPC spec notes

* feat(Utility): Updated RPC spec

* docs(Utility): CLI docs barebones

* fix(Utility): CLI: added missing message handling for account

* fix(Shared): fixed RPC config

* feat(Utility): CLI updated to use the generated RPC client

* chore(go.mod): tidy

* refactor(Utility): CLI + RPC models in server.gen.go

* style(Utility): removed redundant struct definition

* docs(README.md): fixed LICENSE reference

* docs(README.md): updated with references to CLI, RPC and Node docs

* refactor(Shared): RPC config defaults -changing soon,I'm centralizin

* refactor(Shared): RPC config defaults -changing soon,I'm centralizin

Signed-off-by: Alessandro De Blasis <[email protected]>

* fix(Utility): RPC: updated to use test_artifacts defaults

* refactor(Shared): RPC config defaults -changing soon,I'm centralizin

* feat(Utility): CLI: updated to use test_artifacts default

* docs(Utility): RPC and node basic docs

* docs(Utility): CLI: Changelog

* fix(Utility): CLI: fixed output to user. It shouldn't be logging

* fix(Utility): CLI code review feedback

* style(Utility): code review feedback

* feat(Tooling): Updated makefile commands to better handle codegen

* feat(Tooling): Updated makefile commands to better handle codegen

Signed-off-by: Alessandro De Blasis <[email protected]>

* fix(Utility): Fix duplicated models

* chore(Utility): fixed versioning schema

* feat(Utility): CLI documentation generator + first stab at docs

* fix(Utility): CLI specific fixes

* fix(Utility): types fixes

* fix(Utility): RPC configs post-merge

* feat(Consensus): configOptions

* feat(P2P): configOptions

* feat(Utility): CLI: using configOptions to inject PK

* fix(Utility): RPC configs post-merge

* feat(Consensus): configOptions

* feat(P2P): configOptions

* fix(Utility): RPC fix post merge

* fix(Utility): RPC disabled by default because of TECHDEBT

* chore(go.mod): tidy

* fix(go.mod): tidy

* fix(CLI): test_artifacts

* fix(go.mod): tidy

* fix(CLI): updated to use new typesUtil.ActorType

* fix(CLI): runtime based init

* fix(test_artifacts): fix

* fix(CLI): runtime using WithRandomPK()

* fix(CLI): fixed client-only initialization

* fix(Makefile): protogen first

* feat(Utility): GetActorName function (can we autogenerate these?)

* fix(RPC): test_artifacts in runtime

* fix(go.mod): tidy

* fix(CLI): debug commands are now feature flagged

* chore(go.mod): tidy

* chore(CLI): git rm app/pocket/rpc/client.gen.go

* chore(CLI): s/j/tx and s/prepareTx/prepareTxJson

* refactor(shared): converters

* fix(CLI): debug nits

* refactor(CLI): confirmation and credentials

* chore(CLI): removed HACK todo

* fix(Makefile): premature protoc

* fix(RPC): added imports used in codegen files

* docs(RPC): added swagger editor link

* fix(RPC): added imports used in codegen files

* feat(RPC): config proto

* feat(RPC): RPCModule and noopRpcModule

* refactor(Shared): shared.Create -> shared.CreateNode

* refactor(RPC): moved scaffolding into rpc module

* fix(RPC): removed redundant file

* fix(CLI): debug merge fix

* docs(RPC): fixed link after refactoring

* docs(RPC): updated code organization post refactoring

* Update app/client/cli/utils.go

Co-authored-by: Daniel Olshansky <[email protected]>

* fix(RPC): gitignoring generated files

* style(Persistence): reverting space change

* refactor(Defaults): runtime/defaults package

* chore(CLI): issue handle

* chore(CLI): Issue #310 links

* refactor(CLI): preallocation fix

* style(CLI): oneMillion

* style(CLI): s/RelayChainIDs/relayChainIDs

* feat(Utility): ActorType.GetName()

* chore(Utility): tracking issue #142

* chore(Utility): GetBytes -> GetCanonicalBytes

* chore(CLI): actorCmd -> accountCmd

* docs(CLI): fromAddr note (address currently sourced from pk)

* chore(Runtime): new default value from main

* refactor(CLI): moving utility functions in utils.go

* chore(CLI): NewDebug -> NewDebugCommand

* fix(RPC): gitignoring generated files

Signed-off-by: Alessandro De Blasis <[email protected]>

* refactor(Consensus): mocks with Return(nil) and not Do(...)

* docs(RPC): updated changelog versions

* fix(Makefile): generate_rpc_openapi

* fix(Makefile): fix for git clone + make develop_test

* Update rpc/v1/openapi.yaml

Co-authored-by: Daniel Olshansky <[email protected]>

* Update rpc/doc/CHANGELOG.md

Co-authored-by: Daniel Olshansky <[email protected]>

* Update rpc/noop_module.go

Co-authored-by: Daniel Olshansky <[email protected]>

* chore(Shared): added TODOes for ValidateXXX() in modules

* docs(RPC): broadcast_tx_sync summary updated

* Update rpc/doc/README.md

Co-authored-by: Daniel Olshansky <[email protected]>

* Update rpc/doc/README.md

Co-authored-by: Daniel Olshansky <[email protected]>

* Update rpc/doc/README.md

Co-authored-by: Daniel Olshansky <[email protected]>

* fix(Makefile): gitignoring generated files breaks tests fix

* docs(CLI): added todos for exactArgs

* chore(RPC): added types.go

* refactor(RPC): sourcing defaults from defaults not test_artifacts

* feat(CLI): system commands RPC🤝CLI

* feat(Consensus): CurrentRound() and CurrentStep()

* feat(RPC): /v1/consensus/round_state

* feat(RPC): /v1/consensus/round_state handler

* feat(RPC): /v1/consensus/round_state

* refactor(CLI): system command typoes copypastas

* feat(CLI): consensus commands -RoundState and individual ones

* chore(CLI): typo

* docs(CLI): short commands descriptions

* docs(Config): Adding some more color around configuration

* fix(CLI): tx message signing

* feat(CLI): reporting statuscode and body

* fix(Proto): deterministic

* refactor(CLI): prepareTxJSON -> prepareTxBytes

* docs(Docs): Adding some more color config + raw_hex_bytes

* refactor(CLI): Stake command

* fix(CLI): tx message signing

* feat(CLI): reporting statuscode and body

* Merge branch 'issue/utility_local_proof_of_stake_cli_CLI' into issue/utility_local_proof_of_stake_cli

* feat(Tooling): swagger-ui

* feat(RPC): cors feature flag

* Update utility/types/message.go

Co-authored-by: Daniel Olshansky <[email protected]>

* chore(Runtime): comment spacing

* docs(CLI): Changelog

* docs(CLI): changelog

* docs(RPC): changelog

* chore(Runtime): comment spacing

* Update runtime/docs/README.md

Co-authored-by: Daniel Olshansky <[email protected]>

* chore(Consensus): SetBus mock Do(func(modules.Bus) {}) -> Return()

* refactor(Consensus): mocks with Return(nil) and not Do(...)

Signed-off-by: Alessandro De Blasis <[email protected]>

* chore(Consensus): SetBus mock Do(func(modules.Bus) {}) -> Return()

Signed-off-by: Alessandro De Blasis <[email protected]>

* docs(Pocket): changelog

* Update app/pocket/doc/README.md

Co-authored-by: Daniel Olshansky <[email protected]>

* Update app/pocket/doc/README.md

Co-authored-by: Daniel Olshansky <[email protected]>

* docs(RPC): changelog

* docs(RPC): docs TOC

* docs(RPC): Transports -> Endpoints

* feat(Tooling): swagger-ui

Signed-off-by: Alessandro De Blasis <[email protected]>

* docs(RPC): swagger ui link to editor and ref to make cmd

* feat(rpcServer): rpcServer is now IntegratableModule

* chore(Shared): tracking TODO (implement validations) #334

* fix(RPC): merge fix

* chore(go.mod): tidy

* chore(go.mod): tidy

* feat(Tooling): added empty mock_module package for cold start

* docs(RPC): nit

* Update app/client/cli/consensus.go

Co-authored-by: Daniel Olshansky <[email protected]>

* docs(CLI): better commands descriptions

* feat(CLI): boldText helper

* style(CLI): nit: real estate

* refactor(CLI): ConsensusState

* docs(CLI): updated docs

* docs(CLI): \n at the end of sentences in Stake command desc.

* docs(CLI): regenerated docs

* fix(RPC): int64 on RoundState fields

* refactor(Shared): unexporting XXModuleName

* feat(node): single source of truth for version + overridable

Signed-off-by: Alessandro De Blasis <[email protected]>
Co-authored-by: Daniel Olshansky <[email protected]>
  • Loading branch information
deblasis and Olshansk authored Nov 11, 2022
1 parent 9fe53d9 commit f509831
Show file tree
Hide file tree
Showing 68 changed files with 601 additions and 226 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ prototype/vendor/
.idea/

# Generated Mocks (for testing)
shared/modules/mocks/
shared/modules/mocks/*
!shared/modules/mocks/mocks.go
p2p/types/mocks/

# TODO(team): Does the `types` directory contain generated or raw type files?
Expand Down
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ go_oapi-codegen:
echo "Install with 'go install github.com/deepmap/oapi-codegen/cmd/[email protected]'"; \
fi; \
}

.PHONY: go_clean_deps
## Runs `go mod tidy` && `go mod vendor`
go_clean_deps:
Expand Down Expand Up @@ -214,7 +215,7 @@ docker_loki_install: docker_check
## Use `mockgen` to generate mocks used for testing purposes of all the modules.
mockgen:
$(eval modules_dir = "shared/modules")
rm -rf ${modules_dir}/mocks
find ${modules_dir}/mocks -maxdepth 1 -type f ! -name "mocks.go" -exec rm {} \;
go generate ./${modules_dir}
echo "Mocks generated in ${modules_dir}/mocks"

Expand Down
9 changes: 8 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ All the links you'll need are listed below. If you'd like to contribute to the P
- _Coming Soon: Consensus Architecture_ // TODO(olshansky): needs a README file with proper code structure
- [Persistence Architecture](persistence/docs/README.md)
- [P2P Architecture](p2p/README.md)
- [CLI Architecture](app/client/cli/doc/README.md)
- [RPC Architecture](app/pocket/rpc/doc/README.md)
- [Node binary Architecture](app/pocket/doc/README.md)

### Changelogs

Expand All @@ -49,6 +52,10 @@ All the links you'll need are listed below. If you'd like to contribute to the P
- [Consensus Changelog](consensus/CHANGELOG.md)
- [Persistence Changelog](persistence/docs/CHANGELOG.md)
- [P2P Changelog](p2p/CHANGELOG.md)
- [CLI Changelog](app/client/cli/doc/CHANGELOG.md)
- [RPC Changelog](app/pocket/rpc/doc/CHANGELOG.md)
- [Node binary Changelog](app/pocket/doc/CHANGELOG.md)

- _Coming Soon: Telemetry Changelog_

## Support & Contact
Expand All @@ -64,4 +71,4 @@ All the links you'll need are listed below. If you'd like to contribute to the P

## License

This project is licensed under the MIT License; see the [LICENSE.md](LICENSE.md) file for details.
This project is licensed under the MIT License; see the [LICENSE](LICENSE) file for details.
2 changes: 1 addition & 1 deletion app/client/cli/account.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ func accountCommands() []*cobra.Command {
Amount: amount,
}

tx, err := prepareTxJson(msg, pk)
tx, err := prepareTxBytes(msg, pk)
if err != nil {
return err
}
Expand Down
16 changes: 10 additions & 6 deletions app/client/cli/actor.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,13 @@ func newStakeCmd(cmdDef actorCmdDef) *cobra.Command {
Use: "Stake <fromAddr> <amount> <relayChainIDs> <serviceURI>",
Short: "Stake a node in the network. Custodial stake uses the same address as operator/output for rewards/return of staked funds.",
Long: `Stake the node into the network, making it available for service.
Will prompt the user for the <fromAddr> account passphrase. If the node is already staked, this transaction acts as an *update* transaction.
Will prompt the user for the *fromAddr* account passphrase. If the node is already staked, this transaction acts as an *update* transaction.
A node can update relayChainIDs, serviceURI, and raise the stake amount with this transaction.
If the node is currently staked at X and you submit an update with new stake Y. Only Y-X will be subtracted from an account
If the node is currently staked at X and you submit an update with new stake Y. Only Y-X will be subtracted from an account.
If no changes are desired for the parameter, just enter the current param value just as before.`,
Args: cobra.ExactArgs(4), // REFACTOR(#150): <fromAddr> not being used at the moment. Update once a keybase is implemented.
RunE: func(cmd *cobra.Command, args []string) error {
Expand Down Expand Up @@ -116,7 +120,7 @@ If no changes are desired for the parameter, just enter the current param value
ActorType: cmdDef.ActorType,
}

tx, err := prepareTxJson(msg, pk)
tx, err := prepareTxBytes(msg, pk)
if err != nil {
return err
}
Expand Down Expand Up @@ -171,7 +175,7 @@ func newEditStakeCmd(cmdDef actorCmdDef) *cobra.Command {
ActorType: cmdDef.ActorType,
}

tx, err := prepareTxJson(msg, pk)
tx, err := prepareTxBytes(msg, pk)
if err != nil {
return err
}
Expand Down Expand Up @@ -212,7 +216,7 @@ func newUnstakeCmd(cmdDef actorCmdDef) *cobra.Command {
ActorType: cmdDef.ActorType,
}

tx, err := prepareTxJson(msg, pk)
tx, err := prepareTxBytes(msg, pk)
if err != nil {
return err
}
Expand Down Expand Up @@ -253,7 +257,7 @@ func newUnpauseCmd(cmdDef actorCmdDef) *cobra.Command {
ActorType: cmdDef.ActorType,
}

tx, err := prepareTxJson(msg, pk)
tx, err := prepareTxBytes(msg, pk)
if err != nil {
return err
}
Expand Down
108 changes: 108 additions & 0 deletions app/client/cli/consensus.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
package cli

import (
"fmt"

"github.com/pokt-network/pocket/rpc"
"github.com/spf13/cobra"
)

func init() {
consensusCmd := NewConsensusCommand()
rootCmd.AddCommand(consensusCmd)
}

func NewConsensusCommand() *cobra.Command {
cmd := &cobra.Command{
Use: "Consensus",
Short: "Consensus specific commands",
Aliases: []string{"consensus"},
Args: cobra.ExactArgs(0),
}

cmd.AddCommand(consensusCommands()...)

return cmd
}

func consensusCommands() []*cobra.Command {
cmds := []*cobra.Command{
{
Use: "State",
Short: "Returns \"Height/Round/Step\"",
Long: "State returns the height, round and step in \"Height/Round/Step\" format",
Aliases: []string{"state"},
RunE: func(cmd *cobra.Command, args []string) error {
response, err := getConsensusState(cmd)
if err != nil {
return err
}

fmt.Printf("%d/%d/%d\n", response.JSONDefault.Height, response.JSONDefault.Round, response.JSONDefault.Step)

return nil
},
},
{
Use: "Height",
Short: "Returns the Height",
Long: "Height returns the height in the node's current consensus state",
Aliases: []string{"height"},
RunE: func(cmd *cobra.Command, args []string) error {
response, err := getConsensusState(cmd)
if err != nil {
return err
}

fmt.Printf("%d\n", response.JSONDefault.Height)

return nil
},
},
{
Use: "Round",
Short: "Returns the Round",
Long: "Round returns the round in the node's current consensus state",
Aliases: []string{"round"},
RunE: func(cmd *cobra.Command, args []string) error {
response, err := getConsensusState(cmd)
if err != nil {
return err
}

fmt.Printf("%d\n", response.JSONDefault.Round)

return nil
},
},
{
Use: "Step",
Short: "Returns the Step",
Long: "Step returns the step in the node's current consensus state",
Aliases: []string{"step"},
RunE: func(cmd *cobra.Command, args []string) error {
response, err := getConsensusState(cmd)
if err != nil {
return err
}

fmt.Printf("%d\n", response.JSONDefault.Step)

return nil
},
},
}
return cmds
}

func getConsensusState(cmd *cobra.Command) (*rpc.GetV1ConsensusStateResponse, error) {
client, err := rpc.NewClientWithResponses(remoteCLIURL)
if err != nil {
return nil, nil
}
response, err := client.GetV1ConsensusStateWithResponse(cmd.Context())
if err != nil {
return nil, unableToConnectToRpc(err)
}
return response, nil
}
9 changes: 8 additions & 1 deletion app/client/cli/debug.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import (
"github.com/manifoldco/promptui"
"github.com/pokt-network/pocket/consensus"
"github.com/pokt-network/pocket/p2p"
"github.com/pokt-network/pocket/rpc"
"github.com/pokt-network/pocket/runtime"
"github.com/pokt-network/pocket/shared"
pocketCrypto "github.com/pokt-network/pocket/shared/crypto"
Expand Down Expand Up @@ -203,7 +204,13 @@ func initDebug(remoteCLIURL string) {
}
telemetryMod := telemetryM.(modules.TelemetryModule)

_ = shared.CreateBusWithOptionalModules(runtimeMgr, nil, p2pMod, nil, consensusMod, telemetryMod) // TODO: refactor using the `WithXXXModule()` pattern accepting a slice of IntegratableModule
rpcM, err := rpc.Create(runtimeMgr)
if err != nil {
log.Fatalf("[ERROR] Failed to create rpc module: %v", err.Error())
}
rpcMod := rpcM.(modules.RPCModule)

_ = shared.CreateBusWithOptionalModules(runtimeMgr, nil, p2pMod, nil, consensusMod, telemetryMod, rpcMod) // TODO: refactor using the `WithXXXModule()` pattern accepting a slice of IntegratableModule

p2pMod.Start()
})
Expand Down
2 changes: 2 additions & 0 deletions app/client/cli/doc/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

- Fixed message signing
- Reporting RPC StatusCode and body
- System commands working end-to-end
- Added Consensus State commands

## [0.0.1] - 2022-09-09

Expand Down
4 changes: 3 additions & 1 deletion app/client/cli/doc/commands/client.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,11 @@ The CLI is meant to be an user but also a machine friendly way for interacting w

* [client Account](client_Account.md) - Account specific commands
* [client Application](client_Application.md) - Application actor specific commands
* [client Consensus](client_Consensus.md) - Consensus specific commands
* [client Fisherman](client_Fisherman.md) - Fisherman actor specific commands
* [client Governance](client_Governance.md) - Governance specific commands
* [client Node](client_Node.md) - Node actor specific commands
* [client System](client_System.md) - Commands related to health and troubleshooting of the node instance
* [client Validator](client_Validator.md) - Validator actor specific commands

###### Auto generated by spf13/cobra on 19-Oct-2022
###### Auto generated by spf13/cobra on 9-Nov-2022
2 changes: 1 addition & 1 deletion app/client/cli/doc/commands/client_Account.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ Account specific commands
* [client](client.md) - Pocket Network Command Line Interface (CLI)
* [client Account Send](client_Account_Send.md) - Send <fromAddr> <to> <amount>

###### Auto generated by spf13/cobra on 19-Oct-2022
###### Auto generated by spf13/cobra on 9-Nov-2022
2 changes: 1 addition & 1 deletion app/client/cli/doc/commands/client_Account_Send.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,4 @@ client Account Send <fromAddr> <to> <amount> [flags]

* [client Account](client_Account.md) - Account specific commands

###### Auto generated by spf13/cobra on 19-Oct-2022
###### Auto generated by spf13/cobra on 9-Nov-2022
4 changes: 2 additions & 2 deletions app/client/cli/doc/commands/client_Application.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ Application actor specific commands

* [client](client.md) - Pocket Network Command Line Interface (CLI)
* [client Application EditStake](client_Application_EditStake.md) - EditStake <fromAddr> <amount> <relayChainIDs> <serviceURI>
* [client Application Stake](client_Application_Stake.md) - Stake an actor (Application) in the network.
* [client Application Stake](client_Application_Stake.md) - Stake a node in the network. Custodial stake uses the same address as operator/output for rewards/return of staked funds.
* [client Application Unpause](client_Application_Unpause.md) - Unpause <fromAddr>
* [client Application Unstake](client_Application_Unstake.md) - Unstake <fromAddr>

###### Auto generated by spf13/cobra on 19-Oct-2022
###### Auto generated by spf13/cobra on 9-Nov-2022
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,4 @@ client Application EditStake <fromAddr> <amount> <relayChainIDs> <serviceURI> [f

* [client Application](client_Application.md) - Application actor specific commands

###### Auto generated by spf13/cobra on 19-Oct-2022
###### Auto generated by spf13/cobra on 9-Nov-2022
19 changes: 15 additions & 4 deletions app/client/cli/doc/commands/client_Application_Stake.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,22 @@
## client Application Stake

Stake an actor (Application) in the network.
Stake a node in the network. Custodial stake uses the same address as operator/output for rewards/return of staked funds.

### Synopsis

Stake the Application actor into the network, making it available for service.
Stake the node into the network, making it available for service.

Will prompt the user for the *fromAddr* account passphrase. If the node is already staked, this transaction acts as an *update* transaction.

A node can update relayChainIDs, serviceURI, and raise the stake amount with this transaction.

If the node is currently staked at X and you submit an update with new stake Y. Only Y-X will be subtracted from an account.

If no changes are desired for the parameter, just enter the current param value just as before.

```
client Application Stake <fromAddr> <amount> <relayChainIDs> <serviceURI> [flags]
```

### Options

Expand All @@ -23,6 +35,5 @@ Stake the Application actor into the network, making it available for service.
### SEE ALSO

* [client Application](client_Application.md) - Application actor specific commands
* [client Application Stake Custodial](client_Application_Stake_Custodial.md) - Stake a node in the network. Custodial stake uses the same address as operator/output for rewards/return of staked funds.

###### Auto generated by spf13/cobra on 19-Oct-2022
###### Auto generated by spf13/cobra on 9-Nov-2022
35 changes: 0 additions & 35 deletions app/client/cli/doc/commands/client_Application_Stake_Custodial.md

This file was deleted.

2 changes: 1 addition & 1 deletion app/client/cli/doc/commands/client_Application_Unpause.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,4 @@ client Application Unpause <fromAddr> [flags]

* [client Application](client_Application.md) - Application actor specific commands

###### Auto generated by spf13/cobra on 19-Oct-2022
###### Auto generated by spf13/cobra on 9-Nov-2022
2 changes: 1 addition & 1 deletion app/client/cli/doc/commands/client_Application_Unstake.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,4 @@ client Application Unstake <fromAddr> [flags]

* [client Application](client_Application.md) - Application actor specific commands

###### Auto generated by spf13/cobra on 19-Oct-2022
###### Auto generated by spf13/cobra on 9-Nov-2022
Loading

0 comments on commit f509831

Please sign in to comment.