예제 #1
0
파일: blockchain.go 프로젝트: up4k/skycoin
//main net config
func init() {
	MainNet.PubKey = coin.MustPubKeyFromHex("02bb0be2976457d2e30a9aea9b0057b0eb9d1ad6509ef743c25c737f24d6241a99")
	//TestNet.GenesisSignature = coin.MustSigFromHex()
	MainNet.GenesisAddress = coin.MustDecodeBase58Address("26HbgWGwrToLZ6aX8VHtQmH4SPj4baQ5S3p")
	MainNet.GenesisTime = 1392584987 //set time
	MainNet.Coins = 100e6            //100 million
}
예제 #2
0
// Creates a ReadableWalletEntry given a pubkey hex string.  The Secret field
// is left empty.
func ReadableWalletEntryFromPubkey(pub string) ReadableWalletEntry {
	pubkey := coin.MustPubKeyFromHex(pub)
	addr := coin.AddressFromPubKey(pubkey)
	return ReadableWalletEntry{
		Address: addr.String(),
		Public:  pub,
	}
}
예제 #3
0
//testnet config
func init() {
	TestNet.PubKey = coin.MustPubKeyFromHex("025a3b22eb1e132a01f485119ae343342d92ab8599d9ad613a76e3b27f878bca8b")
	//TestNet.GenesisSignature = coin.MustSigFromHex()
	TestNet.GenesisAddress = cipher.MustDecodeBase58Address("26HbgWGwrToLZ6aX8VHtQmH4SPj4baQ5S3p")
	TestNet.GenesisTime = 1392584986 //set time
	TestNet.GenesisCoins = 1e12      //almost as many as Ripple
	//TestNet.GenesisSignature = coin.MustSigFromHex()
}
예제 #4
0
func WalletEntryFromReadable(w *ReadableWalletEntry) WalletEntry {
	// SimpleWallet entries are shared as a form of identification, the secret key
	// is not required
	// TODO -- fix lib/base58 to not panic on invalid input -- should
	// return error, so we can detect a broken wallet.
	if w.Address == "" {
		log.Panic("ReadableWalletEntry has no Address")
	}
	var s coin.SecKey
	if w.Secret != "" {
		s = coin.MustSecKeyFromHex(w.Secret)
	}
	return WalletEntry{
		Address: coin.MustDecodeBase58Address(w.Address),
		Public:  coin.MustPubKeyFromHex(w.Public),
		Secret:  s,
	}
}