proto

package
v0.0.0-...-6bb3ed1 Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Node_Handshake_FullMethodName         = "/Node/Handshake"
	Node_HandleTransaction_FullMethodName = "/Node/HandleTransaction"
)

Variables

View Source
var File_proto_types_proto protoreflect.FileDescriptor
View Source
var Node_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "Node",
	HandlerType: (*NodeServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Handshake",
			Handler:    _Node_Handshake_Handler,
		},
		{
			MethodName: "HandleTransaction",
			Handler:    _Node_HandleTransaction_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "proto/types.proto",
}

Node_ServiceDesc is the grpc.ServiceDesc for Node service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)

Functions

func RegisterNodeServer

func RegisterNodeServer(s grpc.ServiceRegistrar, srv NodeServer)

Types

type Ack

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

func (*Ack) Descriptor deprecated

func (*Ack) Descriptor() ([]byte, []int)

Deprecated: Use Ack.ProtoReflect.Descriptor instead.

func (*Ack) ProtoMessage

func (*Ack) ProtoMessage()

func (*Ack) ProtoReflect

func (x *Ack) ProtoReflect() protoreflect.Message

func (*Ack) Reset

func (x *Ack) Reset()

func (*Ack) String

func (x *Ack) String() string

type Block

type Block struct {
	Header       *Header        `protobuf:"bytes,1,opt,name=header,proto3" json:"header,omitempty"`
	Transactions []*Transaction `protobuf:"bytes,2,rep,name=transactions,proto3" json:"transactions,omitempty"`
	PublicKey    []byte         `protobuf:"bytes,3,opt,name=publicKey,proto3" json:"publicKey,omitempty"`
	Signature    []byte         `protobuf:"bytes,4,opt,name=signature,proto3" json:"signature,omitempty"`
	// contains filtered or unexported fields
}

func (*Block) Descriptor deprecated

func (*Block) Descriptor() ([]byte, []int)

Deprecated: Use Block.ProtoReflect.Descriptor instead.

func (*Block) GetHeader

func (x *Block) GetHeader() *Header

func (*Block) GetPublicKey

func (x *Block) GetPublicKey() []byte

func (*Block) GetSignature

func (x *Block) GetSignature() []byte

func (*Block) GetTransactions

func (x *Block) GetTransactions() []*Transaction

func (*Block) ProtoMessage

func (*Block) ProtoMessage()

func (*Block) ProtoReflect

func (x *Block) ProtoReflect() protoreflect.Message

func (*Block) Reset

func (x *Block) Reset()

func (*Block) String

func (x *Block) String() string
type Header struct {
	Version   int32  `protobuf:"varint,1,opt,name=version,proto3" json:"version,omitempty"`
	Height    int32  `protobuf:"varint,2,opt,name=height,proto3" json:"height,omitempty"`
	PrvHash   []byte `protobuf:"bytes,3,opt,name=prvHash,proto3" json:"prvHash,omitempty"`
	RootHash  []byte `protobuf:"bytes,4,opt,name=rootHash,proto3" json:"rootHash,omitempty"` // merkle root of txs
	Timestamp int64  `protobuf:"varint,5,opt,name=timestamp,proto3" json:"timestamp,omitempty"`
	// contains filtered or unexported fields
}

func (*Header) Descriptor deprecated

func (*Header) Descriptor() ([]byte, []int)

Deprecated: Use Header.ProtoReflect.Descriptor instead.

func (*Header) GetHeight

func (x *Header) GetHeight() int32

func (*Header) GetPrvHash

func (x *Header) GetPrvHash() []byte

func (*Header) GetRootHash

func (x *Header) GetRootHash() []byte

func (*Header) GetTimestamp

func (x *Header) GetTimestamp() int64

func (*Header) GetVersion

func (x *Header) GetVersion() int32

func (*Header) ProtoMessage

func (*Header) ProtoMessage()

func (*Header) ProtoReflect

func (x *Header) ProtoReflect() protoreflect.Message

func (*Header) Reset

func (x *Header) Reset()

func (*Header) String

func (x *Header) String() string

type NodeClient

type NodeClient interface {
	Handshake(ctx context.Context, in *Version, opts ...grpc.CallOption) (*Version, error)
	HandleTransaction(ctx context.Context, in *Transaction, opts ...grpc.CallOption) (*Ack, error)
}

NodeClient is the client API for Node service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.

func NewNodeClient

func NewNodeClient(cc grpc.ClientConnInterface) NodeClient

type NodeServer

type NodeServer interface {
	Handshake(context.Context, *Version) (*Version, error)
	HandleTransaction(context.Context, *Transaction) (*Ack, error)
	// contains filtered or unexported methods
}

NodeServer is the server API for Node service. All implementations must embed UnimplementedNodeServer for forward compatibility

type None

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

func (*None) Descriptor deprecated

func (*None) Descriptor() ([]byte, []int)

Deprecated: Use None.ProtoReflect.Descriptor instead.

func (*None) ProtoMessage

func (*None) ProtoMessage()

func (*None) ProtoReflect

func (x *None) ProtoReflect() protoreflect.Message

func (*None) Reset

func (x *None) Reset()

func (*None) String

func (x *None) String() string

type Transaction

