Documentation
¶
Overview ¶
Package keys manages Anvil private key allocation for E2E tests.
The 10 default Anvil accounts are partitioned by role to avoid collisions:
Account 0: admin (on-chain registration, canonical network ops) Account 1: client (payer envelope signing) Accounts 2-4: gateways (signer + payer keys) Accounts 5-9: nodes (signer keys)
When a pool is exhausted, new ECDSA keys are generated and funded from the admin account via the Anvil RPC.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager allocates private keys from role-specific pools. When a pool is exhausted, it generates new ECDSA keys and funds them from the admin account via the Anvil RPC endpoint.
func NewManager ¶
NewManager creates a key manager that uses the given RPC URL to fund generated keys when pre-funded pools are exhausted.
func (*Manager) NextClientKey ¶
NextClientKey returns a new client payer key. The first call returns the static ClientKey (account 1). Subsequent calls generate new ECDSA keys and fund them from the admin account. Use this when a test needs traffic from multiple distinct payer addresses.
func (*Manager) NextGatewayKey ¶
NextGatewayKey returns the next available gateway key. Returns pre-funded keys from accounts 2-4 first, then generates and funds new keys as needed.
func (*Manager) NextNodeKey ¶
NextNodeKey returns the next available node signer key. Returns pre-funded keys from accounts 5-9 first, then generates and funds new keys as needed.