sdk

package module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 18, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

README

raidan-sdk

Independent Go building blocks for Ethereum execution and consensus networking: wire types, codecs, discovery, handshakes, reusable sessions, request matching, and caller-controlled protocol primitives.

The initial API requires Go 1.26.5 or newer.

go get github.com/nethoxa-labs/raidan-sdk@v0.1.0

Packages are intentionally product-independent and can be imported separately.

Packages

Package Description
module root Portable Test, Target, Result, and case execution
target Execution and consensus endpoints and local endpoint discovery
session Context scope, deadline capping, output, metadata, and write observation
result Structured operation verdicts and optional presentation
reqresp Consensus protocol IDs, libp2p sessions, SSZ-snappy framing, and requests
gossipsub Fork-digest topics, peer waiting, and caller-encoded gossip publication
discovery ENR and enode codecs, DNS discovery, discv4, and discv5
rlpx RLPx authentication, encrypted framing, Hello, and disconnect handling
eth ETH negotiation, caller-owned wire shapes, request matching, and raw wire access
snap SNAP negotiation, messages, and request matching
rpc Execution JSON-RPC and cached chain metadata
wit WIT connections, messages, and caller-parameterized encoders
utils Deterministic keys, byte formatting, and terminal styles

Portable cases

A case is a normal Go function and imports the SDK surface it needs:

func Test(ctx context.Context, target sdk.Target) sdk.Result {
	ctx = session.With(ctx, session.Scope{Client: target.Client})
	return result.Accept("case completed")
}

The public SDK intentionally contains no private behavior catalog, outcome-specific payload presets, client-specific thresholds, or verdict oracles. A private case owns those decisions inside its Test function and uses SDK packages for transport, protocol state, and result values. Upstream Ethereum primitives are imported directly under their native package names. The root package exposes only SDK-owned behavior such as Run, EncodeRLPBytes, and EncodeRLPList; it does not re-export pass-through function wrappers. Dependency-owned Ethereum primitives are imported directly from their upstream packages.

An embedding program runs an imported private case without depending on a Raidan catalog or worker package:

outcome := sdk.Run(ctx, testcase.Test, target, sdk.Scope{
	Output: os.Stdout,
	Client: target.Client,
})

sdk.Run supplies output and client metadata. Callers can attach the neutral session.Observer through sdk.Scope when they need to trace protocol writes. Case registries, private source, candidate selection, and persistence do not belong in the SDK.

License

Apache-2.0. See LICENSE.

Documentation

Overview

Package sdk exposes the small, stable execution surface shared by portable Ethereum cases and their host programs. Protocol-specific wire operations remain in the SDK's subpackages.

Index

Constants

View Source
const (
	// VerdictAccept indicates that the target behaved as expected.
	VerdictAccept = result.VerdictAccept
	// VerdictDisconnect indicates that the target disconnected unexpectedly.
	VerdictDisconnect = result.VerdictDisconnect
	// VerdictTimeout indicates that the target did not respond in time.
	VerdictTimeout = result.VerdictTimeout
	// VerdictInvalid indicates an invalid or inconclusive target response.
	VerdictInvalid = result.VerdictInvalid
	// VerdictBug indicates a protocol bug in the target.
	VerdictBug = result.VerdictBug
	// VerdictCrash indicates that the target crashed.
	VerdictCrash = result.VerdictCrash
)
View Source
const Version = "v0.1.0"

Version identifies this SDK release.

Variables

This section is empty.

Functions

func EncodeRLPBytes

func EncodeRLPBytes(payload []byte) []byte

EncodeRLPBytes returns the canonical RLP byte-string encoding of payload.

func EncodeRLPList

func EncodeRLPList(items ...[]byte) []byte

EncodeRLPList wraps caller-supplied, pre-encoded RLP items in one list.

Types

type Observer

type Observer = session.Observer

Observer receives protocol writes emitted by a case.

type Result

type Result = result.Result

Result is the stable machine-readable outcome returned by every case.

func Run

func Run(ctx context.Context, test Test, target Target, scope Scope) Result

Run invokes test with output and client metadata attached to its context. Callers that need additional context values attach them before calling Run.

type Scope

type Scope = session.Scope

Scope supplies case output, client identity, and write observation.

type Target

type Target = target.Target

Target describes the execution and consensus endpoints exercised by a case.

type Test

type Test = target.Test

Test is the canonical portable case signature.

type Verdict

type Verdict = result.Verdict

Verdict classifies the outcome of a portable case.

type Write

type Write = session.Write

Write describes one protocol write observed during a case.

Directories

Path Synopsis
Package discovery provides Ethereum node discovery primitives.
Package discovery provides Ethereum node discovery primitives.
Package eth provides the execution-layer ETH devp2p capability.
Package eth provides the execution-layer ETH devp2p capability.
Package gossipsub provides Ethereum consensus-layer gossip publishing.
Package gossipsub provides Ethereum consensus-layer gossip publishing.
Package reqresp provides Ethereum consensus-layer request/response streams.
Package reqresp provides Ethereum consensus-layer request/response streams.
Package result classifies an operation with a stable Verdict and detail.
Package result classifies an operation with a stable Verdict and detail.
Package rlpx provides Ethereum's encrypted RLPx transport and devp2p base protocol primitives.
Package rlpx provides Ethereum's encrypted RLPx transport and devp2p base protocol primitives.
Package rpc provides bounded execution-layer JSON-RPC access.
Package rpc provides bounded execution-layer JSON-RPC access.
Package session carries output, client metadata, and write observation in a standard context.Context.
Package session carries output, client metadata, and write observation in a standard context.Context.
Package snap provides the SNAP state-sync capability and its packet model.
Package snap provides the SNAP state-sync capability and its packet model.
Package target describes the HTTP and peer-to-peer endpoints of an Ethereum node pair.
Package target describes the HTTP and peer-to-peer endpoints of an Ethereum node pair.
Package utils provides deterministic identity and presentation helpers shared by the wire packages.
Package utils provides deterministic identity and presentation helpers shared by the wire packages.
Package wit implements the WIT/1 execution-witness devp2p capability.
Package wit implements the WIT/1 execution-witness devp2p capability.

Jump to

Keyboard shortcuts

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