Skip to content

Commit

Permalink
CCQ: Testing (#3424)
Browse files Browse the repository at this point in the history
* CCQ: Testing

* Use new p2p.NewHost function

* More rework

* More rework
  • Loading branch information
bruce-riley authored Oct 12, 2023
1 parent ad696d2 commit ea70610
Show file tree
Hide file tree
Showing 13 changed files with 822 additions and 5 deletions.
22 changes: 21 additions & 1 deletion Tiltfile
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ config.define_bool("wormchain", False, "Enable a wormchain node")
config.define_bool("ibc_relayer", False, "Enable IBC relayer between cosmos chains")
config.define_bool("redis", False, "Enable a redis instance")
config.define_bool("generic_relayer", False, "Enable the generic relayer off-chain component")

config.define_bool("query_server", False, "Enable cross-chain query server")

cfg = config.parse()
num_guardians = int(cfg.get("num", "1"))
Expand All @@ -97,6 +97,7 @@ ibc_relayer = cfg.get("ibc_relayer", ci)
btc = cfg.get("btc", False)
redis = cfg.get('redis', ci)
generic_relayer = cfg.get("generic_relayer", ci)
query_server = cfg.get("query_server", ci)

if ci:
guardiand_loglevel = cfg.get("guardiand_loglevel", "warn")
Expand Down Expand Up @@ -584,6 +585,12 @@ if ci_tests:
trigger_mode = trigger_mode,
resource_deps = [], # uses devnet-consts.json, but wormchain/contracts/tools/test_accountant.sh handles waiting for guardian, not having deps gets the build earlier
)
k8s_resource(
"query-ci-tests",
labels = ["ci"],
trigger_mode = trigger_mode,
resource_deps = [], # node/hack/query/test/test_query.sh handles waiting for guardian, not having deps gets the build earlier
)

if terra_classic:
docker_build(
Expand Down Expand Up @@ -893,3 +900,16 @@ if aptos:
labels = ["aptos"],
trigger_mode = trigger_mode,
)

if query_server:
k8s_yaml_with_ns("devnet/query-server.yaml")

k8s_resource(
"query-server",
resource_deps = ["guardian"],
port_forwards = [
port_forward(6069, name = "REST [:6069]", host = webHost)
],
labels = ["query-server"],
trigger_mode = trigger_mode
)
12 changes: 11 additions & 1 deletion devnet/node.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ metadata:
app: guardian
spec:
ports:
- port: 8996
name: ccq-p2p
protocol: UDP
- port: 8999
name: p2p
protocol: UDP
Expand Down Expand Up @@ -160,7 +163,11 @@ spec:
- /tmp/data
- --publicRpcLogDetail
- "full"
# - --chainGovernorEnabled=true
# - --chainGovernorEnabled=true
- --ccqEnabled=true
- --ccqAllowedRequesters=beFA429d57cD18b7F8A4d91A2da9AB4AF05d0FBe,25021A4FCAf61F2EADC8202D3833Df48B2Fa0D54
- --ccqAllowedPeers=12D3KooWSnju8zhywCYVi2JwTqky1sySPnmtYLsHHzc4WerMnDQH
# - --logLevel=debug
securityContext:
capabilities:
add:
Expand All @@ -171,6 +178,9 @@ spec:
port: 6060
path: /readyz
ports:
- containerPort: 8996
name: ccq-p2p
protocol: UDP
- containerPort: 8999
name: p2p
protocol: UDP
Expand Down
6 changes: 3 additions & 3 deletions devnet/query-server.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,13 @@ spec:
- --env
- dev
- --nodeKey
- node/cmd/ccq/ccq.p2p.key
- node/cmd/ccq/devnet.p2p.key
- --signerKey
- node/cmd/ccq/ccq.signing.key
- node/cmd/ccq/devnet.signing.key
- --listenAddr
- "[::]:6069"
- --permFile
- "node/cmd/ccq/devnet.config.json"
- "node/cmd/ccq/devnet.permissions.json"
- --ethRPC
- http://eth-devnet:8545
- --ethContract
Expand Down
25 changes: 25 additions & 0 deletions devnet/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -72,3 +72,28 @@ spec:
- "/app/accountant/success"
initialDelaySeconds: 5
periodSeconds: 5
---
kind: Job
apiVersion: batch/v1
metadata:
name: query-ci-tests
spec:
backoffLimit: 0
template:
spec:
restartPolicy: Never
containers:
- name: query-ci-tests
image: guardiand-image
command:
- /bin/sh
- -c
- "cd /app/node/hack/query/test && bash test_query.sh && touch success"
readinessProbe:
exec:
command:
- test
- -e
- "/app/node/hack/query/test/success"
initialDelaySeconds: 5
periodSeconds: 5
File renamed without changes.
File renamed without changes.
File renamed without changes.
8 changes: 8 additions & 0 deletions node/hack/query/dev.guardian.key
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
-----BEGIN WORMHOLE GUARDIAN PRIVATE KEY-----
PublicKey: 0xbeFA429d57cD18b7F8A4d91A2da9AB4AF05d0FBe
Description: auto-generated deterministic devnet key

CiDPsSMDoZzeWAu03XcWObDSa8aDU2RVcajP9RarLuEToBAB
=VN/A
-----END WORMHOLE GUARDIAN PRIVATE KEY-----

Binary file added node/hack/query/querier.key
Binary file not shown.
Loading

0 comments on commit ea70610

Please sign in to comment.