[#28] Make storage node configurable

To run storage node at dev-env environment it should have
configurable parameters. To keep `cfg` structures we can
read configuration from env and yml config file with viper
and parse values such as script hashes, fees, keys into
`cfg` structures.

Signed-off-by: Alex Vanin <alexey@nspcc.ru>
This commit is contained in:
Alex Vanin 2020-09-16 10:45:08 +03:00
parent 001a23eb31
commit 86b9aefcae
8 changed files with 123 additions and 149 deletions

View file

@ -10,7 +10,7 @@ import (
func initGRPC(c *cfg) {
var err error
c.cfgGRPC.listener, err = net.Listen("tcp", c.cfgGRPC.endpoint)
c.cfgGRPC.listener, err = net.Listen("tcp", c.viper.GetString(cfgListenAddress))
fatalOnErr(err)
c.cfgGRPC.server = grpc.NewServer()