Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP][Core] Rename the Fisherman actor to Watcher #967

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -182,11 +182,11 @@ build_and_watch: ## Continous build Pocket's main entrypoint as files change
# TODO(olshansky): Need to think of a Pocket related name for `compose_and_watch`, maybe just `pocket_watch`?
.PHONY: compose_and_watch
compose_and_watch: docker_check db_start monitoring_start ## Run a localnet composed of 4 consensus validators w/ hot reload & debugging
${docker-compose} up --force-recreate validator1 validator2 validator3 validator4 servicer1 fisherman1
${docker-compose} up --force-recreate validator1 validator2 validator3 validator4 servicer1 watcher1

.PHONY: rebuild_and_compose_and_watch
rebuild_and_compose_and_watch: docker_check db_start monitoring_start ## Rebuilds the container from scratch and launches compose_and_watch
${docker-compose} up --build --force-recreate validator1 validator2 validator3 validator4 servicer1 fisherman1
${docker-compose} up --build --force-recreate validator1 validator2 validator3 validator4 servicer1 watcher1

.PHONY: db_start
db_start: docker_check ## Start a detached local postgres and admin instance; compose_and_watch is responsible for instantiating the actual schemas
Expand Down Expand Up @@ -538,11 +538,11 @@ todo_this_commit: ## List all the TODOs needed to be done in this commit
numValidators ?= 4
numServicers ?= 1
numApplications ?= 1
numFishermen ?= 1
numWatchers ?= 1

.PHONY: gen_genesis_and_config
gen_genesis_and_config: ## Generate the genesis and config files for LocalNet
go run ./build/config/main.go --genPrefix="gen." --numValidators=${numValidators} --numServicers=${numServicers} --numApplications=${numApplications} --numFishermen=${numFishermen}
go run ./build/config/main.go --genPrefix="gen." --numValidators=${numValidators} --numServicers=${numServicers} --numApplications=${numApplications} --numWatchers=${numWatchers}

