Skip to content

Commit

Permalink
Merge pull request #24 from pokt-network/relayminer
Browse files Browse the repository at this point in the history
  • Loading branch information
Olshansk committed Sep 27, 2023
2 parents aecf3b7 + 1e7105f commit df351a6
Show file tree
Hide file tree
Showing 86 changed files with 3,875 additions and 1,462 deletions.
40 changes: 37 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -219,15 +219,40 @@ session_get: ## Queries the poktroll node for session data

.PHONY: session_get_app1_svc1
session_get_app1_svc1: ## Getting the session for app1 and svc1 and height1
APP=pokt1aj5m44gpvdmqcr3q0fm24vtff8g8j78004wn43 SVC=svc1 HEIGHT=$(SESSION_HEIGHT) make session_get
APP=pokt1mrqt5f7qh8uxs27cjm9t7v9e74a9vvdnq5jva4 SVC=svc1 HEIGHT=$(SESSION_HEIGHT) make session_get

.PHONY: session_get_app2_svc2
session_get_app2_svc2: ## Getting the session for app2 and svc2 and height1
APP=pokt1c0aal6vmfh094v7xuk3ynkfexep3txdpjk6xhz SVC=svc2 HEIGHT=$(SESSION_HEIGHT) make session_get
APP=pokt184zvylazwu4queyzpl0gyz9yf5yxm2kdhh9hpm SVC=svc2 HEIGHT=$(SESSION_HEIGHT) make session_get

.PHONY: session_get_app3_svc3
session_get_app3_svc3: ## Getting the session for app3 and svc3 and height1
APP=pokt1c0aal6vmfh094v7xuk3ynkfexep3txdpjk6xhz SVC=svc3 HEIGHT=$(SESSION_HEIGHT) make session_get
APP=pokt1lqyu4v88vp8tzc86eaqr4lq8rwhssyn6rfwzex SVC=svc3 HEIGHT=$(SESSION_HEIGHT) make session_get

.PHONY: relayer_start
relayer_start: ## Start the relayer
poktrolld relayer \
--node $(POKTROLLD_NODE) \
--signing-key servicer1 \
--keyring-backend test

.PHONY: claims_query
claims_query: ## Query the poktroll node for claims data
SERVICER_ADDR=$(shell poktrolld keys show servicer1 -a --keyring-backend test); \
poktrolld query servicer claims $$SERVICER_ADDR

.PHONY: anvil_start
anvil_start: ## Start the anvil
anvil -p 8547 -b 5

.PHONY: cast_relay
cast_relay: ## Cast a relay
cast block

.PHONY: ws_subscribe
ws_subscribe: ## Subscribe to the websocket for new blocks
echo "Copy paste the following: {"id":1,"jsonrpc":"2.0","method":"eth_subscribe","params":["newHeads"]}"
wscat --connect ws://localhost:8546

.PHONY: localnet_up
localnet_up: ## Starts localnet
Expand Down Expand Up @@ -313,3 +338,12 @@ ignite_regenerate: ## Regenerate the ignite boilerplate
.PHONY: ignite_acc_list
ignite_acc_list: ## List all the accounts in the ignite boilerplate
ignite account list --keyring-dir $(POKTROLLD_HOME) --keyring-backend test

