Skip to content

F split sp #1013

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ docker-images: fabric-docker-images orion-server-images monitoring-docker-images
.PHONY: testing-docker-images
testing-docker-images:
docker pull postgres:16.2-alpine
docker tag postgres:16.2-alpine postgres:latest
docker tag postgres:16.2-alpine fsc.itests/postgres:latest
docker pull hashicorp/vault

.PHONY: fabric-docker-images
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ require (
github.com/gobuffalo/packr/v2 v2.7.1
github.com/hashicorp/go-uuid v1.0.3
github.com/hashicorp/vault/api v1.16.0
github.com/hyperledger-labs/fabric-smart-client v0.4.1-0.20250319152028-b53f202e2b62
github.com/hyperledger-labs/fabric-smart-client v0.4.1-0.20250325161854-c14bfbb172cb
github.com/hyperledger-labs/orion-sdk-go v0.2.10
github.com/hyperledger-labs/orion-server v0.2.10
github.com/hyperledger/fabric v1.4.0-rc1.0.20230405174026-695dd57e01c2
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -1084,8 +1084,8 @@ github.com/hidal-go/hidalgo v0.0.0-20201109092204-05749a6d73df/go.mod h1:bPkrxDl
github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU=
github.com/huin/goupnp v1.3.0 h1:UvLUlWDNpoUdYzb2TCn+MuTWtcjXKSza2n6CBdQ0xXc=
github.com/huin/goupnp v1.3.0/go.mod h1:gnGPsThkYa7bFi/KWmEysQRf48l2dvR5bxr2OFckNX8=
github.com/hyperledger-labs/fabric-smart-client v0.4.1-0.20250319152028-b53f202e2b62 h1:fUK1AxK//9bF8si5AYE6kptAErzn+oWbINndOTfTQTM=
github.com/hyperledger-labs/fabric-smart-client v0.4.1-0.20250319152028-b53f202e2b62/go.mod h1:EdiA1cY2eOOZjqPlutIlFPkueUMMJOxLoiRH5KwOW1c=
github.com/hyperledger-labs/fabric-smart-client v0.4.1-0.20250325161854-c14bfbb172cb h1:vB9h3jS1KFi0RLiQ3OPdKaKjWTA1hZWKOUR+qT205Ko=
github.com/hyperledger-labs/fabric-smart-client v0.4.1-0.20250325161854-c14bfbb172cb/go.mod h1:EdiA1cY2eOOZjqPlutIlFPkueUMMJOxLoiRH5KwOW1c=
github.com/hyperledger-labs/orion-sdk-go v0.2.10 h1:lFgWgxyvngIhWnIqymYGBmtmq9D6uC5d0uLG9cbyh5s=
github.com/hyperledger-labs/orion-sdk-go v0.2.10/go.mod h1:iN2xZB964AqwVJwL+EnwPOs8z1EkMEbbIg/qYeC7gDY=
github.com/hyperledger-labs/orion-server v0.2.10 h1:G4zbQEL5Egk0Oj+TwHCZWdTOLDBHOjaAEvYOT4G7ozw=
Expand Down
19 changes: 18 additions & 1 deletion integration/token/common/sdk/fall/sdk.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,16 @@ import (

"github.com/hyperledger-labs/fabric-smart-client/pkg/node"
dig2 "github.com/hyperledger-labs/fabric-smart-client/platform/common/sdk/dig"
digutils "github.com/hyperledger-labs/fabric-smart-client/platform/common/utils/dig"
fabric2 "github.com/hyperledger-labs/fabric-smart-client/platform/fabric"
"github.com/hyperledger-labs/fabric-smart-client/platform/view/core/id"
"github.com/hyperledger-labs/fabric-smart-client/platform/view/driver"
view3 "github.com/hyperledger-labs/fabric-smart-client/platform/view/services/server/view"
fabtoken "github.com/hyperledger-labs/fabric-token-sdk/token/core/fabtoken/v1/driver"
dlog "github.com/hyperledger-labs/fabric-token-sdk/token/core/zkatdlog/nogh/v1/driver"
tokensdk "github.com/hyperledger-labs/fabric-token-sdk/token/sdk/dig"
"github.com/hyperledger-labs/fabric-token-sdk/token/services/network/fabric"
"go.opentelemetry.io/otel/trace"
"go.uber.org/dig"
)

Expand All @@ -40,5 +46,16 @@ func (p *SDK) Install() error {
return err
}

return p.SDK.Install()
if err := p.SDK.Install(); err != nil {
return err
}

return errors.Join(
digutils.Register[trace.TracerProvider](p.Container()),
digutils.Register[driver.EndpointService](p.Container()),
digutils.Register[view3.IdentityProvider](p.Container()),
digutils.Register[node.ViewManager](p.Container()), // Need to add it as a field in the node
digutils.Register[id.SigService](p.Container()),
digutils.RegisterOptional[*fabric2.NetworkServiceProvider](p.Container()), // GetFabricNetworkService is used by many components
)
}
28 changes: 25 additions & 3 deletions integration/token/common/sdk/fdlog/sdk.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,29 @@ import (
"errors"

"github.com/hyperledger-labs/fabric-smart-client/pkg/node"
dig2 "github.com/hyperledger-labs/fabric-smart-client/platform/common/sdk/dig"
digutils "github.com/hyperledger-labs/fabric-smart-client/platform/common/utils/dig"
fabric2 "github.com/hyperledger-labs/fabric-smart-client/platform/fabric"
"github.com/hyperledger-labs/fabric-smart-client/platform/view/core/id"
"github.com/hyperledger-labs/fabric-smart-client/platform/view/driver"
view3 "github.com/hyperledger-labs/fabric-smart-client/platform/view/services/server/view"
dlog "github.com/hyperledger-labs/fabric-token-sdk/token/core/zkatdlog/nogh/v1/driver"
tokensdk "github.com/hyperledger-labs/fabric-token-sdk/token/sdk/dig"
"github.com/hyperledger-labs/fabric-token-sdk/token/services/network/fabric"
"go.opentelemetry.io/otel/trace"
"go.uber.org/dig"
)

