Expose code as a Graftcode Receiver

Turn an existing library or module into a Receiver without adding HTTP route handlers, controllers, or transport types on the public surface.

1. Choose the public surface

Expose only intentional public classes and methods. Keep database clients, HTTP objects, streams, framework models, and implementation helpers internal.

Use a plain module with a small synchronous or async-free public API (per runtime rules):

namespace Pricing;
public static class PriceService
{
public static double Calculate(double amount, double discountPercent) =>
amount * (1 - discountPercent / 100);
}
Use primitives and plain models. For cross-runtime contracts, represent dates and identifiers as strings. For .NET, the Graftcode Engine rejects framework complex types on the public surface.

2. Build the Receiver

dotnet build ./Pricing/Pricing.csproj
## 3. Start Gateway with the real module

Install and run Graftcode Gateway (gg) if you have not already—it hosts your built module, discovers the public surface, and publishes the callable surface. See Run Gateway locally.

gg ./Pricing/bin/Debug/net9.0/Pricing.dll
Adjust paths and runtime versions to the project. Do not copy package IDs, registry URLs, or project keys from examples.

4. Verify discovery

Check Gateway output and Graftcode Vision for the expected type and methods. Treat the discovered surface as a review gate: remove accidental public members before Callers install a Graft.

There is no universal type matrix. Generate and smoke-test every Receiver/Caller language pair that uses types beyond the portable baseline.

Next steps