rpc

package
v1.38.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 8, 2026 License: MIT Imports: 9 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EvaluateCleartextRPC added in v1.24.0

func EvaluateCleartextRPC(rpcURL string, opts CleartextPolicyOptions) (warnMsg string, blockErr error)

EvaluateCleartextRPC blocks non-localhost HTTP RPC URLs unless explicitly opted in. Returns a warning when cleartext use is allowed via --allow-insecure-rpc.

func IsLoopbackHost added in v1.24.0

func IsLoopbackHost(host string) bool

IsLoopbackHost reports whether host is a local loopback address (localhost, 127.0.0.1, ::1).

func IsValidURL

func IsValidURL(rpcURL string) error

IsValidURL checks that rpcURL has an http or https scheme and a non-empty host.

func QueryEthChainID

func QueryEthChainID(rpcURL string) (uint64, error)

QueryEthChainID dials rpcURL and returns the chain ID from eth_chainId.

func RedactURL added in v1.24.0

func RedactURL(rawURL string) string

RedactURL returns a version of the URL with credentials masked to avoid leaking secrets that may have been resolved from environment variables.

func ValidateMatchesSelector

func ValidateMatchesSelector(rpcURL string, expectedSelector uint64) error

ValidateMatchesSelector verifies the RPC's eth_chainId matches expectedSelector.

Types

type CleartextPolicyOptions added in v1.24.0

type CleartextPolicyOptions struct {
	AllowInsecure bool
}

CleartextPolicyOptions controls cleartext RPC policy evaluation.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL