client

package
v0.2.0-fix-1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 18, 2023 License: GPL-3.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GreenfieldChainSignClient

type GreenfieldChainSignClient struct {
	// contains filtered or unexported fields
}

GreenfieldChainSignClient the greenfield chain client

func NewGreenfieldChainSignClient

func NewGreenfieldChainSignClient(rpcAddr, chainID string, gasLimit uint64, operatorPrivateKey, fundingPrivateKey,
	sealPrivateKey, approvalPrivateKey string, gcPrivateKey string) (*GreenfieldChainSignClient, error)

NewGreenfieldChainSignClient return the GreenfieldChainSignClient instance

func (*GreenfieldChainSignClient) DiscontinueBucket added in v0.2.0

func (client *GreenfieldChainSignClient) DiscontinueBucket(ctx context.Context, scope SignType, discontinueBucket *storagetypes.MsgDiscontinueBucket) ([]byte, error)

DiscontinueBucket stops serving the bucket on the greenfield chain.

func (*GreenfieldChainSignClient) GetAddr

func (client *GreenfieldChainSignClient) GetAddr(scope SignType) (sdk.AccAddress, error)

GetAddr returns the public address of the private key.

func (*GreenfieldChainSignClient) SealObject

func (client *GreenfieldChainSignClient) SealObject(ctx context.Context, scope SignType, sealObject *storagetypes.MsgSealObject) ([]byte, error)

SealObject seal the object on the greenfield chain.

func (*GreenfieldChainSignClient) Sign

func (client *GreenfieldChainSignClient) Sign(scope SignType, msg []byte) ([]byte, error)

Sign returns a msg signature signed by private key.

func (*GreenfieldChainSignClient) VerifySignature

func (client *GreenfieldChainSignClient) VerifySignature(scope SignType, msg, sig []byte) bool

VerifySignature verifies the signature.

type SignType

type SignType string

SignType is the type of msg signature

const (
	// SignOperator is the type of signature signed by the operator account
	SignOperator SignType = "operator"

	// SignFunding is the type of signature signed by the funding account
	SignFunding SignType = "funding"

	// SignSeal is the type of signature signed by the seal account
	SignSeal SignType = "seal"

	// SignApproval is the type of signature signed by the approval account
	SignApproval SignType = "approval"

	// SignGc is the type of signature signed by the gc account
	SignGc SignType = "gc"
)

type SignerClient

type SignerClient struct {
	// contains filtered or unexported fields
}

func NewSignerClient

func NewSignerClient(address string) (*SignerClient, error)

func (*SignerClient) Close

func (client *SignerClient) Close() error

func (*SignerClient) DiscontinueBucketOnChain added in v0.2.0

func (client *SignerClient) DiscontinueBucketOnChain(ctx context.Context,
	discontinueBucket *storagetypes.MsgDiscontinueBucket, opts ...grpc.CallOption) ([]byte, error)

func (*SignerClient) SealObjectOnChain

func (client *SignerClient) SealObjectOnChain(ctx context.Context,
	sealObject *storagetypes.MsgSealObject, opts ...grpc.CallOption) ([]byte, error)

func (*SignerClient) SignBucketApproval

func (client *SignerClient) SignBucketApproval(ctx context.Context,
	msg *storagetypes.MsgCreateBucket, opts ...grpc.CallOption) ([]byte, error)

func (*SignerClient) SignIntegrityHash

func (client *SignerClient) SignIntegrityHash(ctx context.Context,
	objectID uint64,
	checksum [][]byte, opts ...grpc.CallOption,
) ([]byte, []byte, error)

func (*SignerClient) SignObjectApproval

func (client *SignerClient) SignObjectApproval(ctx context.Context,
	msg *storagetypes.MsgCreateObject, opts ...grpc.CallOption) ([]byte, error)

func (*SignerClient) SignPingMsg

func (client *SignerClient) SignPingMsg(ctx context.Context, ping *p2ptpyes.Ping, opts ...grpc.CallOption) (*p2ptpyes.Ping, error)

func (*SignerClient) SignPongMsg

func (client *SignerClient) SignPongMsg(ctx context.Context, pong *p2ptpyes.Pong, opts ...grpc.CallOption) (*p2ptpyes.Pong, error)

func (*SignerClient) SignReplicateApprovalReqMsg

func (client *SignerClient) SignReplicateApprovalReqMsg(ctx context.Context, approval *p2ptpyes.GetApprovalRequest, opts ...grpc.CallOption) (*p2ptpyes.GetApprovalRequest, error)

func (*SignerClient) SignReplicateApprovalRspMsg

func (client *SignerClient) SignReplicateApprovalRspMsg(ctx context.Context, approval *p2ptpyes.GetApprovalResponse, opts ...grpc.CallOption) (*p2ptpyes.GetApprovalResponse, error)

func (*SignerClient) VerifyBucketApproval

func (client *SignerClient) VerifyBucketApproval(ctx context.Context,
	msg *storagetypes.MsgCreateBucket, opts ...grpc.CallOption) (bool, error)

func (*SignerClient) VerifyObjectApproval

func (client *SignerClient) VerifyObjectApproval(ctx context.Context,
	msg *storagetypes.MsgCreateObject, opts ...grpc.CallOption) (bool, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL