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

[LocalNet] Switch to CosmosSDK defaults #609

Merged
merged 10 commits into from
Jun 21, 2024
Merged
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
2 changes: 1 addition & 1 deletion .env.dev
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

POKTROLLD_HOME=./localnet/poktrolld
# The pocket node (validator in the localnet context)
POCKET_NODE=tcp://127.0.0.1:36657
POCKET_NODE=tcp://127.0.0.1:26657
# TestNet RPC endpoint for validator maintained by Grove. Needs to be updated if there's another "primary" testnet.
TESTNET_RPC=https://testnet-validated-validator-rpc.poktroll.com/
APPGATE_SERVER=http://localhost:42069
Expand Down
22 changes: 10 additions & 12 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,11 @@ SHELL = /bin/sh
# endif

POKTROLLD_HOME ?= ./localnet/poktrolld
POCKET_NODE ?= tcp://127.0.0.1:36657 # The pocket node (validator in the localnet context)
POCKET_NODE ?= tcp://127.0.0.1:26657 # The pocket node (validator in the localnet context)
TESTNET_RPC ?= https://testnet-validated-validator-rpc.poktroll.com/ # TestNet RPC endpoint for validator maintained by Grove. Needs to be update if there's another "primary" testnet.
APPGATE_SERVER ?= http://localhost:42069
GATEWAY_URL ?= http://localhost:42079
POCKET_ADDR_PREFIX = pokt
CHAIN_ID = poktroll

# The domain ending in ".town" is staging, ".city" is production
GROVE_GATEWAY_STAGING_ETH_MAINNET = https://eth-mainnet.rpc.grove.town
Expand Down Expand Up @@ -526,7 +525,7 @@ gateway_list: ## List all the staked gateways

.PHONY: gateway_stake
gateway_stake: ## Stake tokens for the gateway specified (must specify the gateway env var)
poktrolld --home=$(POKTROLLD_HOME) tx gateway stake-gateway -y --config $(POKTROLLD_HOME)/config/$(STAKE) --keyring-backend test --from $(GATEWAY) --node $(POCKET_NODE) --chain-id $(CHAIN_ID)
poktrolld --home=$(POKTROLLD_HOME) tx gateway stake-gateway -y --config $(POKTROLLD_HOME)/config/$(STAKE) --keyring-backend test --from $(GATEWAY) --node $(POCKET_NODE)

.PHONY: gateway1_stake
gateway1_stake: ## Stake gateway1
Expand All @@ -542,7 +541,7 @@ gateway3_stake: ## Stake gateway3

.PHONY: gateway_unstake
gateway_unstake: ## Unstake an gateway (must specify the GATEWAY env var)
poktrolld --home=$(POKTROLLD_HOME) tx gateway unstake-gateway -y --keyring-backend test --from $(GATEWAY) --node $(POCKET_NODE) --chain-id $(CHAIN_ID)
poktrolld --home=$(POKTROLLD_HOME) tx gateway unstake-gateway -y --keyring-backend test --from $(GATEWAY) --node $(POCKET_NODE)

.PHONY: gateway1_unstake
gateway1_unstake: ## Unstake gateway1
Expand All @@ -566,7 +565,7 @@ app_list: ## List all the staked applications

.PHONY: app_stake
app_stake: ## Stake tokens for the application specified (must specify the APP and SERVICES env vars)
poktrolld --home=$(POKTROLLD_HOME) tx application stake-application -y --config $(POKTROLLD_HOME)/config/$(SERVICES) --keyring-backend test --from $(APP) --node $(POCKET_NODE) --chain-id $(CHAIN_ID)
poktrolld --home=$(POKTROLLD_HOME) tx application stake-application -y --config $(POKTROLLD_HOME)/config/$(SERVICES) --keyring-backend test --from $(APP) --node $(POCKET_NODE)

.PHONY: app1_stake
app1_stake: ## Stake app1 (also staked in genesis)
Expand All @@ -582,7 +581,7 @@ app3_stake: ## Stake app3

.PHONY: app_unstake
app_unstake: ## Unstake an application (must specify the APP env var)
poktrolld --home=$(POKTROLLD_HOME) tx application unstake-application -y --keyring-backend test --from $(APP) --node $(POCKET_NODE) --chain-id $(CHAIN_ID)
poktrolld --home=$(POKTROLLD_HOME) tx application unstake-application -y --keyring-backend test --from $(APP) --node $(POCKET_NODE)

