diff --git a/auth-server/config.json b/auth-server/config.json index 37906f4..886ad96 100644 --- a/auth-server/config.json +++ b/auth-server/config.json @@ -1,5 +1,7 @@ { "ContractCheckSum": "none", "AuthServerPort": 9096, - "WalletFile": "none" + "WalletFile": "none", + "EndpointUrl": "url", + "AccountSecret": "one" } \ No newline at end of file diff --git a/auth-server/logic/tools.go b/auth-server/logic/tools.go index 0565187..9b5f39c 100644 --- a/auth-server/logic/tools.go +++ b/auth-server/logic/tools.go @@ -13,6 +13,8 @@ type Config struct { ContractCheckSum string `json:"ContractCheckSum"` AuthServerPort int `json:"AuthServerPort"` WalletFile string `json:"WalletFile"` + EndpointUrl string `json:"EndpointUrl"` + AccountSecret string `json:"AccountSecret"` } func LoadConfig(pathToJsonConfig string) (Config, error) { diff --git a/auth-server/server.go b/auth-server/server.go index a074f6a..b77f80c 100644 --- a/auth-server/server.go +++ b/auth-server/server.go @@ -37,14 +37,17 @@ func main() { // contract integration fileWallet, _ := wallet.NewWalletFromFile(config.WalletFile) acc := fileWallet.Accounts[0] - // FIXME: account password should be in the config - if err := acc.Decrypt("one", keys.NEP2ScryptParams()); err != nil { + // FIXME: account password should be in the config: FIXED + // FIXME: Idk which password and url we should use + if err := acc.Decrypt(config.AccountSecret, keys.NEP2ScryptParams()); err != nil { log.Fatal("Wallet decryption failed") } defer fileWallet.Close() - // FIXME: endpoint url should be in the config - rpcClient, _ := rpcclient.New(context.Background(), "url", rpcclient.Options{}) + // FIXME: endpoint url should be in the config FIXED + // FIXME: Idk which password and url we should use + // In idea we need an rpc-server(?) + rpcClient, _ := rpcclient.New(context.Background(), config.EndpointUrl, rpcclient.Options{}) rpcActor, _ := actor.NewSimple(rpcClient, fileWallet.Accounts[0]) // smart contract check sum