.PHONY: gen_genesis_and_config
clear_genesis_and_config: ## Clear the genesis and config files for LocalNet
Expand Down
2 changes: 1 addition & 1 deletion app/client/cli/actor.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ type (
func NewActorCommands() []*cobra.Command {
actorCmdDefs := []actorCmdDef{
{"Application", coreTypes.ActorType_ACTOR_TYPE_APP},
{"Fisherman", coreTypes.ActorType_ACTOR_TYPE_FISH},
{"Watcher", coreTypes.ActorType_ACTOR_TYPE_WATCHER},
{"Validator", coreTypes.ActorType_ACTOR_TYPE_VAL},
}

Expand Down
20 changes: 10 additions & 10 deletions app/client/cli/query.go
Original file line number Diff line number Diff line change
Expand Up @@ -203,11 +203,11 @@ func queryHeightCommands() []*cobra.Command {
},
},
{
Use: "Fisherman <address> [--height]",
Short: "Get the fisherman data of an address",
Long: "Queries the node RPC to obtain the fisherman data of the speicifed address at the given (or latest if unspecified) height",
Use: "Watcher <address> [--height]",
Short: "Get the watcher data of an address",
Long: "Queries the node RPC to obtain the watcher data of the speicifed address at the given (or latest if unspecified) height",
Args: cobra.ExactArgs(1),
Aliases: []string{"fisherman"},
Aliases: []string{"watcher"},
RunE: func(cmd *cobra.Command, args []string) error {
client, err := rpc.NewClientWithResponses(flags.RemoteCLIURL)
if err != nil {
Expand All @@ -219,7 +219,7 @@ func queryHeightCommands() []*cobra.Command {
Height: height,
}

response, err := client.PostV1QueryFisherman(cmd.Context(), body)
response, err := client.PostV1QueryWatcher(cmd.Context(), body)
if err != nil {
return unableToConnectToRpc(err)
}
Expand Down Expand Up @@ -524,11 +524,11 @@ func queryHeightPaginatedCommands() []*cobra.Command {
},
},
{
Use: "Fishermen [--height] [--page] [--per_page]",
Short: "Get all the data of all fishermen",
Long: "Queries the node RPC to obtain the paginated data for all fishermen at the given (or latest if unspecified) height",
Use: "Watchers [--height] [--page] [--per_page]",
Short: "Get all the data of all watchers",
Long: "Queries the node RPC to obtain the paginated data for all watchers at the given (or latest if unspecified) height",
Args: cobra.ExactArgs(0),
Aliases: []string{"fishermen"},
Aliases: []string{"watchers"},
RunE: func(cmd *cobra.Command, args []string) error {
client, err := rpc.NewClientWithResponses(flags.RemoteCLIURL)
if err != nil {
Expand All @@ -541,7 +541,7 @@ func queryHeightPaginatedCommands() []*cobra.Command {
PerPage: per_page,
}

response, err := client.PostV1QueryFishermen(cmd.Context(), body)
response, err := client.PostV1QueryWatchers(cmd.Context(), body)
if err != nil {
return unableToConnectToRpc(err)
}
Expand Down
2 changes: 1 addition & 1 deletion app/client/doc/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Command tree available [here](./commands/client.md)
```bash
├── cli
│ ├── account.go # Account subcommand
│ ├── actor.go # Actor (Application, Node, Fisherman, Validator) subcommands
│ ├── actor.go # Actor (Application, Node, Watcher, Validator) subcommands
│ ├── cmd.go # main (root) command called by the entrypoint
│ ├── debug.go # Debug subcommand
│ ├── doc
Expand Down
2 changes: 1 addition & 1 deletion app/client/doc/commands/client.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ 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 Watcher](client_Watcher.md) - Watcher actor specific commands
* [client Governance](client_Governance.md) - Governance specific commands
* [client Keys](client_Keys.md) - Key specific commands
* [client Query](client_Query.md) - Commands related to querying on-chain data via the node's RPC server
Expand Down
4 changes: 2 additions & 2 deletions app/client/doc/commands/client_Query.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ Commands related to querying on-chain data via the node's RPC server
* [client Query Balance](client_Query_Balance.md) - Get the balance of an address
* [client Query Block](client_Query_Block.md) - Get the block data
* [client Query BlockTxs](client_Query_BlockTxs.md) - Get all the transactions in the block
* [client Query Fisherman](client_Query_Fisherman.md) - Get the fisherman data of an address
* [client Query Fishermen](client_Query_Fishermen.md) - Get all the data of all fishermen
* [client Query Watcher](client_Query_Watcher.md) - Get the watcher data of an address
* [client Query Watchers](client_Query_Watchers.md) - Get all the data of all watchers
* [client Query Height](client_Query_Height.md) - Get current block height
* [client Query Param](client_Query_Param.md) - Get the value of the parameter
* [client Query Servicer](client_Query_Servicer.md) - Get the servicer data of an address
Expand Down
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
## client Query Fisherman
## client Query Watcher

Get the fisherman data of an address
Get the watcher data of an address

### Synopsis

Queries the node RPC to obtain the fisherman data of the speicifed address at the given (or latest if unspecified) height
Queries the node RPC to obtain the watcher data of the speicifed address at the given (or latest if unspecified) height

```
client Query Fisherman <address> [--height] [flags]
client Query Watcher <address> [--height] [flags]
```

### Options

```
--height int block height to query, (default = 0, latest)
-h, --help help for Fisherman
-h, --help help for Watcher
```

### Options inherited from parent commands
Expand Down
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
## client Query Fishermen
## client Query Watchers

Get all the data of all fishermen
Get all the data of all watchers

### Synopsis

Queries the node RPC to obtain the paginated data for all fishermen at the given (or latest if unspecified) height
Queries the node RPC to obtain the paginated data for all watchers at the given (or latest if unspecified) height

```
client Query Fishermen [--height] [--page] [--per_page] [flags]
client Query Watchers [--height] [--page] [--per_page] [flags]
```

### Options

```
--height int block height to query, (default = 0, latest)
-h, --help help for Fishermen
-h, --help help for Watchers
--page int page number to return of paginated query (default 1) (default 1)
--per_page int number of results to show per page in a paginated query (default 1000, max=1000) (default 1000)
```
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
## client Fisherman
## client Watcher

Fisherman actor specific commands
Watcher actor specific commands

### Options

```
-h, --help help for Fisherman
-h, --help help for Watcher
```

### Options inherited from parent commands
Expand All @@ -21,9 +21,9 @@ Fisherman actor specific commands
### SEE ALSO

* [client](client.md) - Pocket Network Command Line Interface (CLI)
* [client Fisherman EditStake](client_Fisherman_EditStake.md) - EditStake <fromAddr> <amount> <relayChainIDs> <serviceURI>
* [client Fisherman Stake](client_Fisherman_Stake.md) - Stake a Fisherman in the network. Custodial stake uses the same address as operator/output for rewards/return of staked funds.
* [client Fisherman Unpause](client_Fisherman_Unpause.md) - Unpause <fromAddr>
* [client Fisherman Unstake](client_Fisherman_Unstake.md) - Unstake <fromAddr>
* [client Watcher EditStake](client_Watcher_EditStake.md) - EditStake <fromAddr> <amount> <relayChainIDs> <serviceURI>
* [client Watcher Stake](client_Watcher_Stake.md) - Stake a Watcher in the network. Custodial stake uses the same address as operator/output for rewards/return of staked funds.
* [client Watcher Unpause](client_Watcher_Unpause.md) - Unpause <fromAddr>
* [client Watcher Unstake](client_Watcher_Unstake.md) - Unstake <fromAddr>

###### Auto generated by spf13/cobra on 4-May-2023
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
## client Fisherman EditStake
## client Watcher EditStake

EditStake <fromAddr> <amount> <relayChainIDs> <serviceURI>

### Synopsis

Stakes a new <amount> for the Fisherman actor with address <fromAddr> for the specified <relayChainIDs> and <serviceURI>.
Stakes a new <amount> for the Watcher actor with address <fromAddr> for the specified <relayChainIDs> and <serviceURI>.

```
client Fisherman EditStake <fromAddr> <amount> <relayChainIDs> <serviceURI> [flags]
client Watcher EditStake <fromAddr> <amount> <relayChainIDs> <serviceURI> [flags]
```

### Options
Expand All @@ -33,6 +33,6 @@ client Fisherman EditStake <fromAddr> <amount> <relayChainIDs> <serviceURI> [fla

### SEE ALSO

* [client Fisherman](client_Fisherman.md) - Fisherman actor specific commands
* [client Watcher](client_Watcher.md) - Watcher actor specific commands

###### Auto generated by spf13/cobra on 4-May-2023
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
## client Fisherman Stake
## client Watcher Stake

Stake a Fisherman in the network. Custodial stake uses the same address as operator/output for rewards/return of staked funds.
Stake a Watcher in the network. Custodial stake uses the same address as operator/output for rewards/return of staked funds.

### Synopsis

Stake the Fisherman into the network, making it available for service.
Stake the Watcher into the network, making it available for service.

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

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

If the Fisherman 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 Watcher 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 Fisherman Stake <fromAddr> <amount> <relayChainIDs> <serviceURI> [flags]
client Watcher Stake <fromAddr> <amount> <relayChainIDs> <serviceURI> [flags]
```

### Options
Expand All @@ -41,6 +41,6 @@ client Fisherman Stake <fromAddr> <amount> <relayChainIDs> <serviceURI> [flags]

### SEE ALSO

* [client Fisherman](client_Fisherman.md) - Fisherman actor specific commands
* [client Watcher](client_Watcher.md) - Watcher actor specific commands

###### Auto generated by spf13/cobra on 4-May-2023
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
## client Fisherman Unpause
## client Watcher Unpause

Unpause <fromAddr>

### Synopsis

Unpauses the Fisherman actor with address <fromAddr>
Unpauses the Watcher actor with address <fromAddr>

```
client Fisherman Unpause <fromAddr> [flags]
client Watcher Unpause <fromAddr> [flags]
```

### Options
Expand All @@ -33,6 +33,6 @@ client Fisherman Unpause <fromAddr> [flags]

### SEE ALSO

* [client Fisherman](client_Fisherman.md) - Fisherman actor specific commands
* [client Watcher](client_Watcher.md) - Watcher actor specific commands

###### Auto generated by spf13/cobra on 4-May-2023
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
## client Fisherman Unstake
## client Watcher Unstake

Unstake <fromAddr>

### Synopsis

Unstakes the previously staked tokens for the Fisherman actor with address <fromAddr>
Unstakes the previously staked tokens for the Watcher actor with address <fromAddr>

```
client Fisherman Unstake <fromAddr> [flags]
client Watcher Unstake <fromAddr> [flags]
```

### Options
Expand All @@ -33,6 +33,6 @@ client Fisherman Unstake <fromAddr> [flags]

### SEE ALSO

* [client Fisherman](client_Fisherman.md) - Fisherman actor specific commands
* [client Watcher](client_Watcher.md) - Watcher actor specific commands

###### Auto generated by spf13/cobra on 4-May-2023
4 changes: 2 additions & 2 deletions build/config/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ The output files are written to `./build/config/`.
From the project's root:

```bash
go run ./build/config/main.go --numFishermen=1
go run ./build/config/main.go --numWatchers=1
```

### Using Make Target
Expand All @@ -37,7 +37,7 @@ make numValidators=5 numServicers=1 gen_genesis_and_config
- `numValidators` is an int flag that sets the number of validators that will be in the network; this affects the contents of the genesis file as well as the number of config files
- `numServicers` is an int flag that set the number of servicers that will be in the network's genesis file
- `numApplications` is an int flag that set the number of applications that will be in the network's genesis file
- `numFishermen` is an int flag that set the number of fishermen that will be in the network's genesis file
- `numWatchers` is an int flag that set the number of watchers that will be in the network's genesis file
- `genPrefix` is a string flag that adds a prefix to the generated files; is an empty string by default

## **WIP NOTE**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
},
"persistence": {
"postgres_url": "postgres://postgres:postgres@pocket-db:5432/postgres",
"node_schema": "fisherman1",
"node_schema": "watcher1",
"block_store_path": "/var/blockstore",
"tx_indexer_path": "/var/txindexer",
"trees_store_dir": "/var/trees",
Expand All @@ -28,7 +28,7 @@
"health_check_period": "30s"
},
"p2p": {
"hostname": "fisherman1",
"hostname": "watcher1",
"port": 42069,
"use_rain_tree": true,
"is_empty_connection_type": false,
Expand All @@ -50,7 +50,7 @@
"timeout": 30000,
"use_cors": false
},
"fisherman": {
"watcher": {
"enabled": true
}
}
Loading