.PHONY: app1_unstake
app1_unstake: ## Unstake app1
Expand All @@ -598,7 +597,7 @@ app3_unstake: ## Unstake app3

.PHONY: app_delegate
app_delegate: ## Delegate trust to a gateway (must specify the APP and GATEWAY_ADDR env vars). Requires the app to be staked
poktrolld --home=$(POKTROLLD_HOME) tx application delegate-to-gateway $(GATEWAY_ADDR) --keyring-backend test --from $(APP) --node $(POCKET_NODE) --chain-id $(CHAIN_ID)
poktrolld --home=$(POKTROLLD_HOME) tx application delegate-to-gateway $(GATEWAY_ADDR) --keyring-backend test --from $(APP) --node $(POCKET_NODE)

.PHONY: app1_delegate_gateway1
app1_delegate_gateway1: ## Delegate trust to gateway1
Expand All @@ -617,7 +616,7 @@ app3_delegate_gateway3: ## Delegate trust to gateway3

.PHONY: app_undelegate
app_undelegate: ## Undelegate trust to a gateway (must specify the APP and GATEWAY_ADDR env vars). Requires the app to be staked
poktrolld --home=$(POKTROLLD_HOME) tx application undelegate-from-gateway $(GATEWAY_ADDR) --keyring-backend test --from $(APP) --node $(POCKET_NODE) --chain-id $(CHAIN_ID)
poktrolld --home=$(POKTROLLD_HOME) tx application undelegate-from-gateway $(GATEWAY_ADDR) --keyring-backend test --from $(APP) --node $(POCKET_NODE)

.PHONY: app1_undelegate_gateway1
app1_undelegate_gateway1: ## Undelegate trust to gateway1
Expand All @@ -644,7 +643,7 @@ supplier_list: ## List all the staked supplier

.PHONY: supplier_stake
supplier_stake: ## Stake tokens for the supplier specified (must specify the SUPPLIER and SUPPLIER_CONFIG env vars)
poktrolld --home=$(POKTROLLD_HOME) tx supplier stake-supplier -y --config $(POKTROLLD_HOME)/config/$(SERVICES) --keyring-backend test --from $(SUPPLIER) --node $(POCKET_NODE) --chain-id $(CHAIN_ID)
poktrolld --home=$(POKTROLLD_HOME) tx supplier stake-supplier -y --config $(POKTROLLD_HOME)/config/$(SERVICES) --keyring-backend test --from $(SUPPLIER) --node $(POCKET_NODE)

.PHONY: supplier1_stake
supplier1_stake: ## Stake supplier1 (also staked in genesis)
Expand All @@ -660,7 +659,7 @@ supplier3_stake: ## Stake supplier3

.PHONY: supplier_unstake
supplier_unstake: ## Unstake an supplier (must specify the SUPPLIER env var)
poktrolld --home=$(POKTROLLD_HOME) tx supplier unstake-supplier --keyring-backend test --from $(SUPPLIER) --node $(POCKET_NODE) --chain-id $(CHAIN_ID)
poktrolld --home=$(POKTROLLD_HOME) tx supplier unstake-supplier --keyring-backend test --from $(SUPPLIER) --node $(POCKET_NODE)

.PHONY: supplier1_unstake
supplier1_unstake: ## Unstake supplier1
Expand Down Expand Up @@ -779,8 +778,7 @@ acc_initialize_pubkeys: ## Make sure the account keeper has public keys for all
$(addr) $(PNF_ADDRESS) 1000upokt \
--yes \
--home=$(POKTROLLD_HOME) \
--node $(POCKET_NODE) \
--chain-id $(CHAIN_ID);)
--node $(POCKET_NODE);)

########################
### Warning Messages ###
Expand Down
14 changes: 7 additions & 7 deletions Tiltfile
Original file line number Diff line number Diff line change
Expand Up @@ -355,21 +355,21 @@ for x in range(localnet_config["gateways"]["count"]):
str(40064 + actor_number)
+ ":40004", # DLV port. gateway1 - exposes 40065, gateway2 exposes 40066, etc.
# Run `curl localhost:PORT` to see the current snapshot of gateway metrics.
str(9089 + actor_number)
+ ":9090", # gateway metrics port. gateway1 - exposes 9090, gateway2 exposes 9091, etc.
str(9059 + actor_number)
+ ":9090", # gateway metrics port. gateway1 - exposes 9060, gateway2 exposes 9061, etc.
# Use with pprof like this: `go tool pprof -http=:3333 http://localhost:6090/debug/pprof/goroutine`
str(6089 + actor_number)
+ ":6060", # gateway metrics port. gateway1 - exposes 6090, gateway2 exposes 6091, etc.
str(6059 + actor_number)
+ ":6060", # gateway metrics port. gateway1 - exposes 6060, gateway2 exposes 6061, etc.
],
)