.PHONY: localnet_regenesis
localnet_regenesis:
# NOTE: intentionally not using --home <dir> flag to avoid overwriting the test keyring
ignite chain init --skip-proto
rm -rf $(POKTROLLD_HOME)/keyring-test
cp -r ${HOME}/.poktroll/keyring-test $(POKTROLLD_HOME)
cp ${HOME}/.poktroll/config/*_key.json $(POKTROLLD_HOME)/config/
cp ${HOME}/.poktroll/config/genesis.json ./localnet/
20 changes: 20 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ This is an alpha version of trying to build Pocket on top of RollKit.
- [Getting a session](#getting-a-session)
- [App=app1 \<\> Servicer=svc1 \<\> Height=1](#appapp1--servicersvc1--height1)
- [Other apps \& servicers](#other-apps--servicers)
- [Send a Relay](#send-a-relay)
- [AUTOGENERATED README BELOW](#autogenerated-readme-below)
- [Get started](#get-started)
- [Configure](#configure)
Expand Down Expand Up @@ -211,6 +212,25 @@ You can repeat the steps above for `servicer` 2&3, with `apps` 2&3 for `services
make session_get_app3_svc3
```

## Send a Relay

```bash
# Console 1
make localnet_regenesis
make localnet_up

# Console 2
make app1_stake && make servicer1_stake
make relayer_start

# Console 3
make anvil_start

# Console 4
make cast_relay

```

## AUTOGENERATED README BELOW

## Get started
Expand Down
3 changes: 3 additions & 0 deletions cmd/poktrolld/cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ import (

"poktroll/app"
appparams "poktroll/app/params"
relayer "poktroll/relayer/cmd"
)

// NewRootCmd creates a new root command for a Cosmos SDK application
Expand Down Expand Up @@ -120,6 +121,8 @@ func initRootCmd(
),
genutilcli.ValidateGenesisCmd(app.ModuleBasics),
AddGenesisAccountCmd(app.DefaultNodeHome),
// Adding the relayer cobra command via a command factory function
relayer.RelayerCmd(),
tmcli.NewCompletionCmd(rootCmd, true),
debug.Cmd(),
config.Cmd(),
Expand Down
48 changes: 38 additions & 10 deletions config.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,41 @@
version: 1
accounts:
- name: alice
- name: faucet
mnemonic: "baby advance work soap slow exclude blur humble lucky rough teach wide chuckle captain rack laundry butter main very cannon donate armor dress follow"
coins:
- 20000token
- 200000000stake
- name: bob
- 999999999999999999stake
- name: validator1
mnemonic: "creek path rule retire evolve vehicle bargain champion roof whisper prize endorse unknown anchor fashion energy club sauce elder parent cotton old affair visa"
coins:
- 900000000stake
- name: app1
mnemonic: "mention spy involve verb exercise fiction catalog order agent envelope mystery text defy sing royal fringe return face alpha knife wonder vocal virus drum"
coins:
- 10000token
- 100000000stake
- name: app2
mnemonic: "material little labor strong search device trick amateur action crouch invite glide provide elite mango now paper sense found hamster neglect work install bulk"
coins:
- 200000000stake
- name: app3
mnemonic: "involve clean slab term real human green immune valid swing protect talk silent unique cart few ice era right thunder again drop among bounce"
coins:
- 300000000stake
- name: servicer1
mnemonic: "cool industry busy tumble funny relax error state height like board wing goat emerge visual idle never unveil announce hill primary okay spatial frog"
coins:
- 110000000stake
- name: servicer2
mnemonic: "peanut hen enroll meat legal have error input bulk later correct denial onion fossil wing excuse elephant object apology switch claim rare decide surface"
coins:
- 220000000stake
- name: servicer3
mnemonic: "client city senior tenant source soda spread buffalo shaft amused bar carbon keen off feel coral easily announce metal orphan sustain maple expand loop"
coins:
- 330000000stake
faucet:
name: bob
name: faucet
coins:
- 5token
- 100000stake
- 10000stake
client:
typescript:
path: ts-client
Expand All @@ -21,5 +44,10 @@ client:
openapi:
path: docs/static/openapi.yml
validators:
- name: alice
bonded: 100000000stake
- name: validator1
bonded: 900000000stake
config:
moniker: "validator1"
# We can persist arbitrary genesis values via 1 to 1 mapping to genesis.json
genesis:
# genesis_time: "2023-09-20T07:37:07.239355799Z"
Loading

0 comments on commit df351a6

Please sign in to comment.