Skip to content

Commit c06712c

Browse files
authored
fabricx integration (#1229)
Signed-off-by: Angelo De Caro <[email protected]>
1 parent 06f4e8c commit c06712c

File tree

38 files changed

+2197
-227
lines changed

38 files changed

+2197
-227
lines changed

.github/workflows/tests.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ jobs:
9393
dlog-fabric-t11,
9494
dlog-fabric-t12,
9595
dlog-fabric-t13,
96+
fabricx-dlog-t1,
9697
fabtoken-dlog-fabric,
9798
dloghsm-fabric-t1,
9899
dloghsm-fabric-t2,
@@ -142,5 +143,10 @@ jobs:
142143
- name: Docker
143144
run: make docker-images
144145

146+
- name: Fabric-x setup
147+
if: startsWith(matrix.tests, 'fabricx')
148+
run: |
149+
make fxconfig configtxgen fabricx-docker-images
150+
145151
- name: Run ${{ matrix.tests }}
146152
run: make integration-tests-${{ matrix.tests }}

.golangci.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ linters:
33
enable:
44
# - containedctx
55
# - contextcheck
6-
# - depguard
6+
- depguard
77
# - dupl
88
# - errname
99
- errorlint
@@ -53,6 +53,12 @@ linters:
5353
# wrapcheck is not working as expected. It is categorizing internal packages as external.
5454
#- wrapcheck
5555
settings:
56+
depguard:
57+
rules:
58+
main:
59+
deny:
60+
- pkg: github.com/pkg/errors
61+
desc: github.com/pkg/errors is no longer maintained
5662
errcheck:
5763
# Report about not checking of errors in type assertions: `a := b.(MyStruct)`.
5864
# Such cases aren't reported by default.

Makefile

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
FABRIC_VERSION ?= 3.1.1
33
FABRIC_CA_VERSION ?= 1.5.7
44
FABRIC_TWO_DIGIT_VERSION = $(shell echo $(FABRIC_VERSION) | cut -d '.' -f 1,2)
5+
FABRIC_X_TOOLS_VERSION ?= v0.0.5
56

67
# need to install fabric binaries outside of fts tree for now (due to chaincode packaging issues)
78
FABRIC_BINARY_BASE=$(PWD)/../fabric
@@ -13,6 +14,15 @@ GINKGO_TEST_OPTS += --keep-going
1314

1415
TOP = .
1516

17+
# include the checks target
18+
include $(TOP)/checks.mk
19+
# include fabricx target
20+
include $(TOP)/fabricx.mk
21+
# include the interop target
22+
include $(TOP)/interop.mk
23+
# include the fungible target
24+
include $(TOP)/fungible.mk
25+
1626
all: install-tools install-softhsm checks unit-tests #integration-tests
1727

1828
.PHONY: install-tools
@@ -26,13 +36,6 @@ install-tools:
2636
download-fabric:
2737
./ci/scripts/download_fabric.sh $(FABRIC_BINARY_BASE) $(FABRIC_VERSION) $(FABRIC_CA_VERSION)
2838

29-
# include the checks target
30-
include $(TOP)/checks.mk
31-
# include the interop target
32-
include $(TOP)/interop.mk
33-
# include the fungible target
34-
include $(TOP)/fungible.mk
35-
3639
.PHONY: unit-tests
3740
unit-tests:
3841
@go test -cover $(shell go list ./... | grep -v '/integration/')
@@ -103,6 +106,7 @@ clean:
103106
docker volume prune -f
104107
rm -rf ./integration/token/fungible/dlog/cmd/
105108
rm -rf ./integration/token/fungible/dlog/testdata/
109+
rm -rf ./integration/token/fungible/dlogx/cmd/
106110
rm -rf ./integration/token/fungible/dloghsm/cmd/
107111
rm -rf ./integration/token/fungible/dloghsm/testdata/
108112
rm -rf ./integration/token/fungible/dlogstress/cmd/

cmd/tokengen/cobra/artifactgen/gen/gen.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ func gen(args []string) error {
119119
if err != nil {
120120
return errors.Wrapf(err, "cannot instantate integration infrastructure")
121121
}
122-
network.RegisterPlatformFactory(token.NewPlatformFactory())
122+
network.RegisterPlatformFactory(token.NewPlatformFactory(nil))
123123
network.Generate()
124124

125125
return nil

fabricx.mk

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
.PHONY: fabricx-docker-images
2+
fabricx-docker-images:
3+
docker pull hyperledger/fabric-x-committer-test-node:0.1.5
4+
5+
.PHONY: fxconfig
6+
fxconfig: ## Install fxconfig
7+
@env GOBIN=$(FAB_BINS) go install $(GO_FLAGS) github.com/hyperledger/fabric-x/tools/fxconfig@$(FABRIC_X_TOOLS_VERSION)
8+
9+
.PHONY: configtxgen
10+
configtxgen: ## Install configtxgen
11+
@env GOBIN=$(FAB_BINS) go install $(GO_FLAGS) github.com/hyperledger/fabric-x/tools/configtxgen@$(FABRIC_X_TOOLS_VERSION)
12+
13+
.PHONY: integration-tests-fabricx-dlog-t1
14+
integration-tests-fabricx-dlog-t1:
15+
make integration-tests-fabricx-dlog TEST_FILTER="T1"
16+
17+
.PHONY: integration-tests-fabricx-dlog
18+
integration-tests-fabricx-dlog:
19+
cd ./integration/token/fungible/dlogx; export FAB_BINS=$(FAB_BINS); ginkgo $(GINKGO_TEST_OPTS) --label-filter="$(TEST_FILTER)" .

go.mod

Lines changed: 24 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module github.com/hyperledger-labs/fabric-token-sdk
22

3-
go 1.24.2
3+
go 1.24.3
44

55
toolchain go1.24.4
66

@@ -9,15 +9,16 @@ require (
99
github.com/IBM/idemix v0.0.2-0.20250313153527-832db18b9478
1010
github.com/IBM/idemix/bccsp/types v0.0.0-20250313153527-832db18b9478
1111
github.com/IBM/mathlib v0.0.3-0.20250709075152-a138079496c3
12-
github.com/dgraph-io/ristretto/v2 v2.2.0
12+
github.com/dgraph-io/ristretto/v2 v2.3.0
1313
github.com/gin-gonic/gin v1.10.0
14-
github.com/gobuffalo/packr/v2 v2.7.1
1514
github.com/hashicorp/go-uuid v1.0.3
16-
github.com/hyperledger-labs/fabric-smart-client v0.5.2
15+
github.com/hyperledger-labs/fabric-smart-client v0.6.0
16+
github.com/hyperledger/fabric v1.4.0-rc1.0.20250510200036-435a7f1a780a
1717
github.com/hyperledger/fabric-chaincode-go/v2 v2.3.0
1818
github.com/hyperledger/fabric-lib-go v1.1.3-0.20240523144151-25edd1eaf5f5
1919
github.com/hyperledger/fabric-protos-go-apiv2 v0.3.7
20-
github.com/jackc/pgx/v5 v5.7.1
20+
github.com/hyperledger/fabric-x-committer v0.1.5
21+
github.com/jackc/pgx/v5 v5.7.6
2122
github.com/mitchellh/mapstructure v1.5.0
2223
github.com/onsi/ginkgo/v2 v2.23.4
2324
github.com/onsi/gomega v1.37.0
@@ -37,7 +38,7 @@ require (
3738
golang.org/x/sync v0.15.0
3839
google.golang.org/protobuf v1.36.6
3940
gopkg.in/yaml.v2 v2.4.0
40-
modernc.org/sqlite v1.33.1
41+
modernc.org/sqlite v1.39.0
4142
)
4243

4344
require (
@@ -49,7 +50,7 @@ require (
4950
cloud.google.com/go/iam v1.2.2 // indirect
5051
cloud.google.com/go/monitoring v1.21.2 // indirect
5152
cloud.google.com/go/storage v1.49.0 // indirect
52-
github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1 // indirect
53+
github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161 // indirect
5354
github.com/BurntSushi/toml v1.4.1-0.20240526193622-a339e1f7089c // indirect
5455
github.com/GoogleCloudPlatform/opentelemetry-operations-go/detectors/gcp v1.26.0 // indirect
5556
github.com/GoogleCloudPlatform/opentelemetry-operations-go/exporter/metric v0.48.1 // indirect
@@ -63,8 +64,8 @@ require (
6364
github.com/benbjohnson/clock v1.3.5 // indirect
6465
github.com/beorn7/perks v1.0.1 // indirect
6566
github.com/bits-and-blooms/bitset v1.20.0 // indirect
66-
github.com/bytedance/sonic v1.11.6 // indirect
67-
github.com/bytedance/sonic/loader v0.1.1 // indirect
67+
github.com/bytedance/sonic v1.12.3 // indirect
68+
github.com/bytedance/sonic/loader v0.2.0 // indirect
6869
github.com/cenkalti/backoff/v4 v4.3.0 // indirect
6970
github.com/cespare/xxhash/v2 v2.3.0 // indirect
7071
github.com/cloudwego/base64x v0.1.4 // indirect
@@ -106,10 +107,10 @@ require (
106107
github.com/go-logr/stdr v1.2.2 // indirect
107108
github.com/go-playground/locales v0.14.1 // indirect
108109
github.com/go-playground/universal-translator v0.18.1 // indirect
109-
github.com/go-playground/validator/v10 v10.20.0 // indirect
110+
github.com/go-playground/validator/v10 v10.22.1 // indirect
110111
github.com/go-task/slim-sprig/v3 v3.0.0 // indirect
111112
github.com/go-viper/mapstructure/v2 v2.4.0 // indirect
112-
github.com/goccy/go-json v0.10.2 // indirect
113+
github.com/goccy/go-json v0.10.3 // indirect
113114
github.com/godbus/dbus/v5 v5.1.0 // indirect
114115
github.com/gogo/googleapis v1.4.1 // indirect
115116
github.com/gogo/protobuf v1.3.2 // indirect
@@ -130,11 +131,10 @@ require (
130131
github.com/hashicorp/errwrap v1.1.0 // indirect
131132
github.com/hashicorp/go-multierror v1.1.1 // indirect
132133
github.com/hashicorp/golang-lru v1.0.2 // indirect
133-
github.com/hashicorp/golang-lru/v2 v2.0.7 // indirect
134134
github.com/huin/goupnp v1.3.0 // indirect
135135
github.com/hyperledger/aries-bbs-go v0.0.0-20240528084656-761671ea73bc // indirect
136-
github.com/hyperledger/fabric v1.4.0-rc1.0.20250510200036-435a7f1a780a // indirect
137136
github.com/hyperledger/fabric-amcl v0.0.0-20230602173724-9e02669dceb2 // indirect
137+
github.com/hyperledger/fabric-x-common v0.0.0-20250917075146-ac37a580bb6e // indirect
138138
github.com/inconshreveable/mousetrap v1.1.0 // indirect
139139
github.com/ipfs/boxo v0.21.0 // indirect
140140
github.com/ipfs/go-cid v0.4.1 // indirect
@@ -182,8 +182,8 @@ require (
182182
github.com/miracl/conflate v1.3.4 // indirect
183183
github.com/moby/docker-image-spec v1.3.1 // indirect
184184
github.com/moby/patternmatcher v0.6.0 // indirect
185-
github.com/moby/sys/sequential v0.5.0 // indirect
186-
github.com/moby/sys/user v0.1.0 // indirect
185+
github.com/moby/sys/sequential v0.6.0 // indirect
186+
github.com/moby/sys/user v0.3.0 // indirect
187187
github.com/moby/sys/userns v0.1.0 // indirect
188188
github.com/moby/term v0.5.0 // indirect
189189
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
@@ -262,7 +262,7 @@ require (
262262
go.opentelemetry.io/auto/sdk v1.1.0 // indirect
263263
go.opentelemetry.io/contrib/detectors/gcp v1.34.0 // indirect
264264
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.54.0 // indirect
265-
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.54.0 // indirect
265+
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.59.0 // indirect
266266
go.opentelemetry.io/otel v1.34.0 // indirect
267267
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.29.0 // indirect
268268
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.28.0 // indirect
@@ -276,15 +276,15 @@ require (
276276
go.uber.org/fx v1.23.0 // indirect
277277
go.uber.org/mock v0.5.0 // indirect
278278
go.uber.org/multierr v1.11.0 // indirect
279-
golang.org/x/arch v0.8.0 // indirect
280-
golang.org/x/exp v0.0.0-20241009180824-f66d83c29e7c // indirect
279+
golang.org/x/arch v0.11.0 // indirect
280+
golang.org/x/exp v0.0.0-20250620022241-b7579e27df2b // indirect
281281
golang.org/x/mod v0.25.0 // indirect
282-
golang.org/x/net v0.40.0 // indirect
282+
golang.org/x/net v0.41.0 // indirect
283283
golang.org/x/oauth2 v0.27.0 // indirect
284-
golang.org/x/sys v0.33.0 // indirect
284+
golang.org/x/sys v0.35.0 // indirect
285285
golang.org/x/text v0.26.0 // indirect
286286
golang.org/x/time v0.8.0 // indirect
287-
golang.org/x/tools v0.33.0 // indirect
287+
golang.org/x/tools v0.34.0 // indirect
288288
gonum.org/v1/gonum v0.15.0 // indirect
289289
google.golang.org/api v0.215.0 // indirect
290290
google.golang.org/genproto v0.0.0-20241118233622-e639e219e697 // indirect
@@ -293,10 +293,7 @@ require (
293293
google.golang.org/grpc v1.72.0 // indirect
294294
gopkg.in/yaml.v3 v3.0.1 // indirect
295295
lukechampine.com/blake3 v1.3.0 // indirect
296-
modernc.org/gc/v3 v3.0.0-20240107210532-573471604cb6 // indirect
297-
modernc.org/libc v1.55.3 // indirect
298-
modernc.org/mathutil v1.6.0 // indirect
299-
modernc.org/memory v1.8.0 // indirect
300-
modernc.org/strutil v1.2.0 // indirect
301-
modernc.org/token v1.1.0 // indirect
296+
modernc.org/libc v1.66.3 // indirect
297+
modernc.org/mathutil v1.7.1 // indirect
298+
modernc.org/memory v1.11.0 // indirect
302299
)

0 commit comments

Comments
 (0)