k8s_resource(
"validator",
labels=["pocket_network"],
port_forwards=[
"36657",
"36658",
"40004",
"26657", # RPC
"9090", # the gRPC server address
"40004", # use with `dlv` when it's turned on in `localnet_config.yaml`
# Use with pprof like this: `go tool pprof -http=:3333 http://localhost:6061/debug/pprof/goroutine`
"6061:6060",
],
Expand Down
32 changes: 16 additions & 16 deletions docusaurus/docs/develop/developer_guide/quickstart.md
Original file line number Diff line number Diff line change
Expand Up @@ -176,27 +176,27 @@ you can click in the top left corner to view its [grafana dashboard](http://loca
You can query the status of the blockchain using `poktrolld` by running:

```bash
poktrolld status --node=tcp://127.0.0.1:36657 | jq
poktrolld status --node=tcp://127.0.0.1:26657 | jq
```

Alternatively, you use the [CometBFT](https://github.com/cometbft/cometbft) status directly at:

```bash
curl -s -X POST localhost:36657/status | jq
curl -s -X POST localhost:26657/status | jq
```

Or at latest block at:

```bash
curl -s -X POST localhost:36657/block | jq
curl -s -X POST localhost:26657/block | jq
```

For example, you can get the height of the blockchain by visiting the
[Validator Grafana Dashboard](http://localhost:3003/d/cosmoscometbft/protocol-cometbft-dashboard?orgId=1&from=now-1h&to=now)
or from the CLI like so:

```bash
curl -s -X POST localhost:36657/block | jq '.result.block.last_commit.height'
curl -s -X POST localhost:26657/block | jq '.result.block.last_commit.height'
```

## 2. Fund New Accounts
Expand Down Expand Up @@ -276,7 +276,7 @@ You can send some uPOKT to your `shannon_supplier` by running:
poktrolld \
tx bank send \
faucet $SHANNON_SUPPLIER 420000000000069upokt \
--node tcp://127.0.0.1:36657 \
--node tcp://127.0.0.1:26657 \
--home=./localnet/poktrolld
```

Expand All @@ -299,7 +299,7 @@ Let's do the same thing for the `shannon_application`:
poktrolld \
tx bank send \
faucet $SHANNON_APPLICATION 420000000000069upokt \
--node tcp://127.0.0.1:36657 \
--node tcp://127.0.0.1:26657 \
--home=./localnet/poktrolld
```

Expand Down Expand Up @@ -382,15 +382,15 @@ poktrolld \
--config shannon_supplier_config.yaml \
--keyring-backend test \
--from shannon_supplier \
--node tcp://127.0.0.1:36657 \
--node tcp://127.0.0.1:26657 \
--home=./localnet/poktrolld \
--yes
```

And verify that the supplier is now staked with:

```bash
poktrolld query supplier show-supplier $SHANNON_SUPPLIER --node tcp://127.0.0.1:36657
poktrolld query supplier show-supplier $SHANNON_SUPPLIER --node tcp://127.0.0.1:26657
```

### 3.4 Prepare the RelayMiner configuration
Expand All @@ -409,9 +409,9 @@ metrics:
enabled: true
addr: :9090
pocket_node:
query_node_rpc_url: tcp://127.0.0.1:36657
query_node_grpc_url: tcp://127.0.0.1:36658
tx_node_rpc_url: tcp://127.0.0.1:36657
query_node_rpc_url: tcp://127.0.0.1:26657
query_node_grpc_url: tcp://127.0.0.1:9090
tx_node_rpc_url: tcp://127.0.0.1:26657
suppliers:
- service_id: anvil
listen_url: http://localhost:6942
Expand Down Expand Up @@ -488,14 +488,14 @@ poktrolld --home=./localnet/poktrolld \
--config shannon_app_config.yaml \
--keyring-backend test \
--from shannon_application \
--node tcp://127.0.0.1:36657 \
--node tcp://127.0.0.1:26657 \
--yes
```

And verify that the application is now staked with:

```bash
poktrolld query application show-application $SHANNON_APPLICATION --node tcp://127.0.0.1:36657
poktrolld query application show-application $SHANNON_APPLICATION --node tcp://127.0.0.1:26657
```

You can also you re-run, `make app_list` you should see that `SHANNON_APPLICATION` is now staked as an app:
Expand All @@ -510,8 +510,8 @@ The following example should get you started:

```yaml
cat <<EOF >> shannon_appgate_config.yaml
query_node_rpc_url: tcp://127.0.0.1:36657
query_node_grpc_url: tcp://127.0.0.1:36658
query_node_rpc_url: tcp://127.0.0.1:26657
query_node_grpc_url: tcp://127.0.0.1:9090
self_signing: true
signing_key: shannon_application
listening_endpoint: http://localhost:42042
Expand All @@ -535,7 +535,7 @@ And the start the appgate server locally:
poktrolld appgate-server \
--config shannon_appgate_config.yaml \
--keyring-backend test \
--node tcp://127.0.0.1:36657 \
--node tcp://127.0.0.1:26657 \
--home=./localnet/poktrolld
```

Expand Down
2 changes: 1 addition & 1 deletion docusaurus/docs/develop/packages/client_events.md
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ const (
// And: https://docs.cosmos.network/v0.47/learn/advanced/events#default-events
eventQueryString = "message.action='messageActionName'"
// Define the websocket URL the EventsQueryClient will subscribe to
cometWebsocketURL = "ws://example.com:36657/websocket"
cometWebsocketURL = "ws://example.com:26657/websocket"
// the amount of events we want before they are emitted
replayObsBufferSize = 1
)
Expand Down
2 changes: 1 addition & 1 deletion docusaurus/docs/operate/configs/app_staking_config.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ poktrolld tx application stake-application \
--config ./stake_config.yaml \
--keyring-backend test \
--from application1 \
--node tcp://poktroll-node:36657
--node tcp://poktroll-node:26657
```

## Configuration
Expand Down
2 changes: 1 addition & 1 deletion docusaurus/docs/operate/configs/gateway_staking_config.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ poktrolld tx gateway stake-gateway \
--config ./stake_config.yaml \
--keyring-backend test \
--from gateway1 \
--node tcp://poktroll-node:36657
--node tcp://poktroll-node:26657
```

## Configuration
Expand Down
2 changes: 1 addition & 1 deletion docusaurus/docs/operate/configs/supplier_staking_config.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ poktrolld tx supplier stake-supplier \
--config ./stake_config.yaml \
--keyring-backend test \
--from supplier1 \
--node tcp://poktroll-node:36657
--node tcp://poktroll-node:26657
```

## Configuration
Expand Down
2 changes: 1 addition & 1 deletion e2e/tests/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ var (
// defaultRPCURL used by pocketdBin to run remote commands
defaultRPCURL = os.Getenv("POCKET_NODE")
// defaultRPCPort is the default RPC port that pocketd listens on
defaultRPCPort = 36657
defaultRPCPort = 26657
// defaultRPCHost is the default RPC host that pocketd listens on
defaultRPCHost = "127.0.0.1"
// defaultHome is the default home directory for pocketd
Expand Down
4 changes: 2 additions & 2 deletions load-testing/tests/relays_stress_helpers_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -915,7 +915,7 @@ func (s *relaysSuite) sendStakeGatewaysTxs(
// signWithRetries signs the transaction with the keyName provided, retrying
// up to maxRetries times if the signing fails.
// TODO_MAINNET: SignTx randomly fails at retrieving the account info with
// the error post failed: Post "http://localhost:36657": EOF. This might be due to
// the error post failed: Post "http://localhost:26657": EOF. This might be due to
// concurrent requests trying to access the same account info and needs to be investigated.
func (s *relaysSuite) signWithRetries(
actorKeyName string,
Expand Down Expand Up @@ -955,7 +955,7 @@ func (s *relaysSuite) sendPendingMsgsTx(actor *accountInfo) {
require.NotNil(s, keyRecord)

// TODO_HACK: Sometimes SignTx fails at retrieving the account info with
// the error post failed: Post "http://localhost:36657": EOF.
// the error post failed: Post "http://localhost:26657": EOF.
// A retry mechanism is added to avoid this issue.
err = s.signWithRetries(keyRecord.Name, txBuilder, signTxMaxRetries)
require.NoError(s, err)
Expand Down
4 changes: 2 additions & 2 deletions localnet/kubernetes/values-appgateserver.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
config:
query_node_rpc_url: tcp://validator-poktroll-validator:36657
query_node_grpc_url: tcp://validator-poktroll-validator:36658
query_node_rpc_url: tcp://validator-poktroll-validator:26657
query_node_grpc_url: tcp://validator-poktroll-validator:9090
metrics:
enabled: true
addr: :9090
Expand Down
4 changes: 2 additions & 2 deletions localnet/kubernetes/values-gateway.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
config:
query_node_rpc_url: tcp://validator-poktroll-validator:36657
query_node_grpc_url: tcp://validator-poktroll-validator:36658
query_node_rpc_url: tcp://validator-poktroll-validator:26657
query_node_grpc_url: tcp://validator-poktroll-validator:9090
self_signing: false
metrics:
enabled: true
Expand Down
4 changes: 4 additions & 0 deletions localnet/kubernetes/values-relayminer-1.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
config:
# TODO_TECHDEBT(@okdas): remove `signing_key_name` - which is currently present
# for backwards-compatibity with the current helm-chart.
signing_key_name: supplier1

default_signing_key_names: [supplier1]
suppliers:
- service_id: anvil
Expand Down
4 changes: 4 additions & 0 deletions localnet/kubernetes/values-relayminer-2.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
config:
# TODO_TECHDEBT(@okdas): remove `signing_key_name` - which is currently present
# for backwards-compatibity with the current helm-chart.
signing_key_name: supplier2

default_signing_key_names: [supplier2]
suppliers:
- service_id: anvil
Expand Down
4 changes: 4 additions & 0 deletions localnet/kubernetes/values-relayminer-3.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
config:
# TODO_TECHDEBT(@okdas): remove `signing_key_name` - which is currently present
# for backwards-compatibity with the current helm-chart.
signing_key_name: supplier3

default_signing_key_names: [supplier3]
suppliers:
- service_id: anvil
Expand Down
6 changes: 3 additions & 3 deletions localnet/kubernetes/values-relayminer-common.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ config:
enabled: true
addr: :9090
pocket_node:
query_node_rpc_url: tcp://validator-poktroll-validator:36657
query_node_grpc_url: tcp://validator-poktroll-validator:36658
tx_node_rpc_url: tcp://validator-poktroll-validator:36657
query_node_rpc_url: tcp://validator-poktroll-validator:26657
query_node_grpc_url: tcp://validator-poktroll-validator:9090
tx_node_rpc_url: tcp://validator-poktroll-validator:26657
suppliers: []
pprof:
enabled: true
Expand Down
4 changes: 2 additions & 2 deletions localnet/poktrolld/config/appgate_server_config.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
query_node_rpc_url: tcp://poktroll-validator:36657
query_node_grpc_url: tcp://poktroll-validator:36658
query_node_rpc_url: tcp://poktroll-validator:26657
query_node_grpc_url: tcp://poktroll-validator:9090
signing_key: app1
self_signing: true
listening_endpoint: http://localhost:42069
Expand Down
4 changes: 2 additions & 2 deletions localnet/poktrolld/config/appgate_server_config_example.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Pocket node URL that exposes CometBFT JSON-RPC API.
# This can be used by the Cosmos client SDK, event subscriptions, etc...
query_node_rpc_url: tcp://poktroll-validator:36657
query_node_rpc_url: tcp://poktroll-validator:26657
# Pocket node URL that exposes the Cosmos gRPC service, dedicated to querying purposes.
query_node_grpc_url: tcp://poktroll-validator:36658
query_node_grpc_url: tcp://poktroll-validator:9090
# The name of the key (in the keyring) that will be used to sign relays
signing_key: app1
# Whether the server should sign all incoming requests with its own ring (for applications)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
query_node_rpc_url: tcp://localhost:36657
query_node_grpc_url: tcp://localhost:36658
query_node_rpc_url: tcp://localhost:26657
query_node_grpc_url: tcp://localhost:9090
signing_key: app1
self_signing: true
listening_endpoint: http://0.0.0.0:42069
Expand Down
Loading
Loading