Skip to content

Commit 5c1ff87

Browse files
ladamesnychrispalaskas
andauthored
jolteon: local env test config (#986)
* new config files for jolteon docker, connectivity only * tests: update node files and secrets with node keys * tests: add secrets config for jolteon_docker env * Fix WebSocket connectivity and add substrate smoke tests for jolteon_docker environment - Fix SubstrateApi WebSocket URL construction to properly convert HTTP/HTTPS to WS/WSS with /ws path - Replace Kubernetes runners with local runners in jolteon_docker stack config to avoid k8s dependency - Add Alice development account (//Alice) fixture for jolteon_docker environment with sufficient balance - Create comprehensive substrate smoke tests covering block production, node info, balance queries, and transactions - Add graceful handling of solochain template runtime validation issues in transaction tests - Improve API resilience with mock fallbacks for missing partner chain components Tests now successfully validate connectivity, RPC functionality, and basic operations against jolteon_docker substrate node. Transaction validation fails due to runtime WASM issue in TaggedTransactionQueue_validate_transaction. * Fix substrate transaction encoding for Polkadot SDK compatibility - Add hardcoded Polkadot SDK-compatible type registry for Jolteon runtime - Upgrade substrate-interface to 1.7.11 and scalecodec to 1.2.11 - Remove skip-on-runtime-errors behavior from transaction test - Resolves WASM runtime validation errors and codec decoding issues * add more jolteon tests * jolteon: local env test config --------- Co-authored-by: chrispalaskas <[email protected]>
1 parent 1a64f23 commit 5c1ff87

11 files changed

+619
-2
lines changed

e2e-tests/JOLTEON_LOCAL_SETUP.md

Lines changed: 119 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,119 @@
1+
# Jolteon Local Environment Configuration
2+
3+
## Overview
4+
5+
I've successfully created a complete configuration for a local Jolteon environment that serves RPC endpoints at `127.0.0.1:9933` without requiring a Cardano node or db sync. This configuration is based on the existing Jolteon Docker environment but adapted for local development and testing.
6+
7+
## Files Created
8+
9+
### Configuration Files (`e2e-tests/config/substrate/`)
10+
11+
1. **`jolteon_local_nodes.json`** - Main node configuration
12+
- Configures 4 nodes (alice, bob, charlie, dave) all pointing to `127.0.0.1:9933`
13+
- Uses Jolteon-specific network parameters (--testnet-magic 2)
14+
- Includes all necessary node metadata (public keys, addresses, etc.)
15+
- Sets `test_environment` to "jolteon_local"
16+
17+
2. **`jolteon_local_stack.json`** - Stack configuration
18+
- Configures tools to run locally without Docker containers
19+
- Sets ogmios to localhost:1337
20+
- Configures substrate-node and cardano-cli paths
21+
22+
3. **`jolteon_local-ci.json`** - CI-specific overrides
23+
- Ensures all nodes point to `127.0.0.1` for CI environments
24+
- Minimal overrides for CI-specific configurations
25+
26+
### Secrets Files (`e2e-tests/secrets/substrate/jolteon_local/`)
27+
28+
1. **`jolteon_local.json`** - Main secrets file
29+
- Contains wallet configurations adapted from local environment
30+
- Uses Jolteon-specific addresses and keys
31+
- No database or Cardano-specific secrets
32+
33+
2. **`jolteon_local-ci.json`** - CI secrets overrides
34+
- Minimal overrides for CI environment
35+
36+
3. **`keys/`** - Directory for key files
37+
- Empty directory ready for any additional key files
38+
39+
### Documentation and Testing
40+
41+
1. **`jolteon_local_README.md`** - Usage documentation
42+
- Explains how to use the environment
43+
- Lists prerequisites and requirements
44+
- Provides example commands
45+
46+
2. **`test_jolteon_local_config.py`** - Configuration validation script
47+
- Verifies all configuration files can be loaded
48+
- Checks that all nodes point to localhost
49+
- Validates secrets directory structure
50+
51+
3. **`test_jolteon_local_example.py`** - Example test file
52+
- Demonstrates how to use the environment in tests
53+
- Validates configuration correctness
54+
- Shows proper test structure
55+
56+
## Key Features
57+
58+
### Environment Characteristics
59+
- **RPC Endpoint**: `127.0.0.1:9933`
60+
- **Network**: Testnet (--testnet-magic 2)
61+
- **No Cardano Node**: Environment doesn't require Cardano node or db sync
62+
- **No Docker**: Runs directly on localhost without containers
63+
- **Multiple Nodes**: All nodes point to the same localhost endpoint
64+
65+
### Configuration Structure
66+
- Based on Jolteon Docker environment but simplified for local use
67+
- Maintains compatibility with existing test framework
68+
- Supports both regular and CI environments
69+
- Includes all necessary metadata for Jolteon-specific features
70+
71+
## Usage
72+
73+
### Running Tests
74+
```bash
75+
# Basic usage
76+
pytest --env=jolteon_local --blockchain=substrate
77+
78+
# With CI overrides
79+
pytest --env=jolteon_local --blockchain=substrate --ci-run
80+
81+
# Run specific test
82+
pytest --env=jolteon_local --blockchain=substrate tests/test_jolteon_local_example.py
83+
```
84+
85+
### Validation
86+
```bash
87+
# Test configuration
88+
python e2e-tests/config/substrate/test_jolteon_local_config.py
89+
90+
# Run example tests
91+
pytest --env=jolteon_local --blockchain=substrate tests/test_jolteon_local_example.py -v
92+
```
93+
94+
## Prerequisites
95+
96+
1. **Jolteon Partner Chain Node**: Must be running locally on port 9933
97+
2. **Network Configuration**: Node should be configured for testnet (--testnet-magic 2)
98+
3. **Required Tools**: `substrate-node` and optionally `cardano-cli` in PATH
99+
100+
## Differences from Jolteon Docker Environment
101+
102+
| Aspect | Jolteon Docker | Jolteon Local |
103+
|--------|----------------|---------------|
104+
| **Host** | DNS names (alice.jolteon.sc.iog.io) | 127.0.0.1 |
105+
| **Port** | 443 (HTTPS) | 9933 (HTTP) |
106+
| **Protocol** | HTTPS | HTTP |
107+
| **Docker** | Required | Not used |
108+
| **Cardano Node** | Included | Not required |
109+
| **DB Sync** | Included | Not required |
110+
| **Secrets** | Complex with keys | Simplified |
111+
112+
## Next Steps
113+
114+
1. **Start Jolteon Node**: Ensure you have a Jolteon Partner Chain node running locally
115+
2. **Test Configuration**: Run the validation script to verify setup
116+
3. **Run Tests**: Execute tests against the local environment
117+
4. **Customize**: Modify configuration as needed for your specific setup
118+
119+
The configuration is now ready to use and should work seamlessly with the existing e2e test framework!
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"nodes_config": {
3+
"nodes": {
4+
"alice": {
5+
"host": "127.0.0.1"
6+
},
7+
"bob": {
8+
"host": "127.0.0.1"
9+
},
10+
"charlie": {
11+
"host": "127.0.0.1"
12+
},
13+
"dave": {
14+
"host": "127.0.0.1"
15+
}
16+
}
17+
}
18+
}
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# Jolteon Local Environment
2+
3+
This directory contains the configuration for running Jolteon Partner Chain tests against a local environment.
4+
5+
## Configuration Files
6+
7+
- `jolteon_local_nodes.json` - Node configuration for local Jolteon environment
8+
- `jolteon_local_stack.json` - Stack configuration for local Jolteon environment
9+
- `jolteon_local-ci.json` - CI-specific overrides for local Jolteon environment
10+
11+
## Usage
12+
13+
To run tests against the Jolteon local environment:
14+
15+
```bash
16+
# Run tests with Jolteon local environment
17+
pytest --env=jolteon_local --blockchain=substrate
18+
19+
# Run tests with CI overrides
20+
pytest --env=jolteon_local --blockchain=substrate --ci-run
21+
22+
# Run specific test file
23+
pytest --env=jolteon_local --blockchain=substrate tests/test_jolteon_smoke.py
24+
```
25+
26+
## Environment Details
27+
28+
- **RPC Endpoint**: `127.0.0.1:9933`
29+
- **Network**: Testnet (--testnet-magic 2)
30+
- **No Cardano Node**: This environment does not include a Cardano node or db sync
31+
- **No Docker**: Runs directly on localhost without Docker containers
32+
33+
## Prerequisites
34+
35+
1. Ensure you have a Jolteon Partner Chain node running locally on port 9933
36+
2. The node should be configured for testnet (--testnet-magic 2)
37+
3. Required tools should be available in PATH:
38+
- `substrate-node`
39+
- `cardano-cli` (optional, for some tests)
40+
41+
## Notes
42+
43+
- This environment is designed for local development and testing
44+
- All nodes point to the same localhost endpoint (127.0.0.1:9933)
45+
- Secrets are minimal and don't include Cardano-specific keys
46+
- The configuration is based on the Jolteon Docker environment but simplified for local use
Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
{
2+
"deployment_mc_epoch": 958,
3+
"initial_pc_epoch": 4859579,
4+
"deployment_version": "v1.7.0-rc2",
5+
"test_environment": "jolteon_local",
6+
"main_chain": {
7+
"network": "--testnet-magic 2",
8+
"epoch_length": 86400,
9+
"slot_length": 1,
10+
"active_slots_coeff": 0.05,
11+
"security_param": 432,
12+
"init_timestamp": 1666656000,
13+
"block_stability_margin": 0
14+
},
15+
"nodes_config": {
16+
"nodes": {
17+
"alice": {
18+
"host": "127.0.0.1",
19+
"port": "9933",
20+
"aura_ss58_address": "5GHLr2zBDNPXno9XdKgh541uRSiTxnZyzFcr4jK6HUbHMpit",
21+
"pool_id": "da74fc8256d15c7ab3370a6ca28398986cb97c32e9ef66026ac61e99",
22+
"public_key": "0x03b827f4da9711bab7292e5695576a841a4d20af9a07b1ba7a230168d2a78e9df4",
23+
"aura_public_key": "0xba94651de6279a38a416b97b9720c3df76224435e951ac73e9e302a4ee9fcf73",
24+
"grandpa_public_key": "0xdde2501588713ddad5daf5a898c19d82cd591609c9184679868640c8cfe8287d",
25+
"rotation_candidate": true,
26+
"cardano_payment_addr": "addr_test1vq6ywn0f007x32j47jrk5qy9hy3gknsvszrcpdqkeaye7pshu2w2t"
27+
},
28+
"bob": {
29+
"host": "127.0.0.1",
30+
"port": "9933",
31+
"aura_ss58_address": "5DHbxU687f1Y3x8yBCWMtqSiJ5qt2yrxQPXNXZNNDaFtmXKv",
32+
"pool_id": "eaed153a8b046770cfd094ee72d080ea682188e63ac11937e3f7f827",
33+
"public_key": "0x02ef5bcd94d54a18ad199559782cd72ac3ccd850976aaaafbca8f9d2625afbf7c4",
34+
"aura_public_key": "0x36128fff2acc04f206ccaf4e9f8e9995998efced29075a58b7d76d3735c21208",
35+
"grandpa_public_key": "0x8f9a9856a27cc114ce85b64f41144f0c907c4bd8b3102b083b52b6b61aff6c47",
36+
"rotation_candidate": true,
37+
"cardano_payment_addr": "addr_test1vz80jkz5d2kdaykfrqlqryr6lt46tunk4ldfjqv88hevrpsrdfmm5"
38+
},
39+
"charlie": {
40+
"host": "127.0.0.1",
41+
"port": "9933",
42+
"aura_ss58_address": "5FYtL6HccYhk6KZeFP7hNnkMaXrAwVpTHJWsfnNJcu8AM6in",
43+
"pool_id": "7dfba85597a867fffa59037df7f6adcd50e745dcceac2b48eda94b20",
44+
"public_key": "0x02f2762ab6e1a125dc03908a7b738f8023d13763f28a11d7633c6c8bc463478430",
45+
"aura_public_key": "0x9a32d3896a56e822321f7bc915befc8ce112c5d67e3c6497295bd3d7b020f94c",
46+
"grandpa_public_key": "0x4f3c0ecc6dc474f27ad7967f5cdbd50da047ffedbc91b65f5cd247515489c98f",
47+
"permissioned_candidate": true,
48+
"cardano_payment_addr": "addr_test1vrxc6wvtmqrqx4n9e89sqf9u0w0jcp8a96s7gkddfsr0ppcdvzcf6"
49+
},
50+
"dave": {
51+
"host": "127.0.0.1",
52+
"port": "9933",
53+
"aura_ss58_address": "5GVpqdtqjxqUjuVKMkmh8ehSwcs2nXjpvzHqjouZXMJAyC4b",
54+
"pool_id": "2a3f5dd02da1310e081f2367412e02b72baad3e2a5045f62df2c78c5",
55+
"public_key": "0x025e19f82c5e2bac5e8869d49ff26359e442628bc5cfa38eeb5275f43d04015da8",
56+
"aura_public_key": "0xc41992b8eb2f3a8a6c46211df584827f9eeb0175e2c75e1242392262b55b6874",
57+
"grandpa_public_key": "0x34b71fdad96431bf115350d8ad21eec07a2b154ff32dc31125f988e308bebea8",
58+
"permissioned_candidate": true,
59+
"cardano_payment_addr": "addr_test1vq65mgmcpd6rq6ndy22kwxzdc9u0tmrpr7s30037qdhlalg3f5ax0"
60+
}
61+
},
62+
"governance_authority": {
63+
"mainchain_address": "addr_test1vq0sjaaupatuvl9x6aefdsd4whlqtfku93068qzkhf3u2rqt9cnuq",
64+
"mainchain_pub_key": "a90ba46b07c0c2c940e3e3149aee5817130a1d8b600bc85b91345e4f7a1e5aca"
65+
},
66+
"selected_node": "alice",
67+
"node": "${nodes_config[nodes][${nodes_config[selected_node]}]}",
68+
"token_conversion_rate": 9,
69+
"block_duration": 6,
70+
"slots_in_epoch": 60,
71+
"token_policy_id": "",
72+
"d_param_min": {
73+
"permissioned_candidates_number": 6,
74+
"trustless_candidates_number": 4
75+
},
76+
"d_param_max": {
77+
"permissioned_candidates_number": 6,
78+
"trustless_candidates_number": 4
79+
},
80+
"default_rpc_scheme": "http",
81+
"default_port": 9933
82+
},
83+
"timeouts": {
84+
"main_chain_tx": 180
85+
}
86+
}
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{
2+
"stack_config": {
3+
"ogmios_scheme": "http",
4+
"ogmios_host": "localhost",
5+
"ogmios_port": 1337,
6+
"tools": {
7+
"runner": {
8+
"workdir": "/tmp"
9+
},
10+
"cardano_cli": {
11+
"path": "cardano-cli",
12+
"runner": {
13+
"workdir": "/tmp"
14+
}
15+
},
16+
"node": {
17+
"path": "substrate-node",
18+
"runner": {
19+
"workdir": "/tmp",
20+
"copy_secrets": false
21+
}
22+
}
23+
}
24+
}
25+
}

0 commit comments

Comments
 (0)