fixed geth data folder path

Former-commit-id: 35b3013f3d
This commit is contained in:
Adrian Tiberius 2016-02-28 12:56:00 +02:00
parent 7043f0526f
commit 9e46cf1bb9
1 changed files with 10 additions and 1 deletions

View File

@ -5,11 +5,13 @@ import com.facebook.react.ReactPackage;
import com.facebook.react.shell.MainReactPackage; import com.facebook.react.shell.MainReactPackage;
import com.rt2zz.reactnativecontacts.ReactNativeContacts; import com.rt2zz.reactnativecontacts.ReactNativeContacts;
import android.os.Bundle; import android.os.Bundle;
import android.os.Environment;
import com.github.ethereum.go_ethereum.cmd.Geth; import com.github.ethereum.go_ethereum.cmd.Geth;
import java.util.Arrays; import java.util.Arrays;
import java.util.List; import java.util.List;
import java.util.Properties; import java.util.Properties;
import java.io.File;
import com.i18n.reactnativei18n.ReactNativeI18n; import com.i18n.reactnativei18n.ReactNativeI18n;
@ -29,10 +31,17 @@ public class MainActivity extends ReactActivity {
properties.setProperty("http.nonProxyHosts", "localhost|127.0.0.1"); properties.setProperty("http.nonProxyHosts", "localhost|127.0.0.1");
properties.setProperty("https.nonProxyHosts", "localhost|127.0.0.1"); properties.setProperty("https.nonProxyHosts", "localhost|127.0.0.1");
String dataFolder = null;
File extStore = Environment.getExternalStorageDirectory();
if (extStore.exists()) {
dataFolder = extStore.getAbsolutePath();
} else {
dataFolder = getApplicationInfo().dataDir;
}
// Launch! // Launch!
new Thread(new Runnable() { new Thread(new Runnable() {
public void run() { public void run() {
Geth.run("--bootnodes \"enode://dead745c1dbcde518b48e52aca1e8d5ba666005a2c8804e39826c6080fb11c1e8abe41d1e41896e871f204f790a90fa9781744cccecf492212192a7c56e7673b@rpc0.syng.io:40404\" --shh --ipcdisable --nodiscover --rpc --rpcapi \"db,eth,net,web3\" --fast --datadir=" + getFilesDir().getAbsolutePath()); Geth.run("--bootnodes \"enode://dead745c1dbcde518b48e52aca1e8d5ba666005a2c8804e39826c6080fb11c1e8abe41d1e41896e871f204f790a90fa9781744cccecf492212192a7c56e7673b@rpc0.syng.io:40404\" --shh --ipcdisable --nodiscover --rpc --rpcapi \"db,eth,net,web3\" --fast --datadir=" + dataFolder);
} }
}).start(); }).start();
} }