示例#1
0
func main() {
	flag.Parse()

	logger := log.New(os.Stdout, "", log.Ltime|log.Llongfile)
	logger.Println(valout, valout)

	params := btcbuilder.BuilderParams{
		Fee:      int64(*fee),
		DustAmnt: 546,
		InTarget: int64(*valout),
	}

	btcparams, err := btcbuilder.NetParamsFromStr(*network)
	if err != nil {
		logger.Fatal(err)
	}
	params = btcbuilder.SetParams(btcparams.Net, params)

	single := btcbuilder.NewPayToPubKeyHash(params, 1)
	fmt.Println(single.Summarize())
	list := []btcbuilder.TxBuilder{
		single,
	}
	fanout := btcbuilder.NewFanOutBuilder(params, list, *numouts)

	fmt.Println(btcbuilder.Send(fanout, params))
}
示例#2
0
func main() {
	logger = log.New(os.Stdout, "", log.Ltime)
	bp := btcbuilder.BuilderParams{
		InTarget: 110000,
		Fee:      10000,
		DustAmnt: 546,
		Logger:   logger,
	}
	params = btcbuilder.SetParams(btcwire.TestNet3, bp)

	defer params.Client.Shutdown()

	http.HandleFunc("/", handler)
	where := "0.0.0.0:1050"
	logger.Printf("Listening on %s\n", where)
	err := http.ListenAndServeTLS(where, "cert.pem", "key.pem", nil)
	//err := http.ListenAndServe(where, nil)
	if err != nil {
		logger.Fatal(err)
	}
}