2020-08-21 15:01:59 +00:00
|
|
|
package main
|
|
|
|
|
2020-08-22 11:03:45 +00:00
|
|
|
import (
|
|
|
|
"context"
|
2020-08-22 14:17:03 +00:00
|
|
|
"crypto/ecdsa"
|
2020-08-22 11:03:45 +00:00
|
|
|
"sync"
|
2020-08-22 14:17:03 +00:00
|
|
|
|
|
|
|
crypto "github.com/nspcc-dev/neofs-crypto"
|
2020-08-22 11:03:45 +00:00
|
|
|
)
|
|
|
|
|
2020-08-21 15:01:59 +00:00
|
|
|
type cfg struct {
|
2020-08-22 11:03:45 +00:00
|
|
|
ctx context.Context
|
|
|
|
|
|
|
|
wg *sync.WaitGroup
|
|
|
|
|
2020-08-21 15:01:59 +00:00
|
|
|
grpcAddr string
|
2020-08-22 14:17:03 +00:00
|
|
|
|
|
|
|
key *ecdsa.PrivateKey
|
2020-08-21 15:01:59 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func defaultCfg() *cfg {
|
2020-08-22 14:17:03 +00:00
|
|
|
key, err := crypto.LoadPrivateKey("Kwk6k2eC3L3QuPvD8aiaNyoSXgQ2YL1bwS5CP1oKoA9waeAze97s")
|
|
|
|
fatalOnErr(err)
|
|
|
|
|
2020-08-21 15:01:59 +00:00
|
|
|
return &cfg{
|
2020-08-22 11:03:45 +00:00
|
|
|
ctx: context.Background(),
|
|
|
|
wg: new(sync.WaitGroup),
|
|
|
|
grpcAddr: "127.0.0.1:50501",
|
2020-08-22 14:17:03 +00:00
|
|
|
key: key,
|
2020-08-21 15:01:59 +00:00
|
|
|
}
|
|
|
|
}
|