mirror of
https://github.com/kaspanet/kaspad.git
synced 2025-03-30 15:08:33 +00:00

* [NOD-241] Implement lower resolution peer rendezvous point discovery * [NOD-241] Implement lower resolution peer rendezvous point discovery * [NOD-241] Find exact rendezvous point * [NOD-241] Find exact rendezvous point * [NOD-241] Fix tests * [NOD-241] Remove hash stop from MsgBlockLocator and add tests to MsgBlockLocator and MsgGetBlockLocator * [NOD-241] Change everywhere startHash to hashStart and change comments * [NOD-241] Fix locateBlockNodes to stop at hashStop * [NOD-241] Formatted locatorSummary. * [NOD-241] Fix node reversal * [NOD-241] Fix hash start and hash stop order, and don't include startNode in dag.blockLocator * [NOD-241] rename locateBlockNodes -> getBlueBlocksBetween and add a comment to it * [NOD-241] change hash start to start hash and hash stop to stop hash * [NOD-241] Move block locator stuff to a different file * [NOD-241] Rename msggetblocks.go to msggetblockinvs.go * [NOD-241] Format project * [NOD-241] Rename rpcserverSyncManager.LocateHeaders to GetBlueBlocksHeadersBetween * [NOD-241] Move the logic of finding the highest shared block to OnBlockLocator * [NOD-241] Rename chainHeight -> nextChainHeight * [NOD-241] Fix typo in comment
33 lines
934 B
Go
33 lines
934 B
Go
package main
|
|
|
|
import (
|
|
"fmt"
|
|
"os"
|
|
|
|
"github.com/daglabs/btcd/btcec"
|
|
"github.com/daglabs/btcd/dagconfig"
|
|
"github.com/daglabs/btcd/util"
|
|
"github.com/daglabs/btcd/util/base58"
|
|
)
|
|
|
|
func main() {
|
|
activeNetParams := &dagconfig.DevNetParams
|
|
privateKey, err := btcec.NewPrivateKey(btcec.S256())
|
|
if err != nil {
|
|
fmt.Fprintf(os.Stderr, "Failed to generate private key: %s", err)
|
|
os.Exit(1)
|
|
}
|
|
fmt.Printf("\nPrivate key (base-58): %s\n", base58.Encode(privateKey.Serialize()))
|
|
wif, err := util.NewWIF(privateKey, activeNetParams.PrivateKeyID, true)
|
|
if err != nil {
|
|
panic(fmt.Sprintf("error generating wif: %s", err))
|
|
}
|
|
fmt.Printf("\nPrivate key wif: %s\n", wif)
|
|
addr, err := util.NewAddressPubKeyHashFromPublicKey(privateKey.PubKey().SerializeCompressed(), activeNetParams.Prefix)
|
|
if err != nil {
|
|
fmt.Fprintf(os.Stderr, "Failed to generate p2pkh address: %s", err)
|
|
os.Exit(1)
|
|
}
|
|
fmt.Printf("Public key: %s\n\n", addr)
|
|
}
|