Documentation
¶
Index ¶
- Variables
- func BytesToBigInt(in []byte) *big.Int
- func Dec2HexStr(dec string) string
- func Float2Wei(f float64) *big.Int
- func GetAddressFromKeystore(ksBytes []byte) (string, error)
- func GetClientTlsConfig() *tls.Config
- func GetClientTlsOption() grpc.DialOption
- func GetClientTlsOptionPermissive() grpc.DialOption
- func GetTokenAddr(tokenInfo *entity.TokenInfo) ctype.Addr
- func GetTokenAddrStr(tokenInfo *entity.TokenInfo) string
- func GetTokenInfoFromAddress(tkaddr ctype.Addr) *entity.TokenInfo
- func GetTsAndSig(sign func([]byte) []byte) (ts uint64, sig []byte)
- func Hex2DecStr(hex string) string
- func HttpPost(url string, input interface{}) ([]byte, error)
- func IsLoopbackTarget(target string) bool
- func IsPermissiveClientTLS() bool
- func NewOnChainCompatibleSigner(signer eth.Signer) eth.Signer
- func Pad(origin []byte, n int) []byte
- func PbToJSONHexBytes(pb proto.Message) (string, error)
- func PbToJSONString(pb proto.Message) (string, error)
- func PrintAccountAmtPair(pair *entity.AccountAmtPair) string
- func PrintByteArrays(array [][]byte) string
- func PrintChannelInitializer(initializer *entity.PaymentChannelInitializer) string
- func PrintCondition(cond *entity.Condition) string
- func PrintConditionalPay(pay *entity.ConditionalPay) string
- func PrintConditions(conds []*entity.Condition) string
- func PrintCooperativeWithdrawInfo(withdrawal *entity.CooperativeWithdrawInfo) string
- func PrintPayIdList(paylist *entity.PayIdList) string
- func PrintPayPath(payPath *rpc.PayPath, payID ctype.PayIDType) string
- func PrintRoutingUpdate(update *rpc.RoutingUpdate) string
- func PrintSimplexChannel(simplex *entity.SimplexPaymentChannel) string
- func PrintToken(tokenInfo *entity.TokenInfo) string
- func PrintTokenAddr(tkaddr ctype.Addr) string
- func PrintTokenDistribution(dist *entity.TokenDistribution) string
- func PrintTokenInfo(token *entity.TokenInfo) string
- func PrintTokenTransfer(transfer *entity.TokenTransfer) string
- func PrintTransferFunc(transfer *entity.TransferFunction) string
- func QueryDeposit(adminHostPort string, depositID string) (*rpc.QueryDepositResponse, error)
- func QueryPeerOsps(adminHostPort string) (*rpc.PeerOspsResponse, error)
- func RecvRoutingInfo(adminHostPort string, info *rpc.RoutingRequest) error
- func RequestBuildRoutingTable(adminHostPort string, tokenAddr ctype.Addr) error
- func RequestDeposit(adminHostPort string, peerAddr, tokenAddr ctype.Addr, amount *big.Int, ...) (string, error)
- func RequestOpenChannel(adminHostPort string, peerAddr, tokenAddr ctype.Addr, ...) error
- func RequestRegisterStream(adminHostPort string, peerAddr ctype.Addr, peerHostPort string) error
- func RequestSendToken(adminHostPort string, receiver, tokenAddr ctype.Addr, amount *big.Int, ...) (ctype.PayIDType, error)
- func RequestSendTokenWithNote(adminHostPort string, receiver, tokenAddr ctype.Addr, amount *big.Int, ...) (ctype.PayIDType, error)
- func TryLock(m *sync.Mutex) bool
- func Uint64ToBytes(i uint64) []byte
- func UnmarshalDelegationDescription(proof *rpc.DelegationProof) (*rpc.DelegationDescription, error)
- func ValidateAndFormatAddress(address string) (ctype.Addr, error)
- func Wei2BigInt(wei string) *big.Int
- func WrapLocalTLSDialError(target string, err error) error
Constants ¶
This section is empty.
Variables ¶
var CelerCA = []byte(`-----BEGIN CERTIFICATE-----
MIIE5DCCAsygAwIBAgIBATANBgkqhkiG9w0BAQsFADASMRAwDgYDVQQDEwdDZWxl
ckNBMB4XDTE5MDkxNzIwMTEyNFoXDTI5MDkxNzIwMTEyNFowEjEQMA4GA1UEAxMH
Q2VsZXJDQTCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBAJMk0gwPrlv/
/8aVaKAoURvPMHEgpDyj8c08A55kjNlStgjtpBpBEfNiLg3nIBeyrrmt/9QXLexD
RxewLgm/9uUB/U1Q4ZBQdAdsSHTyU+wap1HKJ7GX1jhZMjY95vIfTbrSIbo2clym
zKlbwvvBlNYgweHz0YiyWUCsqi2wH++ybUNzmgs0qI+lE/Fg4k8sReVcix5rUvNF
na9tpvGdV9u+iZNlwkeb3Hp9Ank5MR0830LzG2uf95p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OuWfBuWD77selYHU/PhlzNVq2bSWHDQlQJoQr12dGk0NiYAf0FtTWRQoMkq
nwCu157ZSeK2bWffJUcLnTFV63ftZmsqEjYHHVQrbthc+LBpTT4ZYOBerEfQfoKi
c6Z63v4v3R9WB5VYZWH7nh+lMJBPhhL1043iN4Be3Z27GJ0jKIPQAL2gfNiukuz/
D/qaayaXjbo=
-----END CERTIFICATE-----`)
CelerCA root CA file, generated via certstrap new CA file w/ 10yr expiration
var ErrHttpReponse = errors.New("http response error")
Functions ¶
func BytesToBigInt ¶
func GetAddressFromKeystore ¶
func GetClientTlsConfig ¶
GetClientTlsConfig returns tls.Config with system and celerCA, for https interaction
func GetClientTlsOption ¶
func GetClientTlsOption() grpc.DialOption
use for celer client dialing celer server/proxy support os ca and celer ca
func GetClientTlsOptionPermissive ¶
func GetClientTlsOptionPermissive() grpc.DialOption
GetClientTlsOptionPermissive returns insecure transport credentials when the environment variable CELER_INSECURE_TLS is set ("1"/"true"). This is useful for local e2e tests where the server uses a self-signed localhost certificate that may not chain to CAs available to the client.
func GetTokenAddr ¶
GetTokenAddr returns token address
func GetTokenAddrStr ¶
GetTokenAddrStr returns string for tokenInfo
func GetTokenInfoFromAddress ¶
GetTokenInfoFromAddress returns TokenInfo from tkaddr only support ERC20 for now
func GetTsAndSig ¶
GetTsAndSig returns current time and signature of current time using sign param passed in.
func IsLoopbackTarget ¶ added in v1.1.0
func IsPermissiveClientTLS ¶ added in v1.1.0
func IsPermissiveClientTLS() bool
func NewOnChainCompatibleSigner ¶ added in v1.1.0
func PbToJSONHexBytes ¶
PbToJSONHexBytes historically used a custom marshaler to render bytes in hex. It is now log-only and uses the same tolerant JSON path as PbToJSONString.
func PbToJSONString ¶
PbToJSONString marshals a protobuf msg to json string.
This is primarily used for logging/debugging; it is intentionally tolerant of unknown google.protobuf.Any type URLs by falling back to an opaque base64-encoded representation.
func PrintAccountAmtPair ¶
func PrintAccountAmtPair(pair *entity.AccountAmtPair) string
func PrintByteArrays ¶
func PrintChannelInitializer ¶
func PrintChannelInitializer(initializer *entity.PaymentChannelInitializer) string
func PrintCondition ¶
func PrintConditionalPay ¶
func PrintConditionalPay(pay *entity.ConditionalPay) string
func PrintConditions ¶
func PrintCooperativeWithdrawInfo ¶
func PrintCooperativeWithdrawInfo(withdrawal *entity.CooperativeWithdrawInfo) string
func PrintPayIdList ¶
func PrintRoutingUpdate ¶
func PrintRoutingUpdate(update *rpc.RoutingUpdate) string
func PrintSimplexChannel ¶
func PrintSimplexChannel(simplex *entity.SimplexPaymentChannel) string
func PrintToken ¶
func PrintTokenAddr ¶
func PrintTokenDistribution ¶
func PrintTokenDistribution(dist *entity.TokenDistribution) string
func PrintTokenInfo ¶
func PrintTokenTransfer ¶
func PrintTokenTransfer(transfer *entity.TokenTransfer) string
func PrintTransferFunc ¶
func PrintTransferFunc(transfer *entity.TransferFunction) string
func QueryDeposit ¶
func QueryDeposit(adminHostPort string, depositID string) (*rpc.QueryDepositResponse, error)
func QueryPeerOsps ¶
func QueryPeerOsps(adminHostPort string) (*rpc.PeerOspsResponse, error)
func RecvRoutingInfo ¶
func RecvRoutingInfo(adminHostPort string, info *rpc.RoutingRequest) error
HTTP request to send the routing info to the listener/routing server.
func RequestDeposit ¶
func RequestOpenChannel ¶
func RequestRegisterStream ¶
func RequestSendToken ¶
func Uint64ToBytes ¶
Uint64ToBytes converts uint to bytes in big-endian order.
func UnmarshalDelegationDescription ¶
func UnmarshalDelegationDescription(proof *rpc.DelegationProof) (*rpc.DelegationDescription, error)
func WrapLocalTLSDialError ¶ added in v1.1.0
Types ¶
This section is empty.