Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
170 commits
Select commit Hold shift + click to select a range
4b0b593
Merge pull request #122 from Beckn-One/draft_ameetdesh_deg0p5
ravi-prakash-v Nov 21, 2025
57d6405
Revise P2P Trading implementation guide content
ravi-prakash-v Nov 21, 2025
4032370
Updated terminology section in the P2P implementation guide
Nov 21, 2025
56affa6
Add documentation for surplus energy representation in P2P trading
ravi-prakash-v Nov 23, 2025
34d49a0
Merge branch 'p2p-trading' of github.com:Beckn-One/DEG into p2p-trading
Nov 23, 2025
df50523
Add technical specification for user onboarding in digital energy
ravi-prakash-v Nov 24, 2025
6663f17
Add implementation guide for onboarding users in digital energy programs
ravi-prakash-v Nov 24, 2025
3cf7c7a
Merge branch 'p2p-trading' of github.com:Beckn-One/DEG into p2p-trading
Nov 24, 2025
41c4085
Removed version number from EV charging IG, moved inside EV_Charging …
Nov 24, 2025
ab062ff
improved implementatio guide flow
ameetdesh Nov 26, 2025
163f062
correct typos and sentence flow. Fix #79
ameetdesh Nov 26, 2025
417133b
remove EV specific language and add layer2 legacy link
ameetdesh Nov 26, 2025
ce94e57
removed redundent overview section
ameetdesh Nov 26, 2025
7b0f450
updated arch diagram with mermaid chart
ameetdesh Nov 26, 2025
022417c
Merge branch 'draft' into draft_ameetdesh_deg0p5
ameetdesh Nov 26, 2025
64478cf
added TODOs for future improvements
ameetdesh Nov 27, 2025
4515691
merge p2p-trading
ameetdesh Nov 27, 2025
1a1cb65
merge draft branch
ameetdesh Nov 27, 2025
bbb7cb7
merge p2p-trading
ameetdesh Nov 27, 2025
3e72e6a
revert changes unrelated to IG, in order to keep diff short
ameetdesh Nov 27, 2025
9afddec
revert all changes to EV charging IG
ameetdesh Nov 27, 2025
c6ba37a
added TOC & section headers to v1 to v2 migration guide for p2p trading
ameetdesh Nov 27, 2025
fc55788
Merge pull request #135 from Beckn-One/draft_ameetdesh_deg0p5
ameetdesh Nov 29, 2025
668cbdc
fix merge conflicts. Reword introduction & sequence diagram.
ameetdesh Dec 2, 2025
e4384ab
removed arch diagram
ameetdesh Dec 2, 2025
10b7df7
update section numbers
ameetdesh Dec 2, 2025
28f6815
remove the LLM generated text at the end of doc
ameetdesh Dec 2, 2025
a19217b
updated path to p2p-trading context.jsonld & updated examples in impl…
ameetdesh Dec 2, 2025
68258e8
remove redundent confirm call in sequenc diagram
ameetdesh Dec 2, 2025
348fdb2
add example json and use them in implementation guide
ameetdesh Dec 5, 2025
715ff0b
added table of contents to onboarding implementation guide
ameetdesh Dec 5, 2025
d99833e
add utility BPP cascaded calls to implementation guide and postman co…
ameetdesh Dec 6, 2025
7f76e4c
added p2p devkit
ameetdesh Dec 7, 2025
a4503de
fix variables in p2p postman collections
ameetdesh Dec 7, 2025
f5f9dcd
renamed postman collection to have use case first, so as to organize …
ameetdesh Dec 7, 2025
144f3c5
renamed postman collection to have use case first, so as to organize …
ameetdesh Dec 7, 2025
893e33c
renamed postman collection to have use case first, so as to organize …
ameetdesh Dec 7, 2025
3196fec
fix postman collections & built-in variables to ensure sandbox runs ok
ameetdesh Dec 7, 2025
2bc5cfb
fix dedi registry paths, config files. Still work in progress.
ameetdesh Dec 9, 2025
b6d0f3a
fix config & collections
ameetdesh Dec 9, 2025
c7b734f
add schema validation to all yamls
ameetdesh Dec 9, 2025
e970922
resolve dedi registration issues. Confirm roundtrip comms between BAP…
ameetdesh Dec 9, 2025
69fa9d7
fix rest of routing issues in postman collections
ameetdesh Dec 10, 2025
f4a633f
revise the postman & devkit organization for simplicity
ameetdesh Dec 10, 2025
c4e6754
added CDS catalog upload postman schema
ameetdesh Dec 10, 2025
4bbcff6
updated README.md and fixed inconsistent variable names in postman co…
ameetdesh Dec 10, 2025
ab7634b
fix schema validation errors in postmand collections & p2p examples
ameetdesh Dec 11, 2025
5a971cb
updated README
ameetdesh Dec 11, 2025
5a5a17a
added routing digram
ameetdesh Dec 11, 2025
f239d0a
fix ev charging postman & example jsons
ameetdesh Dec 11, 2025
a8c552e
fix embedded jsons within EV charging implementation guide
ameetdesh Dec 11, 2025
eb980b6
replace local sandbox with one from dockerhub in ev charginng devkit
ameetdesh Dec 11, 2025
6b6d447
fix git clone command to pull a specific branch
ameetdesh Dec 12, 2025
64e1cd0
move EV charging implementation guide to make merge in main easier
ameetdesh Dec 12, 2025
fdfaaa3
moved ev-charging example jsons folder location
ameetdesh Dec 12, 2025
f705bf1
moved p2p-trading jsons
ameetdesh Dec 12, 2025
0feee3d
merged issue-146-fix-invalid-ev-charging-jsons
ameetdesh Dec 13, 2025
27beb23
Merge branch 'issue-146-fix-invalid-ev-charging-jsons' into p2p-trading
ameetdesh Dec 15, 2025
b46ac66
committing validated implementation guide, example jsons & postmans
ameetdesh Dec 15, 2025
738b599
moved enrollment examples to new folder, update implementation guide …
ameetdesh Dec 16, 2025
9d5704f
updated validate_schema to work for enrollment and recursive ref updates
ameetdesh Dec 16, 2025
033073b
added Dedi details to README & remove LLM language from Onboarding guide
ameetdesh Dec 17, 2025
2e012bc
improve routing diagram
ameetdesh Dec 17, 2025
4ceed19
Finalize DeDi instructions & improve routing diagram
ameetdesh Dec 17, 2025
1a40792
updated examples, implementation guides, postman collections after p2…
ameetdesh Dec 18, 2025
03ddcdc
fix discovery filter within BAP discover calls within postman, exampl…
ameetdesh Dec 18, 2025
8a1d0da
fix validation errors and add source meter ID to offer Attributes
ameetdesh Dec 19, 2025
f7a6a51
fix registry url to strat with https
ameetdesh Dec 19, 2025
c43a6a5
replaced dedi urls with https
ameetdesh Dec 20, 2025
251ecc3
improvements to enrollment IG
ameetdesh Dec 21, 2025
da7211d
update p2p trading collections/jsons to use improved p2p schemas whic…
ameetdesh Jan 4, 2026
db45a17
added orderAttributes in all p2p trading example jsons. Refreshed gui…
ameetdesh Jan 5, 2026
ecdf6c7
fix error messages, and enrollment domain in example jsons
ameetdesh Jan 5, 2026
3857403
add enrollment devkit, postman collections and refresh jsons
ameetdesh Jan 6, 2026
bb40e75
added new p2p trading json example for update
ameetdesh Jan 6, 2026
b436840
updated postman collection to reuse p2p-trading subscriber id and bap…
ameetdesh Jan 7, 2026
73d23a8
fix buggy context in cds postman, now that the bug has been fixed in …
ameetdesh Jan 8, 2026
cc8cea1
update postman collections & jsons to have customerID (optional in sc…
ameetdesh Jan 8, 2026
0dffd36
update json examples to match latest schemas
ameetdesh Jan 8, 2026
db46a88
updated enrollment postman collection
ameetdesh Jan 8, 2026
83a05fb
updated enrollment implementation guide
ameetdesh Jan 8, 2026
bcc2f02
added userType to EnergyEnrollment / userType
ameetdesh Jan 9, 2026
353dd31
updates p2p examples to use full iso date&time
ameetdesh Jan 9, 2026
7d16d60
merged main
ameetdesh Jan 12, 2026
c4a105d
merged main
ameetdesh Jan 12, 2026
9b43f9f
add publish endpoint in testnet routing
ameetdesh Jan 12, 2026
dc477cb
add ability to publish query to postman automatically from example, a…
ameetdesh Jan 12, 2026
e149a9c
add energy trade order details to each order. Remove line id and pre …
ameetdesh Jan 12, 2026
58d1281
fix errors in catalog
ameetdesh Jan 12, 2026
c22bb44
fix discover example to not use natural language search, use schema c…
ameetdesh Jan 13, 2026
e966282
fix ev charging readme
ameetdesh Jan 13, 2026
bd18799
added instructions to regenrate postman collections to devkit readmes
ameetdesh Jan 13, 2026
40eb999
add on_publish endpoint
ameetdesh Jan 13, 2026
2b8cfb6
fixed CDS endpoint
ameetdesh Jan 13, 2026
adc3581
fix on_publish
ameetdesh Jan 14, 2026
a8b76c8
renamed p2p implementation guide
ameetdesh Jan 14, 2026
34ae8a2
fixed all links and merged draft in p2p-trading
ameetdesh Jan 14, 2026
d2eb5b9
clean up files in IG
ameetdesh Jan 14, 2026
ddc2fe9
Merge branch 'main' into p2p-trading
ameetdesh Jan 15, 2026
b5b394b
dropped amd64 platform requirement for sandbox docker
ameetdesh Jan 16, 2026
80f1bd1
fix broke links
ameetdesh Jan 17, 2026
724fe84
improve naming of routing config files
ameetdesh Jan 18, 2026
26a3d25
cleaned up postman collections to show non-empty collections & avoid …
ameetdesh Jan 18, 2026
9cf658b
moved p2p trading devkit to shorter named folder
ameetdesh Jan 18, 2026
28993ec
added interdiscom p2p devkit for ai summit
ameetdesh Jan 18, 2026
27fb764
fix paths
ameetdesh Jan 19, 2026
649e08f
fix postman
ameetdesh Jan 19, 2026
444c268
Merge branch 'main' into p2p-trading
ameetdesh Jan 20, 2026
84d656f
add energy credential examples
ameetdesh Jan 20, 2026
330ccde
add deg ledger collection for testing
ameetdesh Jan 20, 2026
10b7c4b
add lederservice plugin & use it in interdiscom tesrnet. Also refresh…
ameetdesh Jan 20, 2026
1bc9123
added plugin files
ameetdesh Jan 21, 2026
5e5a659
resolve the arch conflict issue by using local docker build
ameetdesh Jan 21, 2026
4f4aff6
committing working setup which can write to ledger (30 sec timeout).
ameetdesh Jan 21, 2026
7337de8
fix broken docker compose file (commented out degledger plugin calls)
ameetdesh Jan 21, 2026
5f559fa
point to docker container with deg ledger plugin and eblae plugin
ameetdesh Jan 21, 2026
a30d0fa
add more examples to postman collection
ameetdesh Jan 21, 2026
bc6469d
ensure newer examples show up in BPP postman collection
ameetdesh Jan 21, 2026
e017703
added VC postman collection to devkit
ameetdesh Jan 22, 2026
83a31da
fix onix-adapter-deg to v2 which works on linux & ios and is truly mu…
ameetdesh Jan 22, 2026
667598a
updated Energy trade fulfillment attributes
ameetdesh Jan 22, 2026
45bef52
renames customerattribute to providerattribute
ameetdesh Jan 23, 2026
1793da6
updated implementation guide
ameetdesh Jan 23, 2026
0906f9f
updated examples to have new EnergyOrderItem context even before upda…
ameetdesh Jan 23, 2026
0be4e0c
rename fulfillment attributes in example jsons as specs have changes
ameetdesh Jan 23, 2026
54e7aab
updated postman collections, and confirmed that they work
ameetdesh Jan 23, 2026
d7b1e9c
updated json payloads to match on_select & on_init
ameetdesh Jan 25, 2026
ed7a3fe
added all needed attributes to examples to make publish, discover, an…
ameetdesh Jan 26, 2026
5089db5
added utilityId to EnergyCustomer shcema
ameetdesh Jan 26, 2026
9357809
added payment payloads
ameetdesh Jan 26, 2026
cbcd013
changed discover request to filter by network id
ameetdesh Jan 26, 2026
d4097bd
added note on allocation & settlement logic
ameetdesh Jan 28, 2026
a5b6ecb
improved flow of allocation logic document
ameetdesh Jan 28, 2026
fd9f9fc
small change to p2p trading discover examples
ameetdesh Jan 28, 2026
2fb47f0
replaced sanctioned load with trading limit in p2p trading implementa…
ameetdesh Jan 28, 2026
ebce800
refined the flow of allocatio note
ameetdesh Jan 29, 2026
f7fc9d3
ensure no changes to ev charging example jsons
ameetdesh Jan 29, 2026
6066b6c
add toc to allocation note
ameetdesh Jan 29, 2026
0bfeb2f
fix broken link in p2p IG
ameetdesh Jan 29, 2026
d825d89
added debug logs to deg ledger recorder plugin & enabled multi-arch p…
ameetdesh Jan 29, 2026
d42dbb4
add ability to add onix auth header.
ameetdesh Jan 29, 2026
9d1b71d
update registry URLs to point to use beckn.io domain
nirmalnr Jan 30, 2026
60442ac
Revert "update registry URLs to point to use beckn.io domain"
nirmalnr Jan 30, 2026
1b8682e
update registry URLs to point to beckn.io domain
nirmalnr Jan 30, 2026
6334839
Merge pull request #177 from nirmalnr/p2p-trading
ameetdesh Jan 30, 2026
83f582c
add signing to ledger plugin & add configurable action based ledger w…
ameetdesh Jan 30, 2026
f01d404
add signing to ledger plugin & add configurable action based ledger w…
ameetdesh Jan 30, 2026
7113515
add signing to ledger plugin & add configurable action based ledger w…
ameetdesh Jan 30, 2026
e005b9f
merge Nirmal's PR in this
ameetdesh Jan 30, 2026
519889b
merge remote p2p-trading branch
ameetdesh Jan 30, 2026
af56204
replaced p2p-trading example, devkit with urls from tpddl pilot tag c…
ameetdesh Feb 1, 2026
d9c857a
fixed schema inconsistency issues
ameetdesh Feb 2, 2026
f45d827
further schema cleanup & examples & postman collections.
ameetdesh Feb 2, 2026
72e7adc
simplified energy resource examples
ameetdesh Feb 2, 2026
f5d256f
add a working jsonpath filter that returns non-empty results
ameetdesh Feb 2, 2026
b05b7a9
updated domain
ameetdesh Feb 2, 2026
884571f
Merge pull request #178 from beckn/issue-80-fix-p2ptrading-schema
ameetdesh Feb 2, 2026
5240f50
fixed the ledger recording after the new schema changes
ameetdesh Feb 2, 2026
02534f4
added fidedocker prefix to docker image
ameetdesh Feb 2, 2026
a6f638e
pointed docker to fidedocker/onix-adapter-deg:p2p-multiarch-v4 which …
ameetdesh Feb 3, 2026
baa0644
add note on payment flow & update examples & postman collections
ameetdesh Feb 3, 2026
3d8f6e2
add table of contents & section numbers
ameetdesh Feb 3, 2026
3f2e6fb
refine table of contents
ameetdesh Feb 3, 2026
d2016b4
minor change in title
ameetdesh Feb 3, 2026
602a406
reworded some principles in the document
ameetdesh Feb 4, 2026
fb24224
add info about utility charges
ameetdesh Feb 4, 2026
e46133d
fix pseudocode in allocation note
ameetdesh Feb 6, 2026
48f563f
add EnergyTrading and Enrollment schema
ameetdesh Feb 6, 2026
bf5b701
added discom signing devkit
ameetdesh Feb 6, 2026
a85f2e5
fix failing dotnet tests
ameetdesh Feb 6, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 52 additions & 0 deletions build/Dockerfile.onix-adapter-deg
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# Dockerfile for building onix-adapter with DEG plugins
# This ensures the adapter and plugins are built with the same Go version
# and beckn-onix package versions for compatibility.
#
# Build from DEG repo root:
# docker build -f build/Dockerfile.onix-adapter-deg -t onix-adapter-deg \
# --build-context beckn-onix=../beckn-onix .
#
# Or from parent directory containing both repos:
# docker build -f DEG/build/Dockerfile.onix-adapter-deg -t onix-adapter-deg \
# --build-context beckn-onix=beckn-onix DEG

FROM golang:1.24-bullseye AS builder

WORKDIR /workspace

# Copy beckn-onix source
COPY --from=beckn-onix . ./beckn-onix/

# Copy DEG plugins source
COPY plugins ./deg-plugins/

# Build onix-adapter server
WORKDIR /workspace/beckn-onix
RUN go mod download
RUN go build -o server cmd/adapter/main.go

# Build standard beckn-onix plugins
RUN mkdir -p plugins
RUN ./install/build-plugins.sh

# Build DEG plugins
WORKDIR /workspace/deg-plugins

# Update go.mod to use local beckn-onix
RUN sed -i 's|=> ../../beckn-onix|=> /workspace/beckn-onix|g' go.mod
RUN go mod tidy

# Build DEG ledger recorder plugin
RUN go build -buildmode=plugin -o /workspace/beckn-onix/plugins/degledgerrecorder.so ./degledgerrecorder/cmd/plugin.go

# Create minimal runtime image
FROM cgr.dev/chainguard/wolfi-base
WORKDIR /app

# Copy binary and all plugins (standard + DEG)
COPY --from=builder /workspace/beckn-onix/server .
COPY --from=builder /workspace/beckn-onix/plugins ./plugins

EXPOSE 8081

CMD ["sh", "-c", "./server --config=${CONFIG_FILE}"]
132 changes: 132 additions & 0 deletions build/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,132 @@
# DEG Build Scripts

This directory contains build scripts and Docker configurations for the DEG Ledger Recorder plugin and onix-adapter-deg image.

## Files

| File | Description |
|------|-------------|
| `Dockerfile.onix-adapter-deg` | Dockerfile for building onix-adapter with DEG plugins |
| `build-multiarch.sh` | Build multi-arch Docker image (amd64 + arm64) |

## Multi-Architecture Builds

The `build-multiarch.sh` script builds Docker images for multiple architectures (linux/amd64 and linux/arm64) using Docker Buildx and QEMU emulation.

### Prerequisites

1. **Docker with Buildx support**
- Docker Desktop (macOS/Windows): Buildx is included
- Linux: Install Docker Engine 19.03+ with buildx plugin

2. **QEMU** (for cross-architecture emulation)
- The script automatically installs QEMU user-mode emulation
- Or install manually:
```bash
docker run --privileged --rm tonistiigi/binfmt --install all
```

3. **beckn-onix repository**
- Script will prompt for path if not found at default location (`../beckn-onix`)
- Or set `BECKN_ONIX_ROOT` environment variable to skip prompt

### Usage

```bash
# Build and load to local Docker (current architecture only)
./build/build-multiarch.sh --load

# Build for specific platform
./build/build-multiarch.sh --platform amd64 --load
./build/build-multiarch.sh --platform arm64 --load

# Build and push to registry (multi-arch)
./build/build-multiarch.sh --push --registry docker.io/myuser

# Build with custom tag
./build/build-multiarch.sh --push --registry ghcr.io/myorg --tag v1.0.0

# Show help
./build/build-multiarch.sh --help
```

### Environment Variables

| Variable | Default | Description |
|----------|---------|-------------|
| `BECKN_ONIX_ROOT` | (prompts if not found) | Path to beckn-onix repo |
| `IMAGE_NAME` | `onix-adapter-deg` | Docker image name |
| `IMAGE_TAG` | `p2p-multiarch-v3` | Docker image tag |
| `REGISTRY` | (none) | Registry prefix (e.g., `docker.io/user`) |
| `PLATFORMS` | `linux/amd64,linux/arm64` | Target platforms |
| `BUILDER_NAME` | `deg-multiarch` | Buildx builder name |

### Examples

**Local development (macOS Apple Silicon)**
```bash
# Build for your Mac's ARM64 architecture
./build/build-multiarch.sh --platform arm64 --load

# Run locally
docker run -it --rm \
-v $(pwd)/config:/app/config \
-e CONFIG_FILE=/app/config/local.yaml \
-p 8081:8081 \
onix-adapter-deg:latest
```

**Build for production deployment**
```bash
# Build multi-arch and push to Docker Hub
export REGISTRY=docker.io/mycompany
export IMAGE_TAG=v1.2.3
./build/build-multiarch.sh --push

# Verify multi-arch manifest
docker buildx imagetools inspect docker.io/mycompany/onix-adapter-deg:v1.2.3
```

**GitHub Actions CI/CD**

See `.github/workflows/build-multiarch.yml` for automated multi-arch builds.

## Go Plugin Compatibility

**Important:** Go plugins require exact version matching:
- The plugin and host binary must be built with the **same Go version**
- The plugin and host must use the **same dependency versions**
- CGO must be enabled (`CGO_ENABLED=1`)

The Dockerfile ensures compatibility by building both the adapter and plugins in the same build stage with the same Go version.

## Troubleshooting

### "exec format error"
You're trying to run an image built for a different architecture. Either:
- Build for your architecture: `--platform amd64` or `--platform arm64`
- Enable QEMU: `docker run --privileged --rm tonistiigi/binfmt --install all`

### "plugin was built with a different version of package"
The plugin was built with a different Go version or dependency versions than the adapter. Rebuild both together using the Dockerfile.

### "builder not found"
Create the buildx builder manually:
```bash
docker buildx create --name deg-multiarch --driver docker-container --bootstrap
docker buildx use deg-multiarch
```

### Slow builds on non-native architecture
QEMU emulation is slower than native builds. For faster CI:
- Use native runners when available (e.g., GitHub's `ubuntu-latest` for amd64)
- Consider using arm64 runners for arm64 builds
- Use build caching (`--cache-from type=gha`)

## Architecture Notes

The image supports:
- **linux/amd64**: Standard x86-64 servers (AWS EC2, GCP, most cloud VMs)
- **linux/arm64**: ARM64 servers (AWS Graviton, Apple Silicon Macs, Raspberry Pi 4+)

The base image (`cgr.dev/chainguard/wolfi-base`) and Go image (`golang:1.24-bullseye`) both provide multi-arch support.
Loading