-
Notifications
You must be signed in to change notification settings - Fork 2
/
config.go
47 lines (41 loc) · 1.1 KB
/
config.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
/*
Copyright SecureKey Technologies Inc. All Rights Reserved.
SPDX-License-Identifier: Apache-2.0
*/
package api
import (
"crypto/x509"
"time"
"github.com/hyperledger/fabric-sdk-go/pkg/common/errors/retry"
"github.com/securekey/fabric-snaps/util/errors"
"github.com/spf13/viper"
)
// Config configuration interface
type Config interface {
GetLocalPeer() (*PeerConfig, errors.Error)
GetMspID() string
GetMspConfigPath() string
GetTLSRootCertPath() string
GetTLSRootCert() *x509.Certificate
GetTLSCertPath() string
GetTLSCert() *x509.Certificate
GetTLSCertPem() []byte
GetTLSKeyPath() string
GetConfigPath(path string) string
GetPeerConfig() *viper.Viper
GetConfigBytes() []byte
GetCryptoProvider() (string, errors.Error)
GetEndorserSelectionMaxAttempts() int
GetEndorserSelectionInterval() time.Duration
RetryOpts() retry.Opts
CCErrorRetryableCodes() ([]int32, errors.Error)
GetClientCacheRefreshInterval() time.Duration
}
// PeerConfig represents the server addresses of a fabric peer
type PeerConfig struct {
Host string
Port int
EventHost string
EventPort int
MSPid []byte
}