Skip to content

Commit 79d3105

Browse files
Merge pull request #16 from Opulencechuks/main
feat: add env template and configuration
2 parents 78994e7 + 30a1874 commit 79d3105

5 files changed

Lines changed: 51 additions & 1 deletion

File tree

.env.example

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# .env.example
2+
# Environment variable template for ApexChainx contracts
3+
# Do NOT commit real secrets.
4+
5+
# RPC URL for Soroban network
6+
SOROBAN_RPC_URL="https://rpc.testnet.stellar.org"
7+
8+
# Network passphrase (e.g., Testnet)
9+
SOROBAN_NETWORK_PASSPHRASE="Test SDF Network ; September 2015"
10+
11+
# Deployer secret key (private key) – placeholder only
12+
DEPLOYER_SECRET_KEY="SBXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
13+
14+
# Contract ID placeholder
15+
CONTRACT_ID="CXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"

.gitignore

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,9 @@ Thumbs.db
2121

2222
# Temporary files
2323
*.tmp
24-
*.temp
24+
*.temp
25+
26+
# Environment secrets
27+
.env
28+
.env.*
29+
!.env.example

README.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,21 @@ If those are planned, they are future work rather than part of the present repos
208208
- Cargo
209209
- optional: Soroban CLI for deployment workflows
210210

211+
### Environment Configuration
212+
213+
To configure the environment variables for this project, copy the template `.env.example` to `.env`:
214+
215+
```bash
216+
cp .env.example .env
217+
```
218+
219+
And then edit the `.env` file with your specific configurations. This file is ignored by Git to prevent committing secrets:
220+
- `SOROBAN_RPC_URL`: The RPC endpoint for the Stellar/Soroban network.
221+
- `SOROBAN_NETWORK_PASSPHRASE`: Passphrase of the target network.
222+
- `DEPLOYER_SECRET_KEY`: Private key/secret key for deploying contracts.
223+
- `CONTRACT_ID`: The ID of the deployed smart contract.
224+
225+
211226
### Run Tests\n\n```bash\ncd apexchainx_calculator\ncargo test\n```\n\n### Test Vector Artifacts for Backend Parity\n\nRun `cargo test` to generate/update canonical SLA test vectors as JSON snapshots:\n\n```\napexchainx_calculator/test_snapshots/tests/*.json\n```\n\n**Key Vectors**:\n- `test_backend_parity_threshold_boundary_cases.*.json`: SLA met/viol boundaries\n- `test_backend_parity_reward_tier_cases.*.json`: Reward tiers (top/excel/good)\n- `test_stress_1000_calculations_mixed_severities.*.json`: Performance aggregates\n- `test_config_snapshot_is_deterministic_and_complete.*.json`: Full config\n\n**Backend Usage**:\n1. Consume snapshots for parity tests: Input (severity/mttr) → match contract `calculate_sla_view`\n2. Use `get_config_snapshot()` + `get_result_schema()` for schema validation.\n3. Maintenance: `cargo test` after SLA changes → snapshots auto-update.\n\nVectors ensure contract/backend parity without manual duplication.\n\n### Build The Contract\n\n```bash\ncd apexchainx_calculator\ncargo build\n```\n\n### Build WASM\n\n```bash\ncd apexchainx_calculator\ncargo build --target wasm32-unknown-unknown --release\n```\n\nExpected artifact:\n\n- `apexchainx_calculator/target/wasm32-unknown-unknown/release/apexchainx_calculator.wasm`\n\n## Deploy-Oriented Workflow
212227

213228
The current repository does not ship deployment scripts, but the existing crate
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
// Barrel file for demo-admin-dashboard exports
2+
export * from "./types";
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
// Types for the Demo Admin Dashboard feature
2+
3+
/**
4+
* Represents a demo data entry displayed in the admin UI.
5+
*/
6+
export interface DemoData {
7+
/** Unique identifier */
8+
id: string;
9+
/** Human‑readable name */
10+
name: string;
11+
/** Arbitrary payload – kept generic for demo purposes */
12+
payload: Record<string, unknown>;
13+
}

0 commit comments

Comments
 (0)