-
Notifications
You must be signed in to change notification settings - Fork 232
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Database: Add --txIndex
to kaspad
#2103
base: dev
Are you sure you want to change the base?
Changes from 43 commits
3a33c0f
345eaac
c339398
540d77f
d9b5f0e
da7a9dd
02326dc
66809e9
346bd26
463db63
e059e88
b4754d4
560a1a9
09b2c53
600f39f
8bacd2e
edb6962
576a24a
ca01c1f
de5f551
87c5ad0
f7fcffe
11f5a49
9b6c2e3
3b317fc
cc937a2
1593769
06c6706
38e9ab8
e8e57fc
4c9aa95
8f1348b
3c94c86
1b5a236
1aa93d2
325d2fd
7336b2d
d401cac
6f1456c
4ac225c
32205a2
a905e34
22aeb04
1f8fe53
8875d66
231633f
f820acd
735f9c2
d6f0a16
f6d1493
e9f7169
ee09eb5
cdcdfc4
fa5423e
cc05cfa
a2c851f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
package appmessage | ||
|
||
// GetAcceptingBlockOfTxRequestMessage is an appmessage corresponding to | ||
// its respective RPC message | ||
type GetAcceptingBlockOfTxRequestMessage struct { | ||
baseMessage | ||
TxID string | ||
IncludeTransactions bool | ||
} | ||
|
||
// Command returns the protocol command string for the message | ||
func (msg *GetAcceptingBlockOfTxRequestMessage) Command() MessageCommand { | ||
return CmdGetAcceptingBlockOfTxRequestMessage | ||
} | ||
|
||
// NewGetAcceptingBlockOfTxRequest returns a instance of the message | ||
func NewGetAcceptingBlockOfTxRequest(txID string, includeTransactions bool) *GetAcceptingBlockOfTxRequestMessage { | ||
return &GetAcceptingBlockOfTxRequestMessage{ | ||
TxID: txID, | ||
IncludeTransactions: includeTransactions, | ||
} | ||
} | ||
|
||
// GetAcceptingBlockOfTxResponseMessage is an appmessage corresponding to | ||
// its respective RPC message | ||
type GetAcceptingBlockOfTxResponseMessage struct { | ||
baseMessage | ||
Block *RPCBlock | ||
|
||
Error *RPCError | ||
} | ||
|
||
// Command returns the protocol command string for the message | ||
func (msg *GetAcceptingBlockOfTxResponseMessage) Command() MessageCommand { | ||
return CmdGetAcceptingBlockOfTxResponseMessage | ||
} | ||
|
||
// NewGetAcceptingBlockOfTxResponse returns an instance of the message | ||
func NewGetAcceptingBlockOfTxResponse(block *RPCBlock) *GetAcceptingBlockOfTxResponseMessage { | ||
return &GetAcceptingBlockOfTxResponseMessage{ | ||
Block: block, | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
package appmessage | ||
|
||
// GetAcceptingBlockHashOfTxRequestMessage is an appmessage corresponding to | ||
// its respective RPC message | ||
type GetAcceptingBlockHashOfTxRequestMessage struct { | ||
baseMessage | ||
TxID string | ||
} | ||
|
||
// Command returns the protocol command string for the message | ||
func (msg *GetAcceptingBlockHashOfTxRequestMessage) Command() MessageCommand { | ||
return CmdGetAcceptingBlockHashOfTxRequestMessage | ||
} | ||
|
||
// NewGetAcceptingBlockHashOfTxRequest returns a instance of the message | ||
func NewGetAcceptingBlockHashOfTxRequest(txID string) *GetAcceptingBlockHashOfTxRequestMessage { | ||
return &GetAcceptingBlockHashOfTxRequestMessage{ | ||
TxID: txID, | ||
} | ||
} | ||
|
||
// GetAcceptingBlockHashOfTxResponseMessage is an appmessage corresponding to | ||
// its respective RPC message | ||
type GetAcceptingBlockHashOfTxResponseMessage struct { | ||
baseMessage | ||
Hash string | ||
|
||
Error *RPCError | ||
} | ||
|
||
// Command returns the protocol command string for the message | ||
func (msg *GetAcceptingBlockHashOfTxResponseMessage) Command() MessageCommand { | ||
return CmdGetAcceptingBlockHashOfTxResponseMessage | ||
} | ||
|
||
// NewGetAcceptingBlockHashOfTxResponse returns an instance of the message | ||
func NewGetAcceptingBlockHashOfTxResponse(hash string) *GetAcceptingBlockHashOfTxResponseMessage { | ||
return &GetAcceptingBlockHashOfTxResponseMessage{ | ||
Hash: hash, | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
package appmessage | ||
|
||
// TxIDBlockHashPair is an appmessage corresponding to | ||
// its respective RPC message | ||
type TxIDBlockHashPair struct { | ||
TxID string | ||
Hash string | ||
} | ||
|
||
// GetAcceptingBlockHashesOfTxsRequestMessage is an appmessage corresponding to | ||
// its respective RPC message | ||
type GetAcceptingBlockHashesOfTxsRequestMessage struct { | ||
baseMessage | ||
TxIDs []string | ||
} | ||
|
||
// Command returns the protocol command string for the message | ||
func (msg *GetAcceptingBlockHashesOfTxsRequestMessage) Command() MessageCommand { | ||
return CmdGetAcceptingBlockHashesOfTxsRequestMessage | ||
} | ||
|
||
// NewGetAcceptingBlockHashesOfTxsRequest returns a instance of the message | ||
func NewGetAcceptingBlockHashesOfTxsRequest(txIDs []string) *GetAcceptingBlockHashesOfTxsRequestMessage { | ||
return &GetAcceptingBlockHashesOfTxsRequestMessage{ | ||
TxIDs: txIDs, | ||
} | ||
} | ||
|
||
// GetAcceptingBlockHashesOfTxsResponseMessage is an appmessage corresponding to | ||
// its respective RPC message | ||
type GetAcceptingBlockHashesOfTxsResponseMessage struct { | ||
baseMessage | ||
TxIDBlockHashPairs []*TxIDBlockHashPair | ||
|
||
Error *RPCError | ||
} | ||
|
||
// Command returns the protocol command string for the message | ||
func (msg *GetAcceptingBlockHashesOfTxsResponseMessage) Command() MessageCommand { | ||
return CmdGetAcceptingBlockHashesOfTxsResponseMessage | ||
} | ||
|
||
// NewGetAcceptingBlockHashesOfTxsResponse returns an instance of the message | ||
func NewGetAcceptingBlockHashesOfTxsResponse(txIDBlockHashPairs []*TxIDBlockHashPair) *GetAcceptingBlockHashesOfTxsResponseMessage { | ||
return &GetAcceptingBlockHashesOfTxsResponseMessage{ | ||
TxIDBlockHashPairs: txIDBlockHashPairs, | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
package appmessage | ||
|
||
// TxIDBlockPair is an appmessage corresponding to | ||
// its respective RPC message | ||
type TxIDBlockPair struct { | ||
TxID string | ||
Block *RPCBlock | ||
} | ||
|
||
// GetAcceptingBlocksOfTxsRequestMessage is an appmessage corresponding to | ||
// its respective RPC message | ||
type GetAcceptingBlocksOfTxsRequestMessage struct { | ||
baseMessage | ||
TxIDs []string | ||
IncludeTransactions bool | ||
} | ||
|
||
// Command returns the protocol command string for the message | ||
func (msg *GetAcceptingBlocksOfTxsRequestMessage) Command() MessageCommand { | ||
return CmdGetAcceptingBlocksOfTxsRequestMessage | ||
} | ||
|
||
// NewGetAcceptingBlocksOfTxsRequest returns a instance of the message | ||
func NewGetAcceptingBlocksOfTxsRequest(txIDs []string, includeTransactions bool) *GetAcceptingBlocksOfTxsRequestMessage { | ||
return &GetAcceptingBlocksOfTxsRequestMessage{ | ||
TxIDs: txIDs, | ||
IncludeTransactions: includeTransactions, | ||
} | ||
} | ||
|
||
// GetAcceptingBlocksOfTxsResponseMessage is an appmessage corresponding to | ||
// its respective RPC message | ||
type GetAcceptingBlocksOfTxsResponseMessage struct { | ||
baseMessage | ||
TxIDBlockPairs []*TxIDBlockPair | ||
|
||
Error *RPCError | ||
} | ||
|
||
// Command returns the protocol command string for the message | ||
func (msg *GetAcceptingBlocksOfTxsResponseMessage) Command() MessageCommand { | ||
return CmdGetAcceptingBlocksOfTxsResponseMessage | ||
} | ||
|
||
// NewGetAcceptingBlocksOfTxsResponse returns an instance of the message | ||
func NewGetAcceptingBlocksOfTxsResponse(txIDBlockPairs []*TxIDBlockPair) *GetAcceptingBlocksOfTxsResponseMessage { | ||
return &GetAcceptingBlocksOfTxsResponseMessage{ | ||
TxIDBlockPairs: txIDBlockPairs, | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
package appmessage | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I wouldn't expose the including block to the user if it's different between kaspads |
||
|
||
// GetIncludingBlockOfTxRequestMessage is an appmessage corresponding to | ||
// its respective RPC message | ||
type GetIncludingBlockOfTxRequestMessage struct { | ||
baseMessage | ||
TxID string | ||
IncludeTransactions bool | ||
} | ||
|
||
// Command returns the protocol command string for the message | ||
func (msg *GetIncludingBlockOfTxRequestMessage) Command() MessageCommand { | ||
return CmdGetIncludingBlockOfTxRequestMessage | ||
} | ||
|
||
// NewGetIncludingBlockOfTxRequest returns a instance of the message | ||
func NewGetIncludingBlockOfTxRequest(txID string, includeTransactions bool) *GetIncludingBlockOfTxRequestMessage { | ||
return &GetIncludingBlockOfTxRequestMessage{ | ||
TxID: txID, | ||
IncludeTransactions: includeTransactions, | ||
} | ||
} | ||
|
||
// GetIncludingBlockOfTxResponseMessage is an appmessage corresponding to | ||
// its respective RPC message | ||
type GetIncludingBlockOfTxResponseMessage struct { | ||
baseMessage | ||
Block *RPCBlock | ||
|
||
Error *RPCError | ||
} | ||
|
||
// Command returns the protocol command string for the message | ||
func (msg *GetIncludingBlockOfTxResponseMessage) Command() MessageCommand { | ||
return CmdGetIncludingBlockOfTxResponseMessage | ||
} | ||
|
||
// NewGetIncludingBlockOfTxResponse returns an instance of the message | ||
func NewGetIncludingBlockOfTxResponse(block *RPCBlock) *GetIncludingBlockOfTxResponseMessage { | ||
return &GetIncludingBlockOfTxResponseMessage{ | ||
Block: block, | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
package appmessage | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I wouldn't expose the including block to the user if it's different between kaspads. |
||
|
||
// GetIncludingBlockHashOfTxRequestMessage is an appmessage corresponding to | ||
// its respective RPC message | ||
type GetIncludingBlockHashOfTxRequestMessage struct { | ||
baseMessage | ||
TxID string | ||
} | ||
|
||
// Command returns the protocol command string for the message | ||
func (msg *GetIncludingBlockHashOfTxRequestMessage) Command() MessageCommand { | ||
return CmdGetIncludingBlockHashOfTxRequestMessage | ||
} | ||
|
||
// NewGetIncludingBlockHashOfTxRequest returns a instance of the message | ||
func NewGetIncludingBlockHashOfTxRequest(txID string) *GetIncludingBlockHashOfTxRequestMessage { | ||
return &GetIncludingBlockHashOfTxRequestMessage{ | ||
TxID: txID, | ||
} | ||
} | ||
|
||
// GetIncludingBlockHashOfTxResponseMessage is an appmessage corresponding to | ||
// its respective RPC message | ||
type GetIncludingBlockHashOfTxResponseMessage struct { | ||
baseMessage | ||
Hash string | ||
|
||
Error *RPCError | ||
} | ||
|
||
// Command returns the protocol command string for the message | ||
func (msg *GetIncludingBlockHashOfTxResponseMessage) Command() MessageCommand { | ||
return CmdGetIncludingBlockHashOfTxResponseMessage | ||
} | ||
|
||
// NewGetIncludingBlockHashOfTxResponse returns an instance of the message | ||
func NewGetIncludingBlockHashOfTxResponse(hash string) *GetIncludingBlockHashOfTxResponseMessage { | ||
return &GetIncludingBlockHashOfTxResponseMessage{ | ||
Hash: hash, | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
package appmessage | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I wouldn't expose the including block to the user if it's different between kaspads |
||
|
||
// GetIncludingBlockHashesOfTxsRequestMessage is an appmessage corresponding to | ||
// its respective RPC message | ||
type GetIncludingBlockHashesOfTxsRequestMessage struct { | ||
baseMessage | ||
TxIDs []string | ||
} | ||
|
||
// Command returns the protocol command string for the message | ||
func (msg *GetIncludingBlockHashesOfTxsRequestMessage) Command() MessageCommand { | ||
return CmdGetIncludingBlockHashesOfTxsRequestMessage | ||
} | ||
|
||
// NewGetIncludingBlockHashesOfTxsRequest returns a instance of the message | ||
func NewGetIncludingBlockHashesOfTxsRequest(txIDs []string) *GetIncludingBlockHashesOfTxsRequestMessage { | ||
return &GetIncludingBlockHashesOfTxsRequestMessage{ | ||
TxIDs: txIDs, | ||
} | ||
} | ||
|
||
// GetIncludingBlockHashesOfTxsResponseMessage is an appmessage corresponding to | ||
// its respective RPC message | ||
type GetIncludingBlockHashesOfTxsResponseMessage struct { | ||
baseMessage | ||
TxIDBlockHashPairs []*TxIDBlockHashPair | ||
|
||
Error *RPCError | ||
} | ||
|
||
// Command returns the protocol command string for the message | ||
func (msg *GetIncludingBlockHashesOfTxsResponseMessage) Command() MessageCommand { | ||
return CmdGetIncludingBlockHashesOfTxsResponseMessage | ||
} | ||
|
||
// NewGetIncludingBlockHashesOfTxsResponse returns an instance of the message | ||
func NewGetIncludingBlockHashesOfTxsResponse(txIDBlockHashPairs []*TxIDBlockHashPair) *GetIncludingBlockHashesOfTxsResponseMessage { | ||
return &GetIncludingBlockHashesOfTxsResponseMessage{ | ||
TxIDBlockHashPairs: txIDBlockHashPairs, | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not very important, but usually the language we use is "GetTxAcceptingBlock" without any "of"