diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml index 7c8d1b23c..98bc1ef2b 100644 --- a/.github/workflows/deploy.yaml +++ b/.github/workflows/deploy.yaml @@ -32,8 +32,8 @@ jobs: # `-s -w` strips the binary to produce smaller size binaries run: | go build -v -ldflags="-s -w -extldflags=-static" -tags netgo,osusergo -o ./bin/ . ./cmd/... - archive="bin/kaspad-${{ github.event.release.tag_name }}-linux.zip" - asset_name="kaspad-${{ github.event.release.tag_name }}-linux.zip" + archive="bin/c4exd-${{ github.event.release.tag_name }}-linux.zip" + asset_name="c4exd-${{ github.event.release.tag_name }}-linux.zip" zip -r "${archive}" ./bin/* echo "archive=${archive}" >> $GITHUB_ENV echo "asset_name=${asset_name}" >> $GITHUB_ENV @@ -43,8 +43,8 @@ jobs: shell: bash run: | go build -v -ldflags="-s -w" -o bin/ . ./cmd/... - archive="bin/kaspad-${{ github.event.release.tag_name }}-win64.zip" - asset_name="kaspad-${{ github.event.release.tag_name }}-win64.zip" + archive="bin/c4exd-${{ github.event.release.tag_name }}-win64.zip" + asset_name="c4exd-${{ github.event.release.tag_name }}-win64.zip" powershell "Compress-Archive bin/* \"${archive}\"" echo "archive=${archive}" >> $GITHUB_ENV echo "asset_name=${asset_name}" >> $GITHUB_ENV @@ -53,8 +53,8 @@ jobs: if: runner.os == 'macOS' run: | go build -v -ldflags="-s -w" -o ./bin/ . ./cmd/... - archive="bin/kaspad-${{ github.event.release.tag_name }}-osx.zip" - asset_name="kaspad-${{ github.event.release.tag_name }}-osx.zip" + archive="bin/c4exd-${{ github.event.release.tag_name }}-osx.zip" + asset_name="c4exd-${{ github.event.release.tag_name }}-osx.zip" zip -r "${archive}" ./bin/* echo "archive=${archive}" >> $GITHUB_ENV echo "asset_name=${asset_name}" >> $GITHUB_ENV diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 5338a14bb..11fd508f8 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -65,7 +65,7 @@ jobs: with: fetch-depth: 0 - - name: Install kaspad + - name: Install c4exd run: go install ./... - name: Install golint diff --git a/.gitignore b/.gitignore index fe340c91a..7154aa898 100644 --- a/.gitignore +++ b/.gitignore @@ -2,7 +2,7 @@ *~ # Databases -kaspad.db +c4exd.db *-shm *-wal @@ -19,10 +19,10 @@ kaspad.db *.test # Real binaries, build with `go build .` -kaspad +c4exd cmd/gencerts/gencerts -cmd/kaspactl/kaspactl -cmd/kasminer/kaspaminer +cmd/c4exctl/c4exctl +cmd/kasminer/c4exminer *.exe *.exe~ diff --git a/LICENSE b/LICENSE index 05759ed08..fc7bf256b 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ ISC License -Copyright (c) 2018-2019 The kaspanet developers +Copyright (c) 2018-2019 The c4exnet developers Copyright (c) 2013-2018 The btcsuite developers Copyright (c) 2015-2016 The Decred developers Copyright (c) 2013-2014 Conformal Systems LLC. diff --git a/README.md b/README.md index 4c5e84a67..9170415a5 100644 --- a/README.md +++ b/README.md @@ -3,11 +3,11 @@ Kaspad ==== [![ISC License](http://img.shields.io/badge/license-ISC-blue.svg)](https://choosealicense.com/licenses/isc/) -[![GoDoc](https://img.shields.io/badge/godoc-reference-blue.svg)](http://godoc.org/github.com/c4ei/kaspad) +[![GoDoc](https://img.shields.io/badge/godoc-reference-blue.svg)](http://godoc.org/github.com/c4ei/c4exd) Kaspad is the reference full node Kaspa implementation written in Go (golang). -## What is kaspa +## What is c4ex Kaspa is an attempt at a proof-of-work cryptocurrency with instant confirmations and sub-second block times. It is based on [the PHANTOM protocol](https://eprint.iacr.org/2018/104.pdf), a generalization of Nakamoto consensus. @@ -28,11 +28,11 @@ Go 1.18 or later. $ go version ``` -- Run the following commands to obtain and install kaspad including all dependencies: +- Run the following commands to obtain and install c4exd including all dependencies: ```bash -$ git clone https://github.com/c4ei/kaspad -$ cd kaspad +$ git clone https://github.com/c4ei/c4exd +$ cd c4exd $ go install . ./cmd/... ``` @@ -47,7 +47,7 @@ Kaspad has several configuration options available to tweak how it runs, but all of the basic operations work with zero configuration. ```bash -$ kaspad +$ c4exd ``` ## Discord @@ -58,11 +58,11 @@ Join our discord server using the following link: https://discord.gg/YNYnNN5Pf2 The [integrated github issue tracker](https://github.com/c4ei/yunseokyeol/issues) is used for this project. -Issue priorities may be seen at https://github.com/orgs/kaspanet/projects/4 +Issue priorities may be seen at https://github.com/orgs/c4exnet/projects/4 ## Documentation -The [documentation](https://github.com/kaspanet/docs) is a work-in-progress +The [documentation](https://github.com/c4exnet/docs) is a work-in-progress ## License diff --git a/app/app.go b/app/app.go index 7d740afe8..7a6ed3c09 100644 --- a/app/app.go +++ b/app/app.go @@ -31,17 +31,17 @@ var desiredLimits = &limits.DesiredLimits{ } var serviceDescription = &winservice.ServiceDescription{ - Name: "kaspadsvc", + Name: "c4exdsvc", DisplayName: "Kaspad Service", Description: "Downloads and stays synchronized with the Kaspa blockDAG and " + "provides DAG services to applications.", } -type kaspadApp struct { +type c4exdApp struct { cfg *config.Config } -// StartApp starts the kaspad app, and blocks until it finishes running +// StartApp starts the c4exd app, and blocks until it finishes running func StartApp() error { execenv.Initialize(desiredLimits) @@ -55,7 +55,7 @@ func StartApp() error { defer logger.BackendLog.Close() defer panics.HandlePanic(log, "MAIN", nil) - app := &kaspadApp{cfg: cfg} + app := &c4exdApp{cfg: cfg} // Call serviceMain on Windows to handle running as a service. When // the return isService flag is true, exit now since we ran as a @@ -73,7 +73,7 @@ func StartApp() error { return app.main(nil) } -func (app *kaspadApp) main(startedChan chan<- struct{}) error { +func (app *c4exdApp) main(startedChan chan<- struct{}) error { // Get a channel that will be closed when a shutdown signal has been // triggered either from an OS signal such as SIGINT (Ctrl+C) or from // another subsystem such as the RPC server. @@ -125,12 +125,12 @@ func (app *kaspadApp) main(startedChan chan<- struct{}) error { // Create componentManager and start it. componentManager, err := NewComponentManager(app.cfg, databaseContext, interrupt) if err != nil { - log.Errorf("Unable to start kaspad: %+v", err) + log.Errorf("Unable to start c4exd: %+v", err) return err } defer func() { - log.Infof("Gracefully shutting down kaspad...") + log.Infof("Gracefully shutting down c4exd...") shutdownDone := make(chan struct{}) go func() { diff --git a/app/appmessage/README.md b/app/appmessage/README.md index b4fb112a7..054340efd 100644 --- a/app/appmessage/README.md +++ b/app/appmessage/README.md @@ -5,40 +5,40 @@ wire [![GoDoc](https://img.shields.io/badge/godoc-reference-blue.svg)](http://godoc.org/github.com/c4ei/yunseokyeol/wire) ======= -Package wire implements the kaspa wire protocol. +Package wire implements the c4ex wire protocol. ## Kaspa Message Overview -The kaspa protocol consists of exchanging messages between peers. Each message +The c4ex protocol consists of exchanging messages between peers. Each message is preceded by a header which identifies information about it such as which -kaspa network it is a part of, its type, how big it is, and a checksum to +c4ex network it is a part of, its type, how big it is, and a checksum to verify validity. All encoding and decoding of message headers is handled by this package. -To accomplish this, there is a generic interface for kaspa messages named +To accomplish this, there is a generic interface for c4ex messages named `Message` which allows messages of any type to be read, written, or passed around through channels, functions, etc. In addition, concrete implementations -of most all kaspa messages are provided. All of the details of marshalling and -unmarshalling to and from the wire using kaspa encoding are handled so the +of most all c4ex messages are provided. All of the details of marshalling and +unmarshalling to and from the wire using c4ex encoding are handled so the caller doesn't have to concern themselves with the specifics. ## Reading Messages Example -In order to unmarshal kaspa messages from the wire, use the `ReadMessage` +In order to unmarshal c4ex messages from the wire, use the `ReadMessage` function. It accepts any `io.Reader`, but typically this will be a `net.Conn` -to a remote node running a kaspa peer. Example syntax is: +to a remote node running a c4ex peer. Example syntax is: ```Go // Use the most recent protocol version supported by the package and the - // main kaspa network. + // main c4ex network. pver := wire.ProtocolVersion - kaspanet := wire.Mainnet + c4exnet := wire.Mainnet - // Reads and validates the next kaspa message from conn using the - // protocol version pver and the kaspa network kaspanet. The returns + // Reads and validates the next c4ex message from conn using the + // protocol version pver and the c4ex network c4exnet. The returns // are a appmessage.Message, a []byte which contains the unmarshalled // raw payload, and a possible error. - msg, rawPayload, err := wire.ReadMessage(conn, pver, kaspanet) + msg, rawPayload, err := wire.ReadMessage(conn, pver, c4exnet) if err != nil { // Log and handle the error } @@ -48,24 +48,24 @@ See the package documentation for details on determining the message type. ## Writing Messages Example -In order to marshal kaspa messages to the wire, use the `WriteMessage` +In order to marshal c4ex messages to the wire, use the `WriteMessage` function. It accepts any `io.Writer`, but typically this will be a `net.Conn` -to a remote node running a kaspa peer. Example syntax to request addresses +to a remote node running a c4ex peer. Example syntax to request addresses from a remote peer is: ```Go // Use the most recent protocol version supported by the package and the // main bitcoin network. pver := wire.ProtocolVersion - kaspanet := wire.Mainnet + c4exnet := wire.Mainnet - // Create a new getaddr kaspa message. + // Create a new getaddr c4ex message. msg := wire.NewMsgGetAddr() - // Writes a kaspa message msg to conn using the protocol version - // pver, and the kaspa network kaspanet. The return is a possible + // Writes a c4ex message msg to conn using the protocol version + // pver, and the c4ex network c4exnet. The return is a possible // error. - err := wire.WriteMessage(conn, msg, pver, kaspanet) + err := wire.WriteMessage(conn, msg, pver, c4exnet) if err != nil { // Log and handle the error } diff --git a/app/appmessage/common.go b/app/appmessage/common.go index c772b1acd..fcb68d3e6 100644 --- a/app/appmessage/common.go +++ b/app/appmessage/common.go @@ -8,7 +8,7 @@ import ( "github.com/pkg/errors" ) -// MaxInvPerMsg is the maximum number of inventory vectors that can be in any type of kaspa inv message. +// MaxInvPerMsg is the maximum number of inventory vectors that can be in any type of c4ex inv message. const MaxInvPerMsg = 1 << 17 // errNonCanonicalVarInt is the common format string used for non-canonically diff --git a/app/appmessage/doc.go b/app/appmessage/doc.go index 25b329386..4078b6367 100644 --- a/app/appmessage/doc.go +++ b/app/appmessage/doc.go @@ -1,30 +1,30 @@ /* -Package appmessage implements the kaspa appmessage protocol. +Package appmessage implements the c4ex appmessage protocol. At a high level, this package provides support for marshalling and unmarshalling -supported kaspa messages to and from the appmessage. This package does not deal +supported c4ex messages to and from the appmessage. This package does not deal with the specifics of message handling such as what to do when a message is received. This provides the caller with a high level of flexibility. # Kaspa Message Overview -The kaspa protocol consists of exchanging messages between peers. Each +The c4ex protocol consists of exchanging messages between peers. Each message is preceded by a header which identifies information about it such as -which kaspa network it is a part of, its type, how big it is, and a checksum +which c4ex network it is a part of, its type, how big it is, and a checksum to verify validity. All encoding and decoding of message headers is handled by this package. -To accomplish this, there is a generic interface for kaspa messages named +To accomplish this, there is a generic interface for c4ex messages named Message which allows messages of any type to be read, written, or passed around through channels, functions, etc. In addition, concrete implementations of most -of the currently supported kaspa messages are provided. For these supported +of the currently supported c4ex messages are provided. For these supported messages, all of the details of marshalling and unmarshalling to and from the -appmessage using kaspa encoding are handled so the caller doesn't have to concern +appmessage using c4ex encoding are handled so the caller doesn't have to concern themselves with the specifics. # Message Interaction -The following provides a quick summary of how the kaspa messages are intended +The following provides a quick summary of how the c4ex messages are intended to interact with one another. As stated above, these interactions are not directly handled by this package. @@ -48,7 +48,7 @@ interactions in no particular order. # Common Parameters There are several common parameters that arise when using this package to read -and write kaspa messages. The following sections provide a quick overview of +and write c4ex messages. The following sections provide a quick overview of these parameters so the next sections can build on them. # Protocol Version @@ -62,8 +62,8 @@ negotiated. # Kaspa Network -The kaspa network is a magic number which is used to identify the start of a -message and which kaspa network the message applies to. This package provides +The c4ex network is a magic number which is used to identify the start of a +message and which c4ex network the message applies to. This package provides the following constants: appmessage.Mainnet @@ -73,8 +73,8 @@ the following constants: # Determining Message Type -As discussed in the kaspa message overview section, this package reads -and writes kaspa messages using a generic interface named Message. In +As discussed in the c4ex message overview section, this package reads +and writes c4ex messages using a generic interface named Message. In order to determine the actual concrete type of the message, use a type switch or type assertion. An example of a type switch follows: @@ -91,33 +91,33 @@ switch or type assertion. An example of a type switch follows: # Reading Messages -In order to unmarshall kaspa messages from the appmessage, use the ReadMessage +In order to unmarshall c4ex messages from the appmessage, use the ReadMessage function. It accepts any io.Reader, but typically this will be a net.Conn to -a remote node running a kaspa peer. Example syntax is: +a remote node running a c4ex peer. Example syntax is: - // Reads and validates the next kaspa message from conn using the - // protocol version pver and the kaspa network kaspaNet. The returns + // Reads and validates the next c4ex message from conn using the + // protocol version pver and the c4ex network c4exNet. The returns // are a appmessage.Message, a []byte which contains the unmarshalled // raw payload, and a possible error. - msg, rawPayload, err := appmessage.ReadMessage(conn, pver, kaspaNet) + msg, rawPayload, err := appmessage.ReadMessage(conn, pver, c4exNet) if err != nil { // Log and handle the error } # Writing Messages -In order to marshall kaspa messages to the appmessage, use the WriteMessage +In order to marshall c4ex messages to the appmessage, use the WriteMessage function. It accepts any io.Writer, but typically this will be a net.Conn to -a remote node running a kaspa peer. Example syntax to request addresses +a remote node running a c4ex peer. Example syntax to request addresses from a remote peer is: - // Create a new getaddr kaspa message. + // Create a new getaddr c4ex message. msg := appmessage.NewMsgRequestAddresses() - // Writes a kaspa message msg to conn using the protocol version - // pver, and the kaspa network kaspaNet. The return is a possible + // Writes a c4ex message msg to conn using the protocol version + // pver, and the c4ex network c4exNet. The return is a possible // error. - err := appmessage.WriteMessage(conn, msg, pver, kaspaNet) + err := appmessage.WriteMessage(conn, msg, pver, c4exNet) if err != nil { // Log and handle the error } diff --git a/app/appmessage/error.go b/app/appmessage/error.go index 1ec7e1fef..c72f104f8 100644 --- a/app/appmessage/error.go +++ b/app/appmessage/error.go @@ -9,7 +9,7 @@ import ( ) // MessageError describes an issue with a message. -// An example of some potential issues are messages from the wrong kaspa +// An example of some potential issues are messages from the wrong c4ex // network, invalid commands, mismatched checksums, and exceeding max payloads. // // This provides a mechanism for the caller to type assert the error to diff --git a/app/appmessage/message.go b/app/appmessage/message.go index 8f778b117..27a3d8366 100644 --- a/app/appmessage/message.go +++ b/app/appmessage/message.go @@ -27,7 +27,7 @@ func (cmd MessageCommand) String() string { return fmt.Sprintf("%s [code %d]", cmdString, uint8(cmd)) } -// Commands used in kaspa message headers which describe the type of message. +// Commands used in c4ex message headers which describe the type of message. const ( // protocol CmdVersion MessageCommand = iota @@ -302,7 +302,7 @@ var RPCMessageCommandToString = map[MessageCommand]string{ CmdGetCoinSupplyResponseMessage: "GetCoinSupplyResponse", } -// Message is an interface that describes a kaspa message. A type that +// Message is an interface that describes a c4ex message. A type that // implements Message has complete control over the representation of its data // and may therefore contain additional or fewer fields than those which // are used directly in the protocol encoded message. diff --git a/app/appmessage/p2p_blockheaders.go b/app/appmessage/p2p_blockheaders.go index c93e67be9..3deea7fd1 100644 --- a/app/appmessage/p2p_blockheaders.go +++ b/app/appmessage/p2p_blockheaders.go @@ -1,6 +1,6 @@ package appmessage -// BlockHeadersMessage represents a kaspa BlockHeaders message +// BlockHeadersMessage represents a c4ex BlockHeaders message type BlockHeadersMessage struct { baseMessage BlockHeaders []*MsgBlockHeader @@ -11,7 +11,7 @@ func (msg *BlockHeadersMessage) Command() MessageCommand { return CmdBlockHeaders } -// NewBlockHeadersMessage returns a new kaspa BlockHeaders message +// NewBlockHeadersMessage returns a new c4ex BlockHeaders message func NewBlockHeadersMessage(blockHeaders []*MsgBlockHeader) *BlockHeadersMessage { return &BlockHeadersMessage{ BlockHeaders: blockHeaders, diff --git a/app/appmessage/p2p_msgaddresses.go b/app/appmessage/p2p_msgaddresses.go index f9093466e..b517944f5 100644 --- a/app/appmessage/p2p_msgaddresses.go +++ b/app/appmessage/p2p_msgaddresses.go @@ -5,10 +5,10 @@ package appmessage // MaxAddressesPerMsg is the maximum number of addresses that can be in a single -// kaspa Addresses message (MsgAddresses). +// c4ex Addresses message (MsgAddresses). const MaxAddressesPerMsg = 1000 -// MsgAddresses implements the Message interface and represents a kaspa +// MsgAddresses implements the Message interface and represents a c4ex // Addresses message. type MsgAddresses struct { baseMessage @@ -21,7 +21,7 @@ func (msg *MsgAddresses) Command() MessageCommand { return CmdAddresses } -// NewMsgAddresses returns a new kaspa Addresses message that conforms to the +// NewMsgAddresses returns a new c4ex Addresses message that conforms to the // Message interface. See MsgAddresses for details. func NewMsgAddresses(addressList []*NetAddress) *MsgAddresses { return &MsgAddresses{ diff --git a/app/appmessage/p2p_msgblock.go b/app/appmessage/p2p_msgblock.go index 128386ab1..7870e065d 100644 --- a/app/appmessage/p2p_msgblock.go +++ b/app/appmessage/p2p_msgblock.go @@ -22,7 +22,7 @@ type TxLoc struct { TxLen int } -// MsgBlock implements the Message interface and represents a kaspa +// MsgBlock implements the Message interface and represents a c4ex // block message. It is used to deliver block and transaction information in // response to a getdata message (MsgGetData) for a given block hash. type MsgBlock struct { @@ -64,7 +64,7 @@ func (msg *MsgBlock) ConvertToPartial(subnetworkID *externalapi.DomainSubnetwork } } -// NewMsgBlock returns a new kaspa block message that conforms to the +// NewMsgBlock returns a new c4ex block message that conforms to the // Message interface. See MsgBlock for details. func NewMsgBlock(blockHeader *MsgBlockHeader) *MsgBlock { return &MsgBlock{ diff --git a/app/appmessage/p2p_msgblockheader.go b/app/appmessage/p2p_msgblockheader.go index 2c8631a15..673a54a5d 100644 --- a/app/appmessage/p2p_msgblockheader.go +++ b/app/appmessage/p2p_msgblockheader.go @@ -30,7 +30,7 @@ const MaxNumParentBlocks = 255 // BaseBlockHeaderPayload + up to MaxNumParentBlocks hashes of parent blocks const MaxBlockHeaderPayload = BaseBlockHeaderPayload + (MaxNumParentBlocks * externalapi.DomainHashSize) -// MsgBlockHeader defines information about a block and is used in the kaspa +// MsgBlockHeader defines information about a block and is used in the c4ex // block (MsgBlock) and headers (MsgHeader) messages. type MsgBlockHeader struct { baseMessage diff --git a/app/appmessage/p2p_msgblocklocator.go b/app/appmessage/p2p_msgblocklocator.go index 075ec2238..e30842d6b 100644 --- a/app/appmessage/p2p_msgblocklocator.go +++ b/app/appmessage/p2p_msgblocklocator.go @@ -8,7 +8,7 @@ import ( // per message. const MaxBlockLocatorsPerMsg = 500 -// MsgBlockLocator implements the Message interface and represents a kaspa +// MsgBlockLocator implements the Message interface and represents a c4ex // locator message. It is used to find the blockLocator of a peer that is // syncing with you. type MsgBlockLocator struct { @@ -22,7 +22,7 @@ func (msg *MsgBlockLocator) Command() MessageCommand { return CmdBlockLocator } -// NewMsgBlockLocator returns a new kaspa locator message that conforms to +// NewMsgBlockLocator returns a new c4ex locator message that conforms to // the Message interface. See MsgBlockLocator for details. func NewMsgBlockLocator(locatorHashes []*externalapi.DomainHash) *MsgBlockLocator { return &MsgBlockLocator{ diff --git a/app/appmessage/p2p_msgblockwithtrusteddata.go b/app/appmessage/p2p_msgblockwithtrusteddata.go index cb4775044..567b86ace 100644 --- a/app/appmessage/p2p_msgblockwithtrusteddata.go +++ b/app/appmessage/p2p_msgblockwithtrusteddata.go @@ -6,7 +6,7 @@ import ( "github.com/c4ei/yunseokyeol/domain/consensus/model/externalapi" ) -// MsgBlockWithTrustedData represents a kaspa BlockWithTrustedData message +// MsgBlockWithTrustedData represents a c4ex BlockWithTrustedData message type MsgBlockWithTrustedData struct { baseMessage diff --git a/app/appmessage/p2p_msgblockwithtrusteddatav4.go b/app/appmessage/p2p_msgblockwithtrusteddatav4.go index 8f7746792..1d33d2df6 100644 --- a/app/appmessage/p2p_msgblockwithtrusteddatav4.go +++ b/app/appmessage/p2p_msgblockwithtrusteddatav4.go @@ -1,6 +1,6 @@ package appmessage -// MsgBlockWithTrustedDataV4 represents a kaspa BlockWithTrustedDataV4 message +// MsgBlockWithTrustedDataV4 represents a c4ex BlockWithTrustedDataV4 message type MsgBlockWithTrustedDataV4 struct { baseMessage diff --git a/app/appmessage/p2p_msgdoneblockswithmetadata.go b/app/appmessage/p2p_msgdoneblockswithmetadata.go index aad1c50ae..8468b7416 100644 --- a/app/appmessage/p2p_msgdoneblockswithmetadata.go +++ b/app/appmessage/p2p_msgdoneblockswithmetadata.go @@ -1,6 +1,6 @@ package appmessage -// MsgDoneBlocksWithTrustedData implements the Message interface and represents a kaspa +// MsgDoneBlocksWithTrustedData implements the Message interface and represents a c4ex // DoneBlocksWithTrustedData message // // This message has no payload. @@ -14,7 +14,7 @@ func (msg *MsgDoneBlocksWithTrustedData) Command() MessageCommand { return CmdDoneBlocksWithTrustedData } -// NewMsgDoneBlocksWithTrustedData returns a new kaspa DoneBlocksWithTrustedData message that conforms to the +// NewMsgDoneBlocksWithTrustedData returns a new c4ex DoneBlocksWithTrustedData message that conforms to the // Message interface. func NewMsgDoneBlocksWithTrustedData() *MsgDoneBlocksWithTrustedData { return &MsgDoneBlocksWithTrustedData{} diff --git a/app/appmessage/p2p_msgdoneheaders.go b/app/appmessage/p2p_msgdoneheaders.go index d55733264..84d1d867b 100644 --- a/app/appmessage/p2p_msgdoneheaders.go +++ b/app/appmessage/p2p_msgdoneheaders.go @@ -1,6 +1,6 @@ package appmessage -// MsgDoneHeaders implements the Message interface and represents a kaspa +// MsgDoneHeaders implements the Message interface and represents a c4ex // DoneHeaders message. It is used to notify the IBD syncing peer that the // syncer sent all the requested headers. // @@ -15,7 +15,7 @@ func (msg *MsgDoneHeaders) Command() MessageCommand { return CmdDoneHeaders } -// NewMsgDoneHeaders returns a new kaspa DoneIBDBlocks message that conforms to the +// NewMsgDoneHeaders returns a new c4ex DoneIBDBlocks message that conforms to the // Message interface. func NewMsgDoneHeaders() *MsgDoneHeaders { return &MsgDoneHeaders{} diff --git a/app/appmessage/p2p_msgdonepruningpointutxosetchunks.go b/app/appmessage/p2p_msgdonepruningpointutxosetchunks.go index ba2fdca63..44866331e 100644 --- a/app/appmessage/p2p_msgdonepruningpointutxosetchunks.go +++ b/app/appmessage/p2p_msgdonepruningpointutxosetchunks.go @@ -1,6 +1,6 @@ package appmessage -// MsgDonePruningPointUTXOSetChunks represents a kaspa DonePruningPointUTXOSetChunks message +// MsgDonePruningPointUTXOSetChunks represents a c4ex DonePruningPointUTXOSetChunks message type MsgDonePruningPointUTXOSetChunks struct { baseMessage } diff --git a/app/appmessage/p2p_msgdrequestpruningpointanditsanticoneheaders.go b/app/appmessage/p2p_msgdrequestpruningpointanditsanticoneheaders.go index 1fe8c55d2..ad3106799 100644 --- a/app/appmessage/p2p_msgdrequestpruningpointanditsanticoneheaders.go +++ b/app/appmessage/p2p_msgdrequestpruningpointanditsanticoneheaders.go @@ -1,6 +1,6 @@ package appmessage -// MsgRequestPruningPointAndItsAnticone represents a kaspa RequestPruningPointAndItsAnticone message +// MsgRequestPruningPointAndItsAnticone represents a c4ex RequestPruningPointAndItsAnticone message type MsgRequestPruningPointAndItsAnticone struct { baseMessage } diff --git a/app/appmessage/p2p_msgibdblock.go b/app/appmessage/p2p_msgibdblock.go index cf2b67a44..fcd093858 100644 --- a/app/appmessage/p2p_msgibdblock.go +++ b/app/appmessage/p2p_msgibdblock.go @@ -4,7 +4,7 @@ package appmessage -// MsgIBDBlock implements the Message interface and represents a kaspa +// MsgIBDBlock implements the Message interface and represents a c4ex // ibdblock message. It is used to deliver block and transaction information in // response to a RequestIBDBlocks message (MsgRequestIBDBlocks). type MsgIBDBlock struct { @@ -24,7 +24,7 @@ func (msg *MsgIBDBlock) MaxPayloadLength(pver uint32) uint32 { return MaxMessagePayload } -// NewMsgIBDBlock returns a new kaspa ibdblock message that conforms to the +// NewMsgIBDBlock returns a new c4ex ibdblock message that conforms to the // Message interface. See MsgIBDBlock for details. func NewMsgIBDBlock(msgBlock *MsgBlock) *MsgIBDBlock { return &MsgIBDBlock{MsgBlock: msgBlock} diff --git a/app/appmessage/p2p_msgibdblocklocator.go b/app/appmessage/p2p_msgibdblocklocator.go index 06e42a87e..8c7d70f8f 100644 --- a/app/appmessage/p2p_msgibdblocklocator.go +++ b/app/appmessage/p2p_msgibdblocklocator.go @@ -4,7 +4,7 @@ import ( "github.com/c4ei/yunseokyeol/domain/consensus/model/externalapi" ) -// MsgIBDBlockLocator represents a kaspa ibdBlockLocator message +// MsgIBDBlockLocator represents a c4ex ibdBlockLocator message type MsgIBDBlockLocator struct { baseMessage TargetHash *externalapi.DomainHash @@ -16,7 +16,7 @@ func (msg *MsgIBDBlockLocator) Command() MessageCommand { return CmdIBDBlockLocator } -// NewMsgIBDBlockLocator returns a new kaspa ibdBlockLocator message +// NewMsgIBDBlockLocator returns a new c4ex ibdBlockLocator message func NewMsgIBDBlockLocator(targetHash *externalapi.DomainHash, blockLocatorHashes []*externalapi.DomainHash) *MsgIBDBlockLocator { diff --git a/app/appmessage/p2p_msgibdblocklocatorhighesthash.go b/app/appmessage/p2p_msgibdblocklocatorhighesthash.go index 7236051b0..d9bff7ccd 100644 --- a/app/appmessage/p2p_msgibdblocklocatorhighesthash.go +++ b/app/appmessage/p2p_msgibdblocklocatorhighesthash.go @@ -4,7 +4,7 @@ import ( "github.com/c4ei/yunseokyeol/domain/consensus/model/externalapi" ) -// MsgIBDBlockLocatorHighestHash represents a kaspa BlockLocatorHighestHash message +// MsgIBDBlockLocatorHighestHash represents a c4ex BlockLocatorHighestHash message type MsgIBDBlockLocatorHighestHash struct { baseMessage HighestHash *externalapi.DomainHash diff --git a/app/appmessage/p2p_msgibdblocklocatorhighesthashnotfound.go b/app/appmessage/p2p_msgibdblocklocatorhighesthashnotfound.go index dfc2c02e9..83ca6fcea 100644 --- a/app/appmessage/p2p_msgibdblocklocatorhighesthashnotfound.go +++ b/app/appmessage/p2p_msgibdblocklocatorhighesthashnotfound.go @@ -1,6 +1,6 @@ package appmessage -// MsgIBDBlockLocatorHighestHashNotFound represents a kaspa BlockLocatorHighestHashNotFound message +// MsgIBDBlockLocatorHighestHashNotFound represents a c4ex BlockLocatorHighestHashNotFound message type MsgIBDBlockLocatorHighestHashNotFound struct { baseMessage } diff --git a/app/appmessage/p2p_msgibdchainblocklocator.go b/app/appmessage/p2p_msgibdchainblocklocator.go index c12f3c8fe..d9ce5c433 100644 --- a/app/appmessage/p2p_msgibdchainblocklocator.go +++ b/app/appmessage/p2p_msgibdchainblocklocator.go @@ -4,7 +4,7 @@ import ( "github.com/c4ei/yunseokyeol/domain/consensus/model/externalapi" ) -// MsgIBDChainBlockLocator implements the Message interface and represents a kaspa +// MsgIBDChainBlockLocator implements the Message interface and represents a c4ex // locator message. It is used to find the blockLocator of a peer that is // syncing with you. type MsgIBDChainBlockLocator struct { @@ -18,7 +18,7 @@ func (msg *MsgIBDChainBlockLocator) Command() MessageCommand { return CmdIBDChainBlockLocator } -// NewMsgIBDChainBlockLocator returns a new kaspa locator message that conforms to +// NewMsgIBDChainBlockLocator returns a new c4ex locator message that conforms to // the Message interface. See MsgBlockLocator for details. func NewMsgIBDChainBlockLocator(locatorHashes []*externalapi.DomainHash) *MsgIBDChainBlockLocator { return &MsgIBDChainBlockLocator{ diff --git a/app/appmessage/p2p_msginvrelayblock.go b/app/appmessage/p2p_msginvrelayblock.go index 7a58313d8..80147b926 100644 --- a/app/appmessage/p2p_msginvrelayblock.go +++ b/app/appmessage/p2p_msginvrelayblock.go @@ -4,7 +4,7 @@ import ( "github.com/c4ei/yunseokyeol/domain/consensus/model/externalapi" ) -// MsgInvRelayBlock implements the Message interface and represents a kaspa +// MsgInvRelayBlock implements the Message interface and represents a c4ex // block inventory message. It is used to notify the network about new block // by sending their hash, and let the receiving node decide if it needs it. type MsgInvRelayBlock struct { @@ -18,7 +18,7 @@ func (msg *MsgInvRelayBlock) Command() MessageCommand { return CmdInvRelayBlock } -// NewMsgInvBlock returns a new kaspa invrelblk message that conforms to +// NewMsgInvBlock returns a new c4ex invrelblk message that conforms to // the Message interface. See MsgInvRelayBlock for details. func NewMsgInvBlock(hash *externalapi.DomainHash) *MsgInvRelayBlock { return &MsgInvRelayBlock{ diff --git a/app/appmessage/p2p_msginvtransaction.go b/app/appmessage/p2p_msginvtransaction.go index b8cf75b0c..477994023 100644 --- a/app/appmessage/p2p_msginvtransaction.go +++ b/app/appmessage/p2p_msginvtransaction.go @@ -8,7 +8,7 @@ import ( // be in a single CmdInvTransaction message. const MaxInvPerTxInvMsg = MaxInvPerMsg -// MsgInvTransaction implements the Message interface and represents a kaspa +// MsgInvTransaction implements the Message interface and represents a c4ex // TxInv message. It is used to notify the network about new transactions // by sending their ID, and let the receiving node decide if it needs it. type MsgInvTransaction struct { @@ -22,7 +22,7 @@ func (msg *MsgInvTransaction) Command() MessageCommand { return CmdInvTransaction } -// NewMsgInvTransaction returns a new kaspa TxInv message that conforms to +// NewMsgInvTransaction returns a new c4ex TxInv message that conforms to // the Message interface. See MsgInvTransaction for details. func NewMsgInvTransaction(ids []*externalapi.DomainTransactionID) *MsgInvTransaction { return &MsgInvTransaction{ diff --git a/app/appmessage/p2p_msgping.go b/app/appmessage/p2p_msgping.go index 444557ab5..070bef241 100644 --- a/app/appmessage/p2p_msgping.go +++ b/app/appmessage/p2p_msgping.go @@ -4,7 +4,7 @@ package appmessage -// MsgPing implements the Message interface and represents a kaspa ping +// MsgPing implements the Message interface and represents a c4ex ping // message. // // For versions BIP0031Version and earlier, it is used primarily to confirm @@ -28,7 +28,7 @@ func (msg *MsgPing) Command() MessageCommand { return CmdPing } -// NewMsgPing returns a new kaspa ping message that conforms to the Message +// NewMsgPing returns a new c4ex ping message that conforms to the Message // interface. See MsgPing for details. func NewMsgPing(nonce uint64) *MsgPing { return &MsgPing{ diff --git a/app/appmessage/p2p_msgpong.go b/app/appmessage/p2p_msgpong.go index ee847f44b..ac4480572 100644 --- a/app/appmessage/p2p_msgpong.go +++ b/app/appmessage/p2p_msgpong.go @@ -4,9 +4,9 @@ package appmessage -// MsgPong implements the Message interface and represents a kaspa pong +// MsgPong implements the Message interface and represents a c4ex pong // message which is used primarily to confirm that a connection is still valid -// in response to a kaspa ping message (MsgPing). +// in response to a c4ex ping message (MsgPing). // // This message was not added until protocol versions AFTER BIP0031Version. type MsgPong struct { @@ -22,7 +22,7 @@ func (msg *MsgPong) Command() MessageCommand { return CmdPong } -// NewMsgPong returns a new kaspa pong message that conforms to the Message +// NewMsgPong returns a new c4ex pong message that conforms to the Message // interface. See MsgPong for details. func NewMsgPong(nonce uint64) *MsgPong { return &MsgPong{ diff --git a/app/appmessage/p2p_msgpruningpointproof.go b/app/appmessage/p2p_msgpruningpointproof.go index 4d9e31968..c582a8dec 100644 --- a/app/appmessage/p2p_msgpruningpointproof.go +++ b/app/appmessage/p2p_msgpruningpointproof.go @@ -1,6 +1,6 @@ package appmessage -// MsgPruningPointProof represents a kaspa PruningPointProof message +// MsgPruningPointProof represents a c4ex PruningPointProof message type MsgPruningPointProof struct { baseMessage diff --git a/app/appmessage/p2p_msgpruningpoints.go b/app/appmessage/p2p_msgpruningpoints.go index 509cca351..4866c6633 100644 --- a/app/appmessage/p2p_msgpruningpoints.go +++ b/app/appmessage/p2p_msgpruningpoints.go @@ -1,6 +1,6 @@ package appmessage -// MsgPruningPoints represents a kaspa PruningPoints message +// MsgPruningPoints represents a c4ex PruningPoints message type MsgPruningPoints struct { baseMessage diff --git a/app/appmessage/p2p_msgpruningpointutxosetchunk.go b/app/appmessage/p2p_msgpruningpointutxosetchunk.go index fdbb76dcd..84193c1d5 100644 --- a/app/appmessage/p2p_msgpruningpointutxosetchunk.go +++ b/app/appmessage/p2p_msgpruningpointutxosetchunk.go @@ -2,7 +2,7 @@ package appmessage import "github.com/c4ei/yunseokyeol/domain/consensus/model/externalapi" -// MsgPruningPointUTXOSetChunk represents a kaspa PruningPointUTXOSetChunk message +// MsgPruningPointUTXOSetChunk represents a c4ex PruningPointUTXOSetChunk message type MsgPruningPointUTXOSetChunk struct { baseMessage OutpointAndUTXOEntryPairs []*OutpointAndUTXOEntryPair diff --git a/app/appmessage/p2p_msgreject.go b/app/appmessage/p2p_msgreject.go index 887e4895b..77a3b25b8 100644 --- a/app/appmessage/p2p_msgreject.go +++ b/app/appmessage/p2p_msgreject.go @@ -1,6 +1,6 @@ package appmessage -// MsgReject implements the Message interface and represents a kaspa +// MsgReject implements the Message interface and represents a c4ex // Reject message. It is used to notify peers why they are banned. type MsgReject struct { baseMessage @@ -13,7 +13,7 @@ func (msg *MsgReject) Command() MessageCommand { return CmdReject } -// NewMsgReject returns a new kaspa Reject message that conforms to the +// NewMsgReject returns a new c4ex Reject message that conforms to the // Message interface. func NewMsgReject(reason string) *MsgReject { return &MsgReject{ diff --git a/app/appmessage/p2p_msgrequestaddresses.go b/app/appmessage/p2p_msgrequestaddresses.go index b7e726da8..f31a5b5fa 100644 --- a/app/appmessage/p2p_msgrequestaddresses.go +++ b/app/appmessage/p2p_msgrequestaddresses.go @@ -8,7 +8,7 @@ import ( "github.com/c4ei/yunseokyeol/domain/consensus/model/externalapi" ) -// MsgRequestAddresses implements the Message interface and represents a kaspa +// MsgRequestAddresses implements the Message interface and represents a c4ex // RequestAddresses message. It is used to request a list of known active peers on the // network from a peer to help identify potential nodes. The list is returned // via one or more addr messages (MsgAddresses). @@ -26,7 +26,7 @@ func (msg *MsgRequestAddresses) Command() MessageCommand { return CmdRequestAddresses } -// NewMsgRequestAddresses returns a new kaspa RequestAddresses message that conforms to the +// NewMsgRequestAddresses returns a new c4ex RequestAddresses message that conforms to the // Message interface. See MsgRequestAddresses for details. func NewMsgRequestAddresses(includeAllSubnetworks bool, subnetworkID *externalapi.DomainSubnetworkID) *MsgRequestAddresses { return &MsgRequestAddresses{ diff --git a/app/appmessage/p2p_msgrequestanticone.go b/app/appmessage/p2p_msgrequestanticone.go index 898f7a6bc..b85739a8f 100644 --- a/app/appmessage/p2p_msgrequestanticone.go +++ b/app/appmessage/p2p_msgrequestanticone.go @@ -8,7 +8,7 @@ import ( "github.com/c4ei/yunseokyeol/domain/consensus/model/externalapi" ) -// MsgRequestAnticone implements the Message interface and represents a kaspa +// MsgRequestAnticone implements the Message interface and represents a c4ex // RequestHeaders message. It is used to request the set past(ContextHash) \cap anticone(BlockHash) type MsgRequestAnticone struct { baseMessage @@ -22,7 +22,7 @@ func (msg *MsgRequestAnticone) Command() MessageCommand { return CmdRequestAnticone } -// NewMsgRequestAnticone returns a new kaspa RequestPastDiff message that conforms to the +// NewMsgRequestAnticone returns a new c4ex RequestPastDiff message that conforms to the // Message interface using the passed parameters and defaults for the remaining // fields. func NewMsgRequestAnticone(blockHash, contextHash *externalapi.DomainHash) *MsgRequestAnticone { diff --git a/app/appmessage/p2p_msgrequestblocklocator.go b/app/appmessage/p2p_msgrequestblocklocator.go index e88d680a8..9fa780420 100644 --- a/app/appmessage/p2p_msgrequestblocklocator.go +++ b/app/appmessage/p2p_msgrequestblocklocator.go @@ -4,7 +4,7 @@ import ( "github.com/c4ei/yunseokyeol/domain/consensus/model/externalapi" ) -// MsgRequestBlockLocator implements the Message interface and represents a kaspa +// MsgRequestBlockLocator implements the Message interface and represents a c4ex // RequestBlockLocator message. It is used to request a block locator between low // and high hash. // The locator is returned via a locator message (MsgBlockLocator). diff --git a/app/appmessage/p2p_msgrequestheaders.go b/app/appmessage/p2p_msgrequestheaders.go index 9d894445d..bfdc37f2f 100644 --- a/app/appmessage/p2p_msgrequestheaders.go +++ b/app/appmessage/p2p_msgrequestheaders.go @@ -8,7 +8,7 @@ import ( "github.com/c4ei/yunseokyeol/domain/consensus/model/externalapi" ) -// MsgRequestHeaders implements the Message interface and represents a kaspa +// MsgRequestHeaders implements the Message interface and represents a c4ex // RequestHeaders message. It is used to request a list of blocks starting after the // low hash and until the high hash. type MsgRequestHeaders struct { @@ -23,7 +23,7 @@ func (msg *MsgRequestHeaders) Command() MessageCommand { return CmdRequestHeaders } -// NewMsgRequstHeaders returns a new kaspa RequestHeaders message that conforms to the +// NewMsgRequstHeaders returns a new c4ex RequestHeaders message that conforms to the // Message interface using the passed parameters and defaults for the remaining // fields. func NewMsgRequstHeaders(lowHash, highHash *externalapi.DomainHash) *MsgRequestHeaders { diff --git a/app/appmessage/p2p_msgrequestibdblocks.go b/app/appmessage/p2p_msgrequestibdblocks.go index 61af6e3dd..6e20deb71 100644 --- a/app/appmessage/p2p_msgrequestibdblocks.go +++ b/app/appmessage/p2p_msgrequestibdblocks.go @@ -4,7 +4,7 @@ import ( "github.com/c4ei/yunseokyeol/domain/consensus/model/externalapi" ) -// MsgRequestIBDBlocks implements the Message interface and represents a kaspa +// MsgRequestIBDBlocks implements the Message interface and represents a c4ex // RequestIBDBlocks message. It is used to request blocks as part of the IBD // protocol. type MsgRequestIBDBlocks struct { diff --git a/app/appmessage/p2p_msgrequestibdchainblocklocator.go b/app/appmessage/p2p_msgrequestibdchainblocklocator.go index 599a160f9..bf2451542 100644 --- a/app/appmessage/p2p_msgrequestibdchainblocklocator.go +++ b/app/appmessage/p2p_msgrequestibdchainblocklocator.go @@ -4,7 +4,7 @@ import ( "github.com/c4ei/yunseokyeol/domain/consensus/model/externalapi" ) -// MsgRequestIBDChainBlockLocator implements the Message interface and represents a kaspa +// MsgRequestIBDChainBlockLocator implements the Message interface and represents a c4ex // IBDRequestChainBlockLocator message. It is used to request a block locator between low // and high hash. // The locator is returned via a locator message (MsgIBDChainBlockLocator). diff --git a/app/appmessage/p2p_msgrequestnextheaders.go b/app/appmessage/p2p_msgrequestnextheaders.go index 22687f12c..ae3eee216 100644 --- a/app/appmessage/p2p_msgrequestnextheaders.go +++ b/app/appmessage/p2p_msgrequestnextheaders.go @@ -1,6 +1,6 @@ package appmessage -// MsgRequestNextHeaders implements the Message interface and represents a kaspa +// MsgRequestNextHeaders implements the Message interface and represents a c4ex // RequestNextHeaders message. It is used to notify the IBD syncer peer to send // more headers. // @@ -15,7 +15,7 @@ func (msg *MsgRequestNextHeaders) Command() MessageCommand { return CmdRequestNextHeaders } -// NewMsgRequestNextHeaders returns a new kaspa RequestNextHeaders message that conforms to the +// NewMsgRequestNextHeaders returns a new c4ex RequestNextHeaders message that conforms to the // Message interface. func NewMsgRequestNextHeaders() *MsgRequestNextHeaders { return &MsgRequestNextHeaders{} diff --git a/app/appmessage/p2p_msgrequestnextpruningpointanditsanticoneblocks.go b/app/appmessage/p2p_msgrequestnextpruningpointanditsanticoneblocks.go index 3e2b5c0df..b473286db 100644 --- a/app/appmessage/p2p_msgrequestnextpruningpointanditsanticoneblocks.go +++ b/app/appmessage/p2p_msgrequestnextpruningpointanditsanticoneblocks.go @@ -1,6 +1,6 @@ package appmessage -// MsgRequestNextPruningPointAndItsAnticoneBlocks implements the Message interface and represents a kaspa +// MsgRequestNextPruningPointAndItsAnticoneBlocks implements the Message interface and represents a c4ex // RequestNextPruningPointAndItsAnticoneBlocks message. It is used to notify the IBD syncer peer to send // more blocks from the pruning anticone. // @@ -15,7 +15,7 @@ func (msg *MsgRequestNextPruningPointAndItsAnticoneBlocks) Command() MessageComm return CmdRequestNextPruningPointAndItsAnticoneBlocks } -// NewMsgRequestNextPruningPointAndItsAnticoneBlocks returns a new kaspa RequestNextPruningPointAndItsAnticoneBlocks message that conforms to the +// NewMsgRequestNextPruningPointAndItsAnticoneBlocks returns a new c4ex RequestNextPruningPointAndItsAnticoneBlocks message that conforms to the // Message interface. func NewMsgRequestNextPruningPointAndItsAnticoneBlocks() *MsgRequestNextPruningPointAndItsAnticoneBlocks { return &MsgRequestNextPruningPointAndItsAnticoneBlocks{} diff --git a/app/appmessage/p2p_msgrequestnextpruningpointutxosetchunk.go b/app/appmessage/p2p_msgrequestnextpruningpointutxosetchunk.go index 356e7c814..87d51828b 100644 --- a/app/appmessage/p2p_msgrequestnextpruningpointutxosetchunk.go +++ b/app/appmessage/p2p_msgrequestnextpruningpointutxosetchunk.go @@ -1,6 +1,6 @@ package appmessage -// MsgRequestNextPruningPointUTXOSetChunk represents a kaspa RequestNextPruningPointUTXOSetChunk message +// MsgRequestNextPruningPointUTXOSetChunk represents a c4ex RequestNextPruningPointUTXOSetChunk message type MsgRequestNextPruningPointUTXOSetChunk struct { baseMessage } diff --git a/app/appmessage/p2p_msgrequestpruningpointproof.go b/app/appmessage/p2p_msgrequestpruningpointproof.go index dd657f048..e78871b6d 100644 --- a/app/appmessage/p2p_msgrequestpruningpointproof.go +++ b/app/appmessage/p2p_msgrequestpruningpointproof.go @@ -1,6 +1,6 @@ package appmessage -// MsgRequestPruningPointProof represents a kaspa RequestPruningPointProof message +// MsgRequestPruningPointProof represents a c4ex RequestPruningPointProof message type MsgRequestPruningPointProof struct { baseMessage } diff --git a/app/appmessage/p2p_msgrequestpruningpointutxosetandblock.go b/app/appmessage/p2p_msgrequestpruningpointutxosetandblock.go index 23284b2a1..ab9609e96 100644 --- a/app/appmessage/p2p_msgrequestpruningpointutxosetandblock.go +++ b/app/appmessage/p2p_msgrequestpruningpointutxosetandblock.go @@ -4,7 +4,7 @@ import ( "github.com/c4ei/yunseokyeol/domain/consensus/model/externalapi" ) -// MsgRequestPruningPointUTXOSet represents a kaspa RequestPruningPointUTXOSet message +// MsgRequestPruningPointUTXOSet represents a c4ex RequestPruningPointUTXOSet message type MsgRequestPruningPointUTXOSet struct { baseMessage PruningPointHash *externalapi.DomainHash diff --git a/app/appmessage/p2p_msgrequestrelayblocks.go b/app/appmessage/p2p_msgrequestrelayblocks.go index 8f37b334b..7ef00e952 100644 --- a/app/appmessage/p2p_msgrequestrelayblocks.go +++ b/app/appmessage/p2p_msgrequestrelayblocks.go @@ -8,7 +8,7 @@ import ( // be in a single RequestRelayBlocks message. const MaxRequestRelayBlocksHashes = MaxInvPerMsg -// MsgRequestRelayBlocks implements the Message interface and represents a kaspa +// MsgRequestRelayBlocks implements the Message interface and represents a c4ex // RequestRelayBlocks message. It is used to request blocks as part of the block // relay protocol. type MsgRequestRelayBlocks struct { @@ -22,7 +22,7 @@ func (msg *MsgRequestRelayBlocks) Command() MessageCommand { return CmdRequestRelayBlocks } -// NewMsgRequestRelayBlocks returns a new kaspa RequestRelayBlocks message that conforms to +// NewMsgRequestRelayBlocks returns a new c4ex RequestRelayBlocks message that conforms to // the Message interface. See MsgRequestRelayBlocks for details. func NewMsgRequestRelayBlocks(hashes []*externalapi.DomainHash) *MsgRequestRelayBlocks { return &MsgRequestRelayBlocks{ diff --git a/app/appmessage/p2p_msgrequesttransactions.go b/app/appmessage/p2p_msgrequesttransactions.go index 0be32c5b8..6ba43fb69 100644 --- a/app/appmessage/p2p_msgrequesttransactions.go +++ b/app/appmessage/p2p_msgrequesttransactions.go @@ -8,7 +8,7 @@ import ( // be in a single CmdInvTransaction message. const MaxInvPerRequestTransactionsMsg = MaxInvPerMsg -// MsgRequestTransactions implements the Message interface and represents a kaspa +// MsgRequestTransactions implements the Message interface and represents a c4ex // RequestTransactions message. It is used to request transactions as part of the // transactions relay protocol. type MsgRequestTransactions struct { @@ -22,7 +22,7 @@ func (msg *MsgRequestTransactions) Command() MessageCommand { return CmdRequestTransactions } -// NewMsgRequestTransactions returns a new kaspa RequestTransactions message that conforms to +// NewMsgRequestTransactions returns a new c4ex RequestTransactions message that conforms to // the Message interface. See MsgRequestTransactions for details. func NewMsgRequestTransactions(ids []*externalapi.DomainTransactionID) *MsgRequestTransactions { return &MsgRequestTransactions{ diff --git a/app/appmessage/p2p_msgtransactionnotfound.go b/app/appmessage/p2p_msgtransactionnotfound.go index 28975f095..85950d4dc 100644 --- a/app/appmessage/p2p_msgtransactionnotfound.go +++ b/app/appmessage/p2p_msgtransactionnotfound.go @@ -8,7 +8,7 @@ import ( "github.com/c4ei/yunseokyeol/domain/consensus/model/externalapi" ) -// MsgTransactionNotFound defines a kaspa TransactionNotFound message which is sent in response to +// MsgTransactionNotFound defines a c4ex TransactionNotFound message which is sent in response to // a RequestTransactions message if any of the requested data in not available on the peer. type MsgTransactionNotFound struct { baseMessage @@ -21,7 +21,7 @@ func (msg *MsgTransactionNotFound) Command() MessageCommand { return CmdTransactionNotFound } -// NewMsgTransactionNotFound returns a new kaspa transactionsnotfound message that conforms to the +// NewMsgTransactionNotFound returns a new c4ex transactionsnotfound message that conforms to the // Message interface. See MsgTransactionNotFound for details. func NewMsgTransactionNotFound(id *externalapi.DomainTransactionID) *MsgTransactionNotFound { return &MsgTransactionNotFound{ diff --git a/app/appmessage/p2p_msgtrusteddata.go b/app/appmessage/p2p_msgtrusteddata.go index ae2b250ea..49025bb86 100644 --- a/app/appmessage/p2p_msgtrusteddata.go +++ b/app/appmessage/p2p_msgtrusteddata.go @@ -1,6 +1,6 @@ package appmessage -// MsgTrustedData represents a kaspa TrustedData message +// MsgTrustedData represents a c4ex TrustedData message type MsgTrustedData struct { baseMessage diff --git a/app/appmessage/p2p_msgtx.go b/app/appmessage/p2p_msgtx.go index 23c230793..c84940080 100644 --- a/app/appmessage/p2p_msgtx.go +++ b/app/appmessage/p2p_msgtx.go @@ -54,14 +54,14 @@ const ( minTxPayload = 10 ) -// Outpoint defines a kaspa data type that is used to track previous +// Outpoint defines a c4ex data type that is used to track previous // transaction outputs. type Outpoint struct { TxID externalapi.DomainTransactionID Index uint32 } -// NewOutpoint returns a new kaspa transaction outpoint point with the +// NewOutpoint returns a new c4ex transaction outpoint point with the // provided hash and index. func NewOutpoint(txID *externalapi.DomainTransactionID, index uint32) *Outpoint { return &Outpoint{ @@ -85,7 +85,7 @@ func (o Outpoint) String() string { return string(buf) } -// TxIn defines a kaspa transaction input. +// TxIn defines a c4ex transaction input. type TxIn struct { PreviousOutpoint Outpoint SignatureScript []byte @@ -93,7 +93,7 @@ type TxIn struct { SigOpCount byte } -// NewTxIn returns a new kaspa transaction input with the provided +// NewTxIn returns a new c4ex transaction input with the provided // previous outpoint point and signature script with a default sequence of // MaxTxInSequenceNum. func NewTxIn(prevOut *Outpoint, signatureScript []byte, sequence uint64, sigOpCount byte) *TxIn { @@ -105,13 +105,13 @@ func NewTxIn(prevOut *Outpoint, signatureScript []byte, sequence uint64, sigOpCo } } -// TxOut defines a kaspa transaction output. +// TxOut defines a c4ex transaction output. type TxOut struct { Value uint64 ScriptPubKey *externalapi.ScriptPublicKey } -// NewTxOut returns a new kaspa transaction output with the provided +// NewTxOut returns a new c4ex transaction output with the provided // transaction value and public key script. func NewTxOut(value uint64, scriptPubKey *externalapi.ScriptPublicKey) *TxOut { return &TxOut{ @@ -120,7 +120,7 @@ func NewTxOut(value uint64, scriptPubKey *externalapi.ScriptPublicKey) *TxOut { } } -// MsgTx implements the Message interface and represents a kaspa tx message. +// MsgTx implements the Message interface and represents a c4ex tx message. // It is used to deliver transaction information in response to a getdata // message (MsgGetData) for a given transaction. // diff --git a/app/appmessage/p2p_msgverack.go b/app/appmessage/p2p_msgverack.go index 1fcbcf45e..6af7ca982 100644 --- a/app/appmessage/p2p_msgverack.go +++ b/app/appmessage/p2p_msgverack.go @@ -4,7 +4,7 @@ package appmessage -// MsgVerAck defines a kaspa verack message which is used for a peer to +// MsgVerAck defines a c4ex verack message which is used for a peer to // acknowledge a version message (MsgVersion) after it has used the information // to negotiate parameters. It implements the Message interface. // @@ -19,7 +19,7 @@ func (msg *MsgVerAck) Command() MessageCommand { return CmdVerAck } -// NewMsgVerAck returns a new kaspa verack message that conforms to the +// NewMsgVerAck returns a new c4ex verack message that conforms to the // Message interface. func NewMsgVerAck() *MsgVerAck { return &MsgVerAck{} diff --git a/app/appmessage/p2p_msgversion.go b/app/appmessage/p2p_msgversion.go index b33a63aca..31b9b1192 100644 --- a/app/appmessage/p2p_msgversion.go +++ b/app/appmessage/p2p_msgversion.go @@ -20,9 +20,9 @@ import ( const MaxUserAgentLen = 256 // DefaultUserAgent for appmessage in the stack -var DefaultUserAgent = fmt.Sprintf("/kaspad:%s/", version.Version()) +var DefaultUserAgent = fmt.Sprintf("/c4exd:%s/", version.Version()) -// MsgVersion implements the Message interface and represents a kaspa version +// MsgVersion implements the Message interface and represents a c4ex version // message. It is used for a peer to advertise itself as soon as an outbound // connection is made. The remote peer then uses this information along with // its own to negotiate. The remote peer must then respond with a version @@ -78,7 +78,7 @@ func (msg *MsgVersion) Command() MessageCommand { return CmdVersion } -// NewMsgVersion returns a new kaspa version message that conforms to the +// NewMsgVersion returns a new c4ex version message that conforms to the // Message interface using the passed parameters and defaults for the remaining // fields. func NewMsgVersion(addr *NetAddress, id *id.ID, network string, diff --git a/app/appmessage/p2p_ready.go b/app/appmessage/p2p_ready.go index 661f0b10d..7a571f7fa 100644 --- a/app/appmessage/p2p_ready.go +++ b/app/appmessage/p2p_ready.go @@ -1,6 +1,6 @@ package appmessage -// MsgReady implements the Message interface and represents a kaspa +// MsgReady implements the Message interface and represents a c4ex // Ready message. It is used to notify that the peer is ready to receive // messages. // @@ -15,7 +15,7 @@ func (msg *MsgReady) Command() MessageCommand { return CmdReady } -// NewMsgReady returns a new kaspa Ready message that conforms to the +// NewMsgReady returns a new c4ex Ready message that conforms to the // Message interface. func NewMsgReady() *MsgReady { return &MsgReady{} diff --git a/app/appmessage/p2p_unexpectedpruningpoint.go b/app/appmessage/p2p_unexpectedpruningpoint.go index 0546ea1be..e76158417 100644 --- a/app/appmessage/p2p_unexpectedpruningpoint.go +++ b/app/appmessage/p2p_unexpectedpruningpoint.go @@ -1,6 +1,6 @@ package appmessage -// MsgUnexpectedPruningPoint represents a kaspa UnexpectedPruningPoint message +// MsgUnexpectedPruningPoint represents a c4ex UnexpectedPruningPoint message type MsgUnexpectedPruningPoint struct { baseMessage } @@ -10,7 +10,7 @@ func (msg *MsgUnexpectedPruningPoint) Command() MessageCommand { return CmdUnexpectedPruningPoint } -// NewMsgUnexpectedPruningPoint returns a new kaspa UnexpectedPruningPoint message +// NewMsgUnexpectedPruningPoint returns a new c4ex UnexpectedPruningPoint message func NewMsgUnexpectedPruningPoint() *MsgUnexpectedPruningPoint { return &MsgUnexpectedPruningPoint{} } diff --git a/app/appmessage/protocol.go b/app/appmessage/protocol.go index 1818535e8..4390dc96b 100644 --- a/app/appmessage/protocol.go +++ b/app/appmessage/protocol.go @@ -18,13 +18,13 @@ const ( DefaultServices = SFNodeNetwork | SFNodeBloom | SFNodeCF ) -// ServiceFlag identifies services supported by a kaspa peer. -// ServiceFlag는 kaspa 피어가 지원하는 서비스를 식별합니다. +// ServiceFlag identifies services supported by a c4ex peer. +// ServiceFlag는 c4ex 피어가 지원하는 서비스를 식별합니다. type ServiceFlag uint64 const ( // SFNodeNetwork is a flag used to indicate a peer is a full node. - // ServiceFlag는 kaspa 액세서리가 지원하는 서비스를 정의합니다. + // ServiceFlag는 c4ex 액세서리가 지원하는 서비스를 정의합니다. SFNodeNetwork ServiceFlag = 1 << iota // SFNodeGetUTXO is a flag used to indicate a peer supports the @@ -106,21 +106,21 @@ func (f ServiceFlag) String() string { return s } -// C4exNet represents which kaspa network a message belongs to. +// C4exNet represents which c4ex network a message belongs to. // C4exNet은 메시지가 속한 Kaspa 네트워크를 나타냅니다. type C4exNet uint32 -// Constants used to indicate the message kaspa network. They can also be +// Constants used to indicate the message c4ex network. They can also be // used to seek to the next message when a stream's state is unknown, but // this package does not provide that functionality since it's generally a // better idea to simply disconnect clients that are misbehaving over TCP. -// 메시지 kaspa 네트워크를 나타내는 데 사용되는 상수입니다. 그들은 또한 +// 메시지 c4ex 네트워크를 나타내는 데 사용되는 상수입니다. 그들은 또한 // 스트림 상태를 알 수 없을 때 다음 메시지를 찾는 데 사용되지만, // 이 패키지는 일반적으로 다음과 같은 기능을 제공하므로 해당 기능을 제공하지 않습니다. // TCP를 통해 오작동하는 클라이언트의 연결을 끊는 것이 더 나은 아이디어입니다. const ( - // Mainnet represents the main kaspa network. - // 메인넷은 주요 kaspa 네트워크를 나타냅니다. + // Mainnet represents the main c4ex network. + // 메인넷은 주요 c4ex 네트워크를 나타냅니다. Mainnet C4exNet = 0x3ddcf71d // Testnet represents the test network. @@ -133,9 +133,9 @@ const ( Devnet C4exNet = 0x732d87e1 ) -// bnStrings is a map of kaspa networks back to their constant names for +// bnStrings is a map of c4ex networks back to their constant names for // pretty printing. -// bnStrings는 kaspa 네트워크의 상수 이름으로 돌아가는 맵입니다. +// bnStrings는 c4ex 네트워크의 상수 이름으로 돌아가는 맵입니다. // 예쁜 인쇄. var bnStrings = map[C4exNet]string{ Mainnet: "Mainnet", diff --git a/app/appmessage/protocol_test.go b/app/appmessage/protocol_test.go index c5bc73eda..2cee35b82 100644 --- a/app/appmessage/protocol_test.go +++ b/app/appmessage/protocol_test.go @@ -33,7 +33,7 @@ func TestServiceFlagStringer(t *testing.T) { } } -// TestC4exNetStringer tests the stringized output for kaspa net types. +// TestC4exNetStringer tests the stringized output for c4ex net types. func TestC4exNetStringer(t *testing.T) { tests := []struct { in C4exNet diff --git a/app/appmessage/rpc_submit_block.go b/app/appmessage/rpc_submit_block.go index 7917f8c8f..c6bbf3a44 100644 --- a/app/appmessage/rpc_submit_block.go +++ b/app/appmessage/rpc_submit_block.go @@ -60,7 +60,7 @@ func NewSubmitBlockResponseMessage() *SubmitBlockResponseMessage { return &SubmitBlockResponseMessage{} } -// RPCBlock is a kaspad block representation meant to be +// RPCBlock is a c4exd block representation meant to be // used over RPC type RPCBlock struct { Header *RPCBlockHeader @@ -68,7 +68,7 @@ type RPCBlock struct { VerboseData *RPCBlockVerboseData } -// RPCBlockHeader is a kaspad block header representation meant to be +// RPCBlockHeader is a c4exd block header representation meant to be // used over RPC type RPCBlockHeader struct { Version uint32 diff --git a/app/appmessage/rpc_submit_transaction.go b/app/appmessage/rpc_submit_transaction.go index a39e7e574..53824722b 100644 --- a/app/appmessage/rpc_submit_transaction.go +++ b/app/appmessage/rpc_submit_transaction.go @@ -42,7 +42,7 @@ func NewSubmitTransactionResponseMessage(transactionID string) *SubmitTransactio } } -// RPCTransaction is a kaspad transaction representation meant to be +// RPCTransaction is a c4exd transaction representation meant to be // used over RPC type RPCTransaction struct { Version uint16 @@ -55,7 +55,7 @@ type RPCTransaction struct { VerboseData *RPCTransactionVerboseData } -// RPCTransactionInput is a kaspad transaction input representation +// RPCTransactionInput is a c4exd transaction input representation // meant to be used over RPC type RPCTransactionInput struct { PreviousOutpoint *RPCOutpoint @@ -65,13 +65,13 @@ type RPCTransactionInput struct { VerboseData *RPCTransactionInputVerboseData } -// RPCScriptPublicKey is a kaspad ScriptPublicKey representation +// RPCScriptPublicKey is a c4exd ScriptPublicKey representation type RPCScriptPublicKey struct { Version uint16 Script string } -// RPCTransactionOutput is a kaspad transaction output representation +// RPCTransactionOutput is a c4exd transaction output representation // meant to be used over RPC type RPCTransactionOutput struct { Amount uint64 @@ -79,14 +79,14 @@ type RPCTransactionOutput struct { VerboseData *RPCTransactionOutputVerboseData } -// RPCOutpoint is a kaspad outpoint representation meant to be used +// RPCOutpoint is a c4exd outpoint representation meant to be used // over RPC type RPCOutpoint struct { TransactionID string Index uint32 } -// RPCUTXOEntry is a kaspad utxo entry representation meant to be used +// RPCUTXOEntry is a c4exd utxo entry representation meant to be used // over RPC type RPCUTXOEntry struct { Amount uint64 diff --git a/app/component_manager.go b/app/component_manager.go index 5b1a0b7bc..76d0d5849 100644 --- a/app/component_manager.go +++ b/app/component_manager.go @@ -22,7 +22,7 @@ import ( "github.com/c4ei/yunseokyeol/util/panics" ) -// ComponentManager is a wrapper for all the kaspad services +// ComponentManager is a wrapper for all the c4exd services type ComponentManager struct { cfg *config.Config addressManager *addressmanager.AddressManager @@ -34,14 +34,14 @@ type ComponentManager struct { started, shutdown int32 } -// Start launches all the kaspad services. +// Start launches all the c4exd services. func (a *ComponentManager) Start() { // Already started? if atomic.AddInt32(&a.started, 1) != 1 { return } - log.Trace("Starting kaspad") + log.Trace("Starting c4exd") err := a.netAdapter.Start() if err != nil { @@ -51,7 +51,7 @@ func (a *ComponentManager) Start() { a.connectionManager.Start() } -// Stop gracefully shuts down all the kaspad services. +// Stop gracefully shuts down all the c4exd services. func (a *ComponentManager) Stop() { // Make sure this only happens once. if atomic.AddInt32(&a.shutdown, 1) != 1 { diff --git a/app/protocol/flows/handshake/sendversion.go b/app/protocol/flows/handshake/sendversion.go index 101add691..31d3fcfd4 100644 --- a/app/protocol/flows/handshake/sendversion.go +++ b/app/protocol/flows/handshake/sendversion.go @@ -12,11 +12,11 @@ import ( var ( // userAgentName is the user agent name and is used to help identify - // ourselves to other kaspa peers. - userAgentName = "kaspad" + // ourselves to other c4ex peers. + userAgentName = "c4exd" // userAgentVersion is the user agent version and is used to help - // identify ourselves to other kaspa peers. + // identify ourselves to other c4ex peers. userAgentVersion = version.Version() // defaultServices describes the default services that are supported by diff --git a/app/protocol/protocol.go b/app/protocol/protocol.go index 59422f228..e385ab194 100644 --- a/app/protocol/protocol.go +++ b/app/protocol/protocol.go @@ -6,7 +6,7 @@ import ( "github.com/c4ei/yunseokyeol/app/protocol/common" "github.com/c4ei/yunseokyeol/app/protocol/flows/ready" - v5 "github.com/kaspanet/kaspad/app/protocol/flows/v5" + v5 "github.com/c4exnet/c4exd/app/protocol/flows/v5" "github.com/c4ei/yunseokyeol/app/appmessage" "github.com/c4ei/yunseokyeol/app/protocol/flows/handshake" diff --git a/app/rpc/rpccontext/notificationmanager.go b/app/rpc/rpccontext/notificationmanager.go index eac61e765..196e95b48 100644 --- a/app/rpc/rpccontext/notificationmanager.go +++ b/app/rpc/rpccontext/notificationmanager.go @@ -21,7 +21,7 @@ type NotificationManager struct { params *dagconfig.Params } -// UTXOsChangedNotificationAddress represents a kaspad address. +// UTXOsChangedNotificationAddress represents a c4exd address. // This type is meant to be used in UTXOsChanged notifications type UTXOsChangedNotificationAddress struct { Address string diff --git a/app/rpc/rpchandlers/get_balance_by_address.go b/app/rpc/rpchandlers/get_balance_by_address.go index 942a5f205..eeb6ed23f 100644 --- a/app/rpc/rpchandlers/get_balance_by_address.go +++ b/app/rpc/rpchandlers/get_balance_by_address.go @@ -13,7 +13,7 @@ import ( func HandleGetBalanceByAddress(context *rpccontext.Context, _ *router.Router, request appmessage.Message) (appmessage.Message, error) { if !context.Config.UTXOIndex { errorMessage := &appmessage.GetUTXOsByAddressesResponseMessage{} - errorMessage.Error = appmessage.RPCErrorf("Method unavailable when kaspad is run without --utxoindex") + errorMessage.Error = appmessage.RPCErrorf("Method unavailable when c4exd is run without --utxoindex") return errorMessage, nil } diff --git a/app/rpc/rpchandlers/get_balances_by_addresses.go b/app/rpc/rpchandlers/get_balances_by_addresses.go index 86ca59190..0bc3cf44c 100644 --- a/app/rpc/rpchandlers/get_balances_by_addresses.go +++ b/app/rpc/rpchandlers/get_balances_by_addresses.go @@ -11,7 +11,7 @@ import ( func HandleGetBalancesByAddresses(context *rpccontext.Context, _ *router.Router, request appmessage.Message) (appmessage.Message, error) { if !context.Config.UTXOIndex { errorMessage := &appmessage.GetBalancesByAddressesResponseMessage{} - errorMessage.Error = appmessage.RPCErrorf("Method unavailable when kaspad is run without --utxoindex") + errorMessage.Error = appmessage.RPCErrorf("Method unavailable when c4exd is run without --utxoindex") return errorMessage, nil } diff --git a/app/rpc/rpchandlers/get_coin_supply.go b/app/rpc/rpchandlers/get_coin_supply.go index 4242a1f98..38f6e4971 100644 --- a/app/rpc/rpchandlers/get_coin_supply.go +++ b/app/rpc/rpchandlers/get_coin_supply.go @@ -11,7 +11,7 @@ import ( func HandleGetCoinSupply(context *rpccontext.Context, _ *router.Router, _ appmessage.Message) (appmessage.Message, error) { if !context.Config.UTXOIndex { errorMessage := &appmessage.GetCoinSupplyResponseMessage{} - errorMessage.Error = appmessage.RPCErrorf("Method unavailable when kaspad is run without --utxoindex") + errorMessage.Error = appmessage.RPCErrorf("Method unavailable when c4exd is run without --utxoindex") return errorMessage, nil } diff --git a/app/rpc/rpchandlers/get_utxos_by_addresses.go b/app/rpc/rpchandlers/get_utxos_by_addresses.go index 33bddcc84..596153f17 100644 --- a/app/rpc/rpchandlers/get_utxos_by_addresses.go +++ b/app/rpc/rpchandlers/get_utxos_by_addresses.go @@ -12,7 +12,7 @@ import ( func HandleGetUTXOsByAddresses(context *rpccontext.Context, _ *router.Router, request appmessage.Message) (appmessage.Message, error) { if !context.Config.UTXOIndex { errorMessage := &appmessage.GetUTXOsByAddressesResponseMessage{} - errorMessage.Error = appmessage.RPCErrorf("Method unavailable when kaspad is run without --utxoindex") + errorMessage.Error = appmessage.RPCErrorf("Method unavailable when c4exd is run without --utxoindex") return errorMessage, nil } diff --git a/app/rpc/rpchandlers/notify_utxos_changed.go b/app/rpc/rpchandlers/notify_utxos_changed.go index 0c58889a9..734b2f01e 100644 --- a/app/rpc/rpchandlers/notify_utxos_changed.go +++ b/app/rpc/rpchandlers/notify_utxos_changed.go @@ -10,7 +10,7 @@ import ( func HandleNotifyUTXOsChanged(context *rpccontext.Context, router *router.Router, request appmessage.Message) (appmessage.Message, error) { if !context.Config.UTXOIndex { errorMessage := appmessage.NewNotifyUTXOsChangedResponseMessage() - errorMessage.Error = appmessage.RPCErrorf("Method unavailable when kaspad is run without --utxoindex") + errorMessage.Error = appmessage.RPCErrorf("Method unavailable when c4exd is run without --utxoindex") return errorMessage, nil } diff --git a/app/rpc/rpchandlers/stop_notifying_utxos_changed.go b/app/rpc/rpchandlers/stop_notifying_utxos_changed.go index 3b4a0589e..a6431d700 100644 --- a/app/rpc/rpchandlers/stop_notifying_utxos_changed.go +++ b/app/rpc/rpchandlers/stop_notifying_utxos_changed.go @@ -10,7 +10,7 @@ import ( func HandleStopNotifyingUTXOsChanged(context *rpccontext.Context, router *router.Router, request appmessage.Message) (appmessage.Message, error) { if !context.Config.UTXOIndex { errorMessage := appmessage.NewStopNotifyingUTXOsChangedResponseMessage() - errorMessage.Error = appmessage.RPCErrorf("Method unavailable when kaspad is run without --utxoindex") + errorMessage.Error = appmessage.RPCErrorf("Method unavailable when c4exd is run without --utxoindex") return errorMessage, nil } diff --git a/build_and_test.sh b/build_and_test.sh index 76cb28049..4f10657b6 100755 --- a/build_and_test.sh +++ b/build_and_test.sh @@ -14,7 +14,7 @@ golint -set_exit_status ./... staticcheck -checks SA4006,SA4008,SA4009,SA4010,SA5003,SA1004,SA1014,SA1021,SA1023,SA1024,SA1025,SA1026,SA1027,SA1028,SA2000,SA2001,SA2003,SA4000,SA4001,SA4003,SA4004,SA4011,SA4012,SA4013,SA4014,SA4015,SA4016,SA4017,SA4018,SA4019,SA4020,SA4021,SA4022,SA4023,SA5000,SA5002,SA5004,SA5005,SA5007,SA5008,SA5009,SA5010,SA5011,SA5012,SA6001,SA6002,SA9001,SA9002,SA9003,SA9004,SA9005,SA9006,ST1019 ./... -go build $FLAGS -o kaspad . +go build $FLAGS -o c4exd . if [ -n "${NO_PARALLEL}" ] then diff --git a/changelog.txt b/changelog.txt index f3712866b..7ad48b548 100644 --- a/changelog.txt +++ b/changelog.txt @@ -11,8 +11,8 @@ Kaspad v0.12.12 - 2023-03-06 * Rename last references to blockheight (#2089) * Add code of conduct (#2183) * Extend TestGetPreciseSigOps with more tests (#2188) -* Add Dockerfile to kaspawallet (#2187) -* Add `--send-all` to `kaspawallet send` command (#2181) +* Add Dockerfile to c4exwallet (#2187) +* Add `--send-all` to `c4exwallet send` command (#2181) * Bump golang.org/x/text from 0.3.5 to 0.3.8 (#2190) * Upgrade to go 1.19 (#2191) @@ -43,7 +43,7 @@ Kaspad v0.12.8 - 2022-10-23 =========================== * Remove hard fork activation rules (#2152) -* Add lock file to kaspawallet (#2154) +* Add lock file to c4exwallet (#2154) * Add a new testnet DNS seeder (#2156) * Use utxo diff algo for pruning point move and use acceptance data method only as a fall-back (#2157) * Make more checks if status is invalid even if the block exists (#2158) @@ -52,7 +52,7 @@ Kaspad v0.12.8 - 2022-10-23 Kaspad v0.12.7 - 2022-09-21 =========================== -* Security Fix + Hard fork - Full details can be seen here: https://medium.com/@michaelsuttonil/kaspa-security-patch-and-hard-fork-september-2022-12da617b0094 +* Security Fix + Hard fork - Full details can be seen here: https://medium.com/@michaelsuttonil/c4ex-security-patch-and-hard-fork-september-2022-12da617b0094 Kaspad v0.12.6 - 2022-09-09 =========================== @@ -103,7 +103,7 @@ Kaspad v0.12.2 - 2022-06-17 * Clarify wallet message concerning a wallet daemon sync state (#2045) * Change the way the miner executable reports execution errors (closes issue #1677) (#2048) -* Fix kaspawallet help messages, clarify sweep command help string (#2067) +* Fix c4exwallet help messages, clarify sweep command help string (#2067) * Wallet parse/send/create commands improvement (#2024) * Use chunks for `GetBlocksAcceptanceData` calls in order to avoid blocking consensus for too long (#2075) * Unite multiple `GetBlockAcceptanceData` consensus calls to one (#2074) @@ -121,7 +121,7 @@ Bug Fixes: Kaspad v0.12.1 - 2022-05-31 =========================== -* Fix utxoindex synchronization bug which resulted in kaspawallet orphan tx errors (#2052, #2056, #2059) +* Fix utxoindex synchronization bug which resulted in c4exwallet orphan tx errors (#2052, #2056, #2059) * Add a channel mechanism for consensus events to be processed in the order they were produced (#2052, #2056, #2059) * Block template cache improvement (#2023) * Improved staging shard performance (#2034) @@ -130,14 +130,14 @@ Kaspad v0.12.1 - 2022-05-31 * Remove HF1 activation code (#2042) Kaspa wallet: -* Various kaspawallet text fixes and log additions (#2032, #2047, #2062) +* Various c4exwallet text fixes and log additions (#2032, #2047, #2062) * Wallet address synchronization improvement (#2025) -* Add support for `from` address in `kaspawallet send` (#1964) -* Make kaspawallet ignore outputs that exist in the mempool (#2053) +* Add support for `from` address in `c4exwallet send` (#1964) +* Make c4exwallet ignore outputs that exist in the mempool (#2053) * Wrap the entire wallet send operation with a lock (#2063) RPC API: -* Add "GetMempoolEntriesByAddresses" to kaspad RPC (#2022) +* Add "GetMempoolEntriesByAddresses" to c4exd RPC (#2022) * Make sure RPCErrors are returned and do not crash the system (#2039) * Add AcceptedTransactionIDs to ChainChanged notification and VirtualSelectedParentChain RPC (#2036, for exchanges to track tx confirmations) * Allow blank address in NotifyUTXOsChanged to get all updates (#2027) @@ -157,7 +157,7 @@ Bug fixes: * Use cosigner index 0 for read only wallets (#2014) Non-breaking changes: -* Adding a "sweep" command to `kaspawallet` (#2018) +* Adding a "sweep" command to `c4exwallet` (#2018) * Use `blue work` heuristic to skip irrelevant relay blocks * Kaspawallet daemon: Add Send and Sign commands (#2016) @@ -171,12 +171,12 @@ Kaspad v0.11.16 - 2022-04-05 Kaspad v0.11.15 - 2022-04-05 =========================== -* Add support for auto-compound in `kaspawallet send` (#1951) +* Add support for auto-compound in `c4exwallet send` (#1951) * Unite reachability stores (#1963, #1993, #2001) * Add names to nameless routes (#1986) -* Optimize the miner-kaspad flow and latency (#1988) +* Optimize the miner-c4exd flow and latency (#1988) * Upgrade to go 1.18 (#1992) -* Add package name to kaspawalletd .proto file (#1991) +* Add package name to c4exwalletd .proto file (#1991) * Block template cache (#1994) * Add extra data to GetBlockTemplate request (#1995, #1997) * New definition for "out of sync" (#1996) @@ -195,20 +195,20 @@ Kaspad v0.11.13 - 2022-03-16 =========================== * Display progress of IBD process in Kaspad logs (#1938, #1939, #1949, #1977) * Optimize DB writes during fresh IBD (#1937) -* Add AllowConnectionToDifferentVersions flag to kaspactl (#1940) +* Add AllowConnectionToDifferentVersions flag to c4exctl (#1940) * Drop support for p2p v3 (#1942) * Various transaction processing fixes and workarounds (#1943, #1946, #1971, #1974) -* Make kaspawallet store the utxos sorted by amount (#1947) -* Implement a `parse` sub command in the kaspawallet (#1953) +* Make c4exwallet store the utxos sorted by amount (#1947) +* Implement a `parse` sub command in the c4exwallet (#1953) * Set MaxBlockLevels for non-mainnet networks to 250 (#1952) * Add cache to DAA block window (#1948) -* kaspactl: string slice parser for GetUtxosByAddresses (#1955, first contribution by @icook) +* c4exctl: string slice parser for GetUtxosByAddresses (#1955, first contribution by @icook) * Add MergeSet and IsChainBlock to RPC (#1961) * Ignore transaction invs during IBD (#1960) * Optimize validation of expected header pruning point (#1962) * Fix a bug in bounded marge depth validation (#1966) * Don't relay blocks in virtual anticone (#1970) -* Add version to block template to allow tracking of miner's kaspad version (#1967) +* Add version to block template to allow tracking of miner's c4exd version (#1967) * New p2p version: v5 (#1969) * Fix IBD shared past negotiation to be non quadratic also in the worst-case (#1969, p2p v5) * Send pruning point anticone in batches (#1973, p2p v5) @@ -239,10 +239,10 @@ Bug fixes: Non-breaking changes: * Address search: cleanup repetitively-offline addresses and use randomization weighted by connection failures (#1899, #1916) * New DNS seeders and removal of offline one (#1901, #1910, #1918) -* Add request balance by address to kaspactl (#1885) +* Add request balance by address to c4exctl (#1885) * Wallet: show balance by addresses (#1904) * Reject outdated non-DAA blocks submitted via RPC (#1914) -* Add a profile option to kaspawallet daemon (#1854) +* Add a profile option to c4exwallet daemon (#1854) Kaspad v0.11.8 - 2021-12-13 =========================== @@ -256,7 +256,7 @@ Non-breaking changes: Kaspad v0.11.7 - 2021-12-11 =========================== Breaking changes: -* kaspawallet: show-address →new-address + show-addresses (#1870) +* c4exwallet: show-address →new-address + show-addresses (#1870) Bug fixes: * Fix numThreads using getAEAD instead of decryptMnemonic (#1859) @@ -266,7 +266,7 @@ Non-breaking changes: * Ignore header mass in devnet and testnet (#1879) * Remove unused args from CalcSubsidy (#1877) * ExpectedHeaderPruningPoint fix (#1876) -* Changes to libkaspawallet to support Kaspaper (#1878) +* Changes to libc4exwallet to support Kaspaper (#1878) * Get rid of genesis's UTXO dump (#1867) 주요 변경 사항: * devnet 및 testnet에서 헤더 질량을 무시합니다(#1879) @@ -309,7 +309,7 @@ Major changes include: * Removing RIPEMD160 and SHA1 from the codebase entirely * Making P2PKH transactions non-standard * Vastly enhancing the CLI wallet -* Restructuring kaspad's app/home directory +* Restructuring c4exd's app/home directory * Modifying block and transaction types in the RPC to be easier to consume clientside A partial list of the more-important commits is as follows: @@ -322,7 +322,7 @@ A partial list of the more-important commits is as follows: * Use DAA score where needed (#1602) * Remove the Services field from NetAddress. (#1610) * Fix getBlocks to not add the anticone when some blocks were filtered by GetHashesBetween (#1611) -* Restructure the default ~/.kaspad directory layout (#1613) +* Restructure the default ~/.c4exd directory layout (#1613) * Replace the HomeDir flag with a AppDir flag (#1615) * Implement BIP-143-like sighash (#1598) * Change --datadir to --appdir and remove symmetrical connection in stability tests (#1617) @@ -334,7 +334,7 @@ A partial list of the more-important commits is as follows: * Add mass limit to mempool (#1627) * In RPC, use RPCTransactions and RPCBlocks instead of TransactionMessages and BlockMessages (#1609) * Use go-secp256k1 v0.0.5 (#1640) -* Add a show-address subcommand to kaspawallet (#1653) +* Add a show-address subcommand to c4exwallet (#1653) * Replace p2pkh with p2pk (#1650) * Implement importing private keys into the wallet (#1655) * Add dump unencrypted data sub command to the wallet (#1661) @@ -363,7 +363,7 @@ Kaspad v0.9.0 - 2021-03-04 * Add default dns-seeder to testnet (#1568) * Fix utxoindex deserialization (#1566) * Add pruning point hash to GetBlockDagInfo response (#1565) -* Use EmitUnpopulated so that kaspactl prints all fields, even the default ones (#1561) +* Use EmitUnpopulated so that c4exctl prints all fields, even the default ones (#1561) * Stop logging an error whenever an RPC/P2P connection is canceled (#1562) * Cleanup the logger and make it asynchronous (#1524) * Close all iterators (#1542) @@ -379,6 +379,6 @@ Kaspad v0.8.10 - 2021-02-25 * Remove virtual diff parents - only selectedTip is virtualDiffParent now (#1550) * Fix UTXO index (#1548) * Prevent fast failing (#1545) -* Increase the sleep time in kaspaminer when the node is not synced (#1544) +* Increase the sleep time in c4exminer when the node is not synced (#1544) * Disallow header only blocks on RPC, relay and when requesting IBD full blocks (#1537) * Make templateManager hold a DomainBlock and isSynced bool instead of a GetBlockTemplateResponseMessage (#1538) diff --git a/cmd/kaspactl/README.md b/cmd/c4exctl/README.md similarity index 77% rename from cmd/kaspactl/README.md rename to cmd/c4exctl/README.md index 64b5f6617..e54223848 100644 --- a/cmd/kaspactl/README.md +++ b/cmd/c4exctl/README.md @@ -1,6 +1,6 @@ -# kaspactl +# c4exctl -kaspactl is an RPC client for kaspad +c4exctl is an RPC client for c4exd ## Requirements @@ -19,11 +19,11 @@ Go 1.19 or later. $ go version ``` -- Run the following commands to obtain and install kaspad including all dependencies: +- Run the following commands to obtain and install c4exd including all dependencies: ```bash -$ git clone https://github.com/c4ei/kaspad -$ cd kaspad/cmd/kaspactl +$ git clone https://github.com/c4ei/c4exd +$ cd c4exd/cmd/c4exctl $ go install . ``` @@ -42,13 +42,13 @@ $ kaspctl --help But the minimum configuration needed to run it is: ```bash -$ kaspactl +$ c4exctl ``` For example: ``` -$ kaspactl '{"getBlockDagInfoRequest":{}}' +$ c4exctl '{"getBlockDagInfoRequest":{}}' ``` For a list of all available requests check out the [RPC documentation](infrastructure/network/netadapter/server/grpcserver/protowire/rpc.md) \ No newline at end of file diff --git a/cmd/kaspactl/command_parser.go b/cmd/c4exctl/command_parser.go similarity index 100% rename from cmd/kaspactl/command_parser.go rename to cmd/c4exctl/command_parser.go diff --git a/cmd/kaspactl/commands.go b/cmd/c4exctl/commands.go similarity index 100% rename from cmd/kaspactl/commands.go rename to cmd/c4exctl/commands.go diff --git a/cmd/kaspactl/config.go b/cmd/c4exctl/config.go similarity index 85% rename from cmd/kaspactl/config.go rename to cmd/c4exctl/config.go index 1bf6e70e4..9917230a1 100644 --- a/cmd/kaspactl/config.go +++ b/cmd/c4exctl/config.go @@ -16,7 +16,7 @@ type configFlags struct { Timeout uint64 `short:"t" long:"timeout" description:"Timeout for the request (in seconds)"` RequestJSON string `short:"j" long:"json" description:"The request in JSON format"` ListCommands bool `short:"l" long:"list-commands" description:"List all commands and exit"` - AllowConnectionToDifferentVersions bool `short:"a" long:"allow-connection-to-different-versions" description:"Allow connections to versions different than kaspactl's version'"` + AllowConnectionToDifferentVersions bool `short:"a" long:"allow-connection-to-different-versions" description:"Allow connections to versions different than c4exctl's version'"` CommandAndParameters []string config.NetworkFlags } @@ -27,8 +27,8 @@ func parseConfig() (*configFlags, error) { Timeout: defaultTimeout, } parser := flags.NewParser(cfg, flags.HelpFlag) - parser.Usage = "kaspactl [OPTIONS] [COMMAND] [COMMAND PARAMETERS].\n\nCommand can be supplied only if --json is not used." + - "\n\nUse `kaspactl --list-commands` to get a list of all commands and their parameters." + + parser.Usage = "c4exctl [OPTIONS] [COMMAND] [COMMAND PARAMETERS].\n\nCommand can be supplied only if --json is not used." + + "\n\nUse `c4exctl --list-commands` to get a list of all commands and their parameters." + "\nFor optional parameters- use '-' without quotes to not pass the parameter.\n" remainingArgs, err := parser.Parse() if err != nil { diff --git a/cmd/kaspactl/docker/Dockerfile b/cmd/c4exctl/docker/Dockerfile similarity index 57% rename from cmd/kaspactl/docker/Dockerfile rename to cmd/c4exctl/docker/Dockerfile index 0c20df905..9d991fccf 100644 --- a/cmd/kaspactl/docker/Dockerfile +++ b/cmd/c4exctl/docker/Dockerfile @@ -1,9 +1,9 @@ # -- multistage docker build: stage #1: build stage FROM golang:1.19-alpine AS build -RUN mkdir -p /go/src/github.com/c4ei/kaspad +RUN mkdir -p /go/src/github.com/c4ei/c4exd -WORKDIR /go/src/github.com/c4ei/kaspad +WORKDIR /go/src/github.com/c4ei/c4exd RUN apk add --no-cache curl git openssh binutils gcc musl-dev @@ -14,9 +14,9 @@ RUN go mod download COPY . . -WORKDIR /go/src/github.com/c4ei/yunseokyeol/cmd/kaspactl +WORKDIR /go/src/github.com/c4ei/yunseokyeol/cmd/c4exctl -RUN GOOS=linux go build -a -installsuffix cgo -o kaspactl . +RUN GOOS=linux go build -a -installsuffix cgo -o c4exctl . # --- multistage docker build: stage #2: runtime image FROM alpine @@ -24,7 +24,7 @@ WORKDIR /app RUN apk add --no-cache ca-certificates tini -COPY --from=build /go/src/github.com/c4ei/yunseokyeol/cmd/kaspactl/kaspactl /app/ +COPY --from=build /go/src/github.com/c4ei/yunseokyeol/cmd/c4exctl/c4exctl /app/ USER nobody ENTRYPOINT [ "/sbin/tini", "--" ] diff --git a/cmd/kaspactl/main.go b/cmd/c4exctl/main.go similarity index 89% rename from cmd/kaspactl/main.go rename to cmd/c4exctl/main.go index 72fff13b3..1835272cc 100644 --- a/cmd/kaspactl/main.go +++ b/cmd/c4exctl/main.go @@ -36,13 +36,13 @@ func main() { defer client.Disconnect() if !cfg.AllowConnectionToDifferentVersions { - kaspadMessage, err := client.Post(&protowire.KaspadMessage{Payload: &protowire.KaspadMessage_GetInfoRequest{GetInfoRequest: &protowire.GetInfoRequestMessage{}}}) + c4exdMessage, err := client.Post(&protowire.KaspadMessage{Payload: &protowire.KaspadMessage_GetInfoRequest{GetInfoRequest: &protowire.GetInfoRequestMessage{}}}) if err != nil { printErrorAndExit(fmt.Sprintf("Cannot post GetInfo message: %s", err)) } localVersion := version.Version() - remoteVersion := kaspadMessage.GetGetInfoResponse().ServerVersion + remoteVersion := c4exdMessage.GetGetInfoResponse().ServerVersion if localVersion != remoteVersion { printErrorAndExit(fmt.Sprintf("Server version mismatch, expect: %s, got: %s", localVersion, remoteVersion)) @@ -101,8 +101,8 @@ func postJSON(cfg *configFlags, client *grpcclient.GRPCClient, doneChan chan str } func prettifyResponse(response string) string { - kaspadMessage := &protowire.KaspadMessage{} - err := protojson.Unmarshal([]byte(response), kaspadMessage) + c4exdMessage := &protowire.KaspadMessage{} + err := protojson.Unmarshal([]byte(response), c4exdMessage) if err != nil { printErrorAndExit(fmt.Sprintf("error parsing the response from the RPC server: %s", err)) } @@ -110,7 +110,7 @@ func prettifyResponse(response string) string { marshalOptions := &protojson.MarshalOptions{} marshalOptions.Indent = " " marshalOptions.EmitUnpopulated = true - return marshalOptions.Format(kaspadMessage) + return marshalOptions.Format(c4exdMessage) } func printErrorAndExit(message string) { diff --git a/cmd/kaspactl/reflection_helpers.go b/cmd/c4exctl/reflection_helpers.go similarity index 89% rename from cmd/kaspactl/reflection_helpers.go rename to cmd/c4exctl/reflection_helpers.go index 39d1d2ea8..cd3ee1002 100644 --- a/cmd/kaspactl/reflection_helpers.go +++ b/cmd/c4exctl/reflection_helpers.go @@ -33,9 +33,9 @@ func generateKaspadMessage(commandValue reflect.Value, commandDesc *commandDescr commandWrapper := reflect.New(commandDesc.typeof) unwrapCommandValue(commandWrapper).Set(commandValue) - kaspadMessage := reflect.New(reflect.TypeOf(protowire.KaspadMessage{})) - kaspadMessage.Elem().FieldByName("Payload").Set(commandWrapper) - return kaspadMessage.Interface().(*protowire.KaspadMessage), nil + c4exdMessage := reflect.New(reflect.TypeOf(protowire.KaspadMessage{})) + c4exdMessage.Elem().FieldByName("Payload").Set(commandWrapper) + return c4exdMessage.Interface().(*protowire.KaspadMessage), nil } // pointerToValue returns a reflect.Value that represents a pointer to the given value diff --git a/cmd/kaspaminer/README.md b/cmd/c4exminer/README.md similarity index 62% rename from cmd/kaspaminer/README.md rename to cmd/c4exminer/README.md index 5809cc234..65869ec7a 100644 --- a/cmd/kaspaminer/README.md +++ b/cmd/c4exminer/README.md @@ -1,6 +1,6 @@ -# kaspaminer +# c4exminer -Kaspaminer is a CPU-based miner for kaspad +Kaspaminer is a CPU-based miner for c4exd ## Requirements @@ -19,11 +19,11 @@ Go 1.19 or later. $ go version ``` -- Run the following commands to obtain and install kaspad including all dependencies: +- Run the following commands to obtain and install c4exd including all dependencies: ```bash -$ git clone https://github.com/c4ei/kaspad -$ cd kaspad/cmd/kaspaminer +$ git clone https://github.com/c4ei/c4exd +$ cd c4exd/cmd/c4exminer $ go install . ``` @@ -33,13 +33,13 @@ $ go install . ## Usage -The full kaspaminer configuration options can be seen with: +The full c4exminer configuration options can be seen with: ```bash -$ kaspaminer --help +$ c4exminer --help ``` But the minimum configuration needed to run it is: ```bash -$ kaspaminer --miningaddr= +$ c4exminer --miningaddr= ``` \ No newline at end of file diff --git a/cmd/kaspaminer/client.go b/cmd/c4exminer/client.go similarity index 100% rename from cmd/kaspaminer/client.go rename to cmd/c4exminer/client.go diff --git a/cmd/kaspaminer/config.go b/cmd/c4exminer/config.go similarity index 94% rename from cmd/kaspaminer/config.go rename to cmd/c4exminer/config.go index e9a265b93..2394dff1f 100644 --- a/cmd/kaspaminer/config.go +++ b/cmd/c4exminer/config.go @@ -17,14 +17,14 @@ import ( ) const ( - defaultLogFilename = "kaspaminer.log" - defaultErrLogFilename = "kaspaminer_err.log" + defaultLogFilename = "c4exminer.log" + defaultErrLogFilename = "c4exminer_err.log" defaultTargetBlockRateRatio = 2.0 ) var ( // Default configuration options - defaultAppDir = util.AppDir("kaspaminer", false) + defaultAppDir = util.AppDir("c4exminer", false) defaultLogFile = filepath.Join(defaultAppDir, defaultLogFilename) defaultErrLogFile = filepath.Join(defaultAppDir, defaultErrLogFilename) defaultRPCServer = "localhost" diff --git a/cmd/kaspaminer/docker/Dockerfile b/cmd/c4exminer/docker/Dockerfile similarity index 57% rename from cmd/kaspaminer/docker/Dockerfile rename to cmd/c4exminer/docker/Dockerfile index 70f0c8b9e..92afe6a5e 100644 --- a/cmd/kaspaminer/docker/Dockerfile +++ b/cmd/c4exminer/docker/Dockerfile @@ -1,9 +1,9 @@ # -- multistage docker build: stage #1: build stage FROM golang:1.19-alpine AS build -RUN mkdir -p /go/src/github.com/c4ei/kaspad +RUN mkdir -p /go/src/github.com/c4ei/c4exd -WORKDIR /go/src/github.com/c4ei/kaspad +WORKDIR /go/src/github.com/c4ei/c4exd RUN apk add --no-cache curl git openssh binutils gcc musl-dev @@ -14,8 +14,8 @@ RUN go mod download COPY . . -WORKDIR /go/src/github.com/c4ei/yunseokyeol/cmd/kaspaminer -RUN GOOS=linux go build -a -installsuffix cgo -o kaspaminer . +WORKDIR /go/src/github.com/c4ei/yunseokyeol/cmd/c4exminer +RUN GOOS=linux go build -a -installsuffix cgo -o c4exminer . # --- multistage docker build: stage #2: runtime image FROM alpine @@ -23,7 +23,7 @@ WORKDIR /app RUN apk add --no-cache ca-certificates tini -COPY --from=build /go/src/github.com/c4ei/yunseokyeol/cmd/kaspaminer/kaspaminer /app/ +COPY --from=build /go/src/github.com/c4ei/yunseokyeol/cmd/c4exminer/c4exminer /app/ USER nobody ENTRYPOINT [ "/sbin/tini", "--" ] diff --git a/cmd/kaspaminer/log.go b/cmd/c4exminer/log.go similarity index 100% rename from cmd/kaspaminer/log.go rename to cmd/c4exminer/log.go diff --git a/cmd/kaspaminer/main.go b/cmd/c4exminer/main.go similarity index 100% rename from cmd/kaspaminer/main.go rename to cmd/c4exminer/main.go diff --git a/cmd/kaspaminer/mineloop.go b/cmd/c4exminer/mineloop.go similarity index 98% rename from cmd/kaspaminer/mineloop.go rename to cmd/c4exminer/mineloop.go index c831c88c1..1d148c5b0 100644 --- a/cmd/kaspaminer/mineloop.go +++ b/cmd/c4exminer/mineloop.go @@ -9,7 +9,7 @@ import ( "github.com/c4ei/yunseokyeol/version" "github.com/c4ei/yunseokyeol/app/appmessage" - "github.com/c4ei/yunseokyeol/cmd/kaspaminer/templatemanager" + "github.com/c4ei/yunseokyeol/cmd/c4exminer/templatemanager" "github.com/c4ei/yunseokyeol/domain/consensus/model/externalapi" "github.com/c4ei/yunseokyeol/domain/consensus/utils/consensushashing" "github.com/c4ei/yunseokyeol/domain/consensus/utils/pow" @@ -189,7 +189,7 @@ func getBlockForMining(mineWhenNotSynced bool) (*externalapi.DomainBlock, *pow.S func templatesLoop(client *minerClient, miningAddr util.Address, errChan chan error) { getBlockTemplate := func() { - template, err := client.GetBlockTemplate(miningAddr.String(), "kaspaminer-"+version.Version()) + template, err := client.GetBlockTemplate(miningAddr.String(), "c4exminer-"+version.Version()) if nativeerrors.Is(err, router.ErrTimeout) { log.Warnf("Got timeout while requesting block template from %s: %s", client.Address(), err) reconnectErr := client.Reconnect() diff --git a/cmd/kaspaminer/templatemanager/templatemanager.go b/cmd/c4exminer/templatemanager/templatemanager.go similarity index 100% rename from cmd/kaspaminer/templatemanager/templatemanager.go rename to cmd/c4exminer/templatemanager/templatemanager.go diff --git a/cmd/kaspawallet/balance.go b/cmd/c4exwallet/balance.go similarity index 88% rename from cmd/kaspawallet/balance.go rename to cmd/c4exwallet/balance.go index 569668d40..094afdaef 100644 --- a/cmd/kaspawallet/balance.go +++ b/cmd/c4exwallet/balance.go @@ -4,9 +4,9 @@ import ( "context" "fmt" - "github.com/c4ei/yunseokyeol/cmd/kaspawallet/daemon/client" - "github.com/c4ei/yunseokyeol/cmd/kaspawallet/daemon/pb" - "github.com/c4ei/yunseokyeol/cmd/kaspawallet/utils" + "github.com/c4ei/yunseokyeol/cmd/c4exwallet/daemon/client" + "github.com/c4ei/yunseokyeol/cmd/c4exwallet/daemon/pb" + "github.com/c4ei/yunseokyeol/cmd/c4exwallet/utils" ) func balance(conf *balanceConfig) error { diff --git a/cmd/kaspawallet/broadcast.go b/cmd/c4exwallet/broadcast.go similarity index 92% rename from cmd/kaspawallet/broadcast.go rename to cmd/c4exwallet/broadcast.go index f58137737..d1ebafbfa 100644 --- a/cmd/kaspawallet/broadcast.go +++ b/cmd/c4exwallet/broadcast.go @@ -6,8 +6,8 @@ import ( "io/ioutil" "strings" - "github.com/c4ei/yunseokyeol/cmd/kaspawallet/daemon/client" - "github.com/c4ei/yunseokyeol/cmd/kaspawallet/daemon/pb" + "github.com/c4ei/yunseokyeol/cmd/c4exwallet/daemon/client" + "github.com/c4ei/yunseokyeol/cmd/c4exwallet/daemon/pb" "github.com/pkg/errors" ) diff --git a/cmd/kaspawallet/common.go b/cmd/c4exwallet/common.go similarity index 100% rename from cmd/kaspawallet/common.go rename to cmd/c4exwallet/common.go diff --git a/cmd/kaspawallet/config.go b/cmd/c4exwallet/config.go similarity index 95% rename from cmd/kaspawallet/config.go rename to cmd/c4exwallet/config.go index 4f7f5fee4..b59bbdef5 100644 --- a/cmd/kaspawallet/config.go +++ b/cmd/c4exwallet/config.go @@ -34,7 +34,7 @@ type configFlags struct { } type createConfig struct { - KeysFile string `long:"keys-file" short:"f" description:"Keys file location (default: ~/.kaspawallet/keys.json (*nix), %USERPROFILE%\\AppData\\Local\\Kaspawallet\\key.json (Windows))"` + KeysFile string `long:"keys-file" short:"f" description:"Keys file location (default: ~/.c4exwallet/keys.json (*nix), %USERPROFILE%\\AppData\\Local\\Kaspawallet\\key.json (Windows))"` Password string `long:"password" short:"p" description:"Wallet password"` Yes bool `long:"yes" short:"y" description:"Assume \"yes\" to all questions"` MinimumSignatures uint32 `long:"min-signatures" short:"m" description:"Minimum required signatures" default:"1"` @@ -52,7 +52,7 @@ type balanceConfig struct { } type sendConfig struct { - KeysFile string `long:"keys-file" short:"f" description:"Keys file location (default: ~/.kaspawallet/keys.json (*nix), %USERPROFILE%\\AppData\\Local\\Kaspawallet\\key.json (Windows))"` + KeysFile string `long:"keys-file" short:"f" description:"Keys file location (default: ~/.c4exwallet/keys.json (*nix), %USERPROFILE%\\AppData\\Local\\Kaspawallet\\key.json (Windows))"` Password string `long:"password" short:"p" description:"Wallet password"` DaemonAddress string `long:"daemonaddress" short:"d" description:"Wallet daemon server to connect to"` ToAddress string `long:"to-address" short:"t" description:"The public address to send Kaspa to" required:"true"` @@ -81,7 +81,7 @@ type createUnsignedTransactionConfig struct { } type signConfig struct { - KeysFile string `long:"keys-file" short:"f" description:"Keys file location (default: ~/.kaspawallet/keys.json (*nix), %USERPROFILE%\\AppData\\Local\\Kaspawallet\\key.json (Windows))"` + KeysFile string `long:"keys-file" short:"f" description:"Keys file location (default: ~/.c4exwallet/keys.json (*nix), %USERPROFILE%\\AppData\\Local\\Kaspawallet\\key.json (Windows))"` Password string `long:"password" short:"p" description:"Wallet password"` Transaction string `long:"transaction" short:"t" description:"The unsigned transaction(s) to sign on (encoded in hex)"` TransactionFile string `long:"transaction-file" short:"F" description:"The file containing the unsigned transaction(s) to sign on (encoded in hex)"` @@ -113,7 +113,7 @@ type newAddressConfig struct { } type startDaemonConfig struct { - KeysFile string `long:"keys-file" short:"f" description:"Keys file location (default: ~/.kaspawallet/keys.json (*nix), %USERPROFILE%\\AppData\\Local\\Kaspawallet\\key.json (Windows))"` + KeysFile string `long:"keys-file" short:"f" description:"Keys file location (default: ~/.c4exwallet/keys.json (*nix), %USERPROFILE%\\AppData\\Local\\Kaspawallet\\key.json (Windows))"` Password string `long:"password" short:"p" description:"Wallet password"` RPCServer string `long:"rpcserver" short:"s" description:"RPC server to connect to"` Listen string `long:"listen" short:"l" description:"Address to listen on (default: 0.0.0.0:8082)"` @@ -123,7 +123,7 @@ type startDaemonConfig struct { } type dumpUnencryptedDataConfig struct { - KeysFile string `long:"keys-file" short:"f" description:"Keys file location (default: ~/.kaspawallet/keys.json (*nix), %USERPROFILE%\\AppData\\Local\\Kaspawallet\\key.json (Windows))"` + KeysFile string `long:"keys-file" short:"f" description:"Keys file location (default: ~/.c4exwallet/keys.json (*nix), %USERPROFILE%\\AppData\\Local\\Kaspawallet\\key.json (Windows))"` Password string `long:"password" short:"p" description:"Wallet password"` Yes bool `long:"yes" short:"y" description:"Assume \"yes\" to all questions"` config.NetworkFlags diff --git a/cmd/kaspawallet/create.go b/cmd/c4exwallet/create.go similarity index 80% rename from cmd/kaspawallet/create.go rename to cmd/c4exwallet/create.go index 8e330158f..a3101c8ca 100644 --- a/cmd/kaspawallet/create.go +++ b/cmd/c4exwallet/create.go @@ -5,12 +5,12 @@ import ( "fmt" "os" - "github.com/c4ei/yunseokyeol/cmd/kaspawallet/libkaspawallet" - "github.com/c4ei/yunseokyeol/cmd/kaspawallet/libkaspawallet/bip32" - "github.com/c4ei/yunseokyeol/cmd/kaspawallet/utils" + "github.com/c4ei/yunseokyeol/cmd/c4exwallet/libc4exwallet" + "github.com/c4ei/yunseokyeol/cmd/c4exwallet/libc4exwallet/bip32" + "github.com/c4ei/yunseokyeol/cmd/c4exwallet/utils" "github.com/pkg/errors" - "github.com/c4ei/yunseokyeol/cmd/kaspawallet/keys" + "github.com/c4ei/yunseokyeol/cmd/c4exwallet/keys" ) func create(conf *createConfig) error { @@ -32,8 +32,8 @@ func create(conf *createConfig) error { } fmt.Printf("Notice the above is neither a secret key to your wallet " + - "(use \"kaspawallet dump-unencrypted-data\" to see a secret seed phrase) " + - "nor a wallet public address (use \"kaspawallet new-address\" to create and see one)\n\n") + "(use \"c4exwallet dump-unencrypted-data\" to see a secret seed phrase) " + + "nor a wallet public address (use \"c4exwallet new-address\" to create and see one)\n\n") extendedPublicKeys := make([]string, conf.NumPrivateKeys, conf.NumPublicKeys) copy(extendedPublicKeys, signerExtendedPublicKeys) @@ -58,7 +58,7 @@ func create(conf *createConfig) error { // For a read only wallet the cosigner index is 0 cosignerIndex := uint32(0) if len(signerExtendedPublicKeys) > 0 { - cosignerIndex, err = libkaspawallet.MinimumCosignerIndex(signerExtendedPublicKeys, extendedPublicKeys) + cosignerIndex, err = libc4exwallet.MinimumCosignerIndex(signerExtendedPublicKeys, extendedPublicKeys) if err != nil { return err } diff --git a/cmd/kaspawallet/create_unsigned_tx.go b/cmd/c4exwallet/create_unsigned_tx.go similarity index 89% rename from cmd/kaspawallet/create_unsigned_tx.go rename to cmd/c4exwallet/create_unsigned_tx.go index 9c929853b..f0da4eae5 100644 --- a/cmd/kaspawallet/create_unsigned_tx.go +++ b/cmd/c4exwallet/create_unsigned_tx.go @@ -5,8 +5,8 @@ import ( "fmt" "os" - "github.com/c4ei/yunseokyeol/cmd/kaspawallet/daemon/client" - "github.com/c4ei/yunseokyeol/cmd/kaspawallet/daemon/pb" + "github.com/c4ei/yunseokyeol/cmd/c4exwallet/daemon/client" + "github.com/c4ei/yunseokyeol/cmd/c4exwallet/daemon/pb" "github.com/c4ei/yunseokyeol/domain/consensus/utils/constants" ) diff --git a/cmd/kaspawallet/daemon/client/client.go b/cmd/c4exwallet/daemon/client/client.go similarity index 68% rename from cmd/kaspawallet/daemon/client/client.go rename to cmd/c4exwallet/daemon/client/client.go index 432361dde..008d0b6ed 100644 --- a/cmd/kaspawallet/daemon/client/client.go +++ b/cmd/c4exwallet/daemon/client/client.go @@ -4,15 +4,15 @@ import ( "context" "time" - "github.com/c4ei/yunseokyeol/cmd/kaspawallet/daemon/server" + "github.com/c4ei/yunseokyeol/cmd/c4exwallet/daemon/server" "github.com/pkg/errors" - "github.com/c4ei/yunseokyeol/cmd/kaspawallet/daemon/pb" + "github.com/c4ei/yunseokyeol/cmd/c4exwallet/daemon/pb" "google.golang.org/grpc" ) -// Connect connects to the kaspawalletd server, and returns the client instance +// Connect connects to the c4exwalletd server, and returns the client instance func Connect(address string) (pb.KaspawalletdClient, func(), error) { // Connection is local, so 1 second timeout is sufficient ctx, cancel := context.WithTimeout(context.Background(), time.Second) @@ -21,7 +21,7 @@ func Connect(address string) (pb.KaspawalletdClient, func(), error) { conn, err := grpc.DialContext(ctx, address, grpc.WithInsecure(), grpc.WithBlock(), grpc.WithDefaultCallOptions(grpc.MaxCallRecvMsgSize(server.MaxDaemonSendMsgSize))) if err != nil { if errors.Is(err, context.DeadlineExceeded) { - return nil, nil, errors.New("kaspawallet daemon is not running, start it with `kaspawallet start-daemon`") + return nil, nil, errors.New("c4exwallet daemon is not running, start it with `c4exwallet start-daemon`") } return nil, nil, err } diff --git a/cmd/kaspawallet/daemon/pb/generate.go b/cmd/c4exwallet/daemon/pb/generate.go similarity index 52% rename from cmd/kaspawallet/daemon/pb/generate.go rename to cmd/c4exwallet/daemon/pb/generate.go index 77ee07e96..675f12831 100644 --- a/cmd/kaspawallet/daemon/pb/generate.go +++ b/cmd/c4exwallet/daemon/pb/generate.go @@ -1,3 +1,3 @@ -//go:generate protoc --go_out=. --go-grpc_out=. --go_opt=paths=source_relative --go-grpc_opt=paths=source_relative kaspawalletd.proto +//go:generate protoc --go_out=. --go-grpc_out=. --go_opt=paths=source_relative --go-grpc_opt=paths=source_relative c4exwalletd.proto package pb diff --git a/cmd/kaspawallet/daemon/pb/kaspawalletd.pb.go b/cmd/c4exwallet/daemon/pb/kaspawalletd.pb.go similarity index 83% rename from cmd/kaspawallet/daemon/pb/kaspawalletd.pb.go rename to cmd/c4exwallet/daemon/pb/kaspawalletd.pb.go index 31173705f..049e7aae8 100644 --- a/cmd/kaspawallet/daemon/pb/kaspawalletd.pb.go +++ b/cmd/c4exwallet/daemon/pb/kaspawalletd.pb.go @@ -2,7 +2,7 @@ // versions: // protoc-gen-go v1.26.0 // protoc v3.21.12 -// source: kaspawalletd.proto +// source: c4exwalletd.proto package pb @@ -29,7 +29,7 @@ type GetBalanceRequest struct { func (x *GetBalanceRequest) Reset() { *x = GetBalanceRequest{} if protoimpl.UnsafeEnabled { - mi := &file_kaspawalletd_proto_msgTypes[0] + mi := &file_c4exwalletd_proto_msgTypes[0] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -42,7 +42,7 @@ func (x *GetBalanceRequest) String() string { func (*GetBalanceRequest) ProtoMessage() {} func (x *GetBalanceRequest) ProtoReflect() protoreflect.Message { - mi := &file_kaspawalletd_proto_msgTypes[0] + mi := &file_c4exwalletd_proto_msgTypes[0] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -55,7 +55,7 @@ func (x *GetBalanceRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use GetBalanceRequest.ProtoReflect.Descriptor instead. func (*GetBalanceRequest) Descriptor() ([]byte, []int) { - return file_kaspawalletd_proto_rawDescGZIP(), []int{0} + return file_c4exwalletd_proto_rawDescGZIP(), []int{0} } type GetBalanceResponse struct { @@ -71,7 +71,7 @@ type GetBalanceResponse struct { func (x *GetBalanceResponse) Reset() { *x = GetBalanceResponse{} if protoimpl.UnsafeEnabled { - mi := &file_kaspawalletd_proto_msgTypes[1] + mi := &file_c4exwalletd_proto_msgTypes[1] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -84,7 +84,7 @@ func (x *GetBalanceResponse) String() string { func (*GetBalanceResponse) ProtoMessage() {} func (x *GetBalanceResponse) ProtoReflect() protoreflect.Message { - mi := &file_kaspawalletd_proto_msgTypes[1] + mi := &file_c4exwalletd_proto_msgTypes[1] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -97,7 +97,7 @@ func (x *GetBalanceResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use GetBalanceResponse.ProtoReflect.Descriptor instead. func (*GetBalanceResponse) Descriptor() ([]byte, []int) { - return file_kaspawalletd_proto_rawDescGZIP(), []int{1} + return file_c4exwalletd_proto_rawDescGZIP(), []int{1} } func (x *GetBalanceResponse) GetAvailable() uint64 { @@ -134,7 +134,7 @@ type AddressBalances struct { func (x *AddressBalances) Reset() { *x = AddressBalances{} if protoimpl.UnsafeEnabled { - mi := &file_kaspawalletd_proto_msgTypes[2] + mi := &file_c4exwalletd_proto_msgTypes[2] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -147,7 +147,7 @@ func (x *AddressBalances) String() string { func (*AddressBalances) ProtoMessage() {} func (x *AddressBalances) ProtoReflect() protoreflect.Message { - mi := &file_kaspawalletd_proto_msgTypes[2] + mi := &file_c4exwalletd_proto_msgTypes[2] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -160,7 +160,7 @@ func (x *AddressBalances) ProtoReflect() protoreflect.Message { // Deprecated: Use AddressBalances.ProtoReflect.Descriptor instead. func (*AddressBalances) Descriptor() ([]byte, []int) { - return file_kaspawalletd_proto_rawDescGZIP(), []int{2} + return file_c4exwalletd_proto_rawDescGZIP(), []int{2} } func (x *AddressBalances) GetAddress() string { @@ -199,7 +199,7 @@ type CreateUnsignedTransactionsRequest struct { func (x *CreateUnsignedTransactionsRequest) Reset() { *x = CreateUnsignedTransactionsRequest{} if protoimpl.UnsafeEnabled { - mi := &file_kaspawalletd_proto_msgTypes[3] + mi := &file_c4exwalletd_proto_msgTypes[3] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -212,7 +212,7 @@ func (x *CreateUnsignedTransactionsRequest) String() string { func (*CreateUnsignedTransactionsRequest) ProtoMessage() {} func (x *CreateUnsignedTransactionsRequest) ProtoReflect() protoreflect.Message { - mi := &file_kaspawalletd_proto_msgTypes[3] + mi := &file_c4exwalletd_proto_msgTypes[3] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -225,7 +225,7 @@ func (x *CreateUnsignedTransactionsRequest) ProtoReflect() protoreflect.Message // Deprecated: Use CreateUnsignedTransactionsRequest.ProtoReflect.Descriptor instead. func (*CreateUnsignedTransactionsRequest) Descriptor() ([]byte, []int) { - return file_kaspawalletd_proto_rawDescGZIP(), []int{3} + return file_c4exwalletd_proto_rawDescGZIP(), []int{3} } func (x *CreateUnsignedTransactionsRequest) GetAddress() string { @@ -274,7 +274,7 @@ type CreateUnsignedTransactionsResponse struct { func (x *CreateUnsignedTransactionsResponse) Reset() { *x = CreateUnsignedTransactionsResponse{} if protoimpl.UnsafeEnabled { - mi := &file_kaspawalletd_proto_msgTypes[4] + mi := &file_c4exwalletd_proto_msgTypes[4] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -287,7 +287,7 @@ func (x *CreateUnsignedTransactionsResponse) String() string { func (*CreateUnsignedTransactionsResponse) ProtoMessage() {} func (x *CreateUnsignedTransactionsResponse) ProtoReflect() protoreflect.Message { - mi := &file_kaspawalletd_proto_msgTypes[4] + mi := &file_c4exwalletd_proto_msgTypes[4] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -300,7 +300,7 @@ func (x *CreateUnsignedTransactionsResponse) ProtoReflect() protoreflect.Message // Deprecated: Use CreateUnsignedTransactionsResponse.ProtoReflect.Descriptor instead. func (*CreateUnsignedTransactionsResponse) Descriptor() ([]byte, []int) { - return file_kaspawalletd_proto_rawDescGZIP(), []int{4} + return file_c4exwalletd_proto_rawDescGZIP(), []int{4} } func (x *CreateUnsignedTransactionsResponse) GetUnsignedTransactions() [][]byte { @@ -319,7 +319,7 @@ type ShowAddressesRequest struct { func (x *ShowAddressesRequest) Reset() { *x = ShowAddressesRequest{} if protoimpl.UnsafeEnabled { - mi := &file_kaspawalletd_proto_msgTypes[5] + mi := &file_c4exwalletd_proto_msgTypes[5] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -332,7 +332,7 @@ func (x *ShowAddressesRequest) String() string { func (*ShowAddressesRequest) ProtoMessage() {} func (x *ShowAddressesRequest) ProtoReflect() protoreflect.Message { - mi := &file_kaspawalletd_proto_msgTypes[5] + mi := &file_c4exwalletd_proto_msgTypes[5] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -345,7 +345,7 @@ func (x *ShowAddressesRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use ShowAddressesRequest.ProtoReflect.Descriptor instead. func (*ShowAddressesRequest) Descriptor() ([]byte, []int) { - return file_kaspawalletd_proto_rawDescGZIP(), []int{5} + return file_c4exwalletd_proto_rawDescGZIP(), []int{5} } type ShowAddressesResponse struct { @@ -359,7 +359,7 @@ type ShowAddressesResponse struct { func (x *ShowAddressesResponse) Reset() { *x = ShowAddressesResponse{} if protoimpl.UnsafeEnabled { - mi := &file_kaspawalletd_proto_msgTypes[6] + mi := &file_c4exwalletd_proto_msgTypes[6] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -372,7 +372,7 @@ func (x *ShowAddressesResponse) String() string { func (*ShowAddressesResponse) ProtoMessage() {} func (x *ShowAddressesResponse) ProtoReflect() protoreflect.Message { - mi := &file_kaspawalletd_proto_msgTypes[6] + mi := &file_c4exwalletd_proto_msgTypes[6] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -385,7 +385,7 @@ func (x *ShowAddressesResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use ShowAddressesResponse.ProtoReflect.Descriptor instead. func (*ShowAddressesResponse) Descriptor() ([]byte, []int) { - return file_kaspawalletd_proto_rawDescGZIP(), []int{6} + return file_c4exwalletd_proto_rawDescGZIP(), []int{6} } func (x *ShowAddressesResponse) GetAddress() []string { @@ -404,7 +404,7 @@ type NewAddressRequest struct { func (x *NewAddressRequest) Reset() { *x = NewAddressRequest{} if protoimpl.UnsafeEnabled { - mi := &file_kaspawalletd_proto_msgTypes[7] + mi := &file_c4exwalletd_proto_msgTypes[7] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -417,7 +417,7 @@ func (x *NewAddressRequest) String() string { func (*NewAddressRequest) ProtoMessage() {} func (x *NewAddressRequest) ProtoReflect() protoreflect.Message { - mi := &file_kaspawalletd_proto_msgTypes[7] + mi := &file_c4exwalletd_proto_msgTypes[7] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -430,7 +430,7 @@ func (x *NewAddressRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use NewAddressRequest.ProtoReflect.Descriptor instead. func (*NewAddressRequest) Descriptor() ([]byte, []int) { - return file_kaspawalletd_proto_rawDescGZIP(), []int{7} + return file_c4exwalletd_proto_rawDescGZIP(), []int{7} } type NewAddressResponse struct { @@ -444,7 +444,7 @@ type NewAddressResponse struct { func (x *NewAddressResponse) Reset() { *x = NewAddressResponse{} if protoimpl.UnsafeEnabled { - mi := &file_kaspawalletd_proto_msgTypes[8] + mi := &file_c4exwalletd_proto_msgTypes[8] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -457,7 +457,7 @@ func (x *NewAddressResponse) String() string { func (*NewAddressResponse) ProtoMessage() {} func (x *NewAddressResponse) ProtoReflect() protoreflect.Message { - mi := &file_kaspawalletd_proto_msgTypes[8] + mi := &file_c4exwalletd_proto_msgTypes[8] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -470,7 +470,7 @@ func (x *NewAddressResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use NewAddressResponse.ProtoReflect.Descriptor instead. func (*NewAddressResponse) Descriptor() ([]byte, []int) { - return file_kaspawalletd_proto_rawDescGZIP(), []int{8} + return file_c4exwalletd_proto_rawDescGZIP(), []int{8} } func (x *NewAddressResponse) GetAddress() string { @@ -492,7 +492,7 @@ type BroadcastRequest struct { func (x *BroadcastRequest) Reset() { *x = BroadcastRequest{} if protoimpl.UnsafeEnabled { - mi := &file_kaspawalletd_proto_msgTypes[9] + mi := &file_c4exwalletd_proto_msgTypes[9] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -505,7 +505,7 @@ func (x *BroadcastRequest) String() string { func (*BroadcastRequest) ProtoMessage() {} func (x *BroadcastRequest) ProtoReflect() protoreflect.Message { - mi := &file_kaspawalletd_proto_msgTypes[9] + mi := &file_c4exwalletd_proto_msgTypes[9] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -518,7 +518,7 @@ func (x *BroadcastRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use BroadcastRequest.ProtoReflect.Descriptor instead. func (*BroadcastRequest) Descriptor() ([]byte, []int) { - return file_kaspawalletd_proto_rawDescGZIP(), []int{9} + return file_c4exwalletd_proto_rawDescGZIP(), []int{9} } func (x *BroadcastRequest) GetIsDomain() bool { @@ -546,7 +546,7 @@ type BroadcastResponse struct { func (x *BroadcastResponse) Reset() { *x = BroadcastResponse{} if protoimpl.UnsafeEnabled { - mi := &file_kaspawalletd_proto_msgTypes[10] + mi := &file_c4exwalletd_proto_msgTypes[10] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -559,7 +559,7 @@ func (x *BroadcastResponse) String() string { func (*BroadcastResponse) ProtoMessage() {} func (x *BroadcastResponse) ProtoReflect() protoreflect.Message { - mi := &file_kaspawalletd_proto_msgTypes[10] + mi := &file_c4exwalletd_proto_msgTypes[10] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -572,7 +572,7 @@ func (x *BroadcastResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use BroadcastResponse.ProtoReflect.Descriptor instead. func (*BroadcastResponse) Descriptor() ([]byte, []int) { - return file_kaspawalletd_proto_rawDescGZIP(), []int{10} + return file_c4exwalletd_proto_rawDescGZIP(), []int{10} } func (x *BroadcastResponse) GetTxIDs() []string { @@ -591,7 +591,7 @@ type ShutdownRequest struct { func (x *ShutdownRequest) Reset() { *x = ShutdownRequest{} if protoimpl.UnsafeEnabled { - mi := &file_kaspawalletd_proto_msgTypes[11] + mi := &file_c4exwalletd_proto_msgTypes[11] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -604,7 +604,7 @@ func (x *ShutdownRequest) String() string { func (*ShutdownRequest) ProtoMessage() {} func (x *ShutdownRequest) ProtoReflect() protoreflect.Message { - mi := &file_kaspawalletd_proto_msgTypes[11] + mi := &file_c4exwalletd_proto_msgTypes[11] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -617,7 +617,7 @@ func (x *ShutdownRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use ShutdownRequest.ProtoReflect.Descriptor instead. func (*ShutdownRequest) Descriptor() ([]byte, []int) { - return file_kaspawalletd_proto_rawDescGZIP(), []int{11} + return file_c4exwalletd_proto_rawDescGZIP(), []int{11} } type ShutdownResponse struct { @@ -629,7 +629,7 @@ type ShutdownResponse struct { func (x *ShutdownResponse) Reset() { *x = ShutdownResponse{} if protoimpl.UnsafeEnabled { - mi := &file_kaspawalletd_proto_msgTypes[12] + mi := &file_c4exwalletd_proto_msgTypes[12] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -642,7 +642,7 @@ func (x *ShutdownResponse) String() string { func (*ShutdownResponse) ProtoMessage() {} func (x *ShutdownResponse) ProtoReflect() protoreflect.Message { - mi := &file_kaspawalletd_proto_msgTypes[12] + mi := &file_c4exwalletd_proto_msgTypes[12] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -655,7 +655,7 @@ func (x *ShutdownResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use ShutdownResponse.ProtoReflect.Descriptor instead. func (*ShutdownResponse) Descriptor() ([]byte, []int) { - return file_kaspawalletd_proto_rawDescGZIP(), []int{12} + return file_c4exwalletd_proto_rawDescGZIP(), []int{12} } type Outpoint struct { @@ -670,7 +670,7 @@ type Outpoint struct { func (x *Outpoint) Reset() { *x = Outpoint{} if protoimpl.UnsafeEnabled { - mi := &file_kaspawalletd_proto_msgTypes[13] + mi := &file_c4exwalletd_proto_msgTypes[13] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -683,7 +683,7 @@ func (x *Outpoint) String() string { func (*Outpoint) ProtoMessage() {} func (x *Outpoint) ProtoReflect() protoreflect.Message { - mi := &file_kaspawalletd_proto_msgTypes[13] + mi := &file_c4exwalletd_proto_msgTypes[13] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -696,7 +696,7 @@ func (x *Outpoint) ProtoReflect() protoreflect.Message { // Deprecated: Use Outpoint.ProtoReflect.Descriptor instead. func (*Outpoint) Descriptor() ([]byte, []int) { - return file_kaspawalletd_proto_rawDescGZIP(), []int{13} + return file_c4exwalletd_proto_rawDescGZIP(), []int{13} } func (x *Outpoint) GetTransactionId() string { @@ -726,7 +726,7 @@ type UtxosByAddressesEntry struct { func (x *UtxosByAddressesEntry) Reset() { *x = UtxosByAddressesEntry{} if protoimpl.UnsafeEnabled { - mi := &file_kaspawalletd_proto_msgTypes[14] + mi := &file_c4exwalletd_proto_msgTypes[14] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -739,7 +739,7 @@ func (x *UtxosByAddressesEntry) String() string { func (*UtxosByAddressesEntry) ProtoMessage() {} func (x *UtxosByAddressesEntry) ProtoReflect() protoreflect.Message { - mi := &file_kaspawalletd_proto_msgTypes[14] + mi := &file_c4exwalletd_proto_msgTypes[14] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -752,7 +752,7 @@ func (x *UtxosByAddressesEntry) ProtoReflect() protoreflect.Message { // Deprecated: Use UtxosByAddressesEntry.ProtoReflect.Descriptor instead. func (*UtxosByAddressesEntry) Descriptor() ([]byte, []int) { - return file_kaspawalletd_proto_rawDescGZIP(), []int{14} + return file_c4exwalletd_proto_rawDescGZIP(), []int{14} } func (x *UtxosByAddressesEntry) GetAddress() string { @@ -788,7 +788,7 @@ type ScriptPublicKey struct { func (x *ScriptPublicKey) Reset() { *x = ScriptPublicKey{} if protoimpl.UnsafeEnabled { - mi := &file_kaspawalletd_proto_msgTypes[15] + mi := &file_c4exwalletd_proto_msgTypes[15] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -801,7 +801,7 @@ func (x *ScriptPublicKey) String() string { func (*ScriptPublicKey) ProtoMessage() {} func (x *ScriptPublicKey) ProtoReflect() protoreflect.Message { - mi := &file_kaspawalletd_proto_msgTypes[15] + mi := &file_c4exwalletd_proto_msgTypes[15] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -814,7 +814,7 @@ func (x *ScriptPublicKey) ProtoReflect() protoreflect.Message { // Deprecated: Use ScriptPublicKey.ProtoReflect.Descriptor instead. func (*ScriptPublicKey) Descriptor() ([]byte, []int) { - return file_kaspawalletd_proto_rawDescGZIP(), []int{15} + return file_c4exwalletd_proto_rawDescGZIP(), []int{15} } func (x *ScriptPublicKey) GetVersion() uint32 { @@ -845,7 +845,7 @@ type UtxoEntry struct { func (x *UtxoEntry) Reset() { *x = UtxoEntry{} if protoimpl.UnsafeEnabled { - mi := &file_kaspawalletd_proto_msgTypes[16] + mi := &file_c4exwalletd_proto_msgTypes[16] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -858,7 +858,7 @@ func (x *UtxoEntry) String() string { func (*UtxoEntry) ProtoMessage() {} func (x *UtxoEntry) ProtoReflect() protoreflect.Message { - mi := &file_kaspawalletd_proto_msgTypes[16] + mi := &file_c4exwalletd_proto_msgTypes[16] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -871,7 +871,7 @@ func (x *UtxoEntry) ProtoReflect() protoreflect.Message { // Deprecated: Use UtxoEntry.ProtoReflect.Descriptor instead. func (*UtxoEntry) Descriptor() ([]byte, []int) { - return file_kaspawalletd_proto_rawDescGZIP(), []int{16} + return file_c4exwalletd_proto_rawDescGZIP(), []int{16} } func (x *UtxoEntry) GetAmount() uint64 { @@ -913,7 +913,7 @@ type GetExternalSpendableUTXOsRequest struct { func (x *GetExternalSpendableUTXOsRequest) Reset() { *x = GetExternalSpendableUTXOsRequest{} if protoimpl.UnsafeEnabled { - mi := &file_kaspawalletd_proto_msgTypes[17] + mi := &file_c4exwalletd_proto_msgTypes[17] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -926,7 +926,7 @@ func (x *GetExternalSpendableUTXOsRequest) String() string { func (*GetExternalSpendableUTXOsRequest) ProtoMessage() {} func (x *GetExternalSpendableUTXOsRequest) ProtoReflect() protoreflect.Message { - mi := &file_kaspawalletd_proto_msgTypes[17] + mi := &file_c4exwalletd_proto_msgTypes[17] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -939,7 +939,7 @@ func (x *GetExternalSpendableUTXOsRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use GetExternalSpendableUTXOsRequest.ProtoReflect.Descriptor instead. func (*GetExternalSpendableUTXOsRequest) Descriptor() ([]byte, []int) { - return file_kaspawalletd_proto_rawDescGZIP(), []int{17} + return file_c4exwalletd_proto_rawDescGZIP(), []int{17} } func (x *GetExternalSpendableUTXOsRequest) GetAddress() string { @@ -960,7 +960,7 @@ type GetExternalSpendableUTXOsResponse struct { func (x *GetExternalSpendableUTXOsResponse) Reset() { *x = GetExternalSpendableUTXOsResponse{} if protoimpl.UnsafeEnabled { - mi := &file_kaspawalletd_proto_msgTypes[18] + mi := &file_c4exwalletd_proto_msgTypes[18] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -973,7 +973,7 @@ func (x *GetExternalSpendableUTXOsResponse) String() string { func (*GetExternalSpendableUTXOsResponse) ProtoMessage() {} func (x *GetExternalSpendableUTXOsResponse) ProtoReflect() protoreflect.Message { - mi := &file_kaspawalletd_proto_msgTypes[18] + mi := &file_c4exwalletd_proto_msgTypes[18] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -986,7 +986,7 @@ func (x *GetExternalSpendableUTXOsResponse) ProtoReflect() protoreflect.Message // Deprecated: Use GetExternalSpendableUTXOsResponse.ProtoReflect.Descriptor instead. func (*GetExternalSpendableUTXOsResponse) Descriptor() ([]byte, []int) { - return file_kaspawalletd_proto_rawDescGZIP(), []int{18} + return file_c4exwalletd_proto_rawDescGZIP(), []int{18} } func (x *GetExternalSpendableUTXOsResponse) GetEntries() []*UtxosByAddressesEntry { @@ -1013,7 +1013,7 @@ type SendRequest struct { func (x *SendRequest) Reset() { *x = SendRequest{} if protoimpl.UnsafeEnabled { - mi := &file_kaspawalletd_proto_msgTypes[19] + mi := &file_c4exwalletd_proto_msgTypes[19] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1026,7 +1026,7 @@ func (x *SendRequest) String() string { func (*SendRequest) ProtoMessage() {} func (x *SendRequest) ProtoReflect() protoreflect.Message { - mi := &file_kaspawalletd_proto_msgTypes[19] + mi := &file_c4exwalletd_proto_msgTypes[19] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1039,7 +1039,7 @@ func (x *SendRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use SendRequest.ProtoReflect.Descriptor instead. func (*SendRequest) Descriptor() ([]byte, []int) { - return file_kaspawalletd_proto_rawDescGZIP(), []int{19} + return file_c4exwalletd_proto_rawDescGZIP(), []int{19} } func (x *SendRequest) GetToAddress() string { @@ -1096,7 +1096,7 @@ type SendResponse struct { func (x *SendResponse) Reset() { *x = SendResponse{} if protoimpl.UnsafeEnabled { - mi := &file_kaspawalletd_proto_msgTypes[20] + mi := &file_c4exwalletd_proto_msgTypes[20] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1109,7 +1109,7 @@ func (x *SendResponse) String() string { func (*SendResponse) ProtoMessage() {} func (x *SendResponse) ProtoReflect() protoreflect.Message { - mi := &file_kaspawalletd_proto_msgTypes[20] + mi := &file_c4exwalletd_proto_msgTypes[20] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1122,7 +1122,7 @@ func (x *SendResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use SendResponse.ProtoReflect.Descriptor instead. func (*SendResponse) Descriptor() ([]byte, []int) { - return file_kaspawalletd_proto_rawDescGZIP(), []int{20} + return file_c4exwalletd_proto_rawDescGZIP(), []int{20} } func (x *SendResponse) GetTxIDs() []string { @@ -1152,7 +1152,7 @@ type SignRequest struct { func (x *SignRequest) Reset() { *x = SignRequest{} if protoimpl.UnsafeEnabled { - mi := &file_kaspawalletd_proto_msgTypes[21] + mi := &file_c4exwalletd_proto_msgTypes[21] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1165,7 +1165,7 @@ func (x *SignRequest) String() string { func (*SignRequest) ProtoMessage() {} func (x *SignRequest) ProtoReflect() protoreflect.Message { - mi := &file_kaspawalletd_proto_msgTypes[21] + mi := &file_c4exwalletd_proto_msgTypes[21] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1178,7 +1178,7 @@ func (x *SignRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use SignRequest.ProtoReflect.Descriptor instead. func (*SignRequest) Descriptor() ([]byte, []int) { - return file_kaspawalletd_proto_rawDescGZIP(), []int{21} + return file_c4exwalletd_proto_rawDescGZIP(), []int{21} } func (x *SignRequest) GetUnsignedTransactions() [][]byte { @@ -1206,7 +1206,7 @@ type SignResponse struct { func (x *SignResponse) Reset() { *x = SignResponse{} if protoimpl.UnsafeEnabled { - mi := &file_kaspawalletd_proto_msgTypes[22] + mi := &file_c4exwalletd_proto_msgTypes[22] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1219,7 +1219,7 @@ func (x *SignResponse) String() string { func (*SignResponse) ProtoMessage() {} func (x *SignResponse) ProtoReflect() protoreflect.Message { - mi := &file_kaspawalletd_proto_msgTypes[22] + mi := &file_c4exwalletd_proto_msgTypes[22] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1232,7 +1232,7 @@ func (x *SignResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use SignResponse.ProtoReflect.Descriptor instead. func (*SignResponse) Descriptor() ([]byte, []int) { - return file_kaspawalletd_proto_rawDescGZIP(), []int{22} + return file_c4exwalletd_proto_rawDescGZIP(), []int{22} } func (x *SignResponse) GetSignedTransactions() [][]byte { @@ -1242,9 +1242,9 @@ func (x *SignResponse) GetSignedTransactions() [][]byte { return nil } -var File_kaspawalletd_proto protoreflect.FileDescriptor +var File_c4exwalletd_proto protoreflect.FileDescriptor -var file_kaspawalletd_proto_rawDesc = []byte{ +var file_c4exwalletd_proto_rawDesc = []byte{ 0x0a, 0x12, 0x6b, 0x61, 0x73, 0x70, 0x61, 0x77, 0x61, 0x6c, 0x6c, 0x65, 0x74, 0x64, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0c, 0x6b, 0x61, 0x73, 0x70, 0x61, 0x77, 0x61, 0x6c, 0x6c, 0x65, 0x74, 0x64, 0x22, 0x13, 0x0a, 0x11, 0x47, 0x65, 0x74, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, @@ -1430,67 +1430,67 @@ var file_kaspawalletd_proto_rawDesc = []byte{ } var ( - file_kaspawalletd_proto_rawDescOnce sync.Once - file_kaspawalletd_proto_rawDescData = file_kaspawalletd_proto_rawDesc + file_c4exwalletd_proto_rawDescOnce sync.Once + file_c4exwalletd_proto_rawDescData = file_c4exwalletd_proto_rawDesc ) -func file_kaspawalletd_proto_rawDescGZIP() []byte { - file_kaspawalletd_proto_rawDescOnce.Do(func() { - file_kaspawalletd_proto_rawDescData = protoimpl.X.CompressGZIP(file_kaspawalletd_proto_rawDescData) +func file_c4exwalletd_proto_rawDescGZIP() []byte { + file_c4exwalletd_proto_rawDescOnce.Do(func() { + file_c4exwalletd_proto_rawDescData = protoimpl.X.CompressGZIP(file_c4exwalletd_proto_rawDescData) }) - return file_kaspawalletd_proto_rawDescData + return file_c4exwalletd_proto_rawDescData } -var file_kaspawalletd_proto_msgTypes = make([]protoimpl.MessageInfo, 23) -var file_kaspawalletd_proto_goTypes = []interface{}{ - (*GetBalanceRequest)(nil), // 0: kaspawalletd.GetBalanceRequest - (*GetBalanceResponse)(nil), // 1: kaspawalletd.GetBalanceResponse - (*AddressBalances)(nil), // 2: kaspawalletd.AddressBalances - (*CreateUnsignedTransactionsRequest)(nil), // 3: kaspawalletd.CreateUnsignedTransactionsRequest - (*CreateUnsignedTransactionsResponse)(nil), // 4: kaspawalletd.CreateUnsignedTransactionsResponse - (*ShowAddressesRequest)(nil), // 5: kaspawalletd.ShowAddressesRequest - (*ShowAddressesResponse)(nil), // 6: kaspawalletd.ShowAddressesResponse - (*NewAddressRequest)(nil), // 7: kaspawalletd.NewAddressRequest - (*NewAddressResponse)(nil), // 8: kaspawalletd.NewAddressResponse - (*BroadcastRequest)(nil), // 9: kaspawalletd.BroadcastRequest - (*BroadcastResponse)(nil), // 10: kaspawalletd.BroadcastResponse - (*ShutdownRequest)(nil), // 11: kaspawalletd.ShutdownRequest - (*ShutdownResponse)(nil), // 12: kaspawalletd.ShutdownResponse - (*Outpoint)(nil), // 13: kaspawalletd.Outpoint - (*UtxosByAddressesEntry)(nil), // 14: kaspawalletd.UtxosByAddressesEntry - (*ScriptPublicKey)(nil), // 15: kaspawalletd.ScriptPublicKey - (*UtxoEntry)(nil), // 16: kaspawalletd.UtxoEntry - (*GetExternalSpendableUTXOsRequest)(nil), // 17: kaspawalletd.GetExternalSpendableUTXOsRequest - (*GetExternalSpendableUTXOsResponse)(nil), // 18: kaspawalletd.GetExternalSpendableUTXOsResponse - (*SendRequest)(nil), // 19: kaspawalletd.SendRequest - (*SendResponse)(nil), // 20: kaspawalletd.SendResponse - (*SignRequest)(nil), // 21: kaspawalletd.SignRequest - (*SignResponse)(nil), // 22: kaspawalletd.SignResponse +var file_c4exwalletd_proto_msgTypes = make([]protoimpl.MessageInfo, 23) +var file_c4exwalletd_proto_goTypes = []interface{}{ + (*GetBalanceRequest)(nil), // 0: c4exwalletd.GetBalanceRequest + (*GetBalanceResponse)(nil), // 1: c4exwalletd.GetBalanceResponse + (*AddressBalances)(nil), // 2: c4exwalletd.AddressBalances + (*CreateUnsignedTransactionsRequest)(nil), // 3: c4exwalletd.CreateUnsignedTransactionsRequest + (*CreateUnsignedTransactionsResponse)(nil), // 4: c4exwalletd.CreateUnsignedTransactionsResponse + (*ShowAddressesRequest)(nil), // 5: c4exwalletd.ShowAddressesRequest + (*ShowAddressesResponse)(nil), // 6: c4exwalletd.ShowAddressesResponse + (*NewAddressRequest)(nil), // 7: c4exwalletd.NewAddressRequest + (*NewAddressResponse)(nil), // 8: c4exwalletd.NewAddressResponse + (*BroadcastRequest)(nil), // 9: c4exwalletd.BroadcastRequest + (*BroadcastResponse)(nil), // 10: c4exwalletd.BroadcastResponse + (*ShutdownRequest)(nil), // 11: c4exwalletd.ShutdownRequest + (*ShutdownResponse)(nil), // 12: c4exwalletd.ShutdownResponse + (*Outpoint)(nil), // 13: c4exwalletd.Outpoint + (*UtxosByAddressesEntry)(nil), // 14: c4exwalletd.UtxosByAddressesEntry + (*ScriptPublicKey)(nil), // 15: c4exwalletd.ScriptPublicKey + (*UtxoEntry)(nil), // 16: c4exwalletd.UtxoEntry + (*GetExternalSpendableUTXOsRequest)(nil), // 17: c4exwalletd.GetExternalSpendableUTXOsRequest + (*GetExternalSpendableUTXOsResponse)(nil), // 18: c4exwalletd.GetExternalSpendableUTXOsResponse + (*SendRequest)(nil), // 19: c4exwalletd.SendRequest + (*SendResponse)(nil), // 20: c4exwalletd.SendResponse + (*SignRequest)(nil), // 21: c4exwalletd.SignRequest + (*SignResponse)(nil), // 22: c4exwalletd.SignResponse } -var file_kaspawalletd_proto_depIdxs = []int32{ - 2, // 0: kaspawalletd.GetBalanceResponse.addressBalances:type_name -> kaspawalletd.AddressBalances - 13, // 1: kaspawalletd.UtxosByAddressesEntry.outpoint:type_name -> kaspawalletd.Outpoint - 16, // 2: kaspawalletd.UtxosByAddressesEntry.utxoEntry:type_name -> kaspawalletd.UtxoEntry - 15, // 3: kaspawalletd.UtxoEntry.scriptPublicKey:type_name -> kaspawalletd.ScriptPublicKey - 14, // 4: kaspawalletd.GetExternalSpendableUTXOsResponse.Entries:type_name -> kaspawalletd.UtxosByAddressesEntry - 0, // 5: kaspawalletd.kaspawalletd.GetBalance:input_type -> kaspawalletd.GetBalanceRequest - 17, // 6: kaspawalletd.kaspawalletd.GetExternalSpendableUTXOs:input_type -> kaspawalletd.GetExternalSpendableUTXOsRequest - 3, // 7: kaspawalletd.kaspawalletd.CreateUnsignedTransactions:input_type -> kaspawalletd.CreateUnsignedTransactionsRequest - 5, // 8: kaspawalletd.kaspawalletd.ShowAddresses:input_type -> kaspawalletd.ShowAddressesRequest - 7, // 9: kaspawalletd.kaspawalletd.NewAddress:input_type -> kaspawalletd.NewAddressRequest - 11, // 10: kaspawalletd.kaspawalletd.Shutdown:input_type -> kaspawalletd.ShutdownRequest - 9, // 11: kaspawalletd.kaspawalletd.Broadcast:input_type -> kaspawalletd.BroadcastRequest - 19, // 12: kaspawalletd.kaspawalletd.Send:input_type -> kaspawalletd.SendRequest - 21, // 13: kaspawalletd.kaspawalletd.Sign:input_type -> kaspawalletd.SignRequest - 1, // 14: kaspawalletd.kaspawalletd.GetBalance:output_type -> kaspawalletd.GetBalanceResponse - 18, // 15: kaspawalletd.kaspawalletd.GetExternalSpendableUTXOs:output_type -> kaspawalletd.GetExternalSpendableUTXOsResponse - 4, // 16: kaspawalletd.kaspawalletd.CreateUnsignedTransactions:output_type -> kaspawalletd.CreateUnsignedTransactionsResponse - 6, // 17: kaspawalletd.kaspawalletd.ShowAddresses:output_type -> kaspawalletd.ShowAddressesResponse - 8, // 18: kaspawalletd.kaspawalletd.NewAddress:output_type -> kaspawalletd.NewAddressResponse - 12, // 19: kaspawalletd.kaspawalletd.Shutdown:output_type -> kaspawalletd.ShutdownResponse - 10, // 20: kaspawalletd.kaspawalletd.Broadcast:output_type -> kaspawalletd.BroadcastResponse - 20, // 21: kaspawalletd.kaspawalletd.Send:output_type -> kaspawalletd.SendResponse - 22, // 22: kaspawalletd.kaspawalletd.Sign:output_type -> kaspawalletd.SignResponse +var file_c4exwalletd_proto_depIdxs = []int32{ + 2, // 0: c4exwalletd.GetBalanceResponse.addressBalances:type_name -> c4exwalletd.AddressBalances + 13, // 1: c4exwalletd.UtxosByAddressesEntry.outpoint:type_name -> c4exwalletd.Outpoint + 16, // 2: c4exwalletd.UtxosByAddressesEntry.utxoEntry:type_name -> c4exwalletd.UtxoEntry + 15, // 3: c4exwalletd.UtxoEntry.scriptPublicKey:type_name -> c4exwalletd.ScriptPublicKey + 14, // 4: c4exwalletd.GetExternalSpendableUTXOsResponse.Entries:type_name -> c4exwalletd.UtxosByAddressesEntry + 0, // 5: c4exwalletd.c4exwalletd.GetBalance:input_type -> c4exwalletd.GetBalanceRequest + 17, // 6: c4exwalletd.c4exwalletd.GetExternalSpendableUTXOs:input_type -> c4exwalletd.GetExternalSpendableUTXOsRequest + 3, // 7: c4exwalletd.c4exwalletd.CreateUnsignedTransactions:input_type -> c4exwalletd.CreateUnsignedTransactionsRequest + 5, // 8: c4exwalletd.c4exwalletd.ShowAddresses:input_type -> c4exwalletd.ShowAddressesRequest + 7, // 9: c4exwalletd.c4exwalletd.NewAddress:input_type -> c4exwalletd.NewAddressRequest + 11, // 10: c4exwalletd.c4exwalletd.Shutdown:input_type -> c4exwalletd.ShutdownRequest + 9, // 11: c4exwalletd.c4exwalletd.Broadcast:input_type -> c4exwalletd.BroadcastRequest + 19, // 12: c4exwalletd.c4exwalletd.Send:input_type -> c4exwalletd.SendRequest + 21, // 13: c4exwalletd.c4exwalletd.Sign:input_type -> c4exwalletd.SignRequest + 1, // 14: c4exwalletd.c4exwalletd.GetBalance:output_type -> c4exwalletd.GetBalanceResponse + 18, // 15: c4exwalletd.c4exwalletd.GetExternalSpendableUTXOs:output_type -> c4exwalletd.GetExternalSpendableUTXOsResponse + 4, // 16: c4exwalletd.c4exwalletd.CreateUnsignedTransactions:output_type -> c4exwalletd.CreateUnsignedTransactionsResponse + 6, // 17: c4exwalletd.c4exwalletd.ShowAddresses:output_type -> c4exwalletd.ShowAddressesResponse + 8, // 18: c4exwalletd.c4exwalletd.NewAddress:output_type -> c4exwalletd.NewAddressResponse + 12, // 19: c4exwalletd.c4exwalletd.Shutdown:output_type -> c4exwalletd.ShutdownResponse + 10, // 20: c4exwalletd.c4exwalletd.Broadcast:output_type -> c4exwalletd.BroadcastResponse + 20, // 21: c4exwalletd.c4exwalletd.Send:output_type -> c4exwalletd.SendResponse + 22, // 22: c4exwalletd.c4exwalletd.Sign:output_type -> c4exwalletd.SignResponse 14, // [14:23] is the sub-list for method output_type 5, // [5:14] is the sub-list for method input_type 5, // [5:5] is the sub-list for extension type_name @@ -1498,13 +1498,13 @@ var file_kaspawalletd_proto_depIdxs = []int32{ 0, // [0:5] is the sub-list for field type_name } -func init() { file_kaspawalletd_proto_init() } -func file_kaspawalletd_proto_init() { - if File_kaspawalletd_proto != nil { +func init() { file_c4exwalletd_proto_init() } +func file_c4exwalletd_proto_init() { + if File_c4exwalletd_proto != nil { return } if !protoimpl.UnsafeEnabled { - file_kaspawalletd_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + file_c4exwalletd_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*GetBalanceRequest); i { case 0: return &v.state @@ -1516,7 +1516,7 @@ func file_kaspawalletd_proto_init() { return nil } } - file_kaspawalletd_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + file_c4exwalletd_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*GetBalanceResponse); i { case 0: return &v.state @@ -1528,7 +1528,7 @@ func file_kaspawalletd_proto_init() { return nil } } - file_kaspawalletd_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + file_c4exwalletd_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*AddressBalances); i { case 0: return &v.state @@ -1540,7 +1540,7 @@ func file_kaspawalletd_proto_init() { return nil } } - file_kaspawalletd_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + file_c4exwalletd_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*CreateUnsignedTransactionsRequest); i { case 0: return &v.state @@ -1552,7 +1552,7 @@ func file_kaspawalletd_proto_init() { return nil } } - file_kaspawalletd_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + file_c4exwalletd_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*CreateUnsignedTransactionsResponse); i { case 0: return &v.state @@ -1564,7 +1564,7 @@ func file_kaspawalletd_proto_init() { return nil } } - file_kaspawalletd_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + file_c4exwalletd_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ShowAddressesRequest); i { case 0: return &v.state @@ -1576,7 +1576,7 @@ func file_kaspawalletd_proto_init() { return nil } } - file_kaspawalletd_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + file_c4exwalletd_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ShowAddressesResponse); i { case 0: return &v.state @@ -1588,7 +1588,7 @@ func file_kaspawalletd_proto_init() { return nil } } - file_kaspawalletd_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + file_c4exwalletd_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*NewAddressRequest); i { case 0: return &v.state @@ -1600,7 +1600,7 @@ func file_kaspawalletd_proto_init() { return nil } } - file_kaspawalletd_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + file_c4exwalletd_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*NewAddressResponse); i { case 0: return &v.state @@ -1612,7 +1612,7 @@ func file_kaspawalletd_proto_init() { return nil } } - file_kaspawalletd_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + file_c4exwalletd_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*BroadcastRequest); i { case 0: return &v.state @@ -1624,7 +1624,7 @@ func file_kaspawalletd_proto_init() { return nil } } - file_kaspawalletd_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { + file_c4exwalletd_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*BroadcastResponse); i { case 0: return &v.state @@ -1636,7 +1636,7 @@ func file_kaspawalletd_proto_init() { return nil } } - file_kaspawalletd_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { + file_c4exwalletd_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ShutdownRequest); i { case 0: return &v.state @@ -1648,7 +1648,7 @@ func file_kaspawalletd_proto_init() { return nil } } - file_kaspawalletd_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { + file_c4exwalletd_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ShutdownResponse); i { case 0: return &v.state @@ -1660,7 +1660,7 @@ func file_kaspawalletd_proto_init() { return nil } } - file_kaspawalletd_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { + file_c4exwalletd_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Outpoint); i { case 0: return &v.state @@ -1672,7 +1672,7 @@ func file_kaspawalletd_proto_init() { return nil } } - file_kaspawalletd_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { + file_c4exwalletd_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*UtxosByAddressesEntry); i { case 0: return &v.state @@ -1684,7 +1684,7 @@ func file_kaspawalletd_proto_init() { return nil } } - file_kaspawalletd_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { + file_c4exwalletd_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ScriptPublicKey); i { case 0: return &v.state @@ -1696,7 +1696,7 @@ func file_kaspawalletd_proto_init() { return nil } } - file_kaspawalletd_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { + file_c4exwalletd_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*UtxoEntry); i { case 0: return &v.state @@ -1708,7 +1708,7 @@ func file_kaspawalletd_proto_init() { return nil } } - file_kaspawalletd_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { + file_c4exwalletd_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*GetExternalSpendableUTXOsRequest); i { case 0: return &v.state @@ -1720,7 +1720,7 @@ func file_kaspawalletd_proto_init() { return nil } } - file_kaspawalletd_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} { + file_c4exwalletd_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*GetExternalSpendableUTXOsResponse); i { case 0: return &v.state @@ -1732,7 +1732,7 @@ func file_kaspawalletd_proto_init() { return nil } } - file_kaspawalletd_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} { + file_c4exwalletd_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*SendRequest); i { case 0: return &v.state @@ -1744,7 +1744,7 @@ func file_kaspawalletd_proto_init() { return nil } } - file_kaspawalletd_proto_msgTypes[20].Exporter = func(v interface{}, i int) interface{} { + file_c4exwalletd_proto_msgTypes[20].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*SendResponse); i { case 0: return &v.state @@ -1756,7 +1756,7 @@ func file_kaspawalletd_proto_init() { return nil } } - file_kaspawalletd_proto_msgTypes[21].Exporter = func(v interface{}, i int) interface{} { + file_c4exwalletd_proto_msgTypes[21].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*SignRequest); i { case 0: return &v.state @@ -1768,7 +1768,7 @@ func file_kaspawalletd_proto_init() { return nil } } - file_kaspawalletd_proto_msgTypes[22].Exporter = func(v interface{}, i int) interface{} { + file_c4exwalletd_proto_msgTypes[22].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*SignResponse); i { case 0: return &v.state @@ -1785,18 +1785,18 @@ func file_kaspawalletd_proto_init() { out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_kaspawalletd_proto_rawDesc, + RawDescriptor: file_c4exwalletd_proto_rawDesc, NumEnums: 0, NumMessages: 23, NumExtensions: 0, NumServices: 1, }, - GoTypes: file_kaspawalletd_proto_goTypes, - DependencyIndexes: file_kaspawalletd_proto_depIdxs, - MessageInfos: file_kaspawalletd_proto_msgTypes, + GoTypes: file_c4exwalletd_proto_goTypes, + DependencyIndexes: file_c4exwalletd_proto_depIdxs, + MessageInfos: file_c4exwalletd_proto_msgTypes, }.Build() - File_kaspawalletd_proto = out.File - file_kaspawalletd_proto_rawDesc = nil - file_kaspawalletd_proto_goTypes = nil - file_kaspawalletd_proto_depIdxs = nil + File_c4exwalletd_proto = out.File + file_c4exwalletd_proto_rawDesc = nil + file_c4exwalletd_proto_goTypes = nil + file_c4exwalletd_proto_depIdxs = nil } diff --git a/cmd/kaspawallet/daemon/pb/kaspawalletd.proto b/cmd/c4exwallet/daemon/pb/kaspawalletd.proto similarity index 96% rename from cmd/kaspawallet/daemon/pb/kaspawalletd.proto rename to cmd/c4exwallet/daemon/pb/kaspawalletd.proto index ba8d6c8b4..0850af02e 100644 --- a/cmd/kaspawallet/daemon/pb/kaspawalletd.proto +++ b/cmd/c4exwallet/daemon/pb/kaspawalletd.proto @@ -1,9 +1,9 @@ syntax = "proto3"; -option go_package = "github.com/c4ei/yunseokyeol/cmd/kaspawallet/daemon/pb"; -package kaspawalletd; +option go_package = "github.com/c4ei/yunseokyeol/cmd/c4exwallet/daemon/pb"; +package c4exwalletd; -service kaspawalletd { +service c4exwalletd { rpc GetBalance (GetBalanceRequest) returns (GetBalanceResponse) {} rpc GetExternalSpendableUTXOs (GetExternalSpendableUTXOsRequest) returns (GetExternalSpendableUTXOsResponse) {} rpc CreateUnsignedTransactions (CreateUnsignedTransactionsRequest) returns (CreateUnsignedTransactionsResponse) {} diff --git a/cmd/kaspawallet/daemon/pb/kaspawalletd_grpc.pb.go b/cmd/c4exwallet/daemon/pb/kaspawalletd_grpc.pb.go similarity index 83% rename from cmd/kaspawallet/daemon/pb/kaspawalletd_grpc.pb.go rename to cmd/c4exwallet/daemon/pb/kaspawalletd_grpc.pb.go index ea0e968a5..1b23efe36 100644 --- a/cmd/kaspawallet/daemon/pb/kaspawalletd_grpc.pb.go +++ b/cmd/c4exwallet/daemon/pb/kaspawalletd_grpc.pb.go @@ -31,89 +31,89 @@ type KaspawalletdClient interface { Sign(ctx context.Context, in *SignRequest, opts ...grpc.CallOption) (*SignResponse, error) } -type kaspawalletdClient struct { +type c4exwalletdClient struct { cc grpc.ClientConnInterface } func NewKaspawalletdClient(cc grpc.ClientConnInterface) KaspawalletdClient { - return &kaspawalletdClient{cc} + return &c4exwalletdClient{cc} } -func (c *kaspawalletdClient) GetBalance(ctx context.Context, in *GetBalanceRequest, opts ...grpc.CallOption) (*GetBalanceResponse, error) { +func (c *c4exwalletdClient) GetBalance(ctx context.Context, in *GetBalanceRequest, opts ...grpc.CallOption) (*GetBalanceResponse, error) { out := new(GetBalanceResponse) - err := c.cc.Invoke(ctx, "/kaspawalletd.kaspawalletd/GetBalance", in, out, opts...) + err := c.cc.Invoke(ctx, "/c4exwalletd.c4exwalletd/GetBalance", in, out, opts...) if err != nil { return nil, err } return out, nil } -func (c *kaspawalletdClient) GetExternalSpendableUTXOs(ctx context.Context, in *GetExternalSpendableUTXOsRequest, opts ...grpc.CallOption) (*GetExternalSpendableUTXOsResponse, error) { +func (c *c4exwalletdClient) GetExternalSpendableUTXOs(ctx context.Context, in *GetExternalSpendableUTXOsRequest, opts ...grpc.CallOption) (*GetExternalSpendableUTXOsResponse, error) { out := new(GetExternalSpendableUTXOsResponse) - err := c.cc.Invoke(ctx, "/kaspawalletd.kaspawalletd/GetExternalSpendableUTXOs", in, out, opts...) + err := c.cc.Invoke(ctx, "/c4exwalletd.c4exwalletd/GetExternalSpendableUTXOs", in, out, opts...) if err != nil { return nil, err } return out, nil } -func (c *kaspawalletdClient) CreateUnsignedTransactions(ctx context.Context, in *CreateUnsignedTransactionsRequest, opts ...grpc.CallOption) (*CreateUnsignedTransactionsResponse, error) { +func (c *c4exwalletdClient) CreateUnsignedTransactions(ctx context.Context, in *CreateUnsignedTransactionsRequest, opts ...grpc.CallOption) (*CreateUnsignedTransactionsResponse, error) { out := new(CreateUnsignedTransactionsResponse) - err := c.cc.Invoke(ctx, "/kaspawalletd.kaspawalletd/CreateUnsignedTransactions", in, out, opts...) + err := c.cc.Invoke(ctx, "/c4exwalletd.c4exwalletd/CreateUnsignedTransactions", in, out, opts...) if err != nil { return nil, err } return out, nil } -func (c *kaspawalletdClient) ShowAddresses(ctx context.Context, in *ShowAddressesRequest, opts ...grpc.CallOption) (*ShowAddressesResponse, error) { +func (c *c4exwalletdClient) ShowAddresses(ctx context.Context, in *ShowAddressesRequest, opts ...grpc.CallOption) (*ShowAddressesResponse, error) { out := new(ShowAddressesResponse) - err := c.cc.Invoke(ctx, "/kaspawalletd.kaspawalletd/ShowAddresses", in, out, opts...) + err := c.cc.Invoke(ctx, "/c4exwalletd.c4exwalletd/ShowAddresses", in, out, opts...) if err != nil { return nil, err } return out, nil } -func (c *kaspawalletdClient) NewAddress(ctx context.Context, in *NewAddressRequest, opts ...grpc.CallOption) (*NewAddressResponse, error) { +func (c *c4exwalletdClient) NewAddress(ctx context.Context, in *NewAddressRequest, opts ...grpc.CallOption) (*NewAddressResponse, error) { out := new(NewAddressResponse) - err := c.cc.Invoke(ctx, "/kaspawalletd.kaspawalletd/NewAddress", in, out, opts...) + err := c.cc.Invoke(ctx, "/c4exwalletd.c4exwalletd/NewAddress", in, out, opts...) if err != nil { return nil, err } return out, nil } -func (c *kaspawalletdClient) Shutdown(ctx context.Context, in *ShutdownRequest, opts ...grpc.CallOption) (*ShutdownResponse, error) { +func (c *c4exwalletdClient) Shutdown(ctx context.Context, in *ShutdownRequest, opts ...grpc.CallOption) (*ShutdownResponse, error) { out := new(ShutdownResponse) - err := c.cc.Invoke(ctx, "/kaspawalletd.kaspawalletd/Shutdown", in, out, opts...) + err := c.cc.Invoke(ctx, "/c4exwalletd.c4exwalletd/Shutdown", in, out, opts...) if err != nil { return nil, err } return out, nil } -func (c *kaspawalletdClient) Broadcast(ctx context.Context, in *BroadcastRequest, opts ...grpc.CallOption) (*BroadcastResponse, error) { +func (c *c4exwalletdClient) Broadcast(ctx context.Context, in *BroadcastRequest, opts ...grpc.CallOption) (*BroadcastResponse, error) { out := new(BroadcastResponse) - err := c.cc.Invoke(ctx, "/kaspawalletd.kaspawalletd/Broadcast", in, out, opts...) + err := c.cc.Invoke(ctx, "/c4exwalletd.c4exwalletd/Broadcast", in, out, opts...) if err != nil { return nil, err } return out, nil } -func (c *kaspawalletdClient) Send(ctx context.Context, in *SendRequest, opts ...grpc.CallOption) (*SendResponse, error) { +func (c *c4exwalletdClient) Send(ctx context.Context, in *SendRequest, opts ...grpc.CallOption) (*SendResponse, error) { out := new(SendResponse) - err := c.cc.Invoke(ctx, "/kaspawalletd.kaspawalletd/Send", in, out, opts...) + err := c.cc.Invoke(ctx, "/c4exwalletd.c4exwalletd/Send", in, out, opts...) if err != nil { return nil, err } return out, nil } -func (c *kaspawalletdClient) Sign(ctx context.Context, in *SignRequest, opts ...grpc.CallOption) (*SignResponse, error) { +func (c *c4exwalletdClient) Sign(ctx context.Context, in *SignRequest, opts ...grpc.CallOption) (*SignResponse, error) { out := new(SignResponse) - err := c.cc.Invoke(ctx, "/kaspawalletd.kaspawalletd/Sign", in, out, opts...) + err := c.cc.Invoke(ctx, "/c4exwalletd.c4exwalletd/Sign", in, out, opts...) if err != nil { return nil, err } @@ -192,7 +192,7 @@ func _Kaspawalletd_GetBalance_Handler(srv interface{}, ctx context.Context, dec } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/kaspawalletd.kaspawalletd/GetBalance", + FullMethod: "/c4exwalletd.c4exwalletd/GetBalance", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(KaspawalletdServer).GetBalance(ctx, req.(*GetBalanceRequest)) @@ -210,7 +210,7 @@ func _Kaspawalletd_GetExternalSpendableUTXOs_Handler(srv interface{}, ctx contex } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/kaspawalletd.kaspawalletd/GetExternalSpendableUTXOs", + FullMethod: "/c4exwalletd.c4exwalletd/GetExternalSpendableUTXOs", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(KaspawalletdServer).GetExternalSpendableUTXOs(ctx, req.(*GetExternalSpendableUTXOsRequest)) @@ -228,7 +228,7 @@ func _Kaspawalletd_CreateUnsignedTransactions_Handler(srv interface{}, ctx conte } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/kaspawalletd.kaspawalletd/CreateUnsignedTransactions", + FullMethod: "/c4exwalletd.c4exwalletd/CreateUnsignedTransactions", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(KaspawalletdServer).CreateUnsignedTransactions(ctx, req.(*CreateUnsignedTransactionsRequest)) @@ -246,7 +246,7 @@ func _Kaspawalletd_ShowAddresses_Handler(srv interface{}, ctx context.Context, d } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/kaspawalletd.kaspawalletd/ShowAddresses", + FullMethod: "/c4exwalletd.c4exwalletd/ShowAddresses", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(KaspawalletdServer).ShowAddresses(ctx, req.(*ShowAddressesRequest)) @@ -264,7 +264,7 @@ func _Kaspawalletd_NewAddress_Handler(srv interface{}, ctx context.Context, dec } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/kaspawalletd.kaspawalletd/NewAddress", + FullMethod: "/c4exwalletd.c4exwalletd/NewAddress", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(KaspawalletdServer).NewAddress(ctx, req.(*NewAddressRequest)) @@ -282,7 +282,7 @@ func _Kaspawalletd_Shutdown_Handler(srv interface{}, ctx context.Context, dec fu } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/kaspawalletd.kaspawalletd/Shutdown", + FullMethod: "/c4exwalletd.c4exwalletd/Shutdown", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(KaspawalletdServer).Shutdown(ctx, req.(*ShutdownRequest)) @@ -300,7 +300,7 @@ func _Kaspawalletd_Broadcast_Handler(srv interface{}, ctx context.Context, dec f } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/kaspawalletd.kaspawalletd/Broadcast", + FullMethod: "/c4exwalletd.c4exwalletd/Broadcast", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(KaspawalletdServer).Broadcast(ctx, req.(*BroadcastRequest)) @@ -318,7 +318,7 @@ func _Kaspawalletd_Send_Handler(srv interface{}, ctx context.Context, dec func(i } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/kaspawalletd.kaspawalletd/Send", + FullMethod: "/c4exwalletd.c4exwalletd/Send", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(KaspawalletdServer).Send(ctx, req.(*SendRequest)) @@ -336,7 +336,7 @@ func _Kaspawalletd_Sign_Handler(srv interface{}, ctx context.Context, dec func(i } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/kaspawalletd.kaspawalletd/Sign", + FullMethod: "/c4exwalletd.c4exwalletd/Sign", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(KaspawalletdServer).Sign(ctx, req.(*SignRequest)) @@ -348,7 +348,7 @@ func _Kaspawalletd_Sign_Handler(srv interface{}, ctx context.Context, dec func(i // It's only intended for direct use with grpc.RegisterService, // and not to be introspected or modified (even as a copy) var Kaspawalletd_ServiceDesc = grpc.ServiceDesc{ - ServiceName: "kaspawalletd.kaspawalletd", + ServiceName: "c4exwalletd.c4exwalletd", HandlerType: (*KaspawalletdServer)(nil), Methods: []grpc.MethodDesc{ { @@ -389,5 +389,5 @@ var Kaspawalletd_ServiceDesc = grpc.ServiceDesc{ }, }, Streams: []grpc.StreamDesc{}, - Metadata: "kaspawalletd.proto", + Metadata: "c4exwalletd.proto", } diff --git a/cmd/kaspawallet/daemon/server/address.go b/cmd/c4exwallet/daemon/server/address.go similarity index 79% rename from cmd/kaspawallet/daemon/server/address.go rename to cmd/c4exwallet/daemon/server/address.go index 7eafc76e2..7cdd37523 100644 --- a/cmd/kaspawallet/daemon/server/address.go +++ b/cmd/c4exwallet/daemon/server/address.go @@ -4,8 +4,8 @@ import ( "context" "fmt" - "github.com/c4ei/yunseokyeol/cmd/kaspawallet/daemon/pb" - "github.com/c4ei/yunseokyeol/cmd/kaspawallet/libkaspawallet" + "github.com/c4ei/yunseokyeol/cmd/c4exwallet/daemon/pb" + "github.com/c4ei/yunseokyeol/cmd/c4exwallet/libc4exwallet" "github.com/c4ei/yunseokyeol/util" "github.com/pkg/errors" ) @@ -33,12 +33,12 @@ func (s *server) changeAddress(useExisting bool, fromAddresses []*walletAddress) walletAddr = &walletAddress{ index: internalIndex, cosignerIndex: s.keysFile.CosignerIndex, - keyChain: libkaspawallet.InternalKeychain, + keyChain: libc4exwallet.InternalKeychain, } } path := s.walletAddressPath(walletAddr) - address, err := libkaspawallet.Address(s.params, s.keysFile.ExtendedPublicKeys, s.keysFile.MinimumSignatures, path, s.keysFile.ECDSA) + address, err := libc4exwallet.Address(s.params, s.keysFile.ExtendedPublicKeys, s.keysFile.MinimumSignatures, path, s.keysFile.ECDSA) if err != nil { return nil, nil, err } @@ -58,10 +58,10 @@ func (s *server) ShowAddresses(_ context.Context, request *pb.ShowAddressesReque walletAddr := &walletAddress{ index: i, cosignerIndex: s.keysFile.CosignerIndex, - keyChain: libkaspawallet.ExternalKeychain, + keyChain: libc4exwallet.ExternalKeychain, } path := s.walletAddressPath(walletAddr) - address, err := libkaspawallet.Address(s.params, s.keysFile.ExtendedPublicKeys, s.keysFile.MinimumSignatures, path, s.keysFile.ECDSA) + address, err := libc4exwallet.Address(s.params, s.keysFile.ExtendedPublicKeys, s.keysFile.MinimumSignatures, path, s.keysFile.ECDSA) if err != nil { return nil, err } @@ -92,10 +92,10 @@ func (s *server) NewAddress(_ context.Context, request *pb.NewAddressRequest) (* walletAddr := &walletAddress{ index: s.keysFile.LastUsedExternalIndex(), cosignerIndex: s.keysFile.CosignerIndex, - keyChain: libkaspawallet.ExternalKeychain, + keyChain: libc4exwallet.ExternalKeychain, } path := s.walletAddressPath(walletAddr) - address, err := libkaspawallet.Address(s.params, s.keysFile.ExtendedPublicKeys, s.keysFile.MinimumSignatures, path, s.keysFile.ECDSA) + address, err := libc4exwallet.Address(s.params, s.keysFile.ExtendedPublicKeys, s.keysFile.MinimumSignatures, path, s.keysFile.ECDSA) if err != nil { return nil, err } @@ -105,7 +105,7 @@ func (s *server) NewAddress(_ context.Context, request *pb.NewAddressRequest) (* func (s *server) walletAddressString(wAddr *walletAddress) (string, error) { path := s.walletAddressPath(wAddr) - addr, err := libkaspawallet.Address(s.params, s.keysFile.ExtendedPublicKeys, s.keysFile.MinimumSignatures, path, s.keysFile.ECDSA) + addr, err := libc4exwallet.Address(s.params, s.keysFile.ExtendedPublicKeys, s.keysFile.MinimumSignatures, path, s.keysFile.ECDSA) if err != nil { return "", err } diff --git a/cmd/kaspawallet/daemon/server/balance.go b/cmd/c4exwallet/daemon/server/balance.go similarity index 85% rename from cmd/kaspawallet/daemon/server/balance.go rename to cmd/c4exwallet/daemon/server/balance.go index 93580fdc4..c9d2eb44d 100644 --- a/cmd/kaspawallet/daemon/server/balance.go +++ b/cmd/c4exwallet/daemon/server/balance.go @@ -3,8 +3,8 @@ package server import ( "context" - "github.com/c4ei/yunseokyeol/cmd/kaspawallet/daemon/pb" - "github.com/c4ei/yunseokyeol/cmd/kaspawallet/libkaspawallet" + "github.com/c4ei/yunseokyeol/cmd/c4exwallet/daemon/pb" + "github.com/c4ei/yunseokyeol/cmd/c4exwallet/libc4exwallet" ) type balancesType struct{ available, pending uint64 } @@ -41,7 +41,7 @@ func (s *server) GetBalance(_ context.Context, _ *pb.GetBalanceRequest) (*pb.Get i := 0 var available, pending uint64 for walletAddress, balances := range balancesMap { - address, err := libkaspawallet.Address(s.params, s.keysFile.ExtendedPublicKeys, s.keysFile.MinimumSignatures, s.walletAddressPath(walletAddress), s.keysFile.ECDSA) + address, err := libc4exwallet.Address(s.params, s.keysFile.ExtendedPublicKeys, s.keysFile.MinimumSignatures, s.walletAddressPath(walletAddress), s.keysFile.ECDSA) if err != nil { return nil, err } diff --git a/cmd/kaspawallet/daemon/server/broadcast.go b/cmd/c4exwallet/daemon/server/broadcast.go similarity index 85% rename from cmd/kaspawallet/daemon/server/broadcast.go rename to cmd/c4exwallet/daemon/server/broadcast.go index ba438c4d2..377f828a0 100644 --- a/cmd/kaspawallet/daemon/server/broadcast.go +++ b/cmd/c4exwallet/daemon/server/broadcast.go @@ -5,9 +5,9 @@ import ( "time" "github.com/c4ei/yunseokyeol/app/appmessage" - "github.com/c4ei/yunseokyeol/cmd/kaspawallet/daemon/pb" - "github.com/c4ei/yunseokyeol/cmd/kaspawallet/libkaspawallet" - "github.com/c4ei/yunseokyeol/cmd/kaspawallet/libkaspawallet/serialization" + "github.com/c4ei/yunseokyeol/cmd/c4exwallet/daemon/pb" + "github.com/c4ei/yunseokyeol/cmd/c4exwallet/libc4exwallet" + "github.com/c4ei/yunseokyeol/cmd/c4exwallet/libc4exwallet/serialization" "github.com/c4ei/yunseokyeol/domain/consensus/model/externalapi" "github.com/c4ei/yunseokyeol/infrastructure/network/rpcclient" "github.com/pkg/errors" @@ -39,7 +39,7 @@ func (s *server) broadcast(transactions [][]byte, isDomain bool) ([]string, erro return nil, err } } else if !isDomain { //default in proto3 is false - tx, err = libkaspawallet.ExtractTransaction(transaction, s.keysFile.ECDSA) + tx, err = libc4exwallet.ExtractTransaction(transaction, s.keysFile.ECDSA) if err != nil { return nil, err } diff --git a/cmd/kaspawallet/daemon/server/common.go b/cmd/c4exwallet/daemon/server/common.go similarity index 100% rename from cmd/kaspawallet/daemon/server/common.go rename to cmd/c4exwallet/daemon/server/common.go diff --git a/cmd/kaspawallet/daemon/server/create_unsigned_transaction.go b/cmd/c4exwallet/daemon/server/create_unsigned_transaction.go similarity index 88% rename from cmd/kaspawallet/daemon/server/create_unsigned_transaction.go rename to cmd/c4exwallet/daemon/server/create_unsigned_transaction.go index 5bc760011..b7af2ad99 100644 --- a/cmd/kaspawallet/daemon/server/create_unsigned_transaction.go +++ b/cmd/c4exwallet/daemon/server/create_unsigned_transaction.go @@ -5,8 +5,8 @@ import ( "fmt" "time" - "github.com/c4ei/yunseokyeol/cmd/kaspawallet/daemon/pb" - "github.com/c4ei/yunseokyeol/cmd/kaspawallet/libkaspawallet" + "github.com/c4ei/yunseokyeol/cmd/c4exwallet/daemon/pb" + "github.com/c4ei/yunseokyeol/cmd/c4exwallet/libc4exwallet" "github.com/c4ei/yunseokyeol/domain/consensus/utils/constants" "github.com/c4ei/yunseokyeol/util" "github.com/pkg/errors" @@ -71,17 +71,17 @@ func (s *server) createUnsignedTransactions(address string, amount uint64, isSen return nil, err } - payments := []*libkaspawallet.Payment{{ + payments := []*libc4exwallet.Payment{{ Address: toAddress, Amount: spendValue, }} if changeSompi > 0 { - payments = append(payments, &libkaspawallet.Payment{ + payments = append(payments, &libc4exwallet.Payment{ Address: changeAddress, Amount: changeSompi, }) } - unsignedTransaction, err := libkaspawallet.CreateUnsignedTransaction(s.keysFile.ExtendedPublicKeys, + unsignedTransaction, err := libc4exwallet.CreateUnsignedTransaction(s.keysFile.ExtendedPublicKeys, s.keysFile.MinimumSignatures, payments, selectedUTXOs) if err != nil { @@ -96,9 +96,9 @@ func (s *server) createUnsignedTransactions(address string, amount uint64, isSen } func (s *server) selectUTXOs(spendAmount uint64, isSendAll bool, feePerInput uint64, fromAddresses []*walletAddress) ( - selectedUTXOs []*libkaspawallet.UTXO, totalReceived uint64, changeSompi uint64, err error) { + selectedUTXOs []*libc4exwallet.UTXO, totalReceived uint64, changeSompi uint64, err error) { - selectedUTXOs = []*libkaspawallet.UTXO{} + selectedUTXOs = []*libc4exwallet.UTXO{} totalValue := uint64(0) dagInfo, err := s.rpcClient.GetBlockDAGInfo() @@ -120,7 +120,7 @@ func (s *server) selectUTXOs(spendAmount uint64, isSendAll bool, feePerInput uin } } - selectedUTXOs = append(selectedUTXOs, &libkaspawallet.UTXO{ + selectedUTXOs = append(selectedUTXOs, &libc4exwallet.UTXO{ Outpoint: utxo.Outpoint, UTXOEntry: utxo.UTXOEntry, DerivationPath: s.walletAddressPath(utxo.address), diff --git a/cmd/kaspawallet/daemon/server/external_spendable_utxos.go b/cmd/c4exwallet/daemon/server/external_spendable_utxos.go similarity index 88% rename from cmd/kaspawallet/daemon/server/external_spendable_utxos.go rename to cmd/c4exwallet/daemon/server/external_spendable_utxos.go index f9678c5a7..946df5b67 100644 --- a/cmd/kaspawallet/daemon/server/external_spendable_utxos.go +++ b/cmd/c4exwallet/daemon/server/external_spendable_utxos.go @@ -4,8 +4,8 @@ import ( "context" "github.com/c4ei/yunseokyeol/app/appmessage" - "github.com/c4ei/yunseokyeol/cmd/kaspawallet/daemon/pb" - "github.com/c4ei/yunseokyeol/cmd/kaspawallet/libkaspawallet" + "github.com/c4ei/yunseokyeol/cmd/c4exwallet/daemon/pb" + "github.com/c4ei/yunseokyeol/cmd/c4exwallet/libc4exwallet" "github.com/c4ei/yunseokyeol/util" ) @@ -46,7 +46,7 @@ func (s *server) selectExternalSpendableUTXOs(externalUTXOs *appmessage.GetUTXOs if !isExternalUTXOSpendable(entry, daaScore, maturity) { continue } - selectedExternalUtxos = append(selectedExternalUtxos, libkaspawallet.AppMessageUTXOToKaspawalletdUTXO(entry)) + selectedExternalUtxos = append(selectedExternalUtxos, libc4exwallet.AppMessageUTXOToKaspawalletdUTXO(entry)) } return selectedExternalUtxos, nil diff --git a/cmd/kaspawallet/daemon/server/log.go b/cmd/c4exwallet/daemon/server/log.go similarity index 95% rename from cmd/kaspawallet/daemon/server/log.go rename to cmd/c4exwallet/daemon/server/log.go index 9e5eaa375..6ccda14ae 100644 --- a/cmd/kaspawallet/daemon/server/log.go +++ b/cmd/c4exwallet/daemon/server/log.go @@ -16,7 +16,7 @@ var ( log = backendLog.Logger("KSWD") spawn = panics.GoroutineWrapperFunc(log) - defaultAppDir = util.AppDir("kaspawallet", false) + defaultAppDir = util.AppDir("c4exwallet", false) defaultLogFile = filepath.Join(defaultAppDir, "daemon.log") defaultErrLogFile = filepath.Join(defaultAppDir, "daemon_err.log") ) diff --git a/cmd/kaspawallet/daemon/server/rpc.go b/cmd/c4exwallet/daemon/server/rpc.go similarity index 100% rename from cmd/kaspawallet/daemon/server/rpc.go rename to cmd/c4exwallet/daemon/server/rpc.go diff --git a/cmd/kaspawallet/daemon/server/send.go b/cmd/c4exwallet/daemon/server/send.go similarity index 92% rename from cmd/kaspawallet/daemon/server/send.go rename to cmd/c4exwallet/daemon/server/send.go index 181a9c778..20d72ef6d 100644 --- a/cmd/kaspawallet/daemon/server/send.go +++ b/cmd/c4exwallet/daemon/server/send.go @@ -3,7 +3,7 @@ package server import ( "context" - "github.com/c4ei/yunseokyeol/cmd/kaspawallet/daemon/pb" + "github.com/c4ei/yunseokyeol/cmd/c4exwallet/daemon/pb" ) func (s *server) Send(_ context.Context, request *pb.SendRequest) (*pb.SendResponse, error) { diff --git a/cmd/kaspawallet/daemon/server/server.go b/cmd/c4exwallet/daemon/server/server.go similarity index 96% rename from cmd/kaspawallet/daemon/server/server.go rename to cmd/c4exwallet/daemon/server/server.go index 6ff4fdf43..50f6a856d 100644 --- a/cmd/kaspawallet/daemon/server/server.go +++ b/cmd/c4exwallet/daemon/server/server.go @@ -13,8 +13,8 @@ import ( "github.com/c4ei/yunseokyeol/util/profiling" - "github.com/c4ei/yunseokyeol/cmd/kaspawallet/daemon/pb" - "github.com/c4ei/yunseokyeol/cmd/kaspawallet/keys" + "github.com/c4ei/yunseokyeol/cmd/c4exwallet/daemon/pb" + "github.com/c4ei/yunseokyeol/cmd/c4exwallet/keys" "github.com/c4ei/yunseokyeol/domain/dagconfig" "github.com/c4ei/yunseokyeol/infrastructure/network/rpcclient" "github.com/c4ei/yunseokyeol/infrastructure/os/signal" @@ -48,7 +48,7 @@ type server struct { // Currently, set to 100MB const MaxDaemonSendMsgSize = 100_000_000 -// Start starts the kaspawalletd server +// Start starts the c4exwalletd server func Start(params *dagconfig.Params, listen, rpcServer string, keysFilePath string, profile string, timeout uint32) error { initLog(defaultLogFile, defaultErrLogFile) diff --git a/cmd/kaspawallet/daemon/server/shutdown.go b/cmd/c4exwallet/daemon/server/shutdown.go similarity index 81% rename from cmd/kaspawallet/daemon/server/shutdown.go rename to cmd/c4exwallet/daemon/server/shutdown.go index b444cb35a..440575e48 100644 --- a/cmd/kaspawallet/daemon/server/shutdown.go +++ b/cmd/c4exwallet/daemon/server/shutdown.go @@ -3,7 +3,7 @@ package server import ( "context" - "github.com/c4ei/yunseokyeol/cmd/kaspawallet/daemon/pb" + "github.com/c4ei/yunseokyeol/cmd/c4exwallet/daemon/pb" ) func (s *server) Shutdown(ctx context.Context, request *pb.ShutdownRequest) (*pb.ShutdownResponse, error) { diff --git a/cmd/kaspawallet/daemon/server/sign.go b/cmd/c4exwallet/daemon/server/sign.go similarity index 78% rename from cmd/kaspawallet/daemon/server/sign.go rename to cmd/c4exwallet/daemon/server/sign.go index 0660d1c85..f12009216 100644 --- a/cmd/kaspawallet/daemon/server/sign.go +++ b/cmd/c4exwallet/daemon/server/sign.go @@ -3,9 +3,9 @@ package server import ( "context" - "github.com/c4ei/yunseokyeol/cmd/kaspawallet/libkaspawallet" + "github.com/c4ei/yunseokyeol/cmd/c4exwallet/libc4exwallet" - "github.com/c4ei/yunseokyeol/cmd/kaspawallet/daemon/pb" + "github.com/c4ei/yunseokyeol/cmd/c4exwallet/daemon/pb" ) func (s *server) Sign(_ context.Context, request *pb.SignRequest) (*pb.SignResponse, error) { @@ -26,7 +26,7 @@ func (s *server) signTransactions(unsignedTransactions [][]byte, password string } signedTransactions := make([][]byte, len(unsignedTransactions)) for i, unsignedTransaction := range unsignedTransactions { - signedTransaction, err := libkaspawallet.Sign(s.params, mnemonics, unsignedTransaction, s.keysFile.ECDSA) + signedTransaction, err := libc4exwallet.Sign(s.params, mnemonics, unsignedTransaction, s.keysFile.ECDSA) if err != nil { return nil, err } diff --git a/cmd/kaspawallet/daemon/server/split_transaction.go b/cmd/c4exwallet/daemon/server/split_transaction.go similarity index 89% rename from cmd/kaspawallet/daemon/server/split_transaction.go rename to cmd/c4exwallet/daemon/server/split_transaction.go index 65652d470..77f4f4463 100644 --- a/cmd/kaspawallet/daemon/server/split_transaction.go +++ b/cmd/c4exwallet/daemon/server/split_transaction.go @@ -1,11 +1,11 @@ package server import ( - "github.com/kaspanet/go-secp256k1" + "github.com/c4exnet/go-secp256k1" "github.com/pkg/errors" - "github.com/c4ei/yunseokyeol/cmd/kaspawallet/libkaspawallet" - "github.com/c4ei/yunseokyeol/cmd/kaspawallet/libkaspawallet/serialization" + "github.com/c4ei/yunseokyeol/cmd/c4exwallet/libc4exwallet" + "github.com/c4ei/yunseokyeol/cmd/c4exwallet/libc4exwallet/serialization" "github.com/c4ei/yunseokyeol/domain/consensus/model/externalapi" "github.com/c4ei/yunseokyeol/domain/consensus/utils/consensushashing" "github.com/c4ei/yunseokyeol/domain/consensus/utils/constants" @@ -59,10 +59,10 @@ func (s *server) mergeTransaction( totalValue := uint64(0) sentValue := originalTransaction.Tx.Outputs[0].Value - utxos := make([]*libkaspawallet.UTXO, len(splitTransactions)) + utxos := make([]*libc4exwallet.UTXO, len(splitTransactions)) for i, splitTransaction := range splitTransactions { output := splitTransaction.Tx.Outputs[0] - utxos[i] = &libkaspawallet.UTXO{ + utxos[i] = &libc4exwallet.UTXO{ Outpoint: &externalapi.DomainOutpoint{ TransactionID: *consensushashing.TransactionID(splitTransaction.Tx), Index: 0, @@ -85,18 +85,18 @@ func (s *server) mergeTransaction( totalValue += totalValueAdded } - payments := []*libkaspawallet.Payment{{ + payments := []*libc4exwallet.Payment{{ Address: toAddress, Amount: sentValue, }} if totalValue > sentValue { - payments = append(payments, &libkaspawallet.Payment{ + payments = append(payments, &libc4exwallet.Payment{ Address: changeAddress, Amount: totalValue - sentValue, }) } - mergeTransactionBytes, err := libkaspawallet.CreateUnsignedTransaction(s.keysFile.ExtendedPublicKeys, + mergeTransactionBytes, err := libc4exwallet.CreateUnsignedTransaction(s.keysFile.ExtendedPublicKeys, s.keysFile.MinimumSignatures, payments, utxos) if err != nil { return nil, err @@ -162,7 +162,7 @@ func (s *server) splitAndInputPerSplitCounts(transaction *serialization.Partiall massOfAllInputs := transactionMass - massWithoutInputs - // Since the transaction was generated by kaspawallet, we assume all inputs have the same number of signatures, and + // Since the transaction was generated by c4exwallet, we assume all inputs have the same number of signatures, and // thus - the same mass. inputCount := len(transaction.Tx.Inputs) massPerInput := massOfAllInputs / uint64(inputCount) @@ -192,12 +192,12 @@ func (s *server) splitAndInputPerSplitCounts(transaction *serialization.Partiall func (s *server) createSplitTransaction(transaction *serialization.PartiallySignedTransaction, changeAddress util.Address, startIndex int, endIndex int) (*serialization.PartiallySignedTransaction, error) { - selectedUTXOs := make([]*libkaspawallet.UTXO, 0, endIndex-startIndex) + selectedUTXOs := make([]*libc4exwallet.UTXO, 0, endIndex-startIndex) totalSompi := uint64(0) for i := startIndex; i < endIndex && i < len(transaction.PartiallySignedInputs); i++ { partiallySignedInput := transaction.PartiallySignedInputs[i] - selectedUTXOs = append(selectedUTXOs, &libkaspawallet.UTXO{ + selectedUTXOs = append(selectedUTXOs, &libc4exwallet.UTXO{ Outpoint: &transaction.Tx.Inputs[i].PreviousOutpoint, UTXOEntry: utxo.NewUTXOEntry( partiallySignedInput.PrevOutput.Value, partiallySignedInput.PrevOutput.ScriptPublicKey, @@ -208,9 +208,9 @@ func (s *server) createSplitTransaction(transaction *serialization.PartiallySign totalSompi += selectedUTXOs[i-startIndex].UTXOEntry.Amount() totalSompi -= feePerInput } - unsignedTransactionBytes, err := libkaspawallet.CreateUnsignedTransaction(s.keysFile.ExtendedPublicKeys, + unsignedTransactionBytes, err := libc4exwallet.CreateUnsignedTransaction(s.keysFile.ExtendedPublicKeys, s.keysFile.MinimumSignatures, - []*libkaspawallet.Payment{{ + []*libc4exwallet.Payment{{ Address: changeAddress, Amount: totalSompi, }}, selectedUTXOs) @@ -240,7 +240,7 @@ func (s *server) estimateMassAfterSignatures(transaction *serialization.Partiall transaction.Tx.Inputs[i].SigOpCount = byte(len(input.PubKeySignaturePairs)) } - transactionWithSignatures, err := libkaspawallet.ExtractTransactionDeserialized(transaction, s.keysFile.ECDSA) + transactionWithSignatures, err := libc4exwallet.ExtractTransactionDeserialized(transaction, s.keysFile.ECDSA) if err != nil { return 0, err } @@ -248,8 +248,8 @@ func (s *server) estimateMassAfterSignatures(transaction *serialization.Partiall return s.txMassCalculator.CalculateTransactionMass(transactionWithSignatures), nil } -func (s *server) moreUTXOsForMergeTransaction(alreadySelectedUTXOs []*libkaspawallet.UTXO, requiredAmount uint64) ( - additionalUTXOs []*libkaspawallet.UTXO, totalValueAdded uint64, err error) { +func (s *server) moreUTXOsForMergeTransaction(alreadySelectedUTXOs []*libc4exwallet.UTXO, requiredAmount uint64) ( + additionalUTXOs []*libc4exwallet.UTXO, totalValueAdded uint64, err error) { dagInfo, err := s.rpcClient.GetBlockDAGInfo() if err != nil { @@ -267,7 +267,7 @@ func (s *server) moreUTXOsForMergeTransaction(alreadySelectedUTXOs []*libkaspawa if !isUTXOSpendable(utxo, dagInfo.VirtualDAAScore, s.params.BlockCoinbaseMaturity) { continue } - additionalUTXOs = append(additionalUTXOs, &libkaspawallet.UTXO{ + additionalUTXOs = append(additionalUTXOs, &libc4exwallet.UTXO{ Outpoint: utxo.Outpoint, UTXOEntry: utxo.UTXOEntry, DerivationPath: s.walletAddressPath(utxo.address)}) diff --git a/cmd/kaspawallet/daemon/server/split_transaction_test.go b/cmd/c4exwallet/daemon/server/split_transaction_test.go similarity index 81% rename from cmd/kaspawallet/daemon/server/split_transaction_test.go rename to cmd/c4exwallet/daemon/server/split_transaction_test.go index d8c1fa865..8685177e4 100644 --- a/cmd/kaspawallet/daemon/server/split_transaction_test.go +++ b/cmd/c4exwallet/daemon/server/split_transaction_test.go @@ -3,9 +3,9 @@ package server import ( "testing" - "github.com/c4ei/yunseokyeol/cmd/kaspawallet/libkaspawallet/serialization" + "github.com/c4ei/yunseokyeol/cmd/c4exwallet/libc4exwallet/serialization" - "github.com/c4ei/yunseokyeol/cmd/kaspawallet/keys" + "github.com/c4ei/yunseokyeol/cmd/c4exwallet/keys" "github.com/c4ei/yunseokyeol/util/txmass" "github.com/c4ei/yunseokyeol/domain/dagconfig" @@ -15,7 +15,7 @@ import ( "github.com/c4ei/yunseokyeol/domain/consensus/utils/txscript" "github.com/c4ei/yunseokyeol/domain/consensus/utils/utxo" - "github.com/c4ei/yunseokyeol/cmd/kaspawallet/libkaspawallet" + "github.com/c4ei/yunseokyeol/cmd/c4exwallet/libc4exwallet" "github.com/c4ei/yunseokyeol/domain/consensus" "github.com/c4ei/yunseokyeol/domain/consensus/utils/testutils" ) @@ -43,17 +43,17 @@ func TestEstimateMassAfterSignatures(t *testing.T) { t.Fatalf("Error from estimateMassAfterSignatures: %s", err) } - signedTxStep1Bytes, err := libkaspawallet.Sign(params, mnemonics[:1], unsignedTransactionBytes, false) + signedTxStep1Bytes, err := libc4exwallet.Sign(params, mnemonics[:1], unsignedTransactionBytes, false) if err != nil { t.Fatalf("Sign: %+v", err) } - signedTxStep2Bytes, err := libkaspawallet.Sign(params, mnemonics[1:2], signedTxStep1Bytes, false) + signedTxStep2Bytes, err := libc4exwallet.Sign(params, mnemonics[1:2], signedTxStep1Bytes, false) if err != nil { t.Fatalf("Sign: %+v", err) } - extractedSignedTx, err := libkaspawallet.ExtractTransaction(signedTxStep2Bytes, false) + extractedSignedTx, err := libc4exwallet.ExtractTransaction(signedTxStep2Bytes, false) if err != nil { t.Fatalf("ExtractTransaction: %+v", err) } @@ -83,12 +83,12 @@ func testEstimateMassIncreaseForSignaturesSetUp(t *testing.T, consensusConfig *c publicKeys := make([]string, numKeys) for i := 0; i < numKeys; i++ { var err error - mnemonics[i], err = libkaspawallet.CreateMnemonic() + mnemonics[i], err = libc4exwallet.CreateMnemonic() if err != nil { t.Fatalf("CreateMnemonic: %+v", err) } - publicKeys[i], err = libkaspawallet.MasterPublicKeyFromMnemonic(&consensusConfig.Params, mnemonics[i], true) + publicKeys[i], err = libc4exwallet.MasterPublicKeyFromMnemonic(&consensusConfig.Params, mnemonics[i], true) if err != nil { t.Fatalf("MasterPublicKeyFromMnemonic: %+v", err) } @@ -96,7 +96,7 @@ func testEstimateMassIncreaseForSignaturesSetUp(t *testing.T, consensusConfig *c const minimumSignatures = 2 path := "m/1/2/3" - address, err := libkaspawallet.Address(params, publicKeys, minimumSignatures, path, false) + address, err := libc4exwallet.Address(params, publicKeys, minimumSignatures, path, false) if err != nil { t.Fatalf("Address: %+v", err) } @@ -128,7 +128,7 @@ func testEstimateMassIncreaseForSignaturesSetUp(t *testing.T, consensusConfig *c block1Tx := block1.Transactions[0] block1TxOut := block1Tx.Outputs[0] - selectedUTXOs := []*libkaspawallet.UTXO{ + selectedUTXOs := []*libc4exwallet.UTXO{ { Outpoint: &externalapi.DomainOutpoint{ TransactionID: *consensushashing.TransactionID(block1.Transactions[0]), @@ -139,8 +139,8 @@ func testEstimateMassIncreaseForSignaturesSetUp(t *testing.T, consensusConfig *c }, } - unsignedTransaction, err := libkaspawallet.CreateUnsignedTransaction(publicKeys, minimumSignatures, - []*libkaspawallet.Payment{{ + unsignedTransaction, err := libc4exwallet.CreateUnsignedTransaction(publicKeys, minimumSignatures, + []*libc4exwallet.Payment{{ Address: address, Amount: 10, }}, selectedUTXOs) diff --git a/cmd/kaspawallet/daemon/server/sync.go b/cmd/c4exwallet/daemon/server/sync.go similarity index 97% rename from cmd/kaspawallet/daemon/server/sync.go rename to cmd/c4exwallet/daemon/server/sync.go index bda7c224f..458aaa4cc 100644 --- a/cmd/kaspawallet/daemon/server/sync.go +++ b/cmd/c4exwallet/daemon/server/sync.go @@ -5,13 +5,13 @@ import ( "sort" "time" - "github.com/c4ei/yunseokyeol/cmd/kaspawallet/libkaspawallet" + "github.com/c4ei/yunseokyeol/cmd/c4exwallet/libc4exwallet" "github.com/c4ei/yunseokyeol/app/appmessage" "github.com/pkg/errors" ) -var keyChains = []uint8{libkaspawallet.ExternalKeychain, libkaspawallet.InternalKeychain} +var keyChains = []uint8{libc4exwallet.ExternalKeychain, libc4exwallet.InternalKeychain} type walletAddressSet map[string]*walletAddress @@ -188,7 +188,7 @@ func (s *server) updateAddressesAndLastUsedIndexes(requestedAddressSet walletAdd s.addressSet[entry.Address] = walletAddress - if walletAddress.keyChain == libkaspawallet.ExternalKeychain { + if walletAddress.keyChain == libc4exwallet.ExternalKeychain { if walletAddress.index > lastUsedExternalIndex { lastUsedExternalIndex = walletAddress.index } diff --git a/cmd/kaspawallet/docker/Dockerfile b/cmd/c4exwallet/docker/Dockerfile similarity index 56% rename from cmd/kaspawallet/docker/Dockerfile rename to cmd/c4exwallet/docker/Dockerfile index ee14db8b7..c3d88e87a 100644 --- a/cmd/kaspawallet/docker/Dockerfile +++ b/cmd/c4exwallet/docker/Dockerfile @@ -1,9 +1,9 @@ # -- multistage docker build: stage #1: build stage FROM golang:1.18-alpine AS build -RUN mkdir -p /go/src/github.com/c4ei/kaspad +RUN mkdir -p /go/src/github.com/c4ei/c4exd -WORKDIR /go/src/github.com/c4ei/kaspad +WORKDIR /go/src/github.com/c4ei/c4exd RUN apk add --no-cache curl git openssh binutils gcc musl-dev @@ -14,8 +14,8 @@ RUN go mod download COPY . . -WORKDIR /go/src/github.com/c4ei/yunseokyeol/cmd/kaspawallet -RUN GOOS=linux go build -a -installsuffix cgo -o kaspawallet . +WORKDIR /go/src/github.com/c4ei/yunseokyeol/cmd/c4exwallet +RUN GOOS=linux go build -a -installsuffix cgo -o c4exwallet . # --- multistage docker build: stage #2: runtime image FROM alpine @@ -23,7 +23,7 @@ WORKDIR /app RUN apk add --no-cache ca-certificates tini -COPY --from=build /go/src/github.com/c4ei/yunseokyeol/cmd/kaspawallet/kaspawallet /app/ +COPY --from=build /go/src/github.com/c4ei/yunseokyeol/cmd/c4exwallet/c4exwallet /app/ USER nobody ENTRYPOINT [ "/sbin/tini", "--" ] diff --git a/cmd/kaspawallet/dump_unencrypted_data.go b/cmd/c4exwallet/dump_unencrypted_data.go similarity index 83% rename from cmd/kaspawallet/dump_unencrypted_data.go rename to cmd/c4exwallet/dump_unencrypted_data.go index 616713ea1..e402e8e0c 100644 --- a/cmd/kaspawallet/dump_unencrypted_data.go +++ b/cmd/c4exwallet/dump_unencrypted_data.go @@ -5,9 +5,9 @@ import ( "fmt" "os" - "github.com/c4ei/yunseokyeol/cmd/kaspawallet/keys" - "github.com/c4ei/yunseokyeol/cmd/kaspawallet/libkaspawallet" - "github.com/c4ei/yunseokyeol/cmd/kaspawallet/utils" + "github.com/c4ei/yunseokyeol/cmd/c4exwallet/keys" + "github.com/c4ei/yunseokyeol/cmd/c4exwallet/libc4exwallet" + "github.com/c4ei/yunseokyeol/cmd/c4exwallet/utils" "github.com/pkg/errors" ) @@ -36,7 +36,7 @@ func dumpUnencryptedData(conf *dumpUnencryptedDataConfig) error { mnemonicPublicKeys := make(map[string]struct{}) for i, mnemonic := range mnemonics { fmt.Printf("Mnemonic #%d:\n%s\n\n", i+1, mnemonic) - publicKey, err := libkaspawallet.MasterPublicKeyFromMnemonic(conf.NetParams(), mnemonic, len(keysFile.ExtendedPublicKeys) > 1) + publicKey, err := libc4exwallet.MasterPublicKeyFromMnemonic(conf.NetParams(), mnemonic, len(keysFile.ExtendedPublicKeys) > 1) if err != nil { return err } diff --git a/cmd/kaspawallet/keys/create.go b/cmd/c4exwallet/keys/create.go similarity index 92% rename from cmd/kaspawallet/keys/create.go rename to cmd/c4exwallet/keys/create.go index b5cb13e89..91362392c 100644 --- a/cmd/kaspawallet/keys/create.go +++ b/cmd/c4exwallet/keys/create.go @@ -7,8 +7,8 @@ import ( "fmt" "os" - "github.com/c4ei/yunseokyeol/cmd/kaspawallet/libkaspawallet" - "github.com/c4ei/yunseokyeol/cmd/kaspawallet/utils" + "github.com/c4ei/yunseokyeol/cmd/c4exwallet/libc4exwallet" + "github.com/c4ei/yunseokyeol/cmd/c4exwallet/utils" "github.com/c4ei/yunseokyeol/domain/dagconfig" "github.com/pkg/errors" "github.com/tyler-smith/go-bip39" @@ -19,7 +19,7 @@ func CreateMnemonics(params *dagconfig.Params, numKeys uint32, cmdLinePassword s mnemonics := make([]string, numKeys) for i := uint32(0); i < numKeys; i++ { var err error - mnemonics[i], err = libkaspawallet.CreateMnemonic() + mnemonics[i], err = libc4exwallet.CreateMnemonic() if err != nil { return nil, nil, err } @@ -65,7 +65,7 @@ func encryptedMnemonicExtendedPublicKeyPairs(params *dagconfig.Params, mnemonics extendedPublicKeys = make([]string, 0, len(mnemonics)) for _, mnemonic := range mnemonics { - extendedPublicKey, err := libkaspawallet.MasterPublicKeyFromMnemonic(params, mnemonic, isMultisig) + extendedPublicKey, err := libc4exwallet.MasterPublicKeyFromMnemonic(params, mnemonic, isMultisig) if err != nil { return nil, nil, err } diff --git a/cmd/kaspawallet/keys/get_password.go b/cmd/c4exwallet/keys/get_password.go similarity index 100% rename from cmd/kaspawallet/keys/get_password.go rename to cmd/c4exwallet/keys/get_password.go diff --git a/cmd/kaspawallet/keys/keys.go b/cmd/c4exwallet/keys/keys.go similarity index 99% rename from cmd/kaspawallet/keys/keys.go rename to cmd/c4exwallet/keys/keys.go index 04eaa334e..6b7b7b925 100644 --- a/cmd/kaspawallet/keys/keys.go +++ b/cmd/c4exwallet/keys/keys.go @@ -13,7 +13,7 @@ import ( "github.com/gofrs/flock" - "github.com/c4ei/yunseokyeol/cmd/kaspawallet/utils" + "github.com/c4ei/yunseokyeol/cmd/c4exwallet/utils" "github.com/c4ei/yunseokyeol/domain/dagconfig" "github.com/c4ei/yunseokyeol/util" @@ -23,7 +23,7 @@ import ( ) var ( - defaultAppDir = util.AppDir("kaspawallet", false) + defaultAppDir = util.AppDir("c4exwallet", false) ) // LastVersion is the most up to date file format version diff --git a/cmd/kaspawallet/libkaspawallet/bip32/base58/alphabet.go b/cmd/c4exwallet/libkaspawallet/bip32/base58/alphabet.go similarity index 100% rename from cmd/kaspawallet/libkaspawallet/bip32/base58/alphabet.go rename to cmd/c4exwallet/libkaspawallet/bip32/base58/alphabet.go diff --git a/cmd/kaspawallet/libkaspawallet/bip32/base58/base58.go b/cmd/c4exwallet/libkaspawallet/bip32/base58/base58.go similarity index 100% rename from cmd/kaspawallet/libkaspawallet/bip32/base58/base58.go rename to cmd/c4exwallet/libkaspawallet/bip32/base58/base58.go diff --git a/cmd/kaspawallet/libkaspawallet/bip32/base58/base58_test.go b/cmd/c4exwallet/libkaspawallet/bip32/base58/base58_test.go similarity index 100% rename from cmd/kaspawallet/libkaspawallet/bip32/base58/base58_test.go rename to cmd/c4exwallet/libkaspawallet/bip32/base58/base58_test.go diff --git a/cmd/kaspawallet/libkaspawallet/bip32/base58/base58bench_test.go b/cmd/c4exwallet/libkaspawallet/bip32/base58/base58bench_test.go similarity index 100% rename from cmd/kaspawallet/libkaspawallet/bip32/base58/base58bench_test.go rename to cmd/c4exwallet/libkaspawallet/bip32/base58/base58bench_test.go diff --git a/cmd/kaspawallet/libkaspawallet/bip32/base58/base58check.go b/cmd/c4exwallet/libkaspawallet/bip32/base58/base58check.go similarity index 100% rename from cmd/kaspawallet/libkaspawallet/bip32/base58/base58check.go rename to cmd/c4exwallet/libkaspawallet/bip32/base58/base58check.go diff --git a/cmd/kaspawallet/libkaspawallet/bip32/base58/base58check_test.go b/cmd/c4exwallet/libkaspawallet/bip32/base58/base58check_test.go similarity index 100% rename from cmd/kaspawallet/libkaspawallet/bip32/base58/base58check_test.go rename to cmd/c4exwallet/libkaspawallet/bip32/base58/base58check_test.go diff --git a/cmd/kaspawallet/libkaspawallet/bip32/base58/cov_report.sh b/cmd/c4exwallet/libkaspawallet/bip32/base58/cov_report.sh similarity index 100% rename from cmd/kaspawallet/libkaspawallet/bip32/base58/cov_report.sh rename to cmd/c4exwallet/libkaspawallet/bip32/base58/cov_report.sh diff --git a/cmd/kaspawallet/libkaspawallet/bip32/base58/doc.go b/cmd/c4exwallet/libkaspawallet/bip32/base58/doc.go similarity index 100% rename from cmd/kaspawallet/libkaspawallet/bip32/base58/doc.go rename to cmd/c4exwallet/libkaspawallet/bip32/base58/doc.go diff --git a/cmd/kaspawallet/libkaspawallet/bip32/base58/example_test.go b/cmd/c4exwallet/libkaspawallet/bip32/base58/example_test.go similarity index 100% rename from cmd/kaspawallet/libkaspawallet/bip32/base58/example_test.go rename to cmd/c4exwallet/libkaspawallet/bip32/base58/example_test.go diff --git a/cmd/kaspawallet/libkaspawallet/bip32/bip32.go b/cmd/c4exwallet/libkaspawallet/bip32/bip32.go similarity index 100% rename from cmd/kaspawallet/libkaspawallet/bip32/bip32.go rename to cmd/c4exwallet/libkaspawallet/bip32/bip32.go diff --git a/cmd/kaspawallet/libkaspawallet/bip32/bip32_test.go b/cmd/c4exwallet/libkaspawallet/bip32/bip32_test.go similarity index 100% rename from cmd/kaspawallet/libkaspawallet/bip32/bip32_test.go rename to cmd/c4exwallet/libkaspawallet/bip32/bip32_test.go diff --git a/cmd/kaspawallet/libkaspawallet/bip32/child_key_derivation.go b/cmd/c4exwallet/libkaspawallet/bip32/child_key_derivation.go similarity index 98% rename from cmd/kaspawallet/libkaspawallet/bip32/child_key_derivation.go rename to cmd/c4exwallet/libkaspawallet/bip32/child_key_derivation.go index e92927ccd..a5b48655b 100644 --- a/cmd/kaspawallet/libkaspawallet/bip32/child_key_derivation.go +++ b/cmd/c4exwallet/libkaspawallet/bip32/child_key_derivation.go @@ -2,7 +2,8 @@ package bip32 import ( "encoding/binary" - "github.com/kaspanet/go-secp256k1" + + "github.com/c4exnet/go-secp256k1" "github.com/pkg/errors" ) diff --git a/cmd/kaspawallet/libkaspawallet/bip32/extended_key.go b/cmd/c4exwallet/libkaspawallet/bip32/extended_key.go similarity index 98% rename from cmd/kaspawallet/libkaspawallet/bip32/extended_key.go rename to cmd/c4exwallet/libkaspawallet/bip32/extended_key.go index bde63b250..61eeac08a 100644 --- a/cmd/kaspawallet/libkaspawallet/bip32/extended_key.go +++ b/cmd/c4exwallet/libkaspawallet/bip32/extended_key.go @@ -2,7 +2,7 @@ package bip32 import ( "github.com/btcsuite/btcutil/base58" - "github.com/kaspanet/go-secp256k1" + "github.com/c4exnet/go-secp256k1" "github.com/pkg/errors" ) diff --git a/cmd/kaspawallet/libkaspawallet/bip32/hash.go b/cmd/c4exwallet/libkaspawallet/bip32/hash.go similarity index 100% rename from cmd/kaspawallet/libkaspawallet/bip32/hash.go rename to cmd/c4exwallet/libkaspawallet/bip32/hash.go diff --git a/cmd/kaspawallet/libkaspawallet/bip32/path.go b/cmd/c4exwallet/libkaspawallet/bip32/path.go similarity index 100% rename from cmd/kaspawallet/libkaspawallet/bip32/path.go rename to cmd/c4exwallet/libkaspawallet/bip32/path.go diff --git a/cmd/kaspawallet/libkaspawallet/bip32/serialization.go b/cmd/c4exwallet/libkaspawallet/bip32/serialization.go similarity index 97% rename from cmd/kaspawallet/libkaspawallet/bip32/serialization.go rename to cmd/c4exwallet/libkaspawallet/bip32/serialization.go index ae47bd2ea..7b8ad956b 100644 --- a/cmd/kaspawallet/libkaspawallet/bip32/serialization.go +++ b/cmd/c4exwallet/libkaspawallet/bip32/serialization.go @@ -3,8 +3,8 @@ package bip32 import ( "encoding/binary" - "github.com/c4ei/yunseokyeol/cmd/kaspawallet/libkaspawallet/bip32/base58" - "github.com/kaspanet/go-secp256k1" + "github.com/c4ei/yunseokyeol/cmd/c4exwallet/libc4exwallet/bip32/base58" + "github.com/c4exnet/go-secp256k1" "github.com/pkg/errors" ) diff --git a/cmd/kaspawallet/libkaspawallet/bip32/version.go b/cmd/c4exwallet/libkaspawallet/bip32/version.go similarity index 86% rename from cmd/kaspawallet/libkaspawallet/bip32/version.go rename to cmd/c4exwallet/libkaspawallet/bip32/version.go index 7d050cb5f..67b1fcbaf 100644 --- a/cmd/kaspawallet/libkaspawallet/bip32/version.go +++ b/cmd/c4exwallet/libkaspawallet/bip32/version.go @@ -23,7 +23,7 @@ var BitcoinMainnetPublic = [4]byte{ } // KaspaMainnetPrivate is the version that is used for -// kaspa mainnet bip32 private extended keys. +// c4ex mainnet bip32 private extended keys. // Ecnodes to xprv in base58. var KaspaMainnetPrivate = [4]byte{ 0x03, @@ -33,7 +33,7 @@ var KaspaMainnetPrivate = [4]byte{ } // KaspaMainnetPublic is the version that is used for -// kaspa mainnet bip32 public extended keys. +// c4ex mainnet bip32 public extended keys. // Ecnodes to kpub in base58. var KaspaMainnetPublic = [4]byte{ 0x03, @@ -43,7 +43,7 @@ var KaspaMainnetPublic = [4]byte{ } // KaspaTestnetPrivate is the version that is used for -// kaspa testnet bip32 public extended keys. +// c4ex testnet bip32 public extended keys. // Ecnodes to ktrv in base58. var KaspaTestnetPrivate = [4]byte{ 0x03, @@ -53,7 +53,7 @@ var KaspaTestnetPrivate = [4]byte{ } // KaspaTestnetPublic is the version that is used for -// kaspa testnet bip32 public extended keys. +// c4ex testnet bip32 public extended keys. // Ecnodes to ktub in base58. var KaspaTestnetPublic = [4]byte{ 0x03, @@ -63,7 +63,7 @@ var KaspaTestnetPublic = [4]byte{ } // KaspaDevnetPrivate is the version that is used for -// kaspa devnet bip32 public extended keys. +// c4ex devnet bip32 public extended keys. // Ecnodes to kdrv in base58. var KaspaDevnetPrivate = [4]byte{ 0x03, @@ -73,7 +73,7 @@ var KaspaDevnetPrivate = [4]byte{ } // KaspaDevnetPublic is the version that is used for -// kaspa devnet bip32 public extended keys. +// c4ex devnet bip32 public extended keys. // Ecnodes to xdub in base58. var KaspaDevnetPublic = [4]byte{ 0x03, @@ -83,7 +83,7 @@ var KaspaDevnetPublic = [4]byte{ } // KaspaSimnetPrivate is the version that is used for -// kaspa simnet bip32 public extended keys. +// c4ex simnet bip32 public extended keys. // Ecnodes to ksrv in base58. var KaspaSimnetPrivate = [4]byte{ 0x03, @@ -93,7 +93,7 @@ var KaspaSimnetPrivate = [4]byte{ } // KaspaSimnetPublic is the version that is used for -// kaspa simnet bip32 public extended keys. +// c4ex simnet bip32 public extended keys. // Ecnodes to xsub in base58. var KaspaSimnetPublic = [4]byte{ 0x03, diff --git a/cmd/kaspawallet/libkaspawallet/bip39.go b/cmd/c4exwallet/libkaspawallet/bip39.go similarity index 95% rename from cmd/kaspawallet/libkaspawallet/bip39.go rename to cmd/c4exwallet/libkaspawallet/bip39.go index 441fbd53d..669f0d773 100644 --- a/cmd/kaspawallet/libkaspawallet/bip39.go +++ b/cmd/c4exwallet/libkaspawallet/bip39.go @@ -1,9 +1,9 @@ -package libkaspawallet +package libc4exwallet import ( "fmt" - "github.com/c4ei/yunseokyeol/cmd/kaspawallet/libkaspawallet/bip32" + "github.com/c4ei/yunseokyeol/cmd/c4exwallet/libc4exwallet/bip32" "github.com/c4ei/yunseokyeol/domain/dagconfig" "github.com/pkg/errors" "github.com/tyler-smith/go-bip39" diff --git a/cmd/kaspawallet/libkaspawallet/converters.go b/cmd/c4exwallet/libkaspawallet/converters.go similarity index 81% rename from cmd/kaspawallet/libkaspawallet/converters.go rename to cmd/c4exwallet/libkaspawallet/converters.go index 150c04fa0..bcc67b10d 100644 --- a/cmd/kaspawallet/libkaspawallet/converters.go +++ b/cmd/c4exwallet/libkaspawallet/converters.go @@ -1,19 +1,19 @@ -package libkaspawallet +package libc4exwallet import ( "encoding/hex" "github.com/c4ei/yunseokyeol/app/appmessage" - "github.com/c4ei/yunseokyeol/cmd/kaspawallet/daemon/pb" + "github.com/c4ei/yunseokyeol/cmd/c4exwallet/daemon/pb" "github.com/c4ei/yunseokyeol/domain/consensus/model/externalapi" "github.com/c4ei/yunseokyeol/domain/consensus/utils/transactionid" "github.com/c4ei/yunseokyeol/domain/consensus/utils/utxo" ) -// KaspawalletdUTXOsTolibkaspawalletUTXOs converts a []*pb.UtxosByAddressesEntry to a []*libkaspawallet.UTXO -func KaspawalletdUTXOsTolibkaspawalletUTXOs(kaspawalletdUtxoEntires []*pb.UtxosByAddressesEntry) ([]*UTXO, error) { - UTXOs := make([]*UTXO, len(kaspawalletdUtxoEntires)) - for i, entry := range kaspawalletdUtxoEntires { +// KaspawalletdUTXOsTolibc4exwalletUTXOs converts a []*pb.UtxosByAddressesEntry to a []*libc4exwallet.UTXO +func KaspawalletdUTXOsTolibc4exwalletUTXOs(c4exwalletdUtxoEntires []*pb.UtxosByAddressesEntry) ([]*UTXO, error) { + UTXOs := make([]*UTXO, len(c4exwalletdUtxoEntires)) + for i, entry := range c4exwalletdUtxoEntires { script, err := hex.DecodeString(entry.UtxoEntry.ScriptPublicKey.ScriptPublicKey) if err != nil { return nil, err diff --git a/cmd/kaspawallet/libkaspawallet/keychains.go b/cmd/c4exwallet/libkaspawallet/keychains.go similarity index 89% rename from cmd/kaspawallet/libkaspawallet/keychains.go rename to cmd/c4exwallet/libkaspawallet/keychains.go index 3dc487e5d..b1f859f04 100644 --- a/cmd/kaspawallet/libkaspawallet/keychains.go +++ b/cmd/c4exwallet/libkaspawallet/keychains.go @@ -1,4 +1,4 @@ -package libkaspawallet +package libc4exwallet const ( // ExternalKeychain is the key chain that is used to create receive addresses diff --git a/cmd/kaspawallet/libkaspawallet/keypair.go b/cmd/c4exwallet/libkaspawallet/keypair.go similarity index 97% rename from cmd/kaspawallet/libkaspawallet/keypair.go rename to cmd/c4exwallet/libkaspawallet/keypair.go index d8a220049..acddfe307 100644 --- a/cmd/kaspawallet/libkaspawallet/keypair.go +++ b/cmd/c4exwallet/libkaspawallet/keypair.go @@ -1,14 +1,14 @@ -package libkaspawallet +package libc4exwallet import ( "math" "sort" "strings" - "github.com/c4ei/yunseokyeol/cmd/kaspawallet/libkaspawallet/bip32" + "github.com/c4ei/yunseokyeol/cmd/c4exwallet/libc4exwallet/bip32" "github.com/c4ei/yunseokyeol/domain/dagconfig" "github.com/c4ei/yunseokyeol/util" - "github.com/kaspanet/go-secp256k1" + "github.com/c4exnet/go-secp256k1" "github.com/pkg/errors" ) diff --git a/cmd/kaspawallet/libkaspawallet/serialization/protoserialization/generate.go b/cmd/c4exwallet/libkaspawallet/serialization/protoserialization/generate.go similarity index 100% rename from cmd/kaspawallet/libkaspawallet/serialization/protoserialization/generate.go rename to cmd/c4exwallet/libkaspawallet/serialization/protoserialization/generate.go diff --git a/cmd/kaspawallet/libkaspawallet/serialization/protoserialization/wallet.pb.go b/cmd/c4exwallet/libkaspawallet/serialization/protoserialization/wallet.pb.go similarity index 100% rename from cmd/kaspawallet/libkaspawallet/serialization/protoserialization/wallet.pb.go rename to cmd/c4exwallet/libkaspawallet/serialization/protoserialization/wallet.pb.go diff --git a/cmd/kaspawallet/libkaspawallet/serialization/protoserialization/wallet.proto b/cmd/c4exwallet/libkaspawallet/serialization/protoserialization/wallet.proto similarity index 90% rename from cmd/kaspawallet/libkaspawallet/serialization/protoserialization/wallet.proto rename to cmd/c4exwallet/libkaspawallet/serialization/protoserialization/wallet.proto index af17ea562..421844a51 100644 --- a/cmd/kaspawallet/libkaspawallet/serialization/protoserialization/wallet.proto +++ b/cmd/c4exwallet/libkaspawallet/serialization/protoserialization/wallet.proto @@ -1,7 +1,7 @@ syntax = "proto3"; package protoserialization; -option go_package = "github.com/c4ei/yunseokyeol/cmd/kaspawallet/libkaspawallet/serialization/protoserialization"; +option go_package = "github.com/c4ei/yunseokyeol/cmd/c4exwallet/libc4exwallet/serialization/protoserialization"; message PartiallySignedTransaction{ TransactionMessage tx = 1; diff --git a/cmd/kaspawallet/libkaspawallet/serialization/serialization.go b/cmd/c4exwallet/libkaspawallet/serialization/serialization.go similarity index 99% rename from cmd/kaspawallet/libkaspawallet/serialization/serialization.go rename to cmd/c4exwallet/libkaspawallet/serialization/serialization.go index 3cfe30ebc..b11163e71 100644 --- a/cmd/kaspawallet/libkaspawallet/serialization/serialization.go +++ b/cmd/c4exwallet/libkaspawallet/serialization/serialization.go @@ -3,7 +3,7 @@ package serialization import ( "math" - "github.com/c4ei/yunseokyeol/cmd/kaspawallet/libkaspawallet/serialization/protoserialization" + "github.com/c4ei/yunseokyeol/cmd/c4exwallet/libc4exwallet/serialization/protoserialization" "github.com/c4ei/yunseokyeol/domain/consensus/model/externalapi" "github.com/c4ei/yunseokyeol/domain/consensus/utils/subnetworks" "github.com/pkg/errors" diff --git a/cmd/kaspawallet/libkaspawallet/sign.go b/cmd/c4exwallet/libkaspawallet/sign.go similarity index 95% rename from cmd/kaspawallet/libkaspawallet/sign.go rename to cmd/c4exwallet/libkaspawallet/sign.go index 4e48d5a86..93301ae19 100644 --- a/cmd/kaspawallet/libkaspawallet/sign.go +++ b/cmd/c4exwallet/libkaspawallet/sign.go @@ -1,8 +1,8 @@ -package libkaspawallet +package libc4exwallet import ( - "github.com/c4ei/yunseokyeol/cmd/kaspawallet/libkaspawallet/bip32" - "github.com/c4ei/yunseokyeol/cmd/kaspawallet/libkaspawallet/serialization" + "github.com/c4ei/yunseokyeol/cmd/c4exwallet/libc4exwallet/bip32" + "github.com/c4ei/yunseokyeol/cmd/c4exwallet/libc4exwallet/serialization" "github.com/c4ei/yunseokyeol/domain/consensus/model/externalapi" "github.com/c4ei/yunseokyeol/domain/consensus/utils/consensushashing" "github.com/c4ei/yunseokyeol/domain/consensus/utils/txscript" diff --git a/cmd/kaspawallet/libkaspawallet/transaction.go b/cmd/c4exwallet/libkaspawallet/transaction.go similarity index 97% rename from cmd/kaspawallet/libkaspawallet/transaction.go rename to cmd/c4exwallet/libkaspawallet/transaction.go index 02da0d487..0951c45dc 100644 --- a/cmd/kaspawallet/libkaspawallet/transaction.go +++ b/cmd/c4exwallet/libkaspawallet/transaction.go @@ -1,8 +1,8 @@ -package libkaspawallet +package libc4exwallet import ( - "github.com/c4ei/yunseokyeol/cmd/kaspawallet/libkaspawallet/bip32" - "github.com/c4ei/yunseokyeol/cmd/kaspawallet/libkaspawallet/serialization" + "github.com/c4ei/yunseokyeol/cmd/c4exwallet/libc4exwallet/bip32" + "github.com/c4ei/yunseokyeol/cmd/c4exwallet/libc4exwallet/serialization" "github.com/c4ei/yunseokyeol/domain/consensus/model/externalapi" "github.com/c4ei/yunseokyeol/domain/consensus/utils/constants" "github.com/c4ei/yunseokyeol/domain/consensus/utils/subnetworks" diff --git a/cmd/kaspawallet/libkaspawallet/transaction_test.go b/cmd/c4exwallet/libkaspawallet/transaction_test.go similarity index 80% rename from cmd/kaspawallet/libkaspawallet/transaction_test.go rename to cmd/c4exwallet/libkaspawallet/transaction_test.go index 116413558..a9edc077f 100644 --- a/cmd/kaspawallet/libkaspawallet/transaction_test.go +++ b/cmd/c4exwallet/libkaspawallet/transaction_test.go @@ -1,4 +1,4 @@ -package libkaspawallet_test +package libc4exwallet_test import ( "fmt" @@ -7,7 +7,7 @@ import ( "github.com/c4ei/yunseokyeol/domain/consensus/utils/constants" - "github.com/c4ei/yunseokyeol/cmd/kaspawallet/libkaspawallet" + "github.com/c4ei/yunseokyeol/cmd/c4exwallet/libc4exwallet" "github.com/c4ei/yunseokyeol/domain/consensus" "github.com/c4ei/yunseokyeol/domain/consensus/model/externalapi" "github.com/c4ei/yunseokyeol/domain/consensus/utils/consensushashing" @@ -43,12 +43,12 @@ func TestMultisig(t *testing.T) { publicKeys := make([]string, numKeys) for i := 0; i < numKeys; i++ { var err error - mnemonics[i], err = libkaspawallet.CreateMnemonic() + mnemonics[i], err = libc4exwallet.CreateMnemonic() if err != nil { t.Fatalf("CreateMnemonic: %+v", err) } - publicKeys[i], err = libkaspawallet.MasterPublicKeyFromMnemonic(&consensusConfig.Params, mnemonics[i], true) + publicKeys[i], err = libc4exwallet.MasterPublicKeyFromMnemonic(&consensusConfig.Params, mnemonics[i], true) if err != nil { t.Fatalf("MasterPublicKeyFromMnemonic: %+v", err) } @@ -56,7 +56,7 @@ func TestMultisig(t *testing.T) { const minimumSignatures = 2 path := "m/1/2/3" - address, err := libkaspawallet.Address(params, publicKeys, minimumSignatures, path, ecdsa) + address, err := libc4exwallet.Address(params, publicKeys, minimumSignatures, path, ecdsa) if err != nil { t.Fatalf("Address: %+v", err) } @@ -92,7 +92,7 @@ func TestMultisig(t *testing.T) { block1Tx := block1.Transactions[0] block1TxOut := block1Tx.Outputs[0] - selectedUTXOs := []*libkaspawallet.UTXO{ + selectedUTXOs := []*libc4exwallet.UTXO{ { Outpoint: &externalapi.DomainOutpoint{ TransactionID: *consensushashing.TransactionID(block1.Transactions[0]), @@ -103,8 +103,8 @@ func TestMultisig(t *testing.T) { }, } - unsignedTransaction, err := libkaspawallet.CreateUnsignedTransaction(publicKeys, minimumSignatures, - []*libkaspawallet.Payment{{ + unsignedTransaction, err := libc4exwallet.CreateUnsignedTransaction(publicKeys, minimumSignatures, + []*libc4exwallet.Payment{{ Address: address, Amount: 10, }}, selectedUTXOs) @@ -112,7 +112,7 @@ func TestMultisig(t *testing.T) { t.Fatalf("CreateUnsignedTransactions: %+v", err) } - isFullySigned, err := libkaspawallet.IsTransactionFullySigned(unsignedTransaction) + isFullySigned, err := libc4exwallet.IsTransactionFullySigned(unsignedTransaction) if err != nil { t.Fatalf("IsTransactionFullySigned: %+v", err) } @@ -121,17 +121,17 @@ func TestMultisig(t *testing.T) { t.Fatalf("Transaction is not expected to be signed") } - _, err = libkaspawallet.ExtractTransaction(unsignedTransaction, ecdsa) + _, err = libc4exwallet.ExtractTransaction(unsignedTransaction, ecdsa) if err == nil || !strings.Contains(err.Error(), fmt.Sprintf("missing %d signatures", minimumSignatures)) { t.Fatal("Unexpectedly succeed to extract a valid transaction out of unsigned transaction") } - signedTxStep1, err := libkaspawallet.Sign(params, mnemonics[:1], unsignedTransaction, ecdsa) + signedTxStep1, err := libc4exwallet.Sign(params, mnemonics[:1], unsignedTransaction, ecdsa) if err != nil { t.Fatalf("Sign: %+v", err) } - isFullySigned, err = libkaspawallet.IsTransactionFullySigned(signedTxStep1) + isFullySigned, err = libc4exwallet.IsTransactionFullySigned(signedTxStep1) if err != nil { t.Fatalf("IsTransactionFullySigned: %+v", err) } @@ -140,22 +140,22 @@ func TestMultisig(t *testing.T) { t.Fatalf("Transaction is not expected to be fully signed") } - signedTxStep2, err := libkaspawallet.Sign(params, mnemonics[1:2], signedTxStep1, ecdsa) + signedTxStep2, err := libc4exwallet.Sign(params, mnemonics[1:2], signedTxStep1, ecdsa) if err != nil { t.Fatalf("Sign: %+v", err) } - extractedSignedTxStep2, err := libkaspawallet.ExtractTransaction(signedTxStep2, ecdsa) + extractedSignedTxStep2, err := libc4exwallet.ExtractTransaction(signedTxStep2, ecdsa) if err != nil { t.Fatalf("ExtractTransaction: %+v", err) } - signedTxOneStep, err := libkaspawallet.Sign(params, mnemonics[:2], unsignedTransaction, ecdsa) + signedTxOneStep, err := libc4exwallet.Sign(params, mnemonics[:2], unsignedTransaction, ecdsa) if err != nil { t.Fatalf("Sign: %+v", err) } - extractedSignedTxOneStep, err := libkaspawallet.ExtractTransaction(signedTxOneStep, ecdsa) + extractedSignedTxOneStep, err := libc4exwallet.ExtractTransaction(signedTxOneStep, ecdsa) if err != nil { t.Fatalf("ExtractTransaction: %+v", err) } @@ -198,12 +198,12 @@ func TestP2PK(t *testing.T) { publicKeys := make([]string, numKeys) for i := 0; i < numKeys; i++ { var err error - mnemonics[i], err = libkaspawallet.CreateMnemonic() + mnemonics[i], err = libc4exwallet.CreateMnemonic() if err != nil { t.Fatalf("CreateMnemonic: %+v", err) } - publicKeys[i], err = libkaspawallet.MasterPublicKeyFromMnemonic(&consensusConfig.Params, mnemonics[i], false) + publicKeys[i], err = libc4exwallet.MasterPublicKeyFromMnemonic(&consensusConfig.Params, mnemonics[i], false) if err != nil { t.Fatalf("MasterPublicKeyFromMnemonic: %+v", err) } @@ -211,7 +211,7 @@ func TestP2PK(t *testing.T) { const minimumSignatures = 1 path := "m/1/2/3" - address, err := libkaspawallet.Address(params, publicKeys, minimumSignatures, path, ecdsa) + address, err := libc4exwallet.Address(params, publicKeys, minimumSignatures, path, ecdsa) if err != nil { t.Fatalf("Address: %+v", err) } @@ -253,7 +253,7 @@ func TestP2PK(t *testing.T) { block1Tx := block1.Transactions[0] block1TxOut := block1Tx.Outputs[0] - selectedUTXOs := []*libkaspawallet.UTXO{ + selectedUTXOs := []*libc4exwallet.UTXO{ { Outpoint: &externalapi.DomainOutpoint{ TransactionID: *consensushashing.TransactionID(block1.Transactions[0]), @@ -264,8 +264,8 @@ func TestP2PK(t *testing.T) { }, } - unsignedTransaction, err := libkaspawallet.CreateUnsignedTransaction(publicKeys, minimumSignatures, - []*libkaspawallet.Payment{{ + unsignedTransaction, err := libc4exwallet.CreateUnsignedTransaction(publicKeys, minimumSignatures, + []*libc4exwallet.Payment{{ Address: address, Amount: 10, }}, selectedUTXOs) @@ -273,7 +273,7 @@ func TestP2PK(t *testing.T) { t.Fatalf("CreateUnsignedTransactions: %+v", err) } - isFullySigned, err := libkaspawallet.IsTransactionFullySigned(unsignedTransaction) + isFullySigned, err := libc4exwallet.IsTransactionFullySigned(unsignedTransaction) if err != nil { t.Fatalf("IsTransactionFullySigned: %+v", err) } @@ -282,17 +282,17 @@ func TestP2PK(t *testing.T) { t.Fatalf("Transaction is not expected to be signed") } - _, err = libkaspawallet.ExtractTransaction(unsignedTransaction, ecdsa) + _, err = libc4exwallet.ExtractTransaction(unsignedTransaction, ecdsa) if err == nil || !strings.Contains(err.Error(), "missing signature") { t.Fatal("Unexpectedly succeed to extract a valid transaction out of unsigned transaction") } - signedTx, err := libkaspawallet.Sign(params, mnemonics, unsignedTransaction, ecdsa) + signedTx, err := libc4exwallet.Sign(params, mnemonics, unsignedTransaction, ecdsa) if err != nil { t.Fatalf("Sign: %+v", err) } - tx, err := libkaspawallet.ExtractTransaction(signedTx, ecdsa) + tx, err := libc4exwallet.ExtractTransaction(signedTx, ecdsa) if err != nil { t.Fatalf("ExtractTransaction: %+v", err) } @@ -330,12 +330,12 @@ func TestMaxSompi(t *testing.T) { publicKeys := make([]string, numKeys) for i := 0; i < numKeys; i++ { var err error - mnemonics[i], err = libkaspawallet.CreateMnemonic() + mnemonics[i], err = libc4exwallet.CreateMnemonic() if err != nil { t.Fatalf("CreateMnemonic: %+v", err) } - publicKeys[i], err = libkaspawallet.MasterPublicKeyFromMnemonic(&cfg.Params, mnemonics[i], false) + publicKeys[i], err = libc4exwallet.MasterPublicKeyFromMnemonic(&cfg.Params, mnemonics[i], false) if err != nil { t.Fatalf("MasterPublicKeyFromMnemonic: %+v", err) } @@ -343,7 +343,7 @@ func TestMaxSompi(t *testing.T) { const minimumSignatures = 1 path := "m/1/2/3" - address, err := libkaspawallet.Address(params, publicKeys, minimumSignatures, path, false) + address, err := libc4exwallet.Address(params, publicKeys, minimumSignatures, path, false) if err != nil { t.Fatalf("Address: %+v", err) } @@ -407,7 +407,7 @@ func TestMaxSompi(t *testing.T) { txOut2 := fundingBlock3.Transactions[0].Outputs[0] txOut3 := fundingBlock4.Transactions[0].Outputs[0] txOut4 := block1.Transactions[0].Outputs[0] - selectedUTXOsForTxWithLargeInputAmount := []*libkaspawallet.UTXO{ + selectedUTXOsForTxWithLargeInputAmount := []*libc4exwallet.UTXO{ { Outpoint: &externalapi.DomainOutpoint{ TransactionID: *consensushashing.TransactionID(fundingBlock2.Transactions[0]), @@ -426,8 +426,8 @@ func TestMaxSompi(t *testing.T) { }, } - unsignedTxWithLargeInputAmount, err := libkaspawallet.CreateUnsignedTransaction(publicKeys, minimumSignatures, - []*libkaspawallet.Payment{{ + unsignedTxWithLargeInputAmount, err := libc4exwallet.CreateUnsignedTransaction(publicKeys, minimumSignatures, + []*libc4exwallet.Payment{{ Address: address, Amount: 10, }}, selectedUTXOsForTxWithLargeInputAmount) @@ -435,12 +435,12 @@ func TestMaxSompi(t *testing.T) { t.Fatalf("CreateUnsignedTransactions: %+v", err) } - signedTxWithLargeInputAmount, err := libkaspawallet.Sign(params, mnemonics, unsignedTxWithLargeInputAmount, false) + signedTxWithLargeInputAmount, err := libc4exwallet.Sign(params, mnemonics, unsignedTxWithLargeInputAmount, false) if err != nil { t.Fatalf("Sign: %+v", err) } - txWithLargeInputAmount, err := libkaspawallet.ExtractTransaction(signedTxWithLargeInputAmount, false) + txWithLargeInputAmount, err := libc4exwallet.ExtractTransaction(signedTxWithLargeInputAmount, false) if err != nil { t.Fatalf("ExtractTransaction: %+v", err) } @@ -458,7 +458,7 @@ func TestMaxSompi(t *testing.T) { t.Fatalf("Transaction wasn't accepted in the DAG") } - selectedUTXOsForTxWithLargeInputAndOutputAmount := []*libkaspawallet.UTXO{ + selectedUTXOsForTxWithLargeInputAndOutputAmount := []*libc4exwallet.UTXO{ { Outpoint: &externalapi.DomainOutpoint{ TransactionID: *consensushashing.TransactionID(fundingBlock4.Transactions[0]), @@ -477,8 +477,8 @@ func TestMaxSompi(t *testing.T) { }, } - unsignedTxWithLargeInputAndOutputAmount, err := libkaspawallet.CreateUnsignedTransaction(publicKeys, minimumSignatures, - []*libkaspawallet.Payment{{ + unsignedTxWithLargeInputAndOutputAmount, err := libc4exwallet.CreateUnsignedTransaction(publicKeys, minimumSignatures, + []*libc4exwallet.Payment{{ Address: address, Amount: 22e6 * constants.SompiPerKaspa, }}, selectedUTXOsForTxWithLargeInputAndOutputAmount) @@ -486,12 +486,12 @@ func TestMaxSompi(t *testing.T) { t.Fatalf("CreateUnsignedTransactions: %+v", err) } - signedTxWithLargeInputAndOutputAmount, err := libkaspawallet.Sign(params, mnemonics, unsignedTxWithLargeInputAndOutputAmount, false) + signedTxWithLargeInputAndOutputAmount, err := libc4exwallet.Sign(params, mnemonics, unsignedTxWithLargeInputAndOutputAmount, false) if err != nil { t.Fatalf("Sign: %+v", err) } - txWithLargeInputAndOutputAmount, err := libkaspawallet.ExtractTransaction(signedTxWithLargeInputAndOutputAmount, false) + txWithLargeInputAndOutputAmount, err := libc4exwallet.ExtractTransaction(signedTxWithLargeInputAndOutputAmount, false) if err != nil { t.Fatalf("ExtractTransaction: %+v", err) } diff --git a/cmd/kaspawallet/main.go b/cmd/c4exwallet/main.go similarity index 100% rename from cmd/kaspawallet/main.go rename to cmd/c4exwallet/main.go diff --git a/cmd/kaspawallet/new_address.go b/cmd/c4exwallet/new_address.go similarity index 80% rename from cmd/kaspawallet/new_address.go rename to cmd/c4exwallet/new_address.go index d8aa50d95..cad528f64 100644 --- a/cmd/kaspawallet/new_address.go +++ b/cmd/c4exwallet/new_address.go @@ -4,8 +4,8 @@ import ( "context" "fmt" - "github.com/c4ei/yunseokyeol/cmd/kaspawallet/daemon/client" - "github.com/c4ei/yunseokyeol/cmd/kaspawallet/daemon/pb" + "github.com/c4ei/yunseokyeol/cmd/c4exwallet/daemon/client" + "github.com/c4ei/yunseokyeol/cmd/c4exwallet/daemon/pb" ) func newAddress(conf *newAddressConfig) error { diff --git a/cmd/kaspawallet/parse.go b/cmd/c4exwallet/parse.go similarity index 97% rename from cmd/kaspawallet/parse.go rename to cmd/c4exwallet/parse.go index 0d19469fd..b74ce85cb 100644 --- a/cmd/kaspawallet/parse.go +++ b/cmd/c4exwallet/parse.go @@ -6,7 +6,7 @@ import ( "io/ioutil" "strings" - "github.com/c4ei/yunseokyeol/cmd/kaspawallet/libkaspawallet/serialization" + "github.com/c4ei/yunseokyeol/cmd/c4exwallet/libc4exwallet/serialization" "github.com/c4ei/yunseokyeol/domain/consensus/utils/consensushashing" "github.com/c4ei/yunseokyeol/domain/consensus/utils/constants" "github.com/c4ei/yunseokyeol/domain/consensus/utils/txscript" diff --git a/cmd/kaspawallet/send.go b/cmd/c4exwallet/send.go similarity index 89% rename from cmd/kaspawallet/send.go rename to cmd/c4exwallet/send.go index 2e2d049e6..c7867ea2f 100644 --- a/cmd/kaspawallet/send.go +++ b/cmd/c4exwallet/send.go @@ -6,10 +6,10 @@ import ( "os" "strings" - "github.com/c4ei/yunseokyeol/cmd/kaspawallet/daemon/client" - "github.com/c4ei/yunseokyeol/cmd/kaspawallet/daemon/pb" - "github.com/c4ei/yunseokyeol/cmd/kaspawallet/keys" - "github.com/c4ei/yunseokyeol/cmd/kaspawallet/libkaspawallet" + "github.com/c4ei/yunseokyeol/cmd/c4exwallet/daemon/client" + "github.com/c4ei/yunseokyeol/cmd/c4exwallet/daemon/pb" + "github.com/c4ei/yunseokyeol/cmd/c4exwallet/keys" + "github.com/c4ei/yunseokyeol/cmd/c4exwallet/libc4exwallet" "github.com/c4ei/yunseokyeol/domain/consensus/utils/constants" "github.com/pkg/errors" ) @@ -64,7 +64,7 @@ func send(conf *sendConfig) error { signedTransactions := make([][]byte, len(createUnsignedTransactionsResponse.UnsignedTransactions)) for i, unsignedTransaction := range createUnsignedTransactionsResponse.UnsignedTransactions { - signedTransaction, err := libkaspawallet.Sign(conf.NetParams(), mnemonics, unsignedTransaction, keysFile.ECDSA) + signedTransaction, err := libc4exwallet.Sign(conf.NetParams(), mnemonics, unsignedTransaction, keysFile.ECDSA) if err != nil { return err } diff --git a/cmd/kaspawallet/show_addresses.go b/cmd/c4exwallet/show_addresses.go similarity index 87% rename from cmd/kaspawallet/show_addresses.go rename to cmd/c4exwallet/show_addresses.go index 558585c25..02136b6ae 100644 --- a/cmd/kaspawallet/show_addresses.go +++ b/cmd/c4exwallet/show_addresses.go @@ -4,8 +4,8 @@ import ( "context" "fmt" - "github.com/c4ei/yunseokyeol/cmd/kaspawallet/daemon/client" - "github.com/c4ei/yunseokyeol/cmd/kaspawallet/daemon/pb" + "github.com/c4ei/yunseokyeol/cmd/c4exwallet/daemon/client" + "github.com/c4ei/yunseokyeol/cmd/c4exwallet/daemon/pb" ) func showAddresses(conf *showAddressesConfig) error { diff --git a/cmd/kaspawallet/sign.go b/cmd/c4exwallet/sign.go similarity index 86% rename from cmd/kaspawallet/sign.go rename to cmd/c4exwallet/sign.go index cfd9111fe..e230d509b 100644 --- a/cmd/kaspawallet/sign.go +++ b/cmd/c4exwallet/sign.go @@ -6,8 +6,8 @@ import ( "os" "strings" - "github.com/c4ei/yunseokyeol/cmd/kaspawallet/keys" - "github.com/c4ei/yunseokyeol/cmd/kaspawallet/libkaspawallet" + "github.com/c4ei/yunseokyeol/cmd/c4exwallet/keys" + "github.com/c4ei/yunseokyeol/cmd/c4exwallet/libc4exwallet" "github.com/pkg/errors" ) @@ -48,7 +48,7 @@ func sign(conf *signConfig) error { updatedPartiallySignedTransactions := make([][]byte, len(partiallySignedTransactions)) for i, partiallySignedTransaction := range partiallySignedTransactions { updatedPartiallySignedTransactions[i], err = - libkaspawallet.Sign(conf.NetParams(), privateKeys, partiallySignedTransaction, keysFile.ECDSA) + libc4exwallet.Sign(conf.NetParams(), privateKeys, partiallySignedTransaction, keysFile.ECDSA) if err != nil { return err } @@ -57,7 +57,7 @@ func sign(conf *signConfig) error { areAllTransactionsFullySigned := true for _, updatedPartiallySignedTransaction := range updatedPartiallySignedTransactions { // This is somewhat redundant to check all transactions, but we do that just-in-case - isFullySigned, err := libkaspawallet.IsTransactionFullySigned(updatedPartiallySignedTransaction) + isFullySigned, err := libc4exwallet.IsTransactionFullySigned(updatedPartiallySignedTransaction) if err != nil { return err } diff --git a/cmd/kaspawallet/start_daemon.go b/cmd/c4exwallet/start_daemon.go similarity index 72% rename from cmd/kaspawallet/start_daemon.go rename to cmd/c4exwallet/start_daemon.go index 42d9c573c..20b70fdd4 100644 --- a/cmd/kaspawallet/start_daemon.go +++ b/cmd/c4exwallet/start_daemon.go @@ -1,6 +1,6 @@ package main -import "github.com/c4ei/yunseokyeol/cmd/kaspawallet/daemon/server" +import "github.com/c4ei/yunseokyeol/cmd/c4exwallet/daemon/server" func startDaemon(conf *startDaemonConfig) error { return server.Start(conf.NetParams(), conf.Listen, conf.RPCServer, conf.KeysFile, conf.Profile, conf.Timeout) diff --git a/cmd/kaspawallet/sweep.go b/cmd/c4exwallet/sweep.go similarity index 92% rename from cmd/kaspawallet/sweep.go rename to cmd/c4exwallet/sweep.go index 7ecf15666..4b95e2ad3 100644 --- a/cmd/kaspawallet/sweep.go +++ b/cmd/c4exwallet/sweep.go @@ -5,11 +5,11 @@ import ( "encoding/hex" "fmt" - "github.com/c4ei/yunseokyeol/cmd/kaspawallet/daemon/client" - "github.com/c4ei/yunseokyeol/cmd/kaspawallet/daemon/pb" - "github.com/c4ei/yunseokyeol/cmd/kaspawallet/libkaspawallet" - "github.com/c4ei/yunseokyeol/cmd/kaspawallet/libkaspawallet/serialization" - "github.com/c4ei/yunseokyeol/cmd/kaspawallet/utils" + "github.com/c4ei/yunseokyeol/cmd/c4exwallet/daemon/client" + "github.com/c4ei/yunseokyeol/cmd/c4exwallet/daemon/pb" + "github.com/c4ei/yunseokyeol/cmd/c4exwallet/libc4exwallet" + "github.com/c4ei/yunseokyeol/cmd/c4exwallet/libc4exwallet/serialization" + "github.com/c4ei/yunseokyeol/cmd/c4exwallet/utils" "github.com/c4ei/yunseokyeol/domain/consensus/model/externalapi" "github.com/c4ei/yunseokyeol/domain/consensus/utils/consensushashing" "github.com/c4ei/yunseokyeol/domain/consensus/utils/constants" @@ -20,7 +20,7 @@ import ( "github.com/c4ei/yunseokyeol/domain/miningmanager/mempool" "github.com/c4ei/yunseokyeol/util" "github.com/c4ei/yunseokyeol/util/txmass" - "github.com/kaspanet/go-secp256k1" + "github.com/c4exnet/go-secp256k1" "github.com/pkg/errors" ) @@ -33,7 +33,7 @@ func sweep(conf *sweepConfig) error { return err } - publicKeybytes, err := libkaspawallet.PublicKeyFromPrivateKey(privateKeyBytes) + publicKeybytes, err := libc4exwallet.PublicKeyFromPrivateKey(privateKeyBytes) if err != nil { return err } @@ -64,7 +64,7 @@ func sweep(conf *sweepConfig) error { return err } - UTXOs, err := libkaspawallet.KaspawalletdUTXOsTolibkaspawalletUTXOs(getExternalSpendableUTXOsResponse.Entries) + UTXOs, err := libc4exwallet.KaspawalletdUTXOsTolibc4exwalletUTXOs(getExternalSpendableUTXOsResponse.Entries) if err != nil { return err } @@ -140,7 +140,7 @@ func newDummyTransaction() *externalapi.DomainTransaction { func createSplitTransactionsWithSchnorrPrivteKey( params *dagconfig.Params, - selectedUTXOs []*libkaspawallet.UTXO, + selectedUTXOs []*libc4exwallet.UTXO, toAddress util.Address, feePerInput int) ([]*externalapi.DomainTransaction, error) { diff --git a/cmd/kaspawallet/transactions_hex_encoding.go b/cmd/c4exwallet/transactions_hex_encoding.go similarity index 100% rename from cmd/kaspawallet/transactions_hex_encoding.go rename to cmd/c4exwallet/transactions_hex_encoding.go diff --git a/cmd/kaspawallet/utils/format_kas.go b/cmd/c4exwallet/utils/format_kas.go similarity index 100% rename from cmd/kaspawallet/utils/format_kas.go rename to cmd/c4exwallet/utils/format_kas.go diff --git a/cmd/kaspawallet/utils/readline.go b/cmd/c4exwallet/utils/readline.go similarity index 100% rename from cmd/kaspawallet/utils/readline.go rename to cmd/c4exwallet/utils/readline.go diff --git a/cmd/genkeypair/README.md b/cmd/genkeypair/README.md index a25b1d40f..0e1cc2f9a 100644 --- a/cmd/genkeypair/README.md +++ b/cmd/genkeypair/README.md @@ -6,4 +6,4 @@ A tool for generating private-key-address pairs. Note: This tool prints unencrypted private keys and is not recommended for day to day use, and is intended mainly for tests. -In order to manage your funds it's recommended to use [kaspawallet](../kaspawallet) \ No newline at end of file +In order to manage your funds it's recommended to use [c4exwallet](../c4exwallet) \ No newline at end of file diff --git a/cmd/genkeypair/main.go b/cmd/genkeypair/main.go index fbdb68114..fd15282e7 100644 --- a/cmd/genkeypair/main.go +++ b/cmd/genkeypair/main.go @@ -3,7 +3,7 @@ package main import ( "fmt" - "github.com/c4ei/yunseokyeol/cmd/kaspawallet/libkaspawallet" + "github.com/c4ei/yunseokyeol/cmd/c4exwallet/libc4exwallet" "github.com/c4ei/yunseokyeol/util" ) @@ -13,7 +13,7 @@ func main() { panic(err) } - privateKey, publicKey, err := libkaspawallet.CreateKeyPair(false) + privateKey, publicKey, err := libc4exwallet.CreateKeyPair(false) if err != nil { panic(err) } diff --git a/doc.go b/doc.go index b6ee4bf97..25286ee91 100644 --- a/doc.go +++ b/doc.go @@ -1,29 +1,29 @@ /* -Copyright (c) 2018-2019 The kaspanet developers +Copyright (c) 2018-2019 The c4exnet developers Copyright (c) 2013-2018 The btcsuite developers Copyright (c) 2015-2016 The Decred developers Copyright (c) 2013-2014 Conformal Systems LLC. Use of this source code is governed by an ISC license that can be found in the LICENSE file. -Kaspad is a full-node kaspa implementation written in Go. +Kaspad is a full-node c4ex implementation written in Go. -The default options are sane for most users. This means kaspad will work 'out of +The default options are sane for most users. This means c4exd will work 'out of the box' for most users. However, there are also a wide variety of flags that can be used to control it. Usage: - kaspad [OPTIONS] + c4exd [OPTIONS] For an up-to-date help message: - kaspad --help + c4exd --help The long form of all option flags (except -C) can be specified in a configuration -file that is automatically parsed when kaspad starts up. By default, the -configuration file is located at ~/.kaspad/kaspad.conf on POSIX-style operating -systems and %LOCALAPPDATA%\kaspad\kaspad.conf on Windows. The -C (--configfile) +file that is automatically parsed when c4exd starts up. By default, the +configuration file is located at ~/.c4exd/c4exd.conf on POSIX-style operating +systems and %LOCALAPPDATA%\c4exd\c4exd.conf on Windows. The -C (--configfile) flag can be used to override this location. */ package main diff --git a/docker/Dockerfile b/docker/Dockerfile index 892960fd1..6658afb44 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -1,9 +1,9 @@ # -- multistage docker build: stage #1: build stage FROM golang:1.19-alpine AS build -RUN mkdir -p /go/src/github.com/c4ei/kaspad +RUN mkdir -p /go/src/github.com/c4ei/c4exd -WORKDIR /go/src/github.com/c4ei/kaspad +WORKDIR /go/src/github.com/c4ei/c4exd RUN apk add --no-cache curl git openssh binutils gcc musl-dev @@ -11,12 +11,12 @@ COPY go.mod . COPY go.sum . -# Cache kaspad dependencies +# Cache c4exd dependencies RUN go mod download COPY . . -RUN go build $FLAGS -o kaspad . +RUN go build $FLAGS -o c4exd . # --- multistage docker build: stage #2: runtime image FROM alpine @@ -24,8 +24,8 @@ WORKDIR /app RUN apk add --no-cache ca-certificates tini -COPY --from=build /go/src/github.com/c4ei/yunseokyeol/kaspad /app/ -COPY --from=build /go/src/github.com/c4ei/yunseokyeol/infrastructure/config/sample-kaspad.conf /app/ +COPY --from=build /go/src/github.com/c4ei/yunseokyeol/c4exd /app/ +COPY --from=build /go/src/github.com/c4ei/yunseokyeol/infrastructure/config/sample-c4exd.conf /app/ USER nobody ENTRYPOINT [ "/sbin/tini", "--" ] diff --git a/domain/consensus/model/externalapi/blocklevelparents.go b/domain/consensus/model/externalapi/blocklevelparents.go index a4768e49b..afce35352 100644 --- a/domain/consensus/model/externalapi/blocklevelparents.go +++ b/domain/consensus/model/externalapi/blocklevelparents.go @@ -1,7 +1,7 @@ package externalapi // BlockLevelParents represent the parents within a single super-block level -// See https://github.com/kaspanet/research/issues/3 for further details +// See https://github.com/c4exnet/research/issues/3 for further details type BlockLevelParents []*DomainHash // Equal returns true if this BlockLevelParents is equal to `other` diff --git a/domain/consensus/model/interface_processes_syncmanager.go b/domain/consensus/model/interface_processes_syncmanager.go index 05ee1138f..da426d825 100644 --- a/domain/consensus/model/interface_processes_syncmanager.go +++ b/domain/consensus/model/interface_processes_syncmanager.go @@ -2,7 +2,7 @@ package model import "github.com/c4ei/yunseokyeol/domain/consensus/model/externalapi" -// SyncManager exposes functions to support sync between kaspad nodes +// SyncManager exposes functions to support sync between c4exd nodes type SyncManager interface { GetHashesBetween(stagingArea *StagingArea, lowHash, highHash *externalapi.DomainHash, maxBlocks uint64) ( hashes []*externalapi.DomainHash, actualHighHash *externalapi.DomainHash, err error) diff --git a/domain/consensus/processes/blockvalidator/block_body_in_context.go b/domain/consensus/processes/blockvalidator/block_body_in_context.go index b45fc9980..005925984 100644 --- a/domain/consensus/processes/blockvalidator/block_body_in_context.go +++ b/domain/consensus/processes/blockvalidator/block_body_in_context.go @@ -168,7 +168,7 @@ func (v *blockValidator) checkCoinbaseSubsidy( return err } - // The pruning proof ( https://github.com/kaspanet/docs/blob/main/Reference/prunality/Prunality.pdf ) concludes + // The pruning proof ( https://github.com/c4exnet/docs/blob/main/Reference/prunality/Prunality.pdf ) concludes // that it's impossible for a block to be merged if it was created in the anticone of the pruning point that was // present at the time of the block creation. So if such situation happens we can be sure that it happens during // IBD and that this block has at least pruningDepth-finalityInterval confirmations. diff --git a/domain/consensus/processes/consensusstatemanager/check_finality_violation.go b/domain/consensus/processes/consensusstatemanager/check_finality_violation.go index 435952ff1..27c642a65 100644 --- a/domain/consensus/processes/consensusstatemanager/check_finality_violation.go +++ b/domain/consensus/processes/consensusstatemanager/check_finality_violation.go @@ -61,7 +61,7 @@ func (csm *consensusStateManager) isViolatingFinality(stagingArea *model.Staging // On IBD it's pretty normal to get blocks in the anticone of the pruning // point, so we don't notify on cases when the pruning point is in the future // of the finality point. - log.Debugf("Block %s violates finality, but kaspad is currently doing IBD, so this is normal", blockHash) + log.Debugf("Block %s violates finality, but c4exd is currently doing IBD, so this is normal", blockHash) return true, false, nil } log.Debugf("Block %s does not violate finality", blockHash) diff --git a/domain/consensus/processes/pruningmanager/pruningmanager.go b/domain/consensus/processes/pruningmanager/pruningmanager.go index a9ac7652c..0d53bbb70 100644 --- a/domain/consensus/processes/pruningmanager/pruningmanager.go +++ b/domain/consensus/processes/pruningmanager/pruningmanager.go @@ -694,7 +694,7 @@ func (pm *pruningManager) pruningPointCandidate(stagingArea *model.StagingArea) } // validateUTXOSetFitsCommitment makes sure that the calculated UTXOSet of the new pruning point fits the commitment. -// This is a sanity test, to make sure that kaspad doesn't store, and subsequently sends syncing peers the wrong UTXOSet. +// This is a sanity test, to make sure that c4exd doesn't store, and subsequently sends syncing peers the wrong UTXOSet. func (pm *pruningManager) validateUTXOSetFitsCommitment(stagingArea *model.StagingArea, pruningPointHash *externalapi.DomainHash) error { onEnd := logger.LogAndMeasureExecutionTime(log, "pruningManager.validateUTXOSetFitsCommitment") defer onEnd() diff --git a/domain/consensus/processes/transactionvalidator/transaction_in_context.go b/domain/consensus/processes/transactionvalidator/transaction_in_context.go index d280ec68d..f027babba 100644 --- a/domain/consensus/processes/transactionvalidator/transaction_in_context.go +++ b/domain/consensus/processes/transactionvalidator/transaction_in_context.go @@ -150,7 +150,7 @@ func (v *transactionValidator) checkTransactionInputAmounts(tx *externalapi.Doma // output values of the input transactions must not be negative // or more than the max allowed per transaction. All amounts in // a transaction are in a unit value known as a sompi. One - // kaspa is a quantity of sompi as defined by the + // c4ex is a quantity of sompi as defined by the // SompiPerKaspa constant. totalSompiIn, err = v.checkEntryAmounts(utxoEntry, totalSompiIn) if err != nil { diff --git a/domain/consensus/processes/transactionvalidator/transaction_in_isolation.go b/domain/consensus/processes/transactionvalidator/transaction_in_isolation.go index dd4fc75c3..622f1527b 100644 --- a/domain/consensus/processes/transactionvalidator/transaction_in_isolation.go +++ b/domain/consensus/processes/transactionvalidator/transaction_in_isolation.go @@ -67,7 +67,7 @@ func (v *transactionValidator) checkTransactionAmountRanges(tx *externalapi.Doma // output must not be negative or more than the max allowed per // transaction. Also, the total of all outputs must abide by the same // restrictions. All amounts in a transaction are in a unit value known - // as a sompi. One kaspa is a quantity of sompi as defined by the + // as a sompi. One c4ex is a quantity of sompi as defined by the // sompiPerKaspa constant. var totalSompi uint64 for _, txOut := range tx.Outputs { diff --git a/domain/consensus/processes/transactionvalidator/transactionvalidator_test.go b/domain/consensus/processes/transactionvalidator/transactionvalidator_test.go index 7cd087881..f51230035 100644 --- a/domain/consensus/processes/transactionvalidator/transactionvalidator_test.go +++ b/domain/consensus/processes/transactionvalidator/transactionvalidator_test.go @@ -8,7 +8,7 @@ import ( "github.com/c4ei/yunseokyeol/domain/consensus/utils/txscript" "github.com/c4ei/yunseokyeol/domain/consensus/utils/utxo" "github.com/c4ei/yunseokyeol/util" - "github.com/kaspanet/go-secp256k1" + "github.com/c4exnet/go-secp256k1" "testing" diff --git a/domain/consensus/utils/consensushashing/calculate_signature_hash_test.go b/domain/consensus/utils/consensushashing/calculate_signature_hash_test.go index 9f35f7528..3dc3c6b47 100644 --- a/domain/consensus/utils/consensushashing/calculate_signature_hash_test.go +++ b/domain/consensus/utils/consensushashing/calculate_signature_hash_test.go @@ -7,7 +7,7 @@ import ( "github.com/c4ei/yunseokyeol/domain/consensus/utils/subnetworks" - "github.com/kaspanet/go-secp256k1" + "github.com/c4exnet/go-secp256k1" "github.com/c4ei/yunseokyeol/domain/consensus/utils/consensushashing" "github.com/c4ei/yunseokyeol/domain/consensus/utils/txscript" @@ -338,7 +338,7 @@ func generateTxs() (nativeTx, subnetworkTx *externalapi.DomainTransaction, err e genesisCoinbase := dagconfig.SimnetParams.GenesisBlock.Transactions[0] genesisCoinbaseTransactionID := consensushashing.TransactionID(genesisCoinbase) - address1Str := "kaspasim:qzpj2cfa9m40w9m2cmr8pvfuqpp32mzzwsuw6ukhfduqpp32mzzws59e8fapc" + address1Str := "c4exsim:qzpj2cfa9m40w9m2cmr8pvfuqpp32mzzwsuw6ukhfduqpp32mzzws59e8fapc" address1, err := util.DecodeAddress(address1Str, util.Bech32PrefixKaspaSim) if err != nil { return nil, nil, fmt.Errorf("error decoding address1: %+v", err) @@ -348,7 +348,7 @@ func generateTxs() (nativeTx, subnetworkTx *externalapi.DomainTransaction, err e return nil, nil, fmt.Errorf("error generating script: %+v", err) } - address2Str := "kaspasim:qr7w7nqsdnc3zddm6u8s9fex4ysk95hm3v30q353ymuqpp32mzzws59e8fapc" + address2Str := "c4exsim:qr7w7nqsdnc3zddm6u8s9fex4ysk95hm3v30q353ymuqpp32mzzws59e8fapc" address2, err := util.DecodeAddress(address2Str, util.Bech32PrefixKaspaSim) if err != nil { return nil, nil, fmt.Errorf("error decoding address2: %+v", err) @@ -490,7 +490,7 @@ func generateInputs(size int, sourceScript *externalapi.ScriptPublicKey) []*exte } func getSourceScript(b *testing.B) *externalapi.ScriptPublicKey { - sourceAddressStr := "kaspasim:qz6f9z6l3x4v3lf9mgf0t934th4nx5kgzu663x9yjh" + sourceAddressStr := "c4exsim:qz6f9z6l3x4v3lf9mgf0t934th4nx5kgzu663x9yjh" sourceAddress, err := util.DecodeAddress(sourceAddressStr, util.Bech32PrefixKaspaSim) if err != nil { diff --git a/domain/consensus/utils/consensushashing/transaction.go b/domain/consensus/utils/consensushashing/transaction.go index 1d3239094..60533919c 100644 --- a/domain/consensus/utils/consensushashing/transaction.go +++ b/domain/consensus/utils/consensushashing/transaction.go @@ -129,7 +129,7 @@ func serializeTransaction(w io.Writer, tx *externalapi.DomainTransaction, encodi return nil } -// writeTransactionInput encodes ti to the kaspa protocol encoding for a transaction +// writeTransactionInput encodes ti to the c4ex protocol encoding for a transaction // input to w. func writeTransactionInput(w io.Writer, ti *externalapi.DomainTransactionInput, encodingFlags txEncoding) error { err := writeOutpoint(w, &ti.PreviousOutpoint) diff --git a/domain/consensus/utils/constants/constants.go b/domain/consensus/utils/constants/constants.go index ab9b3fafd..4d898569b 100644 --- a/domain/consensus/utils/constants/constants.go +++ b/domain/consensus/utils/constants/constants.go @@ -12,7 +12,7 @@ const ( // MaxScriptPublicKeyVersion is the current latest supported public key script version. MaxScriptPublicKeyVersion uint16 = 0 - // SompiPerKaspa is the number of sompi in one kaspa (1 KAS). + // SompiPerKaspa is the number of sompi in one c4ex (1 KAS). SompiPerKaspa = 100_000_000 // MaxSompi is the maximum transaction amount allowed in sompi. diff --git a/domain/consensus/utils/multiset/multiset.go b/domain/consensus/utils/multiset/multiset.go index f9352807b..f50d02780 100644 --- a/domain/consensus/utils/multiset/multiset.go +++ b/domain/consensus/utils/multiset/multiset.go @@ -3,7 +3,7 @@ package multiset import ( "github.com/c4ei/yunseokyeol/domain/consensus/model" "github.com/c4ei/yunseokyeol/domain/consensus/model/externalapi" - "github.com/kaspanet/go-muhash" + "github.com/c4exnet/go-muhash" "github.com/pkg/errors" ) diff --git a/domain/consensus/utils/txscript/README.md b/domain/consensus/utils/txscript/README.md index 5b007fd1e..8756db976 100644 --- a/domain/consensus/utils/txscript/README.md +++ b/domain/consensus/utils/txscript/README.md @@ -4,19 +4,19 @@ txscript [![ISC License](http://img.shields.io/badge/license-ISC-blue.svg)](https://choosealicense.com/licenses/isc/) [![GoDoc](https://godoc.org/github.com/c4ei/yunseokyeol/txscript?status.png)](http://godoc.org/github.com/c4ei/yunseokyeol/txscript) -Package txscript implements the kaspa transaction script language. There is +Package txscript implements the c4ex transaction script language. There is a comprehensive test suite. ## Kaspa Scripts Kaspa provides a stack-based, FORTH-like language for the scripts in -the kaspa transactions. This language is not turing complete +the c4ex transactions. This language is not turing complete although it is still fairly powerful. ## Examples * [Standard Pay-to-pubkey Script](http://godoc.org/github.com/c4ei/yunseokyeol/txscript#example-PayToAddrScript) - Demonstrates creating a script which pays to a kaspa address. It also + Demonstrates creating a script which pays to a c4ex address. It also prints the created script hex and uses the DisasmString function to display the disassembled script. diff --git a/domain/consensus/utils/txscript/doc.go b/domain/consensus/utils/txscript/doc.go index 694a7c3e4..81a8a1831 100644 --- a/domain/consensus/utils/txscript/doc.go +++ b/domain/consensus/utils/txscript/doc.go @@ -1,26 +1,26 @@ /* -Package txscript implements the kaspa transaction script language. +Package txscript implements the c4ex transaction script language. This package provides data structures and functions to parse and execute -kaspa transaction scripts. +c4ex transaction scripts. # Script Overview Kaspa transaction scripts are written in a stack-base, FORTH-like language. -The kaspa script language consists of a number of opcodes which fall into +The c4ex script language consists of a number of opcodes which fall into several categories such pushing and popping data to and from the stack, performing basic and bitwise arithmetic, conditional branching, comparing hashes, and checking cryptographic signatures. Scripts are processed from left to right and intentionally do not provide loops. -Typical kaspa scripts at the time of this writing are of several standard +Typical c4ex scripts at the time of this writing are of several standard forms which consist of a spender providing a public key and a signature which proves the spender owns the associated private key. This information is used to prove the the spender is authorized to perform the transaction. One benefit of using a scripting language is added flexibility in specifying -what conditions must be met in order to spend kaspa. +what conditions must be met in order to spend c4ex. # Errors diff --git a/domain/consensus/utils/txscript/example_test.go b/domain/consensus/utils/txscript/example_test.go index b8b4a297e..9e0f158b4 100644 --- a/domain/consensus/utils/txscript/example_test.go +++ b/domain/consensus/utils/txscript/example_test.go @@ -15,7 +15,7 @@ import ( "github.com/c4ei/yunseokyeol/util" ) -// This example demonstrates creating a script which pays to a kaspa address. +// This example demonstrates creating a script which pays to a c4ex address. // It also prints the created script hex and uses the DisasmString function to // display the disassembled script. func ExamplePayToAddrScript() { @@ -23,7 +23,7 @@ func ExamplePayToAddrScript() { // which is useful to ensure the accuracy of the address and determine // the address type. It is also required for the upcoming call to // PayToAddrScript. - addressStr := "kaspa:qqj9fg59mptxkr9j0y53j5mwurcmda5mtza9n6v9pm9uj8h0wgk6uma5pvumr" + addressStr := "c4ex:qqj9fg59mptxkr9j0y53j5mwurcmda5mtza9n6v9pm9uj8h0wgk6uma5pvumr" address, err := util.DecodeAddress(addressStr, util.Bech32PrefixKaspa) if err != nil { fmt.Println(err) @@ -76,5 +76,5 @@ func ExampleExtractScriptPubKeyAddress() { // Output: // Script Class: pubkey - // Address: kaspa:qzy6cf82zzah2xh5jwtz8nx9u4gdj6zzke8gljs0v055ksmnl424u6fv7ajrs + // Address: c4ex:qzy6cf82zzah2xh5jwtz8nx9u4gdj6zzke8gljs0v055ksmnl424u6fv7ajrs } diff --git a/domain/consensus/utils/txscript/opcode.go b/domain/consensus/utils/txscript/opcode.go index 8943ff139..ec00d8455 100644 --- a/domain/consensus/utils/txscript/opcode.go +++ b/domain/consensus/utils/txscript/opcode.go @@ -17,7 +17,7 @@ import ( "github.com/c4ei/yunseokyeol/domain/consensus/utils/constants" - "github.com/kaspanet/go-secp256k1" + "github.com/c4exnet/go-secp256k1" ) // An opcode defines the information related to a txscript opcode. opfunc, if @@ -31,7 +31,7 @@ type opcode struct { opfunc func(*parsedOpcode, *Engine) error } -// These constants are the values of the kaspa script opcodes. +// These constants are the values of the c4ex script opcodes. const ( Op0 = 0x00 // 0 OpFalse = 0x00 // 0 - AKA Op0 diff --git a/domain/consensus/utils/txscript/sigcache.go b/domain/consensus/utils/txscript/sigcache.go index 2adee4f10..42d3f8ec2 100644 --- a/domain/consensus/utils/txscript/sigcache.go +++ b/domain/consensus/utils/txscript/sigcache.go @@ -5,7 +5,7 @@ package txscript import ( - "github.com/kaspanet/go-secp256k1" + "github.com/c4exnet/go-secp256k1" ) // sigCacheEntry represents an entry in the SigCache. Entries within the diff --git a/domain/consensus/utils/txscript/sigcache_ecdsa.go b/domain/consensus/utils/txscript/sigcache_ecdsa.go index 27e1ae706..604b5e286 100644 --- a/domain/consensus/utils/txscript/sigcache_ecdsa.go +++ b/domain/consensus/utils/txscript/sigcache_ecdsa.go @@ -5,7 +5,7 @@ package txscript import ( - "github.com/kaspanet/go-secp256k1" + "github.com/c4exnet/go-secp256k1" ) // sigCacheEntryECDSA represents an entry in the SigCache. Entries within the diff --git a/domain/consensus/utils/txscript/sigcache_test.go b/domain/consensus/utils/txscript/sigcache_test.go index 2c24084a9..1ee60035e 100644 --- a/domain/consensus/utils/txscript/sigcache_test.go +++ b/domain/consensus/utils/txscript/sigcache_test.go @@ -6,8 +6,9 @@ package txscript import ( "crypto/rand" - "github.com/kaspanet/go-secp256k1" "testing" + + "github.com/c4exnet/go-secp256k1" ) // genRandomSig returns a random message, a signature of the message under the diff --git a/domain/consensus/utils/txscript/sign.go b/domain/consensus/utils/txscript/sign.go index 04dbece3e..ae7bfbf6a 100644 --- a/domain/consensus/utils/txscript/sign.go +++ b/domain/consensus/utils/txscript/sign.go @@ -7,7 +7,7 @@ package txscript import ( "github.com/c4ei/yunseokyeol/domain/consensus/model/externalapi" "github.com/c4ei/yunseokyeol/domain/consensus/utils/consensushashing" - "github.com/kaspanet/go-secp256k1" + "github.com/c4exnet/go-secp256k1" "github.com/pkg/errors" "github.com/c4ei/yunseokyeol/domain/dagconfig" diff --git a/domain/consensus/utils/txscript/sign_test.go b/domain/consensus/utils/txscript/sign_test.go index 046ae2f5b..a0bcfdf04 100644 --- a/domain/consensus/utils/txscript/sign_test.go +++ b/domain/consensus/utils/txscript/sign_test.go @@ -13,7 +13,7 @@ import ( "github.com/c4ei/yunseokyeol/domain/consensus/utils/consensushashing" "github.com/c4ei/yunseokyeol/domain/consensus/model/externalapi" - "github.com/kaspanet/go-secp256k1" + "github.com/c4exnet/go-secp256k1" "github.com/pkg/errors" "github.com/c4ei/yunseokyeol/domain/dagconfig" diff --git a/domain/consensus/utils/txscript/stack.go b/domain/consensus/utils/txscript/stack.go index 678f549cb..40e0170e2 100644 --- a/domain/consensus/utils/txscript/stack.go +++ b/domain/consensus/utils/txscript/stack.go @@ -31,7 +31,7 @@ func fromBool(v bool) []byte { return nil } -// stack represents a stack of immutable objects to be used with kaspa +// stack represents a stack of immutable objects to be used with c4ex // scripts. Objects may be shared, therefore in usage if a value is to be // changed it *must* be deep-copied first to avoid changing other values on the // stack. diff --git a/domain/dagconfig/genesis.go b/domain/dagconfig/genesis.go index a0d0b02c5..f5b618dc3 100644 --- a/domain/dagconfig/genesis.go +++ b/domain/dagconfig/genesis.go @@ -11,7 +11,7 @@ import ( "github.com/c4ei/yunseokyeol/domain/consensus/utils/blockheader" "github.com/c4ei/yunseokyeol/domain/consensus/utils/subnetworks" "github.com/c4ei/yunseokyeol/domain/consensus/utils/transactionhelper" - "github.com/kaspanet/go-muhash" + "github.com/c4exnet/go-muhash" ) var genesisTxOuts = []*externalapi.DomainTransactionOutput{} @@ -94,7 +94,7 @@ var devnetGenesisTxPayload = []byte{ 0x00, 0x00, // Script version 0x01, // Varint 0x00, // OP-FALSE - 0x6b, 0x61, 0x73, 0x70, 0x61, 0x2d, 0x64, 0x65, 0x76, 0x6e, 0x65, 0x74, // kaspa-devnet + 0x6b, 0x61, 0x73, 0x70, 0x61, 0x2d, 0x64, 0x65, 0x76, 0x6e, 0x65, 0x74, // c4ex-devnet } // devnetGenesisCoinbaseTx is the coinbase transaction for the genesis blocks for @@ -200,7 +200,7 @@ var testnetGenesisTxPayload = []byte{ 0x00, 0x00, // Script version 0x01, // Varint 0x00, // OP-FALSE - 0x6b, 0x61, 0x73, 0x70, 0x61, 0x2d, 0x74, 0x65, 0x73, 0x74, 0x6e, 0x65, 0x74, // kaspa-testnet + 0x6b, 0x61, 0x73, 0x70, 0x61, 0x2d, 0x74, 0x65, 0x73, 0x74, 0x6e, 0x65, 0x74, // c4ex-testnet } // testnetGenesisCoinbaseTx is the coinbase transaction for the testnet genesis block. diff --git a/domain/dagconfig/params.go b/domain/dagconfig/params.go index 0a34882da..5ffde084d 100644 --- a/domain/dagconfig/params.go +++ b/domain/dagconfig/params.go @@ -95,10 +95,10 @@ type Params struct { // SubsidyGenesisReward SubsidyMergeSetRewardMultiplier, and // SubsidyPastRewardMultiplier are part of the block subsidy equation. - // Further details: https://hashdag.medium.com/kaspa-launch-plan-9a63f4d754a6 + // Further details: https://hashdag.medium.com/c4ex-launch-plan-9a63f4d754a6 // SubsidyGenesisReward SubsidyMergeSetRewardMultiplier 및 // SubsidyPastRewardMultiplier는 블록 보조금 방정식의 일부입니다. - // 자세한 내용: https://hashdag.medium.com/kaspa-launch-plan-9a63f4d754a6 + // 자세한 내용: https://hashdag.medium.com/c4ex-launch-plan-9a63f4d754a6 SubsidyGenesisReward uint64 PreDeflationaryPhaseBaseSubsidy uint64 DeflationaryPhaseBaseSubsidy uint64 @@ -214,8 +214,8 @@ type Params struct { // CoinbasePayloadScriptPublicKeyMaxLength는 코인베이스 페이로드에서 허용되는 최대 스크립트 공개 키입니다. CoinbasePayloadScriptPublicKeyMaxLength uint8 - // PruningProofM is the 'm' constant in the pruning proof. For more details see: https://github.com/kaspanet/research/issues/3 - // PruningProofM은 가지치기 증명의 'm' 상수입니다. 자세한 내용은 https://github.com/kaspanet/research/issues/3을 참조하세요. + // PruningProofM is the 'm' constant in the pruning proof. For more details see: https://github.com/c4exnet/research/issues/3 + // PruningProofM은 가지치기 증명의 'm' 상수입니다. 자세한 내용은 https://github.com/c4exnet/research/issues/3을 참조하세요. PruningProofM uint64 // DeflationaryPhaseDaaScore is the DAA score after which the monetary policy switches @@ -266,21 +266,21 @@ var MainnetParams = Params{ "dnsseed.c4ex.net", // "mainnet-dnsseed.kas.pa", // This DNS seeder is run by Denis Mashkevich - // "mainnet-dnsseed-1.kaspanet.org", + // "mainnet-dnsseed-1.c4exnet.org", // // This DNS seeder is run by Denis Mashkevich - // "mainnet-dnsseed-2.kaspanet.org", + // "mainnet-dnsseed-2.c4exnet.org", // // This DNS seeder is run by Constantine Bytensky // "dnsseed.cbytensky.org", // // This DNS seeder is run by Georges Künzli - // "seeder1.kaspad.net", + // "seeder1.c4exd.net", // // This DNS seeder is run by Georges Künzli - // "seeder2.kaspad.net", + // "seeder2.c4exd.net", // // This DNS seeder is run by Georges Künzli - // "seeder3.kaspad.net", + // "seeder3.c4exd.net", // // This DNS seeder is run by Georges Künzli - // "seeder4.kaspad.net", + // "seeder4.c4exd.net", // // This DNS seeder is run by Tim - // "kaspadns.kaspacalc.net", + // "c4exdns.c4excalc.net", }, // DAG parameters @@ -342,7 +342,7 @@ var MainnetParams = Params{ // TestnetParams defines the network parameters for the test Kaspa network. var TestnetParams = Params{ K: defaultGHOSTDAGK, - Name: "c4ex-testnet", // kaspa-testnet-10 + Name: "c4ex-testnet", // c4ex-testnet-10 Net: appmessage.Testnet, RPCPort: "22000", // 16210 --> 22000 DefaultPort: "22001", // 16211 --> 22001 @@ -350,7 +350,7 @@ var TestnetParams = Params{ "test-dnsseed.c4ex.net", // "testnet-10-dnsseed.kas.pa", // This DNS seeder is run by Tiram - // "seeder1-testnet.kaspad.net", + // "seeder1-testnet.c4exd.net", }, // DAG parameters diff --git a/domain/miningmanager/miningmanager_test.go b/domain/miningmanager/miningmanager_test.go index 942634d6b..985c5f7e8 100644 --- a/domain/miningmanager/miningmanager_test.go +++ b/domain/miningmanager/miningmanager_test.go @@ -5,7 +5,7 @@ import ( "strings" "testing" - "github.com/c4ei/yunseokyeol/cmd/kaspawallet/libkaspawallet" + "github.com/c4ei/yunseokyeol/cmd/c4exwallet/libc4exwallet" "github.com/c4ei/yunseokyeol/domain/consensusreference" "github.com/c4ei/yunseokyeol/domain/miningmanager/model" "github.com/c4ei/yunseokyeol/util" @@ -820,7 +820,7 @@ func generateNewCoinbase(addressPrefix util.Bech32Prefix, op opType) (*externala ExtraData: nil, }, nil } - _, publicKey, err := libkaspawallet.CreateKeyPair(op == opECDSA) + _, publicKey, err := libc4exwallet.CreateKeyPair(op == opECDSA) if err != nil { return nil, err } diff --git a/go.mod b/go.mod index 7db50239d..adc7ba8c4 100644 --- a/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module github.com/c4ei/kaspad +module github.com/c4ei/c4exd go 1.18 @@ -11,8 +11,8 @@ require ( github.com/golang/protobuf v1.5.2 github.com/jessevdk/go-flags v1.4.0 github.com/jrick/logrotate v1.0.0 - github.com/kaspanet/go-muhash v0.0.4 - github.com/kaspanet/go-secp256k1 v0.0.7 + github.com/c4exnet/go-muhash v0.0.4 + github.com/c4exnet/go-secp256k1 v0.0.7 github.com/pkg/errors v0.9.1 github.com/syndtr/goleveldb v1.0.1-0.20190923125748-758128399b1d github.com/tyler-smith/go-bip39 v1.1.0 diff --git a/go.sum b/go.sum index 95827ee43..597007bb8 100644 --- a/go.sum +++ b/go.sum @@ -59,10 +59,10 @@ github.com/jessevdk/go-flags v1.4.0 h1:4IU2WS7AumrZ/40jfhf4QVDMsQwqA7VEHozFRrGAR github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= github.com/jrick/logrotate v1.0.0 h1:lQ1bL/n9mBNeIXoTUoYRlK4dHuNJVofX9oWqBtPnSzI= github.com/jrick/logrotate v1.0.0/go.mod h1:LNinyqDIJnpAur+b8yyulnQw/wDuN1+BYKlTRt3OuAQ= -github.com/kaspanet/go-muhash v0.0.4 h1:CQrm1RTJpQy+h4ZFjj9qq42K5fmA5QTGifzb47p4qWk= -github.com/kaspanet/go-muhash v0.0.4/go.mod h1:10bPW5mO1vNHPSejaAh9ZTtLZE16jzEvgaP7f3Q5s/8= -github.com/kaspanet/go-secp256k1 v0.0.7 h1:WHnrwopKB6ZeHSbdAwwxNhTqflm56XT1mM6LF4/OvOs= -github.com/kaspanet/go-secp256k1 v0.0.7/go.mod h1:cFbxhxKkxqHX5eIwUGKARkph19PehipDPJejWB+H0jM= +github.com/c4exnet/go-muhash v0.0.4 h1:CQrm1RTJpQy+h4ZFjj9qq42K5fmA5QTGifzb47p4qWk= +github.com/c4exnet/go-muhash v0.0.4/go.mod h1:10bPW5mO1vNHPSejaAh9ZTtLZE16jzEvgaP7f3Q5s/8= +github.com/c4exnet/go-secp256k1 v0.0.7 h1:WHnrwopKB6ZeHSbdAwwxNhTqflm56XT1mM6LF4/OvOs= +github.com/c4exnet/go-secp256k1 v0.0.7/go.mod h1:cFbxhxKkxqHX5eIwUGKARkph19PehipDPJejWB+H0jM= github.com/kkdai/bstream v0.0.0-20161212061736-f391b8402d23/go.mod h1:J+Gs4SYgM6CZQHDETBtE9HaSEkGmuNXF86RwHhHUvq4= github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.7.0 h1:WSHQ+IS43OoUrWtD1/bbclrwK8TTH5hzp+umCiuxHgs= diff --git a/infrastructure/config/config.go b/infrastructure/config/config.go index a65878f9c..e40ae1b43 100644 --- a/infrastructure/config/config.go +++ b/infrastructure/config/config.go @@ -28,11 +28,11 @@ import ( ) const ( - defaultConfigFilename = "kaspad.conf" + defaultConfigFilename = "c4exd.conf" defaultLogLevel = "info" defaultLogDirname = "logs" - defaultLogFilename = "kaspad.log" - defaultErrLogFilename = "kaspad_err.log" + defaultLogFilename = "c4exd.log" + defaultErrLogFilename = "c4exd_err.log" defaultTargetOutboundPeers = 8 defaultMaxInboundPeers = 117 defaultBanDuration = time.Hour * 24 @@ -51,14 +51,14 @@ const ( //DefaultMaxOrphanTxSize is the default maximum size for an orphan transaction DefaultMaxOrphanTxSize = 100_000 defaultSigCacheMaxSize = 100_000 - sampleConfigFilename = "sample-kaspad.conf" + sampleConfigFilename = "sample-c4exd.conf" defaultMaxUTXOCacheSize = 5_000_000_000 defaultProtocolVersion = 5 ) var ( - // DefaultAppDir is the default home directory for kaspad. - DefaultAppDir = util.AppDir("kaspad", false) + // DefaultAppDir is the default home directory for c4exd. + DefaultAppDir = util.AppDir("c4exd", false) defaultConfigFile = filepath.Join(DefaultAppDir, defaultConfigFilename) defaultDataDir = filepath.Join(DefaultAppDir) @@ -66,14 +66,14 @@ var ( defaultRPCCertFile = filepath.Join(DefaultAppDir, "rpc.cert") ) -//go:embed sample-kaspad.conf +//go:embed sample-c4exd.conf var sampleConfig string // RunServiceCommand is only set to a real function on Windows. It is used // to parse and execute service commands specified via the -s flag. var RunServiceCommand func(string) error -// Flags defines the configuration options for kaspad. +// Flags defines the configuration options for c4exd. // // See loadConfig for details on the configuration load process. type Flags struct { @@ -130,7 +130,7 @@ type Flags struct { ServiceOptions *ServiceOptions } -// Config defines the configuration options for kaspad. +// Config defines the configuration options for c4exd. // // See loadConfig for details on the configuration load process. type Config struct { @@ -196,7 +196,7 @@ func defaultFlags() *Flags { } } -// DefaultConfig returns the default kaspad configuration +// DefaultConfig returns the default c4exd configuration func DefaultConfig() *Config { config := &Config{Flags: defaultFlags()} config.NetworkFlags.ActiveNetParams = &dagconfig.MainnetParams @@ -212,7 +212,7 @@ func DefaultConfig() *Config { // 3. Load configuration file overwriting defaults with any specified options // 4. Parse CLI options and overwrite/add any specified options // -// The above results in kaspad functioning properly without any config settings +// The above results in c4exd functioning properly without any config settings // while still allowing the user to override settings with config files and // command line options. Command line options always take precedence. func LoadConfig() (*Config, error) { @@ -575,7 +575,7 @@ func LoadConfig() (*Config, error) { return cfg, nil } -// createDefaultConfig copies the file sample-kaspad.conf to the given destination path, +// createDefaultConfig copies the file sample-c4exd.conf to the given destination path, // and populates it with some randomly generated RPC username and password. func createDefaultConfigFile(destinationPath string) error { // Create the destination directory if it does not exists diff --git a/infrastructure/config/config_test.go b/infrastructure/config/config_test.go index c1216e8e0..4fd41b8b9 100644 --- a/infrastructure/config/config_test.go +++ b/infrastructure/config/config_test.go @@ -18,16 +18,16 @@ func TestCreateDefaultConfigFile(t *testing.T) { if !ok { t.Fatalf("Failed finding config file path") } - sampleConfigFile := filepath.Join(filepath.Dir(path), "sample-kaspad.conf") + sampleConfigFile := filepath.Join(filepath.Dir(path), "sample-c4exd.conf") // Setup a temporary directory - tmpDir, err := ioutil.TempDir("", "kaspad") + tmpDir, err := ioutil.TempDir("", "c4exd") if err != nil { t.Fatalf("Failed creating a temporary directory: %v", err) } testpath := filepath.Join(tmpDir, "test.conf") - // copy config file to location of kaspad binary + // copy config file to location of c4exd binary data, err := ioutil.ReadFile(sampleConfigFile) if err != nil { t.Fatalf("Failed reading sample config file: %v", err) @@ -36,7 +36,7 @@ func TestCreateDefaultConfigFile(t *testing.T) { if err != nil { t.Fatalf("Failed obtaining app path: %v", err) } - tmpConfigFile := filepath.Join(appPath, "sample-kaspad.conf") + tmpConfigFile := filepath.Join(appPath, "sample-c4exd.conf") err = ioutil.WriteFile(tmpConfigFile, data, 0644) if err != nil { t.Fatalf("Failed copying sample config file: %v", err) diff --git a/infrastructure/config/sample-kaspad.conf b/infrastructure/config/sample-c4exd.conf similarity index 95% rename from infrastructure/config/sample-kaspad.conf rename to infrastructure/config/sample-c4exd.conf index 816baaa5c..a27af167d 100644 --- a/infrastructure/config/sample-kaspad.conf +++ b/infrastructure/config/sample-c4exd.conf @@ -6,12 +6,12 @@ ; The directory to store data such as the block DAG and peer addresses. The ; block DAG takes several GB, so this location must have a lot of free space. -; The default is ~/.kaspad/data on POSIX OSes, $LOCALAPPDATA/Kaspad/data on Windows, -; ~/Library/Application Support/Kaspad/data on Mac OS, and $home/kaspad/data on +; The default is ~/.c4exd/data on POSIX OSes, $LOCALAPPDATA/Kaspad/data on Windows, +; ~/Library/Application Support/Kaspad/data on Mac OS, and $home/c4exd/data on ; Plan9. Environment variables are expanded so they may be used. NOTE: Windows ; environment variables are typically %VARIABLE%, but they must be accessed with ; $VARIABLE here. Also, ~ is expanded to $LOCALAPPDATA on Windows. -; datadir=~/.kaspad/data +; datadir=~/.c4exd/data ; ------------------------------------------------------------------------------ @@ -34,7 +34,7 @@ ; upnp=1 ; Specify the external IP addresses your node is listening on. One address per -; line. kaspad will not contact 3rd-party sites to obtain external ip addresses. +; line. c4exd will not contact 3rd-party sites to obtain external ip addresses. ; This means if you are behind NAT, your node will not be able to advertise a ; reachable address unless you specify it here or enable the 'upnp' option (and ; have a supported device). @@ -46,7 +46,7 @@ ; ; Only one of the following two options, 'addpeer' and 'connect', may be ; specified. Both allow you to specify peers that you want to stay connected -; with, but the behavior is slightly different. By default, kaspad will query DNS +; with, but the behavior is slightly different. By default, c4exd will query DNS ; to find peers to connect to, so unless you have a specific reason such as ; those described below, you probably won't need to modify anything here. ; @@ -103,7 +103,7 @@ ; whitelist=192.168.0.0/24 ; whitelist=fd00::/16 -; Disable DNS seeding for peers. By default, when kaspad starts, it will use +; Disable DNS seeding for peers. By default, when c4exd starts, it will use ; DNS to query for available peers to connect with. ; nodnsseed=1 @@ -148,7 +148,7 @@ ; ------------------------------------------------------------------------------ ; RPC server options - The following options control the built-in RPC server -; which is used to control and query information from a running kaspad process. +; which is used to control and query information from a running c4exd process. ; ------------------------------------------------------------------------------ ; Specify the interfaces for the RPC server listen on. One listen address per @@ -223,7 +223,7 @@ ; Debug logging level. ; Valid levels are {trace, debug, info, warn, error, critical} ; You may also specify =,=,... to set -; log level for individual subsystems. Use kaspad --loglevel=show to list +; log level for individual subsystems. Use c4exd --loglevel=show to list ; available subsystems. ; loglevel=info diff --git a/infrastructure/db/database/README.md b/infrastructure/db/database/README.md index 362c91df8..863fe63db 100644 --- a/infrastructure/db/database/README.md +++ b/infrastructure/db/database/README.md @@ -4,7 +4,7 @@ database [![ISC License](http://img.shields.io/badge/license-ISC-blue.svg)](https://choosealicense.com/licenses/isc/) [![GoDoc](https://img.shields.io/badge/godoc-reference-blue.svg)](http://godoc.org/github.com/c4ei/yunseokyeol/database) -Package database provides a database for kaspad. +Package database provides a database for c4exd. Overview -------- @@ -18,7 +18,7 @@ Implementors of additional backends are required to implement the following inte DataAccessor ------------ -This defines the common interface by which data gets accessed in a generic kaspad +This defines the common interface by which data gets accessed in a generic c4exd database. Both the Database and the Transaction interfaces (see below) implement it. Database @@ -27,7 +27,7 @@ This defines the interface of a database that can begin transactions and close i Transaction ----------- -This defines the interface of a generic kaspad database transaction. +This defines the interface of a generic c4exd database transaction. Note: Transactions provide data consistency over the state of the database as it was when the transaction started. There is NO guarantee that if one puts data into the diff --git a/infrastructure/db/database/dataaccessor.go b/infrastructure/db/database/dataaccessor.go index 7f6283bbe..44ebc2677 100644 --- a/infrastructure/db/database/dataaccessor.go +++ b/infrastructure/db/database/dataaccessor.go @@ -1,7 +1,7 @@ package database // DataAccessor defines the common interface by which data gets -// accessed in a generic kaspad database. +// accessed in a generic c4exd database. type DataAccessor interface { // Put sets the value for the given key. It overwrites // any previous value for that key. diff --git a/infrastructure/db/database/doc.go b/infrastructure/db/database/doc.go index 69740698a..bcbf0c8f1 100644 --- a/infrastructure/db/database/doc.go +++ b/infrastructure/db/database/doc.go @@ -1,5 +1,5 @@ /* -Package database provides a database for kaspad. +Package database provides a database for c4exd. # Overview @@ -13,7 +13,7 @@ Implementors of additional backends are required to implement the following inte # DataAccessor -This defines the common interface by which data gets accessed in a generic kaspad +This defines the common interface by which data gets accessed in a generic c4exd database. Both the Database and the Transaction interfaces (see below) implement it. # Database @@ -22,7 +22,7 @@ This defines the interface of a database that can begin transactions and close i # Transaction -This defines the interface of a generic kaspad database transaction. +This defines the interface of a generic c4exd database transaction. Note: transactions provide data consistency over the state of the database as it was when the transaction started. There is NO guarantee that if one puts data into the transaction then it will be available to get within the same transaction. diff --git a/infrastructure/db/database/transaction.go b/infrastructure/db/database/transaction.go index c6da23e63..53ade8672 100644 --- a/infrastructure/db/database/transaction.go +++ b/infrastructure/db/database/transaction.go @@ -1,6 +1,6 @@ package database -// Transaction defines the interface of a generic kaspad database +// Transaction defines the interface of a generic c4exd database // transaction. // // Note: Transactions provide data consistency over the state of diff --git a/infrastructure/network/netadapter/server/grpcserver/protowire/README.md b/infrastructure/network/netadapter/server/grpcserver/protowire/README.md index 2c1922f8c..4660b6ec7 100644 --- a/infrastructure/network/netadapter/server/grpcserver/protowire/README.md +++ b/infrastructure/network/netadapter/server/grpcserver/protowire/README.md @@ -11,5 +11,5 @@ Documentation ------------- To generate `rpc.md`: -1. `go install -u github.com/kaspanet/protoc-gen-doc/cmd/protoc-gen-doc` +1. `go install -u github.com/c4exnet/protoc-gen-doc/cmd/protoc-gen-doc` 2. In the protowire directory: `protoc --doc_out=. --doc_opt=markdown,rpc.md rpc.proto` diff --git a/infrastructure/network/netadapter/server/grpcserver/protowire/p2p_request_addresses.go b/infrastructure/network/netadapter/server/grpcserver/protowire/p2p_request_addresses.go index fa327fb4f..0963d8ce7 100644 --- a/infrastructure/network/netadapter/server/grpcserver/protowire/p2p_request_addresses.go +++ b/infrastructure/network/netadapter/server/grpcserver/protowire/p2p_request_addresses.go @@ -17,7 +17,7 @@ func (x *RequestAddressesMessage) toAppMessage() (appmessage.Message, error) { return nil, errors.Wrapf(errorNil, "RequestAddressesMessage is nil") } subnetworkID, err := x.SubnetworkId.toDomain() - // Full kaspa nodes set SubnetworkId==nil + // Full c4ex nodes set SubnetworkId==nil if err != nil && !errors.Is(err, errorNil) { return nil, err } diff --git a/infrastructure/network/netadapter/server/grpcserver/protowire/p2p_version.go b/infrastructure/network/netadapter/server/grpcserver/protowire/p2p_version.go index 042662dfe..6d0cef750 100644 --- a/infrastructure/network/netadapter/server/grpcserver/protowire/p2p_version.go +++ b/infrastructure/network/netadapter/server/grpcserver/protowire/p2p_version.go @@ -25,7 +25,7 @@ func (x *VersionMessage) toAppMessage() (appmessage.Message, error) { } subnetworkID, err := x.SubnetworkId.toDomain() - // Full kaspa nodes set SubnetworkId==nil + // Full c4ex nodes set SubnetworkId==nil if err != nil && !errors.Is(err, errorNil) { return nil, err } diff --git a/infrastructure/network/netadapter/server/grpcserver/protowire/rpc.md b/infrastructure/network/netadapter/server/grpcserver/protowire/rpc.md index 12a22923c..7763eacf5 100644 --- a/infrastructure/network/netadapter/server/grpcserver/protowire/rpc.md +++ b/infrastructure/network/netadapter/server/grpcserver/protowire/rpc.md @@ -388,7 +388,7 @@ Receivers of any ResponseMessage are expected to check whether its error field i ### GetCurrentNetworkRequestMessage -GetCurrentNetworkRequestMessage requests the network kaspad is currently running against. +GetCurrentNetworkRequestMessage requests the network c4exd is currently running against. Possible networks are: Mainnet, Testnet, Simnet, Devnet @@ -459,7 +459,7 @@ See: SubmitBlockRequestMessage | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| payAddress | [string](#string) | | Which kaspa address should the coinbase block reward transaction pay into | +| payAddress | [string](#string) | | Which c4ex address should the coinbase block reward transaction pay into | | extraData | [string](#string) | | | @@ -476,7 +476,7 @@ See: SubmitBlockRequestMessage | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | | block | [RpcBlock](#protowire.RpcBlock) | | | -| isSynced | [bool](#bool) | | Whether kaspad thinks that it's synced. Callers are discouraged (but not forbidden) from solving blocks when kaspad is not synced. That is because when kaspad isn't in sync with the rest of the network there's a high chance the block will never be accepted, thus the solving effort would have been wasted. | +| isSynced | [bool](#bool) | | Whether c4exd thinks that it's synced. Callers are discouraged (but not forbidden) from solving blocks when c4exd is not synced. That is because when c4exd isn't in sync with the rest of the network there's a high chance the block will never be accepted, thus the solving effort would have been wasted. | | error | [RPCError](#protowire.RPCError) | | | @@ -532,7 +532,7 @@ See: NotifyBlockAddedRequestMessage ### GetPeerAddressesRequestMessage -GetPeerAddressesRequestMessage requests the list of known kaspad addresses in the +GetPeerAddressesRequestMessage requests the list of known c4exd addresses in the current network. (mainnet, testnet, etc.) @@ -687,7 +687,7 @@ currently in the mempool. ### GetConnectedPeerInfoRequestMessage GetConnectedPeerInfoRequestMessage requests information about all the p2p peers -currently connected to this kaspad. +currently connected to this c4exd. @@ -721,11 +721,11 @@ currently connected to this kaspad. | id | [string](#string) | | | | address | [string](#string) | | | | lastPingDuration | [int64](#int64) | | How long did the last ping/pong exchange take | -| isOutbound | [bool](#bool) | | Whether this kaspad initiated the connection | +| isOutbound | [bool](#bool) | | Whether this c4exd initiated the connection | | timeOffset | [int64](#int64) | | | | userAgent | [string](#string) | | | | advertisedProtocolVersion | [uint32](#uint32) | | The protocol version that this peer claims to support | -| timeConnected | [int64](#int64) | | The timestamp of when this peer connected to this kaspad | +| timeConnected | [int64](#int64) | | The timestamp of when this peer connected to this c4exd | | isIbdPeer | [bool](#bool) | | Whether this peer is the IBD peer (if IBD is running) | @@ -736,8 +736,8 @@ currently connected to this kaspad. ### AddPeerRequestMessage -AddPeerRequestMessage adds a peer to kaspad's outgoing connection list. -This will, in most cases, result in kaspad connecting to said peer. +AddPeerRequestMessage adds a peer to c4exd's outgoing connection list. +This will, in most cases, result in c4exd connecting to said peer. | Field | Type | Label | Description | @@ -918,7 +918,7 @@ Currently unimplemented ### GetVirtualSelectedParentChainFromBlockRequestMessage GetVirtualSelectedParentChainFromBlockRequestMessage requests the virtual selected -parent chain from some startHash to this kaspad's current virtual +parent chain from some startHash to this c4exd's current virtual | Field | Type | Label | Description | @@ -969,7 +969,7 @@ parent chain from some startHash to this kaspad's current virtual ### GetBlocksRequestMessage GetBlocksRequestMessage requests blocks between a certain block lowHash up to this -kaspad's current virtual. +c4exd's current virtual. | Field | Type | Label | Description | @@ -1003,7 +1003,7 @@ kaspad's current virtual. ### GetBlockCountRequestMessage -GetBlockCountRequestMessage requests the current number of blocks in this kaspad. +GetBlockCountRequestMessage requests the current number of blocks in this c4exd. Note that this number may decrease as pruning occurs. @@ -1032,7 +1032,7 @@ Note that this number may decrease as pruning occurs. ### GetBlockDagInfoRequestMessage GetBlockDagInfoRequestMessage requests general information about the current state -of this kaspad's DAG. +of this c4exd's DAG. @@ -1151,7 +1151,7 @@ of this kaspad's DAG. ### ShutDownRequestMessage -ShutDownRequestMessage shuts down this kaspad. +ShutDownRequestMessage shuts down this c4exd. @@ -1213,7 +1213,7 @@ current virtual, up to the given limit. NotifyUtxosChangedRequestMessage registers this connection for utxoChanged notifications for the given addresses. -This call is only available when this kaspad was started with `--utxoindex` +This call is only available when this c4exd was started with `--utxoindex` See: UtxosChangedNotificationMessage @@ -1283,7 +1283,7 @@ See: NotifyUtxosChangedRequestMessage StopNotifyingUtxosChangedRequestMessage unregisters this connection for utxoChanged notifications for the given addresses. -This call is only available when this kaspad was started with `--utxoindex` +This call is only available when this c4exd was started with `--utxoindex` See: UtxosChangedNotificationMessage @@ -1315,9 +1315,9 @@ See: UtxosChangedNotificationMessage ### GetUtxosByAddressesRequestMessage -GetUtxosByAddressesRequestMessage requests all current UTXOs for the given kaspad addresses +GetUtxosByAddressesRequestMessage requests all current UTXOs for the given c4exd addresses -This call is only available when this kaspad was started with `--utxoindex` +This call is only available when this c4exd was started with `--utxoindex` | Field | Type | Label | Description | @@ -1350,7 +1350,7 @@ This call is only available when this kaspad was started with `--utxoindex` ### GetBalanceByAddressRequestMessage GetBalanceByAddressRequest returns the total balance in unspent transactions towards a given address -This call is only available when this kaspad was started with `--utxoindex` +This call is only available when this c4exd was started with `--utxoindex` | Field | Type | Label | Description | @@ -1551,7 +1551,7 @@ See NotifyVirtualDaaScoreChangedRequestMessage NotifyPruningPointUTXOSetOverrideRequestMessage registers this connection for pruning point UTXO set override notifications. -This call is only available when this kaspad was started with `--utxoindex` +This call is only available when this c4exd was started with `--utxoindex` See: NotifyPruningPointUTXOSetOverrideResponseMessage @@ -1594,7 +1594,7 @@ See NotifyPruningPointUTXOSetOverrideRequestMessage StopNotifyingPruningPointUTXOSetOverrideRequestMessage unregisters this connection for pruning point UTXO set override notifications. -This call is only available when this kaspad was started with `--utxoindex` +This call is only available when this c4exd was started with `--utxoindex` See: PruningPointUTXOSetOverrideNotificationMessage diff --git a/infrastructure/network/netadapter/server/grpcserver/protowire/rpc.pb.go b/infrastructure/network/netadapter/server/grpcserver/protowire/rpc.pb.go index a72e70fe4..a96235315 100644 --- a/infrastructure/network/netadapter/server/grpcserver/protowire/rpc.pb.go +++ b/infrastructure/network/netadapter/server/grpcserver/protowire/rpc.pb.go @@ -1091,7 +1091,7 @@ func (x *RpcTransactionOutputVerboseData) GetScriptPublicKeyAddress() string { return "" } -// GetCurrentNetworkRequestMessage requests the network kaspad is currently running against. +// GetCurrentNetworkRequestMessage requests the network c4exd is currently running against. // // Possible networks are: Mainnet, Testnet, Simnet, Devnet type GetCurrentNetworkRequestMessage struct { @@ -1310,7 +1310,7 @@ type GetBlockTemplateRequestMessage struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - // Which kaspa address should the coinbase block reward transaction pay into + // Which c4ex address should the coinbase block reward transaction pay into PayAddress string `protobuf:"bytes,1,opt,name=payAddress,proto3" json:"payAddress,omitempty"` ExtraData string `protobuf:"bytes,2,opt,name=extraData,proto3" json:"extraData,omitempty"` } @@ -1367,9 +1367,9 @@ type GetBlockTemplateResponseMessage struct { unknownFields protoimpl.UnknownFields Block *RpcBlock `protobuf:"bytes,3,opt,name=block,proto3" json:"block,omitempty"` - // Whether kaspad thinks that it's synced. - // Callers are discouraged (but not forbidden) from solving blocks when kaspad is not synced. - // That is because when kaspad isn't in sync with the rest of the network there's a high + // Whether c4exd thinks that it's synced. + // Callers are discouraged (but not forbidden) from solving blocks when c4exd is not synced. + // That is because when c4exd isn't in sync with the rest of the network there's a high // chance the block will never be accepted, thus the solving effort would have been wasted. IsSynced bool `protobuf:"varint,2,opt,name=isSynced,proto3" json:"isSynced,omitempty"` Error *RPCError `protobuf:"bytes,1000,opt,name=error,proto3" json:"error,omitempty"` @@ -1567,7 +1567,7 @@ func (x *BlockAddedNotificationMessage) GetBlock() *RpcBlock { return nil } -// GetPeerAddressesRequestMessage requests the list of known kaspad addresses in the +// GetPeerAddressesRequestMessage requests the list of known c4exd addresses in the // current network. (mainnet, testnet, etc.) type GetPeerAddressesRequestMessage struct { state protoimpl.MessageState @@ -2109,7 +2109,7 @@ func (x *MempoolEntry) GetIsOrphan() bool { } // GetConnectedPeerInfoRequestMessage requests information about all the p2p peers -// currently connected to this kaspad. +// currently connected to this c4exd. type GetConnectedPeerInfoRequestMessage struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -2212,13 +2212,13 @@ type GetConnectedPeerInfoMessage struct { Address string `protobuf:"bytes,2,opt,name=address,proto3" json:"address,omitempty"` // How long did the last ping/pong exchange take LastPingDuration int64 `protobuf:"varint,3,opt,name=lastPingDuration,proto3" json:"lastPingDuration,omitempty"` - // Whether this kaspad initiated the connection + // Whether this c4exd initiated the connection IsOutbound bool `protobuf:"varint,6,opt,name=isOutbound,proto3" json:"isOutbound,omitempty"` TimeOffset int64 `protobuf:"varint,7,opt,name=timeOffset,proto3" json:"timeOffset,omitempty"` UserAgent string `protobuf:"bytes,8,opt,name=userAgent,proto3" json:"userAgent,omitempty"` // The protocol version that this peer claims to support AdvertisedProtocolVersion uint32 `protobuf:"varint,9,opt,name=advertisedProtocolVersion,proto3" json:"advertisedProtocolVersion,omitempty"` - // The timestamp of when this peer connected to this kaspad + // The timestamp of when this peer connected to this c4exd TimeConnected int64 `protobuf:"varint,10,opt,name=timeConnected,proto3" json:"timeConnected,omitempty"` // Whether this peer is the IBD peer (if IBD is running) IsIbdPeer bool `protobuf:"varint,11,opt,name=isIbdPeer,proto3" json:"isIbdPeer,omitempty"` @@ -2319,8 +2319,8 @@ func (x *GetConnectedPeerInfoMessage) GetIsIbdPeer() bool { return false } -// AddPeerRequestMessage adds a peer to kaspad's outgoing connection list. -// This will, in most cases, result in kaspad connecting to said peer. +// AddPeerRequestMessage adds a peer to c4exd's outgoing connection list. +// This will, in most cases, result in c4exd connecting to said peer. type AddPeerRequestMessage struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -2922,7 +2922,7 @@ func (x *GetSubnetworkResponseMessage) GetError() *RPCError { } // GetVirtualSelectedParentChainFromBlockRequestMessage requests the virtual selected -// parent chain from some startHash to this kaspad's current virtual +// parent chain from some startHash to this c4exd's current virtual type GetVirtualSelectedParentChainFromBlockRequestMessage struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -3109,7 +3109,7 @@ func (x *GetVirtualSelectedParentChainFromBlockResponseMessage) GetError() *RPCE } // GetBlocksRequestMessage requests blocks between a certain block lowHash up to this -// kaspad's current virtual. +// c4exd's current virtual. type GetBlocksRequestMessage struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -3236,7 +3236,7 @@ func (x *GetBlocksResponseMessage) GetError() *RPCError { return nil } -// GetBlockCountRequestMessage requests the current number of blocks in this kaspad. +// GetBlockCountRequestMessage requests the current number of blocks in this c4exd. // Note that this number may decrease as pruning occurs. type GetBlockCountRequestMessage struct { state protoimpl.MessageState @@ -3340,7 +3340,7 @@ func (x *GetBlockCountResponseMessage) GetError() *RPCError { } // GetBlockDagInfoRequestMessage requests general information about the current state -// of this kaspad's DAG. +// of this c4exd's DAG. type GetBlockDagInfoRequestMessage struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -3771,7 +3771,7 @@ func (x *FinalityConflictResolvedNotificationMessage) GetFinalityBlockHash() str return "" } -// ShutDownRequestMessage shuts down this kaspad. +// ShutDownRequestMessage shuts down this c4exd. type ShutDownRequestMessage struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -3980,7 +3980,7 @@ func (x *GetHeadersResponseMessage) GetError() *RPCError { // NotifyUtxosChangedRequestMessage registers this connection for utxoChanged notifications // for the given addresses. // -// This call is only available when this kaspad was started with `--utxoindex` +// This call is only available when this c4exd was started with `--utxoindex` // // See: UtxosChangedNotificationMessage type NotifyUtxosChangedRequestMessage struct { @@ -4201,7 +4201,7 @@ func (x *UtxosByAddressesEntry) GetUtxoEntry() *RpcUtxoEntry { // StopNotifyingUtxosChangedRequestMessage unregisters this connection for utxoChanged notifications // for the given addresses. // -// This call is only available when this kaspad was started with `--utxoindex` +// This call is only available when this c4exd was started with `--utxoindex` // // See: UtxosChangedNotificationMessage type StopNotifyingUtxosChangedRequestMessage struct { @@ -4298,9 +4298,9 @@ func (x *StopNotifyingUtxosChangedResponseMessage) GetError() *RPCError { return nil } -// GetUtxosByAddressesRequestMessage requests all current UTXOs for the given kaspad addresses +// GetUtxosByAddressesRequestMessage requests all current UTXOs for the given c4exd addresses // -// This call is only available when this kaspad was started with `--utxoindex` +// This call is only available when this c4exd was started with `--utxoindex` type GetUtxosByAddressesRequestMessage struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -4405,7 +4405,7 @@ func (x *GetUtxosByAddressesResponseMessage) GetError() *RPCError { // GetBalanceByAddressRequest returns the total balance in unspent transactions towards a given address // -// This call is only available when this kaspad was started with `--utxoindex` +// This call is only available when this c4exd was started with `--utxoindex` type GetBalanceByAddressRequestMessage struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -5051,7 +5051,7 @@ func (x *VirtualDaaScoreChangedNotificationMessage) GetVirtualDaaScore() uint64 // NotifyPruningPointUTXOSetOverrideRequestMessage registers this connection for // pruning point UTXO set override notifications. // -// This call is only available when this kaspad was started with `--utxoindex` +// This call is only available when this c4exd was started with `--utxoindex` // // See: NotifyPruningPointUTXOSetOverrideResponseMessage type NotifyPruningPointUTXOSetOverrideRequestMessage struct { @@ -5184,7 +5184,7 @@ func (*PruningPointUTXOSetOverrideNotificationMessage) Descriptor() ([]byte, []i // StopNotifyingPruningPointUTXOSetOverrideRequestMessage unregisters this connection for // pruning point UTXO set override notifications. // -// This call is only available when this kaspad was started with `--utxoindex` +// This call is only available when this c4exd was started with `--utxoindex` // // See: PruningPointUTXOSetOverrideNotificationMessage type StopNotifyingPruningPointUTXOSetOverrideRequestMessage struct { diff --git a/infrastructure/network/netadapter/server/grpcserver/protowire/rpc.proto b/infrastructure/network/netadapter/server/grpcserver/protowire/rpc.proto index c4593747d..b7a10b744 100644 --- a/infrastructure/network/netadapter/server/grpcserver/protowire/rpc.proto +++ b/infrastructure/network/netadapter/server/grpcserver/protowire/rpc.proto @@ -115,7 +115,7 @@ message RpcTransactionOutputVerboseData{ string scriptPublicKeyAddress = 6; } -// GetCurrentNetworkRequestMessage requests the network kaspad is currently running against. +// GetCurrentNetworkRequestMessage requests the network c4exd is currently running against. // // Possible networks are: Mainnet, Testnet, Simnet, Devnet message GetCurrentNetworkRequestMessage{ @@ -150,7 +150,7 @@ message SubmitBlockResponseMessage{ // // See: SubmitBlockRequestMessage message GetBlockTemplateRequestMessage{ - // Which kaspa address should the coinbase block reward transaction pay into + // Which c4ex address should the coinbase block reward transaction pay into string payAddress = 1; string extraData = 2; } @@ -158,9 +158,9 @@ message GetBlockTemplateRequestMessage{ message GetBlockTemplateResponseMessage{ RpcBlock block = 3; - // Whether kaspad thinks that it's synced. - // Callers are discouraged (but not forbidden) from solving blocks when kaspad is not synced. - // That is because when kaspad isn't in sync with the rest of the network there's a high + // Whether c4exd thinks that it's synced. + // Callers are discouraged (but not forbidden) from solving blocks when c4exd is not synced. + // That is because when c4exd isn't in sync with the rest of the network there's a high // chance the block will never be accepted, thus the solving effort would have been wasted. bool isSynced = 2; @@ -185,7 +185,7 @@ message BlockAddedNotificationMessage{ RpcBlock block = 3; } -// GetPeerAddressesRequestMessage requests the list of known kaspad addresses in the +// GetPeerAddressesRequestMessage requests the list of known c4exd addresses in the // current network. (mainnet, testnet, etc.) message GetPeerAddressesRequestMessage{ } @@ -245,7 +245,7 @@ message MempoolEntry{ } // GetConnectedPeerInfoRequestMessage requests information about all the p2p peers -// currently connected to this kaspad. +// currently connected to this c4exd. message GetConnectedPeerInfoRequestMessage{ } @@ -261,7 +261,7 @@ message GetConnectedPeerInfoMessage{ // How long did the last ping/pong exchange take int64 lastPingDuration = 3; - // Whether this kaspad initiated the connection + // Whether this c4exd initiated the connection bool isOutbound = 6; int64 timeOffset = 7; string userAgent = 8; @@ -269,15 +269,15 @@ message GetConnectedPeerInfoMessage{ // The protocol version that this peer claims to support uint32 advertisedProtocolVersion = 9; - // The timestamp of when this peer connected to this kaspad + // The timestamp of when this peer connected to this c4exd int64 timeConnected = 10; // Whether this peer is the IBD peer (if IBD is running) bool isIbdPeer = 11; } -// AddPeerRequestMessage adds a peer to kaspad's outgoing connection list. -// This will, in most cases, result in kaspad connecting to said peer. +// AddPeerRequestMessage adds a peer to c4exd's outgoing connection list. +// This will, in most cases, result in c4exd connecting to said peer. message AddPeerRequestMessage{ string address = 1; @@ -355,7 +355,7 @@ message GetSubnetworkResponseMessage{ } // GetVirtualSelectedParentChainFromBlockRequestMessage requests the virtual selected -// parent chain from some startHash to this kaspad's current virtual +// parent chain from some startHash to this c4exd's current virtual message GetVirtualSelectedParentChainFromBlockRequestMessage{ string startHash = 1; bool includeAcceptedTransactionIds = 2; @@ -381,7 +381,7 @@ message GetVirtualSelectedParentChainFromBlockResponseMessage{ } // GetBlocksRequestMessage requests blocks between a certain block lowHash up to this -// kaspad's current virtual. +// c4exd's current virtual. message GetBlocksRequestMessage{ string lowHash = 1; bool includeBlocks = 2; @@ -394,7 +394,7 @@ message GetBlocksResponseMessage{ RPCError error = 1000; } -// GetBlockCountRequestMessage requests the current number of blocks in this kaspad. +// GetBlockCountRequestMessage requests the current number of blocks in this c4exd. // Note that this number may decrease as pruning occurs. message GetBlockCountRequestMessage{ } @@ -406,7 +406,7 @@ message GetBlockCountResponseMessage{ } // GetBlockDagInfoRequestMessage requests general information about the current state -// of this kaspad's DAG. +// of this c4exd's DAG. message GetBlockDagInfoRequestMessage{ } @@ -446,7 +446,7 @@ message FinalityConflictResolvedNotificationMessage{ string finalityBlockHash = 1; } -// ShutDownRequestMessage shuts down this kaspad. +// ShutDownRequestMessage shuts down this c4exd. message ShutDownRequestMessage{ } @@ -470,7 +470,7 @@ message GetHeadersResponseMessage{ // NotifyUtxosChangedRequestMessage registers this connection for utxoChanged notifications // for the given addresses. // -// This call is only available when this kaspad was started with `--utxoindex` +// This call is only available when this c4exd was started with `--utxoindex` // // See: UtxosChangedNotificationMessage message NotifyUtxosChangedRequestMessage { @@ -498,7 +498,7 @@ message UtxosByAddressesEntry { // StopNotifyingUtxosChangedRequestMessage unregisters this connection for utxoChanged notifications // for the given addresses. // -// This call is only available when this kaspad was started with `--utxoindex` +// This call is only available when this c4exd was started with `--utxoindex` // // See: UtxosChangedNotificationMessage message StopNotifyingUtxosChangedRequestMessage { @@ -509,9 +509,9 @@ message StopNotifyingUtxosChangedResponseMessage { RPCError error = 1000; } -// GetUtxosByAddressesRequestMessage requests all current UTXOs for the given kaspad addresses +// GetUtxosByAddressesRequestMessage requests all current UTXOs for the given c4exd addresses // -// This call is only available when this kaspad was started with `--utxoindex` +// This call is only available when this c4exd was started with `--utxoindex` message GetUtxosByAddressesRequestMessage { repeated string addresses = 1; } @@ -524,7 +524,7 @@ message GetUtxosByAddressesResponseMessage { // GetBalanceByAddressRequest returns the total balance in unspent transactions towards a given address // -// This call is only available when this kaspad was started with `--utxoindex` +// This call is only available when this c4exd was started with `--utxoindex` message GetBalanceByAddressRequestMessage { string address = 1; } @@ -604,7 +604,7 @@ message VirtualDaaScoreChangedNotificationMessage { // NotifyPruningPointUTXOSetOverrideRequestMessage registers this connection for // pruning point UTXO set override notifications. // -// This call is only available when this kaspad was started with `--utxoindex` +// This call is only available when this c4exd was started with `--utxoindex` // // See: NotifyPruningPointUTXOSetOverrideResponseMessage message NotifyPruningPointUTXOSetOverrideRequestMessage { @@ -625,7 +625,7 @@ message PruningPointUTXOSetOverrideNotificationMessage { // StopNotifyingPruningPointUTXOSetOverrideRequestMessage unregisters this connection for // pruning point UTXO set override notifications. // -// This call is only available when this kaspad was started with `--utxoindex` +// This call is only available when this c4exd was started with `--utxoindex` // // See: PruningPointUTXOSetOverrideNotificationMessage message StopNotifyingPruningPointUTXOSetOverrideRequestMessage { diff --git a/infrastructure/os/execenv/initialize.go b/infrastructure/os/execenv/initialize.go index f08e35d0c..66e64ae97 100644 --- a/infrastructure/os/execenv/initialize.go +++ b/infrastructure/os/execenv/initialize.go @@ -8,7 +8,7 @@ import ( "github.com/c4ei/yunseokyeol/infrastructure/os/limits" ) -// Initialize initializes the execution environment required to run kaspad +// Initialize initializes the execution environment required to run c4exd func Initialize(desiredLimits *limits.DesiredLimits) { // Use all processor cores. runtime.GOMAXPROCS(runtime.NumCPU()) diff --git a/infrastructure/os/limits/limits_unix.go b/infrastructure/os/limits/limits_unix.go index 0e99ff8d5..146a0b9e1 100644 --- a/infrastructure/os/limits/limits_unix.go +++ b/infrastructure/os/limits/limits_unix.go @@ -13,7 +13,7 @@ import ( "github.com/pkg/errors" ) -// SetLimits raises some process limits to values which allow kaspad and +// SetLimits raises some process limits to values which allow c4exd and // associated utilities to run. func SetLimits(desiredLimits *DesiredLimits) error { var rLimit syscall.Rlimit diff --git a/infrastructure/os/winservice/common.go b/infrastructure/os/winservice/common.go index 06817ea23..81ce2ea8e 100644 --- a/infrastructure/os/winservice/common.go +++ b/infrastructure/os/winservice/common.go @@ -12,6 +12,6 @@ type ServiceDescription struct { // MainFunc specifies the signature of an application's main function to be able to run as a windows service type MainFunc func(startedChan chan<- struct{}) error -// WinServiceMain is only invoked on Windows. It detects when kaspad is running +// WinServiceMain is only invoked on Windows. It detects when c4exd is running // as a service and reacts accordingly. var WinServiceMain = func(MainFunc, *ServiceDescription, *config.Config) (bool, error) { return false, nil } diff --git a/infrastructure/os/winservice/service_command_windows.go b/infrastructure/os/winservice/service_command_windows.go index 955df7fe0..b670f6663 100644 --- a/infrastructure/os/winservice/service_command_windows.go +++ b/infrastructure/os/winservice/service_command_windows.go @@ -39,7 +39,7 @@ func (s *Service) performServiceCommand() error { return err } -// installService attempts to install the kaspad service. Typically this should +// installService attempts to install the c4exd service. Typically this should // be done by the msi installer, but it is provided here since it can be useful // for development. func (s *Service) installService() error { @@ -91,7 +91,7 @@ func (s *Service) installService() error { return eventlog.InstallAsEventCreate(s.description.Name, eventsSupported) } -// removeService attempts to uninstall the kaspad service. Typically this should +// removeService attempts to uninstall the c4exd service. Typically this should // be done by the msi uninstaller, but it is provided here since it can be // useful for development. Not the eventlog entry is intentionally not removed // since it would invalidate any existing event log messages. @@ -114,7 +114,7 @@ func (s *Service) removeService() error { return service.Delete() } -// startService attempts to Start the kaspad service. +// startService attempts to Start the c4exd service. func (s *Service) startService() error { // Connect to the windows service manager. serviceManager, err := mgr.Connect() diff --git a/infrastructure/os/winservice/service_windows.go b/infrastructure/os/winservice/service_windows.go index 0d8fac609..94be377b9 100644 --- a/infrastructure/os/winservice/service_windows.go +++ b/infrastructure/os/winservice/service_windows.go @@ -51,20 +51,20 @@ func (s *Service) Start() error { // Execute is the main entry point the winsvc package calls when receiving // information from the Windows service control manager. It launches the -// long-running kaspadMain (which is the real meat of kaspad), handles service +// long-running c4exdMain (which is the real meat of c4exd), handles service // change requests, and notifies the service control manager of changes. func (s *Service) Execute(args []string, r <-chan svc.ChangeRequest, changes chan<- svc.Status) (bool, uint32) { // Service start is pending. const cmdsAccepted = svc.AcceptStop | svc.AcceptShutdown changes <- svc.Status{State: svc.StartPending} - // Start kaspadMain in a separate goroutine so the service can start + // Start c4exdMain in a separate goroutine so the service can start // quickly. Shutdown (along with a potential error) is reported via - // doneChan. startedChan is notified once kaspad is started so this can + // doneChan. startedChan is notified once c4exd is started so this can // be properly logged doneChan := make(chan error) startedChan := make(chan struct{}) - spawn("kaspadMain-windows", func() { + spawn("c4exdMain-windows", func() { err := s.main(startedChan) doneChan <- err }) @@ -108,7 +108,7 @@ loop: return false, 0 } -// logServiceStart logs information about kaspad when the main server has +// logServiceStart logs information about c4exd when the main server has // been started to the Windows event log. func (s *Service) logServiceStart() { var message string diff --git a/stability-tests/README.md b/stability-tests/README.md index dca693c63..0f1c95f7e 100644 --- a/stability-tests/README.md +++ b/stability-tests/README.md @@ -1,5 +1,5 @@ # Stability-Test Tools -This package provides some higher-level tests for kaspad. +This package provides some higher-level tests for c4exd. These are tests that are beyond the scope of unit-tests, and some of them might take long time to run. # Running diff --git a/stability-tests/application-level-garbage/README.md b/stability-tests/application-level-garbage/README.md index c70620ee1..0173c76c8 100644 --- a/stability-tests/application-level-garbage/README.md +++ b/stability-tests/application-level-garbage/README.md @@ -2,7 +2,7 @@ This tool sends invalid blocks to a node, making sure the node responds with a reject, and does not crash as a result. ## Running - 1. `go install` kaspad and application-level-garbage. + 1. `go install` c4exd and application-level-garbage. 2. `cd run` 3. `./run.sh` diff --git a/stability-tests/application-level-garbage/main.go b/stability-tests/application-level-garbage/main.go index 4ea27999e..0edea995b 100644 --- a/stability-tests/application-level-garbage/main.go +++ b/stability-tests/application-level-garbage/main.go @@ -25,10 +25,10 @@ func main() { profiling.Start(cfg.Profile, log) } - kaspadConfig := config.DefaultConfig() - kaspadConfig.NetworkFlags = cfg.NetworkFlags + c4exdConfig := config.DefaultConfig() + c4exdConfig.NetworkFlags = cfg.NetworkFlags - minimalNetAdapter, err := standalone.NewMinimalNetAdapter(kaspadConfig) + minimalNetAdapter, err := standalone.NewMinimalNetAdapter(c4exdConfig) if err != nil { fmt.Fprintf(os.Stderr, "Error creating minimalNetAdapter: %+v", err) backendLog.Close() diff --git a/stability-tests/application-level-garbage/run/run.sh b/stability-tests/application-level-garbage/run/run.sh index c55c4f645..ad62a592f 100755 --- a/stability-tests/application-level-garbage/run/run.sh +++ b/stability-tests/application-level-garbage/run/run.sh @@ -1,7 +1,7 @@ #!/bin/bash -rm -rf /tmp/kaspad-temp +rm -rf /tmp/c4exd-temp -kaspad --devnet --appdir=/tmp/kaspad-temp --profile=6061 --loglevel=debug & +c4exd --devnet --appdir=/tmp/c4exd-temp --profile=6061 --loglevel=debug & KASPAD_PID=$! KASPAD_KILLED=0 function killKaspadIfNotKilled() { diff --git a/stability-tests/kaspadsanity/README.md b/stability-tests/c4exdsanity/README.md similarity index 88% rename from stability-tests/kaspadsanity/README.md rename to stability-tests/c4exdsanity/README.md index dec27bd43..efeb86ac8 100644 --- a/stability-tests/kaspadsanity/README.md +++ b/stability-tests/c4exdsanity/README.md @@ -6,7 +6,7 @@ argument so it will be able to clean it between runs, so it's forbidden to use --appdir as part of the arguments set. ## Running - 1. `go install` kaspad and kaspadsanity. + 1. `go install` c4exd and c4exdsanity. 2. `cd run` 3. `./run.sh` diff --git a/stability-tests/kaspadsanity/commandloop.go b/stability-tests/c4exdsanity/commandloop.go similarity index 93% rename from stability-tests/kaspadsanity/commandloop.go rename to stability-tests/c4exdsanity/commandloop.go index b62e821e9..977bd97a5 100644 --- a/stability-tests/kaspadsanity/commandloop.go +++ b/stability-tests/c4exdsanity/commandloop.go @@ -23,7 +23,7 @@ func (cf commandFailure) String() string { func commandLoop(argsChan <-chan []string) ([]commandFailure, error) { failures := make([]commandFailure, 0) - dataDirectoryPath, err := common.TempDir("kaspadsanity-kaspad-datadir") + dataDirectoryPath, err := common.TempDir("c4exdsanity-c4exd-datadir") if err != nil { return nil, errors.Wrapf(err, "error creating temp dir") } @@ -40,7 +40,7 @@ func commandLoop(argsChan <-chan []string) ([]commandFailure, error) { return nil, err } - cmd := exec.Command("kaspad", args...) + cmd := exec.Command("c4exd", args...) cmd.Stdout = common.NewLogWriter(log, logger.LevelTrace, "KASPAD-STDOUT") cmd.Stderr = common.NewLogWriter(log, logger.LevelWarn, "KASPAD-STDERR") diff --git a/stability-tests/kaspadsanity/config.go b/stability-tests/c4exdsanity/config.go similarity index 91% rename from stability-tests/kaspadsanity/config.go rename to stability-tests/c4exdsanity/config.go index 1f2a04171..586ddf7de 100644 --- a/stability-tests/kaspadsanity/config.go +++ b/stability-tests/c4exdsanity/config.go @@ -8,8 +8,8 @@ import ( ) const ( - defaultLogFilename = "kaspadsanity.log" - defaultErrLogFilename = "kaspadsanity_err.log" + defaultLogFilename = "c4exdsanity.log" + defaultErrLogFilename = "c4exdsanity_err.log" ) var ( diff --git a/stability-tests/kaspadsanity/log.go b/stability-tests/c4exdsanity/log.go similarity index 100% rename from stability-tests/kaspadsanity/log.go rename to stability-tests/c4exdsanity/log.go diff --git a/stability-tests/kaspadsanity/main.go b/stability-tests/c4exdsanity/main.go similarity index 93% rename from stability-tests/kaspadsanity/main.go rename to stability-tests/c4exdsanity/main.go index 909f32019..6fb3db566 100644 --- a/stability-tests/kaspadsanity/main.go +++ b/stability-tests/c4exdsanity/main.go @@ -12,7 +12,7 @@ import ( ) func main() { - defer panics.HandlePanic(log, "kaspadsanity-main", nil) + defer panics.HandlePanic(log, "c4exdsanity-main", nil) err := parseConfig() if err != nil { panic(errors.Wrap(err, "error in parseConfig")) diff --git a/stability-tests/kaspadsanity/read.go b/stability-tests/c4exdsanity/read.go similarity index 100% rename from stability-tests/kaspadsanity/read.go rename to stability-tests/c4exdsanity/read.go diff --git a/stability-tests/kaspadsanity/run/commands-list b/stability-tests/c4exdsanity/run/commands-list similarity index 100% rename from stability-tests/kaspadsanity/run/commands-list rename to stability-tests/c4exdsanity/run/commands-list diff --git a/stability-tests/c4exdsanity/run/run.sh b/stability-tests/c4exdsanity/run/run.sh new file mode 100755 index 000000000..9c975cc96 --- /dev/null +++ b/stability-tests/c4exdsanity/run/run.sh @@ -0,0 +1,12 @@ +#!/bin/bash +c4exdsanity --command-list-file ./commands-list --profile=7000 +TEST_EXIT_CODE=$? + +echo "Exit code: $TEST_EXIT_CODE" + +if [ $TEST_EXIT_CODE -eq 0 ]; then + echo "c4exdsanity test: PASSED" + exit 0 +fi +echo "c4exdsanity test: FAILED" +exit 1 diff --git a/stability-tests/common/cmd.go b/stability-tests/common/cmd.go index c381fc12d..32513316b 100644 --- a/stability-tests/common/cmd.go +++ b/stability-tests/common/cmd.go @@ -26,7 +26,7 @@ func StartCmd(name string, args ...string) (*exec.Cmd, error) { return cmd, nil } -// NetworkCliArgumentFromNetParams returns the kaspad command line argument that starts the given network. +// NetworkCliArgumentFromNetParams returns the c4exd command line argument that starts the given network. func NetworkCliArgumentFromNetParams(params *dagconfig.Params) string { - return fmt.Sprintf("--%s", strings.TrimPrefix(params.Name, "kaspa-")) + return fmt.Sprintf("--%s", strings.TrimPrefix(params.Name, "c4ex-")) } diff --git a/stability-tests/common/run-kaspad.go b/stability-tests/common/run-c4exd.go similarity index 82% rename from stability-tests/common/run-kaspad.go rename to stability-tests/common/run-c4exd.go index cccbe3ee9..7bd53d3f1 100644 --- a/stability-tests/common/run-kaspad.go +++ b/stability-tests/common/run-c4exd.go @@ -10,15 +10,15 @@ import ( "github.com/c4ei/yunseokyeol/domain/dagconfig" ) -// RunKaspadForTesting runs kaspad for testing purposes +// RunKaspadForTesting runs c4exd for testing purposes func RunKaspadForTesting(t *testing.T, testName string, rpcAddress string) func() { appDir, err := TempDir(testName) if err != nil { t.Fatalf("TempDir: %s", err) } - kaspadRunCommand, err := StartCmd("KASPAD", - "kaspad", + c4exdRunCommand, err := StartCmd("KASPAD", + "c4exd", NetworkCliArgumentFromNetParams(&dagconfig.DevnetParams), "--appdir", appDir, "--rpclisten", rpcAddress, @@ -31,7 +31,7 @@ func RunKaspadForTesting(t *testing.T, testName string, rpcAddress string) func( isShutdown := uint64(0) go func() { - err := kaspadRunCommand.Wait() + err := c4exdRunCommand.Wait() if err != nil { if atomic.LoadUint64(&isShutdown) == 0 { panic(fmt.Sprintf("Kaspad closed unexpectedly: %s. See logs at: %s", err, appDir)) @@ -40,7 +40,7 @@ func RunKaspadForTesting(t *testing.T, testName string, rpcAddress string) func( }() return func() { - err := kaspadRunCommand.Process.Signal(syscall.SIGTERM) + err := c4exdRunCommand.Process.Signal(syscall.SIGTERM) if err != nil { t.Fatalf("Signal: %s", err) } diff --git a/stability-tests/daa/README.md b/stability-tests/daa/README.md index 8e3315e7f..17cc1d269 100644 --- a/stability-tests/daa/README.md +++ b/stability-tests/daa/README.md @@ -4,7 +4,7 @@ This tool simulates various hashrate patterns to stress-test the DAA algorithm ## Running -1. `go install` kaspad and daa. +1. `go install` c4exd and daa. 2. `cd run` 3. `./run.sh` diff --git a/stability-tests/daa/daa_test.go b/stability-tests/daa/daa_test.go index 596f141d3..e176d7fae 100644 --- a/stability-tests/daa/daa_test.go +++ b/stability-tests/daa/daa_test.go @@ -16,7 +16,7 @@ import ( ) const rpcAddress = "localhost:9000" -const miningAddress = "kaspadev:qrcqat6l9zcjsu7swnaztqzrv0s7hu04skpaezxk43y4etj8ncwfkuhy0zmax" +const miningAddress = "c4exdev:qrcqat6l9zcjsu7swnaztqzrv0s7hu04skpaezxk43y4etj8ncwfkuhy0zmax" const blockRateDeviationThreshold = 0.5 const averageBlockRateSampleSize = 60 const averageHashRateSampleSize = 100_000 @@ -181,7 +181,7 @@ func runDAATest(t *testing.T, testName string, runDuration time.Duration, t.Logf("DAA TEST STARTED: %s", testName) defer t.Logf("DAA TEST FINISHED: %s", testName) - tearDownKaspad := common.RunKaspadForTesting(t, "kaspad-daa-test", rpcAddress) + tearDownKaspad := common.RunKaspadForTesting(t, "c4exd-daa-test", rpcAddress) defer tearDownKaspad() rpcClient, err := rpcclient.NewRPCClient(rpcAddress) diff --git a/stability-tests/docker/Dockerfile b/stability-tests/docker/Dockerfile index f6f932eaf..61d22b31d 100644 --- a/stability-tests/docker/Dockerfile +++ b/stability-tests/docker/Dockerfile @@ -1,14 +1,14 @@ ARG KASPAD_IMAGE ARG KASPAMINER_IMAGE -FROM ${KASPAD_IMAGE} as kaspad -FROM ${KASPAMINER_IMAGE} as kaspaminer +FROM ${KASPAD_IMAGE} as c4exd +FROM ${KASPAMINER_IMAGE} as c4exminer FROM golang:1.19-alpine -RUN mkdir -p /go/src/github.com/c4ei/kaspad +RUN mkdir -p /go/src/github.com/c4ei/c4exd -WORKDIR /go/src/github.com/c4ei/kaspad +WORKDIR /go/src/github.com/c4ei/c4exd RUN apk add bash build-base git @@ -19,8 +19,8 @@ RUN go mod download COPY . . -COPY --from=kaspad /app/ /app/ -COPY --from=kaspaminer /app/ /app/ +COPY --from=c4exd /app/ /app/ +COPY --from=c4exminer /app/ /app/ ENV PATH="/app:${PATH}" WORKDIR /go/src/github.com/c4ei/yunseokyeol/stability-tests diff --git a/stability-tests/infra-level-garbage/README.md b/stability-tests/infra-level-garbage/README.md index 01016fbe1..943259a25 100644 --- a/stability-tests/infra-level-garbage/README.md +++ b/stability-tests/infra-level-garbage/README.md @@ -2,7 +2,7 @@ This tool sends invalid messages to a node, making sure the node does not crash as a result. ## Running - 1. `go install` kaspad and infra-level-garbage. + 1. `go install` c4exd and infra-level-garbage. 2. `cd run` 3. `./run.sh` diff --git a/stability-tests/infra-level-garbage/run/run.sh b/stability-tests/infra-level-garbage/run/run.sh index 76e70621b..26c33a68d 100755 --- a/stability-tests/infra-level-garbage/run/run.sh +++ b/stability-tests/infra-level-garbage/run/run.sh @@ -1,7 +1,7 @@ #!/bin/bash -rm -rf /tmp/kaspad-temp +rm -rf /tmp/c4exd-temp -kaspad --devnet --appdir=/tmp/kaspad-temp --profile=6061 & +c4exd --devnet --appdir=/tmp/c4exd-temp --profile=6061 & KASPAD_PID=$! sleep 1 diff --git a/stability-tests/kaspadsanity/run/run.sh b/stability-tests/kaspadsanity/run/run.sh deleted file mode 100755 index e28bb551a..000000000 --- a/stability-tests/kaspadsanity/run/run.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/bash -kaspadsanity --command-list-file ./commands-list --profile=7000 -TEST_EXIT_CODE=$? - -echo "Exit code: $TEST_EXIT_CODE" - -if [ $TEST_EXIT_CODE -eq 0 ]; then - echo "kaspadsanity test: PASSED" - exit 0 -fi -echo "kaspadsanity test: FAILED" -exit 1 diff --git a/stability-tests/many-tips/main.go b/stability-tests/many-tips/main.go index 6ebcf550d..1f9cb7fb2 100644 --- a/stability-tests/many-tips/main.go +++ b/stability-tests/many-tips/main.go @@ -14,7 +14,7 @@ import ( "github.com/c4ei/yunseokyeol/app/appmessage" "github.com/c4ei/yunseokyeol/domain/consensus/utils/mining" "github.com/c4ei/yunseokyeol/util" - "github.com/kaspanet/go-secp256k1" + "github.com/c4exnet/go-secp256k1" "github.com/c4ei/yunseokyeol/stability-tests/common" "github.com/c4ei/yunseokyeol/stability-tests/common/rpc" @@ -103,14 +103,14 @@ func realMain() error { func startNode() (teardown func(), err error) { log.Infof("Starting node") - dataDir, err := common.TempDir("kaspad-datadir") + dataDir, err := common.TempDir("c4exd-datadir") if err != nil { panic(errors.Wrapf(err, "Error in Tempdir")) } - log.Infof("kaspad datadir: %s", dataDir) + log.Infof("c4exd datadir: %s", dataDir) - kaspadCmd, err := common.StartCmd("KASPAD", - "kaspad", + c4exdCmd, err := common.StartCmd("KASPAD", + "c4exd", common.NetworkCliArgumentFromNetParams(activeConfig().NetParams()), "--appdir", dataDir, "--logdir", dataDir, @@ -125,15 +125,15 @@ func startNode() (teardown func(), err error) { processesStoppedWg := sync.WaitGroup{} processesStoppedWg.Add(1) - spawn("startNode-kaspadCmd.Wait", func() { - err := kaspadCmd.Wait() + spawn("startNode-c4exdCmd.Wait", func() { + err := c4exdCmd.Wait() if err != nil { if atomic.LoadUint64(&shutdown) == 0 { - panics.Exit(log, fmt.Sprintf("kaspadCmd closed unexpectedly: %s. See logs at: %s", err, dataDir)) + panics.Exit(log, fmt.Sprintf("c4exdCmd closed unexpectedly: %s. See logs at: %s", err, dataDir)) } if !strings.Contains(err.Error(), "signal: killed") { - // TODO: Panic here and check why sometimes kaspad closes ungracefully - log.Errorf("kaspadCmd closed with an error: %s. See logs at: %s", err, dataDir) + // TODO: Panic here and check why sometimes c4exd closes ungracefully + log.Errorf("c4exdCmd closed with an error: %s. See logs at: %s", err, dataDir) } } processesStoppedWg.Done() @@ -141,7 +141,7 @@ func startNode() (teardown func(), err error) { return func() { log.Infof("defer start-node") atomic.StoreUint64(&shutdown, 1) - killWithSigterm(kaspadCmd, "kaspadCmd") + killWithSigterm(c4exdCmd, "c4exdCmd") processesStoppedChan := make(chan struct{}) spawn("startNode-processStoppedWg.Wait", func() { @@ -227,8 +227,8 @@ func mineLoopUntilHavingOnlyOneTipInDAG(rpcClient *rpc.Client, miningAddress uti } numOfBlocksBeforeMining := dagInfo.BlockCount - kaspaMinerCmd, err := common.StartCmd("MINER", - "kaspaminer", + c4exMinerCmd, err := common.StartCmd("MINER", + "c4exminer", common.NetworkCliArgumentFromNetParams(activeConfig().NetParams()), "-s", rpcAddress, "--mine-when-not-synced", @@ -241,8 +241,8 @@ func mineLoopUntilHavingOnlyOneTipInDAG(rpcClient *rpc.Client, miningAddress uti startMiningTime := time.Now() shutdown := uint64(0) - spawn("kaspa-miner-Cmd.Wait", func() { - err := kaspaMinerCmd.Wait() + spawn("c4ex-miner-Cmd.Wait", func() { + err := c4exMinerCmd.Wait() if err != nil { if atomic.LoadUint64(&shutdown) == 0 { panics.Exit(log, fmt.Sprintf("minerCmd closed unexpectedly: %s.", err)) @@ -284,7 +284,7 @@ func mineLoopUntilHavingOnlyOneTipInDAG(rpcClient *rpc.Client, miningAddress uti numOfAddedBlocks := dagInfo.BlockCount - numOfBlocksBeforeMining log.Infof("Added %d blocks to reach this.", numOfAddedBlocks) atomic.StoreUint64(&shutdown, 1) - killWithSigterm(kaspaMinerCmd, "kaspaMinerCmd") + killWithSigterm(c4exMinerCmd, "c4exMinerCmd") return nil } diff --git a/stability-tests/mempool-limits/README.md b/stability-tests/mempool-limits/README.md index f13a0d773..73905be67 100644 --- a/stability-tests/mempool-limits/README.md +++ b/stability-tests/mempool-limits/README.md @@ -7,7 +7,7 @@ This tool: ## Running -1. `go install` kaspad and mempool-limits. +1. `go install` c4exd and mempool-limits. 2. `cd run` 3. `./run.sh` diff --git a/stability-tests/mempool-limits/config.go b/stability-tests/mempool-limits/config.go index f8a0eabce..2e31bf0e6 100644 --- a/stability-tests/mempool-limits/config.go +++ b/stability-tests/mempool-limits/config.go @@ -21,7 +21,7 @@ var ( type configFlags struct { LogLevel string `long:"loglevel" description:"Set log level {trace, debug, info, warn, error, critical}"` Profile string `long:"profile" description:"Enable HTTP profiling on given port -- NOTE port must be between 1024 and 65536"` - KaspadRPCAddress string `long:"rpc-address" description:"RPC address of the kaspad node"` + KaspadRPCAddress string `long:"rpc-address" description:"RPC address of the c4exd node"` } var cfg *configFlags diff --git a/stability-tests/mempool-limits/run/run.sh b/stability-tests/mempool-limits/run/run.sh index e3477243e..492f6b53e 100755 --- a/stability-tests/mempool-limits/run/run.sh +++ b/stability-tests/mempool-limits/run/run.sh @@ -1,11 +1,11 @@ #!/bin/bash -APPDIR=/tmp/kaspad-temp +APPDIR=/tmp/c4exd-temp KASPAD_RPC_PORT=29587 rm -rf "${APPDIR}" -kaspad --simnet --appdir="${APPDIR}" --rpclisten=0.0.0.0:"${KASPAD_RPC_PORT}" --profile=6061 & +c4exd --simnet --appdir="${APPDIR}" --rpclisten=0.0.0.0:"${KASPAD_RPC_PORT}" --profile=6061 & KASPAD_PID=$! sleep 1 diff --git a/stability-tests/mempool-limits/transactions.go b/stability-tests/mempool-limits/transactions.go index b033e5016..4a0964cea 100644 --- a/stability-tests/mempool-limits/transactions.go +++ b/stability-tests/mempool-limits/transactions.go @@ -17,11 +17,11 @@ import ( "github.com/c4ei/yunseokyeol/infrastructure/network/rpcclient" "github.com/c4ei/yunseokyeol/stability-tests/common/mine" "github.com/c4ei/yunseokyeol/util" - "github.com/kaspanet/go-secp256k1" + "github.com/c4exnet/go-secp256k1" ) const ( - payAddress = "kaspasim:qzuax2jhawd354e54thhpd9m9wg03pdzwjlpr4vtq3k7xrpumhhtwa2hkr3ep" + payAddress = "c4exsim:qzuax2jhawd354e54thhpd9m9wg03pdzwjlpr4vtq3k7xrpumhhtwa2hkr3ep" payAddressPrivateKey = "05d8f681e954a550395ee2297fc1a14f6e801f554c0b9d48cd7165a7ea72ff77" fundingCoinbaseTransactionAmount = 1000 outputsPerTransaction = 3 diff --git a/stability-tests/netsync/README.md b/stability-tests/netsync/README.md index d20ccd654..921d3444a 100644 --- a/stability-tests/netsync/README.md +++ b/stability-tests/netsync/README.md @@ -1,11 +1,11 @@ # Netsync Stability Tester This tests that the netsync is at least 5 blocks per second. -Note: the test doesn't delete kaspad's data directory and it's the user +Note: the test doesn't delete c4exd's data directory and it's the user responsibility to delete the data directories that appear in the log. ## Running - 1. `go install kaspad`. + 1. `go install c4exd`. 2. `go install ./...`. 3. `cd run` 4. `./run.sh` diff --git a/stability-tests/netsync/node.go b/stability-tests/netsync/node.go index 2be3dcaab..d87d93bc0 100644 --- a/stability-tests/netsync/node.go +++ b/stability-tests/netsync/node.go @@ -31,7 +31,7 @@ func startNode(name string, rpcAddress, listen, connect, profilePort, dataDir st log.Infof("Data directory for %s is %s", name, dataDir) args := []string{ - "kaspad", + "c4exd", common.NetworkCliArgumentFromNetParams(activeConfig().NetParams()), "--appdir", dataDir, "--logdir", dataDir, @@ -120,7 +120,7 @@ func setupNodeWithRPC(name, listen, rpcListen, connect, profilePort, dataDir str func setupSyncee() (*rpc.Client, func(), error) { const syncedProfilePort = "6061" - synceeDataDir, err := useDirOrCreateTemp(activeConfig().SynceeDataDirectory, "syncee-kaspad-data-dir") + synceeDataDir, err := useDirOrCreateTemp(activeConfig().SynceeDataDirectory, "syncee-c4exd-data-dir") if err != nil { return nil, nil, err } @@ -132,7 +132,7 @@ func setupSyncee() (*rpc.Client, func(), error) { func setupSyncer() (*rpc.Client, func(), error) { const syncerProfilePort = "6062" - syncerDataDir, err := useDirOrCreateTemp(activeConfig().SyncerDataDirectory, "syncer-kaspad-data-dir") + syncerDataDir, err := useDirOrCreateTemp(activeConfig().SyncerDataDirectory, "syncer-c4exd-data-dir") if err != nil { return nil, nil, err } diff --git a/stability-tests/orphans/README.md b/stability-tests/orphans/README.md index d712d011a..4426cc874 100644 --- a/stability-tests/orphans/README.md +++ b/stability-tests/orphans/README.md @@ -1,8 +1,8 @@ # Orphans -This tool makes sure orphan resolution works and doesn't crash kaspad +This tool makes sure orphan resolution works and doesn't crash c4exd ## Running - 1. `go install` kaspad and orphans. + 1. `go install` c4exd and orphans. 2. `cd run` 3. `./run.sh` diff --git a/stability-tests/orphans/connect_to_node.go b/stability-tests/orphans/connect_to_node.go index 0f73d4910..3efbc8d11 100644 --- a/stability-tests/orphans/connect_to_node.go +++ b/stability-tests/orphans/connect_to_node.go @@ -11,10 +11,10 @@ import ( func connectToNode() *standalone.Routes { cfg := activeConfig() - kaspadConfig := config.DefaultConfig() - kaspadConfig.NetworkFlags = cfg.NetworkFlags + c4exdConfig := config.DefaultConfig() + c4exdConfig.NetworkFlags = cfg.NetworkFlags - minimalNetAdapter, err := standalone.NewMinimalNetAdapter(kaspadConfig) + minimalNetAdapter, err := standalone.NewMinimalNetAdapter(c4exdConfig) if err != nil { fmt.Fprintf(os.Stderr, "error creating minimalNetAdapter: %+v", err) os.Exit(1) diff --git a/stability-tests/orphans/main.go b/stability-tests/orphans/main.go index 5b7c143da..0a5a69589 100644 --- a/stability-tests/orphans/main.go +++ b/stability-tests/orphans/main.go @@ -49,7 +49,7 @@ func main() { os.Exit(1) } - // Wait a second to let kaspad process orphans + // Wait a second to let c4exd process orphans <-time.After(1 * time.Second) err = checkTopBlockIsTip(rpcClient, topBlock) diff --git a/stability-tests/orphans/run/run.sh b/stability-tests/orphans/run/run.sh index efafa5bcf..e85b4f3d6 100755 --- a/stability-tests/orphans/run/run.sh +++ b/stability-tests/orphans/run/run.sh @@ -1,7 +1,7 @@ #!/bin/bash -rm -rf /tmp/kaspad-temp +rm -rf /tmp/c4exd-temp -kaspad --simnet --appdir=/tmp/kaspad-temp --profile=6061 & +c4exd --simnet --appdir=/tmp/c4exd-temp --profile=6061 & KASPAD_PID=$! sleep 1 diff --git a/stability-tests/rpc-idle-clients/run/run.sh b/stability-tests/rpc-idle-clients/run/run.sh index b21793eed..f0c7d5eb7 100755 --- a/stability-tests/rpc-idle-clients/run/run.sh +++ b/stability-tests/rpc-idle-clients/run/run.sh @@ -1,8 +1,8 @@ #!/bin/bash -rm -rf /tmp/kaspad-temp +rm -rf /tmp/c4exd-temp NUM_CLIENTS=128 -kaspad --devnet --appdir=/tmp/kaspad-temp --profile=6061 --rpcmaxwebsockets=$NUM_CLIENTS & +c4exd --devnet --appdir=/tmp/c4exd-temp --profile=6061 --rpcmaxwebsockets=$NUM_CLIENTS & KASPAD_PID=$! KASPAD_KILLED=0 function killKaspadIfNotKilled() { diff --git a/stability-tests/rpc-stability/README.md b/stability-tests/rpc-stability/README.md index 591ffb7fd..8e4d01f11 100644 --- a/stability-tests/rpc-stability/README.md +++ b/stability-tests/rpc-stability/README.md @@ -2,7 +2,7 @@ This tests JSON-RPC stability by sending the node commands and making sure it does not crash ## Running - 1. `go install` kaspad and rpc-stability. + 1. `go install` c4exd and rpc-stability. 2. `cd run` 3. `./run.sh` diff --git a/stability-tests/rpc-stability/run/run.sh b/stability-tests/rpc-stability/run/run.sh index f9546764d..9fe404f7c 100755 --- a/stability-tests/rpc-stability/run/run.sh +++ b/stability-tests/rpc-stability/run/run.sh @@ -1,7 +1,7 @@ #!/bin/bash -rm -rf /tmp/kaspad-temp +rm -rf /tmp/c4exd-temp -kaspad --devnet --appdir=/tmp/kaspad-temp --profile=6061 --loglevel=debug & +c4exd --devnet --appdir=/tmp/c4exd-temp --profile=6061 --loglevel=debug & KASPAD_PID=$! sleep 1 diff --git a/stability-tests/run/run-fast.sh b/stability-tests/run/run-fast.sh index d50cb4c2f..3df44a1be 100755 --- a/stability-tests/run/run-fast.sh +++ b/stability-tests/run/run-fast.sh @@ -14,9 +14,9 @@ echo "Running infra-level-garbage" cd "${PROJECT_ROOT}/infra-level-garbage/run" && ./run.sh || failedTests+=("infra-level-garbage") echo "Done running infra-level-garbage" -echo "Running kaspadsanity" -cd "${PROJECT_ROOT}/kaspadsanity/run" && ./run.sh || failedTests+=("kaspadsanity") -echo "Done running kaspadsanity" +echo "Running c4exdsanity" +cd "${PROJECT_ROOT}/c4exdsanity/run" && ./run.sh || failedTests+=("c4exdsanity") +echo "Done running c4exdsanity" echo "Running rpc-stability" cd "${PROJECT_ROOT}/rpc-stability/run" && ./run.sh || failedTests+=("rpc-stability") diff --git a/stability-tests/run/run-slow.sh b/stability-tests/run/run-slow.sh index b2f87c433..12892073c 100755 --- a/stability-tests/run/run-slow.sh +++ b/stability-tests/run/run-slow.sh @@ -14,9 +14,9 @@ echo "Running infra-level-garbage" cd "${PROJECT_ROOT}/infra-level-garbage/run" && ./run.sh || failedTests+=("infra-level-garbage") echo "Done running infra-level-garbage" -echo "Running kaspadsanity" -cd "${PROJECT_ROOT}/kaspadsanity/run" && ./run.sh || failedTests+=("kaspadsanity") -echo "Done running kaspadsanity" +echo "Running c4exdsanity" +cd "${PROJECT_ROOT}/c4exdsanity/run" && ./run.sh || failedTests+=("c4exdsanity") +echo "Done running c4exdsanity" echo "Running rpc-stability" cd "${PROJECT_ROOT}/rpc-stability/run" && ./run.sh || failedTests+=("rpc-stability") diff --git a/stability-tests/simple-sync/README.md b/stability-tests/simple-sync/README.md index 0253d5e3c..c4772a0d7 100644 --- a/stability-tests/simple-sync/README.md +++ b/stability-tests/simple-sync/README.md @@ -3,7 +3,7 @@ This tests that two nodes that are connected to each other stay synced while one of them mines a chain. ## Running - 1. `go install` kaspad and simple-sync. + 1. `go install` c4exd and simple-sync. 2. `cd run` 3. `./run.sh` diff --git a/stability-tests/simple-sync/mineloop.go b/stability-tests/simple-sync/mineloop.go index 5d34cec9a..e06cddf1a 100644 --- a/stability-tests/simple-sync/mineloop.go +++ b/stability-tests/simple-sync/mineloop.go @@ -7,7 +7,7 @@ import ( "github.com/c4ei/yunseokyeol/stability-tests/common" "github.com/c4ei/yunseokyeol/stability-tests/common/rpc" "github.com/c4ei/yunseokyeol/util" - "github.com/kaspanet/go-secp256k1" + "github.com/c4exnet/go-secp256k1" "github.com/pkg/errors" ) @@ -32,7 +32,7 @@ func mineLoop(syncerRPCClient, syncedRPCClient *rpc.Client) error { err = mineBlock(syncerRPCClient.Address(), miningAddr) if err != nil { // Ignore error and instead check that the block count changed correctly. - // TODO: Fix the race condition in kaspaminer so it won't panic (proper shutdown handler) + // TODO: Fix the race condition in c4exminer so it won't panic (proper shutdown handler) log.Warnf("mineBlock returned an err: %s", err) } @@ -129,8 +129,8 @@ func areTipsAreEqual(resultA, resultB *appmessage.GetBlockDAGInfoResponseMessage } func mineBlock(syncerRPCAddress string, miningAddress util.Address) error { - kaspaMinerCmd, err := common.StartCmd("MINER", - "kaspaminer", + c4exMinerCmd, err := common.StartCmd("MINER", + "c4exminer", common.NetworkCliArgumentFromNetParams(activeConfig().NetParams()), "-s", syncerRPCAddress, "--mine-when-not-synced", @@ -140,5 +140,5 @@ func mineBlock(syncerRPCAddress string, miningAddress util.Address) error { if err != nil { return err } - return errors.Wrapf(kaspaMinerCmd.Wait(), "error with command '%s'", kaspaMinerCmd) + return errors.Wrapf(c4exMinerCmd.Wait(), "error with command '%s'", c4exMinerCmd) } diff --git a/stability-tests/simple-sync/start-nodes.go b/stability-tests/simple-sync/start-nodes.go index beb3d52e1..a0ab58dff 100644 --- a/stability-tests/simple-sync/start-nodes.go +++ b/stability-tests/simple-sync/start-nodes.go @@ -24,20 +24,20 @@ func startNodes() (teardown func(), err error) { ) log.Infof("Starting nodes") - syncerDataDir, err := common.TempDir("kaspad-datadir-syncer") + syncerDataDir, err := common.TempDir("c4exd-datadir-syncer") if err != nil { panic(errors.Wrapf(err, "error in Tempdir")) } log.Infof("SYNCER datadir: %s", syncerDataDir) - syncedDataDir, err := common.TempDir("kaspad-datadir-synced") + syncedDataDir, err := common.TempDir("c4exd-datadir-synced") if err != nil { panic(errors.Wrapf(err, "error in Tempdir")) } log.Infof("SYNCED datadir: %s", syncedDataDir) syncerCmd, err := common.StartCmd("KASPAD-SYNCER", - "kaspad", + "c4exd", common.NetworkCliArgumentFromNetParams(activeConfig().NetParams()), "--appdir", syncerDataDir, "--logdir", syncerDataDir, @@ -51,7 +51,7 @@ func startNodes() (teardown func(), err error) { } syncedCmd, err := common.StartCmd("KASPAD-SYNCED", - "kaspad", + "c4exd", common.NetworkCliArgumentFromNetParams(activeConfig().NetParams()), "--appdir", syncedDataDir, "--logdir", syncedDataDir, diff --git a/start_chg.txt b/start_chg.txt index 3a88427b9..a37137c76 100644 --- a/start_chg.txt +++ b/start_chg.txt @@ -1,6 +1,6 @@ -kaspa-mainnet --> c4ex-mainnet +c4ex-mainnet --> c4ex-mainnet -/home/dev/coin/kaspad/domain/dagconfig/params.go +/home/dev/coin/c4exd/domain/dagconfig/params.go var MainnetParams = Params{ K: defaultGHOSTDAGK, Name: "c4ex-mainnet", diff --git a/testing/integration/config_test.go b/testing/integration/config_test.go index 40f97591e..1307c1bab 100644 --- a/testing/integration/config_test.go +++ b/testing/integration/config_test.go @@ -22,13 +22,13 @@ const ( rpcAddress4 = "127.0.0.1:12348" rpcAddress5 = "127.0.0.1:12349" - miningAddress1 = "kaspasim:qqqqnc0pxg7qw3qkc7l6sge8kfhsvvyt7mkw8uamtndqup27ftnd6c769gn66" + miningAddress1 = "c4exsim:qqqqnc0pxg7qw3qkc7l6sge8kfhsvvyt7mkw8uamtndqup27ftnd6c769gn66" miningAddress1PrivateKey = "0d81045b0deb2af36a25403c2154c87aa82d89dd337b575bae27ce7f5de53cee" - miningAddress2 = "kaspasim:qqqqnc0pxg7qw3qkc7l6sge8kfhsvvyt7mkw8uamtndqup27ftnd6c769gn66" + miningAddress2 = "c4exsim:qqqqnc0pxg7qw3qkc7l6sge8kfhsvvyt7mkw8uamtndqup27ftnd6c769gn66" miningAddress2PrivateKey = "0d81045b0deb2af36a25403c2154c87aa82d89dd337b575bae27ce7f5de53cee" - miningAddress3 = "kaspasim:qqq754f2gdcjcnykwuwwr60c82rh5u6mxxe7yqxljnrxz9fu0h95kduq9ezng" + miningAddress3 = "c4exsim:qqq754f2gdcjcnykwuwwr60c82rh5u6mxxe7yqxljnrxz9fu0h95kduq9ezng" miningAddress3PrivateKey = "f6c8f31fd359cbb97007034780bc4021f6ad01c6bc10499b79849efd4cc7ca39" defaultTimeout = 30 * time.Second diff --git a/testing/integration/selected_parent_chain_test.go b/testing/integration/selected_parent_chain_test.go index 3f6827cbf..f4e36acc1 100644 --- a/testing/integration/selected_parent_chain_test.go +++ b/testing/integration/selected_parent_chain_test.go @@ -10,13 +10,13 @@ import ( ) func TestVirtualSelectedParentChain(t *testing.T) { - // Setup a couple of kaspad instances - kaspad1, kaspad2, _, teardown := standardSetup(t) + // Setup a couple of c4exd instances + c4exd1, c4exd2, _, teardown := standardSetup(t) defer teardown() // Register to virtual selected parent chain changes onVirtualSelectedParentChainChangedChan := make(chan *appmessage.VirtualSelectedParentChainChangedNotificationMessage) - err := kaspad1.rpcClient.RegisterForVirtualSelectedParentChainChangedNotifications(true, + err := c4exd1.rpcClient.RegisterForVirtualSelectedParentChainChangedNotifications(true, func(notification *appmessage.VirtualSelectedParentChainChangedNotificationMessage) { onVirtualSelectedParentChainChangedChan <- notification }) @@ -24,14 +24,14 @@ func TestVirtualSelectedParentChain(t *testing.T) { t.Fatalf("Failed to register for virtual selected parent chain change notifications: %s", err) } - // In kaspad1, mine a chain over the genesis and make sure + // In c4exd1, mine a chain over the genesis and make sure // each chain changed notifications contains only one entry // in `added` and nothing in `removed` - chain1TipHash := consensushashing.BlockHash(kaspad1.config.NetParams().GenesisBlock) + chain1TipHash := consensushashing.BlockHash(c4exd1.config.NetParams().GenesisBlock) chain1TipHashString := chain1TipHash.String() const blockAmountToMine = 10 for i := 0; i < blockAmountToMine; i++ { - minedBlock := mineNextBlock(t, kaspad1) + minedBlock := mineNextBlock(t, c4exd1) notification := <-onVirtualSelectedParentChainChangedChan if len(notification.RemovedChainBlockHashes) > 0 { t.Fatalf("RemovedChainBlockHashes is unexpectedly not empty") @@ -50,16 +50,16 @@ func TestVirtualSelectedParentChain(t *testing.T) { chain1TipHashString = minedBlockHashString } - // In kaspad2, mine a different chain of `blockAmountToMine` + 1 + // In c4exd2, mine a different chain of `blockAmountToMine` + 1 // blocks over the genesis var chain2Tip *externalapi.DomainBlock for i := 0; i < blockAmountToMine+1; i++ { - chain2Tip = mineNextBlock(t, kaspad2) + chain2Tip = mineNextBlock(t, c4exd2) } - // Connect the two kaspads. This should trigger sync + // Connect the two c4exds. This should trigger sync // between the two nodes - connect(t, kaspad1, kaspad2) + connect(t, c4exd1, c4exd2) chain2TipHash := consensushashing.BlockHash(chain2Tip) chain2TipHashString := chain2TipHash.String() @@ -79,7 +79,7 @@ func TestVirtualSelectedParentChain(t *testing.T) { // Get the virtual selected parent chain from the tip of // the first chain - virtualSelectedParentChainFromChain1Tip, err := kaspad1.rpcClient.GetVirtualSelectedParentChainFromBlock( + virtualSelectedParentChainFromChain1Tip, err := c4exd1.rpcClient.GetVirtualSelectedParentChainFromBlock( chain1TipHashString, true) if err != nil { t.Fatalf("GetVirtualSelectedParentChainFromBlock failed: %s", err) diff --git a/testing/integration/tx_relay_test.go b/testing/integration/tx_relay_test.go index 884be6d16..766781ae5 100644 --- a/testing/integration/tx_relay_test.go +++ b/testing/integration/tx_relay_test.go @@ -17,7 +17,7 @@ import ( "github.com/c4ei/yunseokyeol/domain/consensus/utils/transactionhelper" "github.com/c4ei/yunseokyeol/domain/consensus/utils/txscript" "github.com/c4ei/yunseokyeol/util" - "github.com/kaspanet/go-secp256k1" + "github.com/c4exnet/go-secp256k1" ) func TestTxRelay(t *testing.T) { diff --git a/testing/integration/utxo_index_test.go b/testing/integration/utxo_index_test.go index 6cc7d875d..70079f54a 100644 --- a/testing/integration/utxo_index_test.go +++ b/testing/integration/utxo_index_test.go @@ -13,11 +13,11 @@ import ( "github.com/c4ei/yunseokyeol/domain/consensus/utils/transactionid" "github.com/c4ei/yunseokyeol/domain/consensus/utils/txscript" "github.com/c4ei/yunseokyeol/util" - "github.com/kaspanet/go-secp256k1" + "github.com/c4exnet/go-secp256k1" ) func TestUTXOIndex(t *testing.T) { - // Setup a single kaspad instance + // Setup a single c4exd instance harnessParams := &harnessParams{ p2pAddress: p2pAddress1, rpcAddress: rpcAddress1, @@ -25,17 +25,17 @@ func TestUTXOIndex(t *testing.T) { miningAddressPrivateKey: miningAddress1PrivateKey, utxoIndex: true, } - kaspad, teardown := setupHarness(t, harnessParams) + c4exd, teardown := setupHarness(t, harnessParams) defer teardown() // skip the first block because it's paying to genesis script, // which contains no outputs - mineNextBlock(t, kaspad) + mineNextBlock(t, c4exd) // Register for UTXO changes const blockAmountToMine = 100 onUTXOsChangedChan := make(chan *appmessage.UTXOsChangedNotificationMessage, blockAmountToMine) - err := kaspad.rpcClient.RegisterForUTXOsChangedNotifications([]string{miningAddress1}, func( + err := c4exd.rpcClient.RegisterForUTXOsChangedNotifications([]string{miningAddress1}, func( notification *appmessage.UTXOsChangedNotificationMessage) { onUTXOsChangedChan <- notification @@ -46,17 +46,17 @@ func TestUTXOIndex(t *testing.T) { // Mine some blocks for i := 0; i < blockAmountToMine; i++ { - mineNextBlock(t, kaspad) + mineNextBlock(t, c4exd) } //check if rewards corrosponds to circulating supply. - getCoinSupplyResponse, err := kaspad.rpcClient.GetCoinSupply() + getCoinSupplyResponse, err := c4exd.rpcClient.GetCoinSupply() if err != nil { t.Fatalf("Error Retriving Coin supply: %s", err) } rewardsMinedSompi := uint64(blockAmountToMine * constants.SompiPerKaspa * 500) - getBlockCountResponse, err := kaspad.rpcClient.GetBlockCount() + getBlockCountResponse, err := c4exd.rpcClient.GetBlockCount() if err != nil { t.Fatalf("Error Retriving BlockCount: %s", err) } @@ -89,14 +89,14 @@ func TestUTXOIndex(t *testing.T) { const transactionAmountToSpend = 5 for i := 0; i < transactionAmountToSpend; i++ { rpcTransaction := buildTransactionForUTXOIndexTest(t, notificationEntries[i]) - _, err = kaspad.rpcClient.SubmitTransaction(rpcTransaction, false) + _, err = c4exd.rpcClient.SubmitTransaction(rpcTransaction, false) if err != nil { t.Fatalf("Error submitting transaction: %s", err) } } // Mine a block to include the above transactions - mineNextBlock(t, kaspad) + mineNextBlock(t, c4exd) // Make sure this block removed the UTXOs we spent notification := <-onUTXOsChangedChan @@ -128,7 +128,7 @@ func TestUTXOIndex(t *testing.T) { // Get all the UTXOs and make sure the response is equivalent // to the data collected via notifications - utxosByAddressesResponse, err := kaspad.rpcClient.GetUTXOsByAddresses([]string{miningAddress1}) + utxosByAddressesResponse, err := c4exd.rpcClient.GetUTXOsByAddresses([]string{miningAddress1}) if err != nil { t.Fatalf("Failed to get UTXOs: %s", err) } diff --git a/testing/integration/virtual_selected_parent_blue_score_test.go b/testing/integration/virtual_selected_parent_blue_score_test.go index 2bf913cb0..012cf5b4b 100644 --- a/testing/integration/virtual_selected_parent_blue_score_test.go +++ b/testing/integration/virtual_selected_parent_blue_score_test.go @@ -7,7 +7,7 @@ import ( ) func TestVirtualSelectedParentBlueScoreAndVirtualDAAScore(t *testing.T) { - // Setup a single kaspad instance + // Setup a single c4exd instance harnessParams := &harnessParams{ p2pAddress: p2pAddress1, rpcAddress: rpcAddress1, @@ -15,11 +15,11 @@ func TestVirtualSelectedParentBlueScoreAndVirtualDAAScore(t *testing.T) { miningAddressPrivateKey: miningAddress1PrivateKey, utxoIndex: true, } - kaspad, teardown := setupHarness(t, harnessParams) + c4exd, teardown := setupHarness(t, harnessParams) defer teardown() // Make sure that the initial selected parent blue score is 0 - response, err := kaspad.rpcClient.GetVirtualSelectedParentBlueScore() + response, err := c4exd.rpcClient.GetVirtualSelectedParentBlueScore() if err != nil { t.Fatalf("Error getting virtual selected parent blue score: %s", err) } @@ -30,7 +30,7 @@ func TestVirtualSelectedParentBlueScoreAndVirtualDAAScore(t *testing.T) { // Register to virtual selected parent blue score changes onVirtualSelectedParentBlueScoreChangedChan := make(chan *appmessage.VirtualSelectedParentBlueScoreChangedNotificationMessage) - err = kaspad.rpcClient.RegisterForVirtualSelectedParentBlueScoreChangedNotifications( + err = c4exd.rpcClient.RegisterForVirtualSelectedParentBlueScoreChangedNotifications( func(notification *appmessage.VirtualSelectedParentBlueScoreChangedNotificationMessage) { onVirtualSelectedParentBlueScoreChangedChan <- notification }) @@ -41,7 +41,7 @@ func TestVirtualSelectedParentBlueScoreAndVirtualDAAScore(t *testing.T) { // Register to virtual DAA score changes onVirtualDaaScoreChangedChan := make(chan *appmessage.VirtualDaaScoreChangedNotificationMessage) - err = kaspad.rpcClient.RegisterForVirtualDaaScoreChangedNotifications( + err = c4exd.rpcClient.RegisterForVirtualDaaScoreChangedNotifications( func(notification *appmessage.VirtualDaaScoreChangedNotificationMessage) { onVirtualDaaScoreChangedChan <- notification }) @@ -53,7 +53,7 @@ func TestVirtualSelectedParentBlueScoreAndVirtualDAAScore(t *testing.T) { // report correct values const blockAmountToMine = 100 for i := 0; i < blockAmountToMine; i++ { - mineNextBlock(t, kaspad) + mineNextBlock(t, c4exd) blueScoreChangedNotification := <-onVirtualSelectedParentBlueScoreChangedChan if blueScoreChangedNotification.VirtualSelectedParentBlueScore != 1+uint64(i) { t.Fatalf("Unexpected virtual selected parent blue score. Want: %d, got: %d", @@ -67,7 +67,7 @@ func TestVirtualSelectedParentBlueScoreAndVirtualDAAScore(t *testing.T) { } // Make sure that the blue score after all that mining is as expected - response, err = kaspad.rpcClient.GetVirtualSelectedParentBlueScore() + response, err = c4exd.rpcClient.GetVirtualSelectedParentBlueScore() if err != nil { t.Fatalf("Error getting virtual selected parent blue score: %s", err) } diff --git a/util/README.md b/util/README.md index 811e8e6d8..b1d38d65c 100644 --- a/util/README.md +++ b/util/README.md @@ -2,6 +2,6 @@ util ======= [![ISC License](http://img.shields.io/badge/license-ISC-blue.svg)](https://choosealicense.com/licenses/isc/) -[![GoDoc](http://img.shields.io/badge/godoc-reference-blue.svg)](http://godoc.org/github.com/kaspanet/util) +[![GoDoc](http://img.shields.io/badge/godoc-reference-blue.svg)](http://godoc.org/github.com/c4exnet/util) -Package util provides kaspa-specific convenience functions and types. +Package util provides c4ex-specific convenience functions and types. diff --git a/util/address.go b/util/address.go index 63f6dcfe1..b3d83f4c3 100644 --- a/util/address.go +++ b/util/address.go @@ -54,10 +54,10 @@ const ( // Map from strings to Bech32 address prefix constants for parsing purposes. var stringsToBech32Prefixes = map[string]Bech32Prefix{ - "kaspa": Bech32PrefixKaspa, - "kaspadev": Bech32PrefixKaspaDev, - "kaspatest": Bech32PrefixKaspaTest, - "kaspasim": Bech32PrefixKaspaSim, + "c4ex": Bech32PrefixKaspa, + "c4exdev": Bech32PrefixKaspaDev, + "c4extest": Bech32PrefixKaspaTest, + "c4exsim": Bech32PrefixKaspaSim, } // ParsePrefix attempts to parse a Bech32 address prefix. @@ -82,7 +82,7 @@ func (prefix Bech32Prefix) String() string { } // encodeAddress returns a human-readable payment address given a network prefix -// and a payload which encodes the kaspa network and address type. It is used +// and a payload which encodes the c4ex network and address type. It is used // in both pay-to-pubkey (P2PK) and pay-to-script-hash (P2SH) address // encoding. func encodeAddress(prefix Bech32Prefix, payload []byte, version byte) string { @@ -118,7 +118,7 @@ type Address interface { Prefix() Bech32Prefix // IsForPrefix returns whether or not the address is associated with the - // passed kaspa network. + // passed c4ex network. IsForPrefix(prefix Bech32Prefix) bool } @@ -199,7 +199,7 @@ func (a *AddressPublicKey) ScriptAddress() []byte { } // IsForPrefix returns whether or not the pay-to-pubkey address is associated -// with the passed kaspa network. +// with the passed c4ex network. func (a *AddressPublicKey) IsForPrefix(prefix Bech32Prefix) bool { return a.prefix == prefix } @@ -261,7 +261,7 @@ func (a *AddressPublicKeyECDSA) ScriptAddress() []byte { } // IsForPrefix returns whether or not the pay-to-pubkey address is associated -// with the passed kaspa network. +// with the passed c4ex network. func (a *AddressPublicKeyECDSA) IsForPrefix(prefix Bech32Prefix) bool { return a.prefix == prefix } @@ -326,7 +326,7 @@ func (a *AddressScriptHash) ScriptAddress() []byte { } // IsForPrefix returns whether or not the pay-to-script-hash address is associated -// with the passed kaspa network. +// with the passed c4ex network. func (a *AddressScriptHash) IsForPrefix(prefix Bech32Prefix) bool { return a.prefix == prefix } diff --git a/util/address_test.go b/util/address_test.go index fc45d77f9..6c51068a6 100644 --- a/util/address_test.go +++ b/util/address_test.go @@ -30,8 +30,8 @@ func TestAddresses(t *testing.T) { // Positive P2PK tests. { name: "mainnet p2pk", - addr: "kaspa:qr35ennsep3hxfe7lnz5ee7j5jgmkjswsn35ennsep3hxfe7ln35cdv0dy335", - encoded: "kaspa:qr35ennsep3hxfe7lnz5ee7j5jgmkjswsn35ennsep3hxfe7ln35cdv0dy335", + addr: "c4ex:qr35ennsep3hxfe7lnz5ee7j5jgmkjswsn35ennsep3hxfe7ln35cdv0dy335", + encoded: "c4ex:qr35ennsep3hxfe7lnz5ee7j5jgmkjswsn35ennsep3hxfe7ln35cdv0dy335", valid: true, result: util.TstAddressPubKey( util.Bech32PrefixKaspa, @@ -54,8 +54,8 @@ func TestAddresses(t *testing.T) { }, { name: "mainnet p2pk 2", - addr: "kaspa:qq80qvqs0lfxuzmt7sz3909ze6camq9d4t35ennsep3hxfe7ln35cvfqgz3z8", - encoded: "kaspa:qq80qvqs0lfxuzmt7sz3909ze6camq9d4t35ennsep3hxfe7ln35cvfqgz3z8", + addr: "c4ex:qq80qvqs0lfxuzmt7sz3909ze6camq9d4t35ennsep3hxfe7ln35cvfqgz3z8", + encoded: "c4ex:qq80qvqs0lfxuzmt7sz3909ze6camq9d4t35ennsep3hxfe7ln35cvfqgz3z8", valid: true, result: util.TstAddressPubKey( util.Bech32PrefixKaspa, @@ -79,8 +79,8 @@ func TestAddresses(t *testing.T) { }, { name: "testnet p2pk", - addr: "kaspatest:qputx94qseratdmjs0j395mq8u03er0x3l35ennsep3hxfe7ln35ckquw528z", - encoded: "kaspatest:qputx94qseratdmjs0j395mq8u03er0x3l35ennsep3hxfe7ln35ckquw528z", + addr: "c4extest:qputx94qseratdmjs0j395mq8u03er0x3l35ennsep3hxfe7ln35ckquw528z", + encoded: "c4extest:qputx94qseratdmjs0j395mq8u03er0x3l35ennsep3hxfe7ln35ckquw528z", valid: true, result: util.TstAddressPubKey( util.Bech32PrefixKaspaTest, @@ -106,8 +106,8 @@ func TestAddresses(t *testing.T) { // ECDSA P2PK tests. { name: "mainnet ecdsa p2pk", - addr: "kaspa:q835ennsep3hxfe7lnz5ee7j5jgmkjswsn35ennsep3hxfe7ln35e2sm7yrlr4w", - encoded: "kaspa:q835ennsep3hxfe7lnz5ee7j5jgmkjswsn35ennsep3hxfe7ln35e2sm7yrlr4w", + addr: "c4ex:q835ennsep3hxfe7lnz5ee7j5jgmkjswsn35ennsep3hxfe7ln35e2sm7yrlr4w", + encoded: "c4ex:q835ennsep3hxfe7lnz5ee7j5jgmkjswsn35ennsep3hxfe7ln35e2sm7yrlr4w", valid: true, result: util.TstAddressPubKeyECDSA( util.Bech32PrefixKaspa, @@ -146,7 +146,7 @@ func TestAddresses(t *testing.T) { }, { name: "p2pk bad checksum", - addr: "kaspa:qr35ennsep3hxfe7lnz5ee7j5jgmkjswss74as46gx", + addr: "c4ex:qr35ennsep3hxfe7lnz5ee7j5jgmkjswss74as46gx", valid: false, passedPrefix: util.Bech32PrefixKaspa, expectedPrefix: util.Bech32PrefixKaspa, @@ -155,8 +155,8 @@ func TestAddresses(t *testing.T) { // Positive P2SH tests. { name: "mainnet p2sh", - addr: "kaspa:prq20q4qd9ulr044cauyy9wtpeupqpjv67pn2vyc6acly7xqkrjdzmh8rj9f4", - encoded: "kaspa:prq20q4qd9ulr044cauyy9wtpeupqpjv67pn2vyc6acly7xqkrjdzmh8rj9f4", + addr: "c4ex:prq20q4qd9ulr044cauyy9wtpeupqpjv67pn2vyc6acly7xqkrjdzmh8rj9f4", + encoded: "c4ex:prq20q4qd9ulr044cauyy9wtpeupqpjv67pn2vyc6acly7xqkrjdzmh8rj9f4", valid: true, result: util.TstAddressScriptHash( util.Bech32PrefixKaspa, @@ -196,8 +196,8 @@ func TestAddresses(t *testing.T) { }, { name: "mainnet p2sh 2", - addr: "kaspa:pr5vxqxg0xrwl2zvxlq9rxffqx00sm44kn5vxqxg0xrwl2zvxl5vxyhvsake2", - encoded: "kaspa:pr5vxqxg0xrwl2zvxlq9rxffqx00sm44kn5vxqxg0xrwl2zvxl5vxyhvsake2", + addr: "c4ex:pr5vxqxg0xrwl2zvxlq9rxffqx00sm44kn5vxqxg0xrwl2zvxl5vxyhvsake2", + encoded: "c4ex:pr5vxqxg0xrwl2zvxlq9rxffqx00sm44kn5vxqxg0xrwl2zvxl5vxyhvsake2", valid: true, result: util.TstAddressScriptHash( util.Bech32PrefixKaspa, @@ -221,8 +221,8 @@ func TestAddresses(t *testing.T) { }, { name: "testnet p2sh", - addr: "kaspatest:przhjdpv93xfygpqtckdc2zkzuzqeyj2pt5vxqxg0xrwl2zvxl5vx35yyy2h9", - encoded: "kaspatest:przhjdpv93xfygpqtckdc2zkzuzqeyj2pt5vxqxg0xrwl2zvxl5vx35yyy2h9", + addr: "c4extest:przhjdpv93xfygpqtckdc2zkzuzqeyj2pt5vxqxg0xrwl2zvxl5vx35yyy2h9", + encoded: "c4extest:przhjdpv93xfygpqtckdc2zkzuzqeyj2pt5vxqxg0xrwl2zvxl5vx35yyy2h9", valid: true, result: util.TstAddressScriptHash( util.Bech32PrefixKaspaTest, @@ -388,17 +388,17 @@ func TestDecodeAddressErrorConditions(t *testing.T) { "decoded address's prefix could not be parsed", }, { - "kaspasim:raskzctpv9skzctpv9skzctpv9skzctpvy37ct7zafpv9skzctpvymmnd3gh8", + "c4exsim:raskzctpv9skzctpv9skzctpv9skzctpvy37ct7zafpv9skzctpvymmnd3gh8", util.Bech32PrefixKaspaSim, "unknown address type", }, { - "kaspasim:raskzcg58mth0an", + "c4exsim:raskzcg58mth0an", util.Bech32PrefixKaspaSim, "unknown address type", }, { - "kaspatest:qqq65mvpxcmajeq44n2n8vfn6u9f8l4zsy0xez0tzw", + "c4extest:qqq65mvpxcmajeq44n2n8vfn6u9f8l4zsy0xez0tzw", util.Bech32PrefixKaspa, "decoded address is of wrong network", }, @@ -421,9 +421,9 @@ func TestParsePrefix(t *testing.T) { expectedPrefix util.Bech32Prefix expectedError bool }{ - {"kaspa", util.Bech32PrefixKaspa, false}, - {"kaspatest", util.Bech32PrefixKaspaTest, false}, - {"kaspasim", util.Bech32PrefixKaspaSim, false}, + {"c4ex", util.Bech32PrefixKaspa, false}, + {"c4extest", util.Bech32PrefixKaspaTest, false}, + {"c4exsim", util.Bech32PrefixKaspaSim, false}, {"blabla", util.Bech32PrefixUnknown, true}, {"unknown", util.Bech32PrefixUnknown, true}, {"", util.Bech32PrefixUnknown, true}, @@ -448,9 +448,9 @@ func TestPrefixToString(t *testing.T) { prefix util.Bech32Prefix expectedPrefixStr string }{ - {util.Bech32PrefixKaspa, "kaspa"}, - {util.Bech32PrefixKaspaTest, "kaspatest"}, - {util.Bech32PrefixKaspaSim, "kaspasim"}, + {util.Bech32PrefixKaspa, "c4ex"}, + {util.Bech32PrefixKaspaTest, "c4extest"}, + {util.Bech32PrefixKaspaSim, "c4exsim"}, {util.Bech32PrefixUnknown, ""}, } diff --git a/util/amount.go b/util/amount.go index 21d53e719..61536fe2c 100644 --- a/util/amount.go +++ b/util/amount.go @@ -13,12 +13,12 @@ import ( ) // AmountUnit describes a method of converting an Amount to something -// other than the base unit of a kaspa. The value of the AmountUnit +// other than the base unit of a c4ex. The value of the AmountUnit // is the exponent component of the decadic multiple to convert from -// an amount in kaspa to an amount counted in units. +// an amount in c4ex to an amount counted in units. type AmountUnit int -// These constants define various units used when describing a kaspa +// These constants define various units used when describing a c4ex // monetary amount. const ( AmountMegaKAS AmountUnit = 6 @@ -51,8 +51,8 @@ func (u AmountUnit) String() string { } } -// Amount represents the base kaspa monetary unit (colloquially referred -// to as a `Sompi'). A single Amount is equal to 1e-8 of a kaspa. +// Amount represents the base c4ex monetary unit (colloquially referred +// to as a `Sompi'). A single Amount is equal to 1e-8 of a c4ex. type Amount uint64 // round converts a floating point number, which may or may not be representable @@ -67,8 +67,8 @@ func round(f float64) Amount { } // NewAmount creates an Amount from a floating point value representing -// some value in kaspa. NewAmount errors if f is NaN or +-Infinity, but -// does not check that the amount is within the total amount of kaspa +// some value in c4ex. NewAmount errors if f is NaN or +-Infinity, but +// does not check that the amount is within the total amount of c4ex // producible as f may not refer to an amount at a single moment in time. // // NewAmount is for specifically for converting KAS to Sompi. @@ -85,14 +85,14 @@ func NewAmount(f float64) (Amount, error) { case math.IsInf(f, 1): fallthrough case math.IsInf(f, -1): - return 0, errors.New("invalid kaspa amount") + return 0, errors.New("invalid c4ex amount") } return round(f * constants.SompiPerKaspa), nil } -// ToUnit converts a monetary amount counted in kaspa base units to a -// floating point value representing an amount of kaspa. +// ToUnit converts a monetary amount counted in c4ex base units to a +// floating point value representing an amount of c4ex. func (a Amount) ToUnit(u AmountUnit) float64 { return float64(a) / math.Pow10(int(u+8)) } @@ -102,7 +102,7 @@ func (a Amount) ToKAS() float64 { return a.ToUnit(AmountKAS) } -// Format formats a monetary amount counted in kaspa base units as a +// Format formats a monetary amount counted in c4ex base units as a // string for a given unit. The conversion will succeed for any unit, // however, known units will be formated with an appended label describing // the units with SI notation, or "Sompi" for the base unit. @@ -118,7 +118,7 @@ func (a Amount) String() string { // MulF64 multiplies an Amount by a floating point value. While this is not // an operation that must typically be done by a full node or wallet, it is -// useful for services that build on top of kaspa (for example, calculating +// useful for services that build on top of c4ex (for example, calculating // a fee by multiplying by a percentage). func (a Amount) MulF64(f float64) Amount { return round(float64(a) * f) diff --git a/util/doc.go b/util/doc.go index 9846ef610..9d2525efe 100644 --- a/util/doc.go +++ b/util/doc.go @@ -1,31 +1,31 @@ /* -Package util provides kaspa-specific convenience functions and types. +Package util provides c4ex-specific convenience functions and types. # Block Overview -A Block defines a kaspa block that provides easier and more efficient +A Block defines a c4ex block that provides easier and more efficient manipulation of raw blocks. It also memoizes hashes for the block and its transactions on their first access so subsequent accesses don't have to repeat the relatively expensive hashing operations. # Tx Overview -A Tx defines a kaspa transaction that provides more efficient manipulation of +A Tx defines a c4ex transaction that provides more efficient manipulation of raw transactions. It memoizes the hash for the transaction on its first access so subsequent accesses don't have to repeat the relatively expensive hashing operations. # Address Overview -The Address interface provides an abstraction for a kaspa address. While the -most common type is a pay-to-pubkey, kaspa already supports others and +The Address interface provides an abstraction for a c4ex address. While the +most common type is a pay-to-pubkey, c4ex already supports others and may well support more in the future. This package currently provides implementations for the pay-to-pubkey, and pay-to-script-hash address types. To decode/encode an address: - addrString := "kaspa:qqj9fg59mptxkr9j0y53j5mwurcmda5mtza9n6v9pm9uj8h0wgk6uma5pvumr" + addrString := "c4ex:qqj9fg59mptxkr9j0y53j5mwurcmda5mtza9n6v9pm9uj8h0wgk6uma5pvumr" defaultPrefix := util.Bech32PrefixKaspa addr, err := util.DecodeAddress(addrString, defaultPrefix) if err != nil { diff --git a/util/example_test.go b/util/example_test.go index 68d6752f2..f366bc734 100644 --- a/util/example_test.go +++ b/util/example_test.go @@ -58,7 +58,7 @@ func ExampleNewAmount() { // Output: 1 KAS // 0.01234567 KAS // 0 KAS - // invalid kaspa amount + // invalid c4ex amount } func ExampleAmount_unitConversions() { diff --git a/util/internal_test.go b/util/internal_test.go index b28532fb5..d4d33a66a 100644 --- a/util/internal_test.go +++ b/util/internal_test.go @@ -47,21 +47,21 @@ func TstAddressScriptHash(prefix Bech32Prefix, hash [blake2b.Size256]byte) *Addr } // TstAddressSAddr returns the expected script address bytes for -// P2PK kaspa addresses. +// P2PK c4ex addresses. func TstAddressSAddrP2PK(addr string) []byte { _, decoded, _, _ := bech32.Decode(addr) return decoded[:PublicKeySize] } // TstAddressSAddr returns the expected script address bytes for -// ECDSA P2PK kaspa addresses. +// ECDSA P2PK c4ex addresses. func TstAddressSAddrP2PKECDSA(addr string) []byte { _, decoded, _, _ := bech32.Decode(addr) return decoded[:PublicKeySizeECDSA] } // TstAddressSAddrP2SH returns the expected script address bytes for -// P2SH kaspa addresses. +// P2SH c4ex addresses. func TstAddressSAddrP2SH(addr string) []byte { _, decoded, _, _ := bech32.Decode(addr) return decoded[:blake2b.Size256]