package example import ( "fmt" "net/http" "os" "git.bivouac.wiki/use/trade" ) func main() { // get key password from env variable passwd, exist := os.LookupEnv("KEY_PASSWD") if !exist { fmt.Println("no KEY_PASSWD environment variable") os.Exit(1) } if len(os.Args) != 1 { fmt.Println("no key path specified") os.Exit(1) } keypath := os.Args[1] // spawn trade KV trade.Load(passwd, keypath, GLOBAL_KV) // load self key or generate one // spawn server http.Serve() }