type SDK struct {
*tokensdk.SDK
dig2.SDK
}

func NewSDK(registry node.Registry) *SDK {
return &SDK{SDK: tokensdk.NewSDK(registry)}
return NewFrom(tokensdk.NewSDK(registry))
}

func NewFrom(sdk dig2.SDK) *SDK {
return &SDK{SDK: sdk}
}

func (p *SDK) Install() error {
Expand All @@ -33,5 +44,16 @@ func (p *SDK) Install() error {
return err
}

return p.SDK.Install()
if err := p.SDK.Install(); err != nil {
return err
}

return errors.Join(
digutils.Register[trace.TracerProvider](p.Container()),
digutils.Register[driver.EndpointService](p.Container()),
digutils.Register[view3.IdentityProvider](p.Container()),
digutils.Register[node.ViewManager](p.Container()), // Need to add it as a field in the node
digutils.Register[id.SigService](p.Container()),
digutils.RegisterOptional[*fabric2.NetworkServiceProvider](p.Container()), // GetFabricNetworkService is used by many components
)
}
19 changes: 18 additions & 1 deletion integration/token/common/sdk/ffabtoken/sdk.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,15 @@ import (
"errors"

"github.com/hyperledger-labs/fabric-smart-client/pkg/node"
digutils "github.com/hyperledger-labs/fabric-smart-client/platform/common/utils/dig"
fabric2 "github.com/hyperledger-labs/fabric-smart-client/platform/fabric"
"github.com/hyperledger-labs/fabric-smart-client/platform/view/core/id"
"github.com/hyperledger-labs/fabric-smart-client/platform/view/driver"
view3 "github.com/hyperledger-labs/fabric-smart-client/platform/view/services/server/view"
fabtoken "github.com/hyperledger-labs/fabric-token-sdk/token/core/fabtoken/v1/driver"
tokensdk "github.com/hyperledger-labs/fabric-token-sdk/token/sdk/dig"
"github.com/hyperledger-labs/fabric-token-sdk/token/services/network/fabric"
"go.opentelemetry.io/otel/trace"
"go.uber.org/dig"
)

Expand All @@ -33,5 +39,16 @@ func (p *SDK) Install() error {
return err
}

return p.SDK.Install()
if err := p.SDK.Install(); err != nil {
return err
}

