-
Notifications
You must be signed in to change notification settings - Fork 507
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Change-Id: Iaa9bd6dd64c854124c040205f0f3c37cdcd308e7 Signed-off-by: Sandra Vrtikapa <[email protected]>
- Loading branch information
Showing
50 changed files
with
2,159 additions
and
472 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
/* | ||
Copyright SecureKey Technologies Inc. All Rights Reserved. | ||
SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
package apifabclient | ||
|
||
import "github.com/hyperledger/fabric-sdk-go/third_party/github.com/hyperledger/fabric/bccsp" | ||
|
||
// SigningIdentity is the identity object that encapsulates the user's private key for signing | ||
// and the user's enrollment certificate (identity) | ||
type SigningIdentity struct { | ||
MspID string | ||
EnrollmentCert []byte | ||
PrivateKey bccsp.Key | ||
} | ||
|
||
// CredentialManager retrieves user's signing identity | ||
type CredentialManager interface { | ||
GetSigningIdentity(name string) (*SigningIdentity, error) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
/* | ||
Copyright SecureKey Technologies Inc. All Rights Reserved. | ||
SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
package apifabclient | ||
|
||
// DiscoveryProvider is used to discover peers on the network | ||
type DiscoveryProvider interface { | ||
NewDiscoveryService(channel Channel) (DiscoveryService, error) | ||
} | ||
|
||
// DiscoveryService is used to discover eligible peers on specific channel | ||
type DiscoveryService interface { | ||
GetPeers(chaincodeID string) ([]Peer, error) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
/* | ||
Copyright SecureKey Technologies Inc. All Rights Reserved. | ||
SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
package apifabclient | ||
|
||
import "github.com/hyperledger/fabric-sdk-go/third_party/github.com/hyperledger/fabric/bccsp" | ||
|
||
// SigningManager signs object with provided key | ||
type SigningManager interface { | ||
Sign([]byte, bccsp.Key) ([]byte, error) | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,105 @@ | ||
/* | ||
Copyright SecureKey Technologies Inc. All Rights Reserved. | ||
SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
package apitxn | ||
|
||
import "time" | ||
|
||
// QueryRequest contains the parameters for query | ||
type QueryRequest struct { | ||
ChaincodeID string | ||
Fcn string | ||
Args [][]byte | ||
} | ||
|
||
// QueryOpts allows the user to specify more advanced options | ||
type QueryOpts struct { | ||
Notifier chan QueryResponse // async | ||
ProposalProcessors []ProposalProcessor // targets | ||
Timeout time.Duration | ||
} | ||
|
||
// QueryResponse contains result of asynchronous call | ||
type QueryResponse struct { | ||
Response []byte | ||
Error error | ||
} | ||
|
||
// ExecuteTxResponse contains result of asynchronous call | ||
type ExecuteTxResponse struct { | ||
Response TransactionID | ||
Error error | ||
} | ||
|
||
// ExecuteTxRequest contains the parameters to execute transaction | ||
type ExecuteTxRequest struct { | ||
ChaincodeID string | ||
Fcn string | ||
Args [][]byte | ||
TransientMap map[string][]byte | ||
} | ||
|
||
// ExecuteTxOpts allows the user to specify more advanced options | ||
type ExecuteTxOpts struct { | ||
Notifier chan ExecuteTxResponse // async | ||
TxFilter ExecuteTxFilter | ||
Timeout time.Duration | ||
} | ||
|
||
// ExecuteTxFilter allows the user to inspect/modify response before commit | ||
type ExecuteTxFilter interface { | ||
// process transaction proposal response (there will be no commit if an error is returned) | ||
ProcessTxProposalResponse(txProposalResponse []*TransactionProposalResponse) ([]*TransactionProposalResponse, error) | ||
} | ||
|
||
// Registration is a handle that is returned from a successful Register Chaincode Event. | ||
// This handle should be used in Unregister in order to unregister the event. | ||
type Registration interface { | ||
} | ||
|
||
// CCEvent contains the data for a chaincocde event | ||
type CCEvent struct { | ||
TxID string | ||
ChaincodeID string | ||
EventName string | ||
Payload []byte | ||
} | ||
|
||
// ChannelClient ... | ||
/* | ||
* A channel client instance provides a handler to interact with peers on specified channel. | ||
* An application that requires interaction with multiple channels should create a separate | ||
* instance of the channel client for each channel. Channel client supports non-admin functions only. | ||
* | ||
* Each Client instance maintains {@link Channel} instance representing channel and the associated | ||
* private ledgers. | ||
* | ||
*/ | ||
type ChannelClient interface { | ||
|
||
// Query chaincode | ||
Query(request QueryRequest) ([]byte, error) | ||
|
||
// QueryWithOpts allows the user to provide options for query (sync vs async, etc.) | ||
QueryWithOpts(request QueryRequest, opt QueryOpts) ([]byte, error) | ||
|
||
// ExecuteTx execute transaction | ||
ExecuteTx(request ExecuteTxRequest) (TransactionID, error) | ||
|
||
// ExecuteTxWithOpts allows the user to provide options for transaction execution (sync vs async, etc.) | ||
ExecuteTxWithOpts(request ExecuteTxRequest, opt ExecuteTxOpts) (TransactionID, error) | ||
|
||
// RegisterChaincodeEvent registers chain code event | ||
// @param {chan bool} channel which receives event details when the event is complete | ||
// @returns {object} object handle that should be used to unregister | ||
RegisterChaincodeEvent(notify chan<- *CCEvent, chainCodeID string, eventID string) Registration | ||
|
||
// UnregisterChaincodeEvent unregisters chain code event | ||
UnregisterChaincodeEvent(registration Registration) error | ||
|
||
// Close releases channel client resources (disconnects event hub etc.) | ||
Close() error | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.