Skip to content

fix(devnet): migrate from REST API to JSON-RPC 2.0#837

Open
dik654 wants to merge 1 commit into
NethermindEth:mainfrom
dik654:fix/devnet-jsonrpc-migration
Open

fix(devnet): migrate from REST API to JSON-RPC 2.0#837
dik654 wants to merge 1 commit into
NethermindEth:mainfrom
dik654:fix/devnet-jsonrpc-migration

Conversation

@dik654

@dik654 dik654 commented Jan 2, 2026

Copy link
Copy Markdown

Changes

devnet/devnet.go

  • Add JSON-RPC 2.0 infrastructure: Implement rpcCall() helper with proper request/response handling and error parsing
  • Migrate Accounts(): Convert from GET /predeployed_accounts to JSON-RPC devnet_getPredeployedAccounts method
  • Migrate Mint(): Convert from POST /mint to JSON-RPC devnet_mint method with proper parameter serialization (address as hex string, amount as uint64, unit as "WEI")
  • Remove FeeToken(): This endpoint no longer exists in devnet-rs. The fee token information can be obtained through other Starknet RPC methods if needed

.github/workflows/test_devnet.yml

  • Bump devnet Docker image from 0.5.0 to 0.7.1 to use the latest stable release

Documentation

  • Update method descriptions to reflect JSON-RPC usage
  • Remove FeeToken documentation and example code (docs/docs/pages/docs/devnet/methods/fee-token.mdx)

Removed

  • docs/tests/devnet/fee_token.go: Example test for the removed FeeToken() method

Test plan

Verified all devnet tests pass with the new implementation:

  • TestDevnet_IsAlive - Health check still uses REST endpoint (unchanged)
  • TestDevnet_Accounts - Successfully retrieves predeployed accounts via JSON-RPC
  • TestDevnet_Mint - Successfully mints tokens via JSON-RPC

Closes #833

- Add JSON-RPC 2.0 client for devnet API calls
- Convert Accounts() to use devnet_getPredeployedAccounts
- Convert Mint() to use devnet_mint
- Remove deprecated FeeToken() method
- Bump devnet image to 0.7.1 in CI workflow
- Update documentation

Closes NethermindEth#833
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

Update devnet pkg

1 participant