return errors.Join(
digutils.Register[trace.TracerProvider](p.Container()),
digutils.Register[driver.EndpointService](p.Container()),
digutils.Register[view3.IdentityProvider](p.Container()),
digutils.Register[node.ViewManager](p.Container()), // Need to add it as a field in the node
digutils.Register[id.SigService](p.Container()),
digutils.RegisterOptional[*fabric2.NetworkServiceProvider](p.Container()), // GetFabricNetworkService is used by many components
)
}
23 changes: 22 additions & 1 deletion integration/token/common/sdk/fodlog/sdk.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,21 @@ import (
"errors"

"github.com/hyperledger-labs/fabric-smart-client/pkg/node"
digutils "github.com/hyperledger-labs/fabric-smart-client/platform/common/utils/dig"
fabric2 "github.com/hyperledger-labs/fabric-smart-client/platform/fabric"
fabricsdk "github.com/hyperledger-labs/fabric-smart-client/platform/fabric/sdk/dig"
orion2 "github.com/hyperledger-labs/fabric-smart-client/platform/orion"
core2 "github.com/hyperledger-labs/fabric-smart-client/platform/orion/core"
orionsdk "github.com/hyperledger-labs/fabric-smart-client/platform/orion/sdk/dig"
"github.com/hyperledger-labs/fabric-smart-client/platform/view/core/id"
"github.com/hyperledger-labs/fabric-smart-client/platform/view/driver"
viewsdk "github.com/hyperledger-labs/fabric-smart-client/platform/view/sdk/dig"
view3 "github.com/hyperledger-labs/fabric-smart-client/platform/view/services/server/view"
dlog "github.com/hyperledger-labs/fabric-token-sdk/token/core/zkatdlog/nogh/v1/driver"
tokensdk "github.com/hyperledger-labs/fabric-token-sdk/token/sdk/dig"
"github.com/hyperledger-labs/fabric-token-sdk/token/services/network/fabric"
"github.com/hyperledger-labs/fabric-token-sdk/token/services/network/orion"
"go.opentelemetry.io/otel/trace"
"go.uber.org/dig"
)

Expand Down Expand Up @@ -51,5 +59,18 @@ func (p *SDK) Install() error {
return err
}

return p.SDK.Install()
if err := p.SDK.Install(); err != nil {
return err
}

return errors.Join(
digutils.Register[trace.TracerProvider](p.Container()),
digutils.Register[driver.EndpointService](p.Container()),
digutils.Register[view3.IdentityProvider](p.Container()),
digutils.Register[node.ViewManager](p.Container()), // Need to add it as a field in the node
digutils.Register[id.SigService](p.Container()),
digutils.RegisterOptional[*fabric2.NetworkServiceProvider](p.Container()), // GetFabricNetworkService is used by many components
digutils.RegisterOptional[*orion2.NetworkServiceProvider](p.Container()),
digutils.RegisterOptional[*core2.ONSProvider](p.Container()),
)
}
23 changes: 22 additions & 1 deletion integration/token/common/sdk/fofabtoken/sdk.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,21 @@ import (
"errors"

"github.com/hyperledger-labs/fabric-smart-client/pkg/node"
digutils "github.com/hyperledger-labs/fabric-smart-client/platform/common/utils/dig"
fabric2 "github.com/hyperledger-labs/fabric-smart-client/platform/fabric"
fabricsdk "github.com/hyperledger-labs/fabric-smart-client/platform/fabric/sdk/dig"
orion2 "github.com/hyperledger-labs/fabric-smart-client/platform/orion"
core2 "github.com/hyperledger-labs/fabric-smart-client/platform/orion/core"
orionsdk "github.com/hyperledger-labs/fabric-smart-client/platform/orion/sdk/dig"
"github.com/hyperledger-labs/fabric-smart-client/platform/view/core/id"
"github.com/hyperledger-labs/fabric-smart-client/platform/view/driver"
viewsdk "github.com/hyperledger-labs/fabric-smart-client/platform/view/sdk/dig"
view3 "github.com/hyperledger-labs/fabric-smart-client/platform/view/services/server/view"
fabtoken "github.com/hyperledger-labs/fabric-token-sdk/token/core/fabtoken/v1/driver"
tokensdk "github.com/hyperledger-labs/fabric-token-sdk/token/sdk/dig"
"github.com/hyperledger-labs/fabric-token-sdk/token/services/network/fabric"
"github.com/hyperledger-labs/fabric-token-sdk/token/services/network/orion"
"go.opentelemetry.io/otel/trace"
"go.uber.org/dig"
)

Expand Down Expand Up @@ -51,5 +59,18 @@ func (p *SDK) Install() error {
return err
}

return p.SDK.Install()
if err := p.SDK.Install(); err != nil {
return err
}