type Transaction struct {
	Version int32       `protobuf:"varint,1,opt,name=version,proto3" json:"version,omitempty"`
	Inputs  []*TxInput  `protobuf:"bytes,2,rep,name=inputs,proto3" json:"inputs,omitempty"`
	Outputs []*TxOutput `protobuf:"bytes,3,rep,name=outputs,proto3" json:"outputs,omitempty"`
	// contains filtered or unexported fields
}

func (*Transaction) Descriptor deprecated

func (*Transaction) Descriptor() ([]byte, []int)

Deprecated: Use Transaction.ProtoReflect.Descriptor instead.

func (*Transaction) GetInputs

func (x *Transaction) GetInputs() []*TxInput

func (*Transaction) GetOutputs

func (x *Transaction) GetOutputs() []*TxOutput

func (*Transaction) GetVersion

func (x *Transaction) GetVersion() int32

func (*Transaction) ProtoMessage

func (*Transaction) ProtoMessage()

func (*Transaction) ProtoReflect

func (x *Transaction) ProtoReflect() protoreflect.Message

func (*Transaction) Reset

func (x *Transaction) Reset()

func (*Transaction) String

func (x *Transaction) String() string

type TxInput

type TxInput struct {

	// The previous hash of the transaction
	// containing the output we want to spend
	PrvHash []byte `protobuf:"bytes,1,opt,name=prvHash,proto3" json:"prvHash,omitempty"`
	// The index of the output of the previous
	// transaction we want to spend
	PrvOutIndex uint32 `protobuf:"varint,2,opt,name=prvOutIndex,proto3" json:"prvOutIndex,omitempty"`
	PublicKey   []byte `protobuf:"bytes,3,opt,name=publicKey,proto3" json:"publicKey,omitempty"`
	Signature   []byte `protobuf:"bytes,4,opt,name=signature,proto3" json:"signature,omitempty"`
	// contains filtered or unexported fields
}

func (*TxInput) Descriptor deprecated

func (*TxInput) Descriptor() ([]byte, []int)

Deprecated: Use TxInput.ProtoReflect.Descriptor instead.

func (*TxInput) GetPrvHash

func (x *TxInput) GetPrvHash() []byte

func (*TxInput) GetPrvOutIndex

func (x *TxInput) GetPrvOutIndex() uint32

func (*TxInput) GetPublicKey

func (x *TxInput) GetPublicKey() []byte

func (*TxInput) GetSignature

func (x *TxInput) GetSignature() []byte

func (*TxInput) ProtoMessage

func (*TxInput) ProtoMessage()

func (*TxInput) ProtoReflect

func (x *TxInput) ProtoReflect() protoreflect.Message

func (*TxInput) Reset

func (x *TxInput) Reset()

func (*TxInput) String

func (x *TxInput) String() string

type TxOutput

type TxOutput struct {
	Amount  int64  `protobuf:"varint,1,opt,name=amount,proto3" json:"amount,omitempty"`
	Address []byte `protobuf:"bytes,2,opt,name=address,proto3" json:"address,omitempty"`
	// contains filtered or unexported fields
}

func (*TxOutput) Descriptor deprecated

func (*TxOutput) Descriptor() ([]byte, []int)

Deprecated: Use TxOutput.ProtoReflect.Descriptor instead.

func (*TxOutput) GetAddress

func (x *TxOutput) GetAddress() []byte

func (*TxOutput) GetAmount

func (x *TxOutput) GetAmount() int64

func (*TxOutput) ProtoMessage

func (*TxOutput) ProtoMessage()

func (*TxOutput) ProtoReflect

func (x *TxOutput) ProtoReflect() protoreflect.Message

func (*TxOutput) Reset

func (x *TxOutput) Reset()

func (*TxOutput) String

func (x *TxOutput) String() string

type UnimplementedNodeServer

type UnimplementedNodeServer struct {
}

UnimplementedNodeServer must be embedded to have forward compatible implementations.

func (UnimplementedNodeServer) HandleTransaction

func (UnimplementedNodeServer) HandleTransaction(context.Context, *Transaction) (*Ack, error)

func (UnimplementedNodeServer) Handshake

type UnsafeNodeServer

type UnsafeNodeServer interface {
	// contains filtered or unexported methods
}

UnsafeNodeServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to NodeServer will result in compilation errors.

type Version

type Version struct {
	Version    string   `protobuf:"bytes,1,opt,name=version,proto3" json:"version,omitempty"`
	Height     int32    `protobuf:"varint,2,opt,name=height,proto3" json:"height,omitempty"`
	ListenAddr string   `protobuf:"bytes,3,opt,name=listenAddr,proto3" json:"listenAddr,omitempty"`
	PeerList   []string `protobuf:"bytes,4,rep,name=peerList,proto3" json:"peerList,omitempty"`
	// contains filtered or unexported fields
}

func (*Version) Descriptor deprecated

func (*Version) Descriptor() ([]byte, []int)

Deprecated: Use Version.ProtoReflect.Descriptor instead.

func (*Version) GetHeight

func (x *Version) GetHeight() int32

func (*Version) GetListenAddr

func (x *Version) GetListenAddr() string

func (*Version) GetPeerList

func (x *Version) GetPeerList() []string

func (*Version) GetVersion

func (x *Version) GetVersion() string

func (*Version) ProtoMessage

func (*Version) ProtoMessage()

func (*Version) ProtoReflect

func (x *Version) ProtoReflect() protoreflect.Message

func (*Version) Reset

func (x *Version) Reset()

func (*Version) String

func (x *Version) String() string

Jump to

Keyboard shortcuts

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