You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

24 lines
470 B

  1. package main
  2. import (
  3. "encoding/json"
  4. "io/ioutil"
  5. )
  6. type Config struct {
  7. User string `json:"user"`
  8. Pass string `json:"pass"`
  9. Host string `json:"host"`
  10. Port string `json:"port"`
  11. GenesisTx string `json:"genesisTx"`
  12. GenesisBlock string `json:"genesisBlock"`
  13. }
  14. var config Config
  15. func readConfig(path string) {
  16. file, err := ioutil.ReadFile(path)
  17. check(err)
  18. content := string(file)
  19. json.Unmarshal([]byte(content), &config)
  20. }