github.com/quantosnetwork/Quantos@v0.0.0-20220306172517-e20b28c5a29a/main.go (about) 1 /* 2 Copyright © 2022 Quantos developers 3 4 Permission is hereby granted, free of charge, to any person obtaining a copy 5 of this software and associated documentation files (the "Software"), to deal 6 in the Software without restriction, including without limitation the rights 7 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 copies of the Software, and to permit persons to whom the Software is 9 furnished to do so, subject to the following conditions: 10 11 The above copyright notice and this permission notice shall be included in 12 all copies or substantial portions of the Software. 13 14 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 THE SOFTWARE. 21 */ 22 package main 23 24 import ( 25 "github.com/quantosnetwork/Quantos/merkle" 26 "github.com/quantosnetwork/Quantos/sdk" 27 28 "fmt" 29 "log" 30 ) 31 32 func main() { 33 /*c, err := config.Init(os.Stdout) 34 addrSDK := sdk.GetAddressSDK() 35 addrSDK.InitSDK("test") 36 var out string 37 o := addrSDK.GenerateQBITWalletAddress(out) 38 z := addrSDK.GetZeroAddress() 39 spew.Dump(z) 40 fmt.Printf("New Wallet Address (QBIT): %s \n", o) 41 if err != nil { 42 panic(err) 43 } 44 spew.Dump(c.Identity)*/ 45 46 //cmd.Execute() 47 raw, m := sdk.GetAddressSDK().GenerateMasterWalletAddress() 48 d := sdk.GetAddressSDK().DeriveFromMaster(raw, m) 49 50 log.Printf("Master Key (to unlock your wallet): %s", m) 51 log.Printf("Your wallet address (long form): %s \n", d[:40]) 52 53 content := make([]merkle.TreeContent, 5) 54 55 for i := 0; i < 5; i++ { 56 c := []byte(fmt.Sprintf("content %x", i)) 57 content[i] = merkle.TreeContent{c} 58 } 59 60 merkle.NewTree(content) 61 62 }