return errors.Join(
digutils.Register[trace.TracerProvider](p.Container()),
digutils.Register[driver.EndpointService](p.Container()),
digutils.Register[view3.IdentityProvider](p.Container()),
digutils.Register[node.ViewManager](p.Container()), // Need to add it as a field in the node
digutils.Register[id.SigService](p.Container()),
digutils.RegisterOptional[*fabric2.NetworkServiceProvider](p.Container()), // GetFabricNetworkService is used by many components
digutils.RegisterOptional[*orion2.NetworkServiceProvider](p.Container()),
digutils.RegisterOptional[*core2.ONSProvider](p.Container()),
)
}
31 changes: 28 additions & 3 deletions integration/token/common/sdk/odlog/sdk.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,21 +10,33 @@ import (
"errors"

"github.com/hyperledger-labs/fabric-smart-client/pkg/node"
dig2 "github.com/hyperledger-labs/fabric-smart-client/platform/common/sdk/dig"
digutils "github.com/hyperledger-labs/fabric-smart-client/platform/common/utils/dig"
orion2 "github.com/hyperledger-labs/fabric-smart-client/platform/orion"
core2 "github.com/hyperledger-labs/fabric-smart-client/platform/orion/core"
"github.com/hyperledger-labs/fabric-smart-client/platform/orion/driver"
orionsdk "github.com/hyperledger-labs/fabric-smart-client/platform/orion/sdk/dig"
"github.com/hyperledger-labs/fabric-smart-client/platform/view/core/id"
driver2 "github.com/hyperledger-labs/fabric-smart-client/platform/view/driver"
view3 "github.com/hyperledger-labs/fabric-smart-client/platform/view/services/server/view"
dlog "github.com/hyperledger-labs/fabric-token-sdk/token/core/zkatdlog/nogh/v1/driver"
tokensdk "github.com/hyperledger-labs/fabric-token-sdk/token/sdk/dig"
"github.com/hyperledger-labs/fabric-token-sdk/token/services/network/common"
"github.com/hyperledger-labs/fabric-token-sdk/token/services/network/orion"
"go.opentelemetry.io/otel/trace"
"go.uber.org/dig"
)

type SDK struct {
*tokensdk.SDK
dig2.SDK
}

func NewSDK(registry node.Registry) *SDK {
return &SDK{SDK: tokensdk.NewFrom(orionsdk.NewSDK(registry))}
return NewFrom(tokensdk.NewFrom(orionsdk.NewSDK(registry)))
}

func NewFrom(sdk dig2.SDK) *SDK {
return &SDK{SDK: sdk}
}

func (p *SDK) Install() error {
Expand All @@ -45,5 +57,18 @@ func (p *SDK) Install() error {
return err
}

return p.SDK.Install()
if err := p.SDK.Install(); err != nil {
return err
}

return errors.Join(
digutils.Register[trace.TracerProvider](p.Container()),
digutils.Register[driver2.EndpointService](p.Container()),
digutils.Register[view3.IdentityProvider](p.Container()),
digutils.Register[node.ViewManager](p.Container()), // Need to add it as a field in the node
digutils.Register[id.SigService](p.Container()),

digutils.RegisterOptional[*orion2.NetworkServiceProvider](p.Container()),
digutils.RegisterOptional[*core2.ONSProvider](p.Container()),
)
}
22 changes: 21 additions & 1 deletion integration/token/common/sdk/ofabtoken/sdk.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,17 @@ import (
"errors"

"github.com/hyperledger-labs/fabric-smart-client/pkg/node"
digutils "github.com/hyperledger-labs/fabric-smart-client/platform/common/utils/dig"
orion2 "github.com/hyperledger-labs/fabric-smart-client/platform/orion"
core2 "github.com/hyperledger-labs/fabric-smart-client/platform/orion/core"
orionsdk "github.com/hyperledger-labs/fabric-smart-client/platform/orion/sdk/dig"
"github.com/hyperledger-labs/fabric-smart-client/platform/view/core/id"
driver2 "github.com/hyperledger-labs/fabric-smart-client/platform/view/driver"
view3 "github.com/hyperledger-labs/fabric-smart-client/platform/view/services/server/view"
fabtoken "github.com/hyperledger-labs/fabric-token-sdk/token/core/fabtoken/v1/driver"
tokensdk "github.com/hyperledger-labs/fabric-token-sdk/token/sdk/dig"
"github.com/hyperledger-labs/fabric-token-sdk/token/services/network/orion"
"go.opentelemetry.io/otel/trace"
"go.uber.org/dig"
)

Expand All @@ -34,5 +41,18 @@ func (p *SDK) Install() error {
return err
}

return p.SDK.Install()
if err := p.SDK.Install(); err != nil {
return err
}

return errors.Join(
digutils.Register[trace.TracerProvider](p.Container()),
digutils.Register[driver2.EndpointService](p.Container()),
digutils.Register[view3.IdentityProvider](p.Container()),
digutils.Register[node.ViewManager](p.Container()), // Need to add it as a field in the node
digutils.Register[id.SigService](p.Container()),

digutils.RegisterOptional[*orion2.NetworkServiceProvider](p.Container()),
digutils.RegisterOptional[*core2.ONSProvider](p.Container()),
)
}
6 changes: 4 additions & 2 deletions integration/token/fungible/topology/topology.go
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,9 @@ func Topology(opts common.Opts) []api.Topology {
nodeList = fscTopology.ListNodes()
} else {
nodeList = fscTopology.ListNodes()
fscTopology.SetBootstrapNode(fscTopology.AddNodeByName("lib-p2p-bootstrap-node"))
if opts.CommType == fsc.LibP2P {
fscTopology.SetBootstrapNode(fscTopology.AddNodeByName("lib-p2p-bootstrap-node"))
}
}
if !opts.NoAuditor {
tms.AddAuditor(auditor)
Expand Down Expand Up @@ -225,7 +227,7 @@ func Topology(opts common.Opts) []api.Topology {
// additional nodes that are backend specific
if opts.Backend == "orion" {
fscTopology.ListNodes("custodian")[0].AddSDK(opts.SDKs[0])
} else {
} else if opts.CommType == fsc.LibP2P {
fscTopology.ListNodes("lib-p2p-bootstrap-node")[0].AddSDK(opts.SDKs[0])
}

Expand Down
4 changes: 3 additions & 1 deletion token/services/network/fabric/endorsement/approval.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ package endorsement
import (
"time"

"github.com/hyperledger-labs/fabric-smart-client/platform/common/utils"
fabric2 "github.com/hyperledger-labs/fabric-smart-client/platform/fabric"
"github.com/hyperledger-labs/fabric-smart-client/platform/fabric/services/endorser"
"github.com/hyperledger-labs/fabric-smart-client/platform/view/services/hash"
Expand Down Expand Up @@ -39,6 +40,7 @@ type RequestApprovalView struct {

func (r *RequestApprovalView) Call(context view.Context) (interface{}, error) {
_, tx, err := endorser.NewTransaction(
utils.MustGet(fabric2.GetNetworkServiceProvider(context)),
context,
fabric2.WithCreator(r.TxID.Creator),
fabric2.WithNonce(r.TxID.Nonce),
Expand Down Expand Up @@ -114,7 +116,7 @@ func (r *RequestApprovalResponderView) Call(context view.Context) (interface{},
// When the borrower runs the CollectEndorsementsView, at some point, the borrower sends the assembled transaction
// to the approver. Therefore, the approver waits to receive the transaction.
logger.Debugf("Waiting for transaction on context [%s]", context.ID())
tx, err := endorser.ReceiveTransaction(context)
tx, err := endorser.ReceiveTransaction(utils.MustGet(fabric2.GetNetworkServiceProvider(context)), context)
if err != nil {
return nil, errors.WithMessagef(err, "failed to received transaction for approval")
}
Expand Down
14 changes: 7 additions & 7 deletions tools/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,20 @@ require (
github.com/google/addlicense v1.1.1
github.com/gordonklaus/ineffassign v0.1.0
github.com/maxbrunsfeld/counterfeiter/v6 v6.8.1
github.com/onsi/ginkgo/v2 v2.20.2
golang.org/x/tools v0.24.0
google.golang.org/protobuf v1.34.2
github.com/onsi/ginkgo/v2 v2.22.1
golang.org/x/tools v0.28.0
google.golang.org/protobuf v1.35.1
honnef.co/go/tools v0.5.1
)

require (
github.com/BurntSushi/toml v1.4.1-0.20240526193622-a339e1f7089c // indirect
github.com/bmatcuk/doublestar/v4 v4.6.1 // indirect
github.com/go-task/slim-sprig/v3 v3.0.0 // indirect
github.com/google/pprof v0.0.0-20240827171923-fa2c70bbbfe5 // indirect
github.com/google/pprof v0.0.0-20241210010833-40e02aabc2ad // indirect
github.com/stretchr/testify v1.9.0 // indirect
golang.org/x/exp/typeparams v0.0.0-20240823005443-9b4947da3948 // indirect
golang.org/x/mod v0.20.0 // indirect
golang.org/x/sync v0.8.0 // indirect
golang.org/x/text v0.17.0 // indirect
golang.org/x/mod v0.22.0 // indirect
golang.org/x/sync v0.10.0 // indirect
golang.org/x/text v0.21.0 // indirect
)
Loading
Loading