add port to config

This commit is contained in:
fuwa
2019-06-27 12:10:28 +00:00
parent 67ed39c4c3
commit cfa6b4fc24
3 changed files with 6 additions and 8 deletions
+1
View File
@@ -31,5 +31,6 @@ const config = CryptoConfig
70,
Colors.green,
Colors.black,
34568,
['--prune-blockchain'],
);
+2
View File
@@ -28,6 +28,7 @@ class CryptoConfig {
final int splashDelay;
final Color textColor;
final Color backgroundColor;
final int port;
final List<String> extraArgs;
const CryptoConfig
(
@@ -37,6 +38,7 @@ class CryptoConfig {
this.splashDelay,
this.textColor,
this.backgroundColor,
this.port,
this.extraArgs,
);
}
+3 -8
View File
@@ -25,15 +25,10 @@ import 'dart:convert';
import 'package:http/http.dart' as http;
import 'package:flutter/foundation.dart';
Future<http.Response> rpc(String method) async {
var url = '';
if (kReleaseMode) {
url = 'http://127.0.0.1:34568/json_rpc';
} else {
url = 'http://192.168.10.101:34568/json_rpc';
}
import '../config.dart';
url = 'http://127.0.0.1:34568/json_rpc';
Future<http.Response> rpc(String method) async {
final url = 'http://127.0.0.1:${config.port}/json_rpc';
final body = json.encode
(