Skip to content

Added default path flow#32

Merged
0xKrishna merged 22 commits intomainfrom
krishna/default-path
Dec 31, 2025
Merged

Added default path flow#32
0xKrishna merged 22 commits intomainfrom
krishna/default-path

Conversation

@0xKrishna
Copy link
Copy Markdown
Contributor

@0xKrishna 0xKrishna commented Dec 6, 2025

Major changes:

  1. Storage abstraction layer (storage.go)

Introduces Storage[AppTx, R] struct that consolidates all databases (appchain, txpool, txbatch) and components (multichain, subscriber) with unified lifecycle management and accessor methods.

  1. Standardized path hierarchy (paths.go)

Defines three-layer data directory structure (multichain/{chainID}/, consensus/txbatch/{chainID}/, appchain/db/) with helper functions for consistent path resolution across SDK and pelacli.

  1. One-call initialization (init.go)

InitApp() orchestrates full appchain bootstrap—waits for required chains, opens all databases, creates multichain accessor and subscriber—reducing ~60 lines of boilerplate to one function call.

@0xKrishna 0xKrishna changed the base branch from krishna/evmtypes-hash-verification to main December 14, 2025 09:00
@0xKrishna 0xKrishna force-pushed the krishna/default-path branch from 4cf47f2 to ebdecda Compare December 14, 2025 09:09
@0xKrishna 0xKrishna marked this pull request as ready for review December 14, 2025 17:56
@0xKrishna 0xKrishna requested review from 0xaigen and JekaMas December 17, 2025 06:04
@0xKrishna
Copy link
Copy Markdown
Contributor Author

Related example PR : 0xAtelerix/example#14

There are also changed in pelacli regarding default multichain and ext-network config for which I will raise PR once the SDK PR is finalized and merged.

Comment thread gosdk/multichain.go
@0xKrishna 0xKrishna requested a review from 0xaigen December 28, 2025 19:58
Comment thread gosdk/init.go Outdated
Comment thread gosdk/init.go Outdated
Comment thread gosdk/init.go
Comment thread gosdk/paths.go Outdated
Comment thread gosdk/paths.go
Comment thread gosdk/state_transition.go Outdated
Comment thread gosdk/state_transition.go Outdated
Comment thread gosdk/appchain.go
Comment thread gosdk/appchain.go
Comment thread gosdk/appchain.go
Comment thread gosdk/appchain.go
Comment thread gosdk/appchain.go
Comment thread gosdk/init.go Outdated
Comment thread gosdk/appchain.go
Comment thread gosdk/appchain.go
Comment thread gosdk/init.go
Comment thread gosdk/init.go Outdated
Comment thread gosdk/storage.go Outdated
Comment thread gosdk/storage.go Outdated
Comment thread gosdk/storage.go Outdated
Comment thread gosdk/init.go
@github-actions github-actions Bot mentioned this pull request Dec 30, 2025
Comment thread Readme.md Outdated
Comment thread Readme.md Outdated
Comment thread gosdk/paths.go Outdated
@github-actions
Copy link
Copy Markdown

Code Metrics Report

#32 (bfb63d8) #32 (12600cf) +/-
Coverage 58.7% 58.7% 0.0%
Code to Test Ratio 1:0.4 1:0.4 -0.1
Test Execution Time 1m6s 1m6s 0s
Details
  |                     | #32 (bfb63d8) | #32 (12600cf) | +/-  |
  |---------------------|---------------|---------------|------|
  | Coverage            |         58.7% |         58.7% | 0.0% |
  |   Files             |            56 |            56 |    0 |
  |   Lines             |          2902 |          2902 |    0 |
  |   Covered           |          1706 |          1706 |    0 |
- | Code to Test Ratio  |         1:0.4 |         1:0.4 | -0.1 |
  |   Code              |         13642 |         13651 |   +9 |
  |   Test              |          6359 |          6359 |    0 |
  | Test Execution Time |          1m6s |          1m6s |   0s |

Code coverage of files in pull request scope (40.7% → 40.7%)

Files Coverage +/- Status
gosdk/appchain.go 30.0% 0.0% modified
gosdk/init.go 59.5% 0.0% added
gosdk/mdbx_event_wrapper.go 6.3% 0.0% modified
gosdk/multichain.go 76.6% 0.0% modified
gosdk/multichain_sql.go 61.4% 0.0% modified
gosdk/paths.go 88.8% 0.0% added
gosdk/receipt/receipt.go 76.9% 0.0% modified
gosdk/state_transition.go 1.7% 0.0% modified
gosdk/storage.go 52.4% 0.0% added

Reported by octocov

@0xKrishna 0xKrishna merged commit b37c5a7 into main Dec 31, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants