mirror of
https://github.com/status-im/status-react.git
synced 2025-02-20 06:39:22 +00:00
Set FLEET in env variable
Signed-off-by: Igor Mandrigin <i@mandrigin.ru>
This commit is contained in:
parent
7ecf1465b1
commit
f054830533
1
.env
1
.env
@ -4,6 +4,7 @@ OFFLINE_INBOX_ENABLED=1
|
|||||||
RPC_NETWORKS_ONLY=1
|
RPC_NETWORKS_ONLY=1
|
||||||
LOG_LEVEL=debug
|
LOG_LEVEL=debug
|
||||||
LOG_LEVEL_STATUS_GO=info
|
LOG_LEVEL_STATUS_GO=info
|
||||||
|
FLEET=eth.beta
|
||||||
QUEUE_MESSAGE_ENABLED=1
|
QUEUE_MESSAGE_ENABLED=1
|
||||||
RN_BRIDGE_THRESHOLD_WARNINGS=0
|
RN_BRIDGE_THRESHOLD_WARNINGS=0
|
||||||
POW_TARGET=0.002
|
POW_TARGET=0.002
|
||||||
|
1
.env.e2e
1
.env.e2e
@ -3,6 +3,7 @@ ETHEREUM_DEV_CLUSTER=1
|
|||||||
OFFLINE_INBOX_ENABLED=1
|
OFFLINE_INBOX_ENABLED=1
|
||||||
LOG_LEVEL=debug
|
LOG_LEVEL=debug
|
||||||
LOG_LEVEL_STATUS_GO=info
|
LOG_LEVEL_STATUS_GO=info
|
||||||
|
FLEET=eth.beta
|
||||||
JSC_ENABLED=1
|
JSC_ENABLED=1
|
||||||
QUEUE_MESSAGE_ENABLED=1
|
QUEUE_MESSAGE_ENABLED=1
|
||||||
RN_BRIDGE_THRESHOLD_WARNINGS=0
|
RN_BRIDGE_THRESHOLD_WARNINGS=0
|
||||||
|
@ -3,6 +3,7 @@ ETHEREUM_DEV_CLUSTER=1
|
|||||||
OFFLINE_INBOX_ENABLED=1
|
OFFLINE_INBOX_ENABLED=1
|
||||||
LOG_LEVEL=debug
|
LOG_LEVEL=debug
|
||||||
LOG_LEVEL_STATUS_GO=info
|
LOG_LEVEL_STATUS_GO=info
|
||||||
|
FLEET=eth.beta
|
||||||
JSC_ENABLED=1
|
JSC_ENABLED=1
|
||||||
QUEUE_MESSAGE_ENABLED=1
|
QUEUE_MESSAGE_ENABLED=1
|
||||||
RN_BRIDGE_THRESHOLD_WARNINGS=0
|
RN_BRIDGE_THRESHOLD_WARNINGS=0
|
||||||
|
@ -3,6 +3,7 @@ ETHEREUM_DEV_CLUSTER=1
|
|||||||
OFFLINE_INBOX_ENABLED=1
|
OFFLINE_INBOX_ENABLED=1
|
||||||
LOG_LEVEL=debug
|
LOG_LEVEL=debug
|
||||||
LOG_LEVEL_STATUS_GO=info
|
LOG_LEVEL_STATUS_GO=info
|
||||||
|
FLEET=eth.beta
|
||||||
JSC_ENABLED=1
|
JSC_ENABLED=1
|
||||||
QUEUE_MESSAGE_ENABLED=1
|
QUEUE_MESSAGE_ENABLED=1
|
||||||
RN_BRIDGE_THRESHOLD_WARNINGS=0
|
RN_BRIDGE_THRESHOLD_WARNINGS=0
|
||||||
|
19
.env.nightly.staging.fleet
Normal file
19
.env.nightly.staging.fleet
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
TESTFAIRY_ENABLED=1
|
||||||
|
ETHEREUM_DEV_CLUSTER=1
|
||||||
|
OFFLINE_INBOX_ENABLED=1
|
||||||
|
LOG_LEVEL=debug
|
||||||
|
LOG_LEVEL_STATUS_GO=info
|
||||||
|
FLEET=eth.staging
|
||||||
|
JSC_ENABLED=1
|
||||||
|
QUEUE_MESSAGE_ENABLED=1
|
||||||
|
RN_BRIDGE_THRESHOLD_WARNINGS=0
|
||||||
|
TESTFAIRY_TOKEN=969f6c921cb435cea1d41d1ea3f5b247d6026d55
|
||||||
|
POW_TARGET=0.002
|
||||||
|
POW_TIME=1
|
||||||
|
DEFAULT_NETWORK=mainnet_rpc
|
||||||
|
INSTABUG_TOKEN=758630ed52864cbad9c5eeeac596c60c
|
||||||
|
DEBUG_WEBVIEW=1
|
||||||
|
INSTABUG_SURVEYS=1
|
||||||
|
GROUP_CHATS_ENABLED=0
|
||||||
|
SPAM_BUTTON_DETECTION_ENABLED=1
|
||||||
|
MAINNET_WARNING_ENABLED=1
|
@ -5,6 +5,7 @@ OFFLINE_INBOX_ENABLED=1
|
|||||||
RPC_NETWORKS_ONLY=1
|
RPC_NETWORKS_ONLY=1
|
||||||
LOG_LEVEL=info
|
LOG_LEVEL=info
|
||||||
LOG_LEVEL_STATUS_GO=
|
LOG_LEVEL_STATUS_GO=
|
||||||
|
FLEET=eth.beta
|
||||||
QUEUE_MESSAGE_ENABLED=0
|
QUEUE_MESSAGE_ENABLED=0
|
||||||
RN_BRIDGE_THRESHOLD_WARNINGS=0
|
RN_BRIDGE_THRESHOLD_WARNINGS=0
|
||||||
POW_TARGET=0.002
|
POW_TARGET=0.002
|
||||||
|
179
ci/Jenkinsfile.nightly_fastlane_staging_fleet
Normal file
179
ci/Jenkinsfile.nightly_fastlane_staging_fleet
Normal file
@ -0,0 +1,179 @@
|
|||||||
|
// We need nightly builds for users who want to test apps, diawi removes old builds and limits downloads, hence the need for Artifactory.
|
||||||
|
// To see env: echo sh(returnStdout: true, script: 'env')
|
||||||
|
properties([
|
||||||
|
buildDiscarder(logRotator(
|
||||||
|
numToKeepStr: '30',
|
||||||
|
daysToKeepStr: '30',
|
||||||
|
))
|
||||||
|
])
|
||||||
|
|
||||||
|
env.LANG="en_US.UTF-8"
|
||||||
|
env.LANGUAGE="en_US.UTF-8"
|
||||||
|
env.LC_ALL="en_US.UTF-8"
|
||||||
|
env.FASTLANE_DISABLE_COLORS=1
|
||||||
|
env.REALM_DISABLE_ANALYTICS=1
|
||||||
|
|
||||||
|
def installJSDeps() {
|
||||||
|
def attempt = 1
|
||||||
|
def maxAttempts = 10
|
||||||
|
def installed = false
|
||||||
|
while (!installed && attempt <= maxAttempts) {
|
||||||
|
println "#${attempt} attempt to install npm deps"
|
||||||
|
sh 'npm install'
|
||||||
|
installed = fileExists('node_modules/web3/index.js')
|
||||||
|
attemp = attempt + 1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
timeout(90) {
|
||||||
|
node ('fastlane'){
|
||||||
|
def apkUrl = ''
|
||||||
|
def testApkUrl = ''
|
||||||
|
def ipaUrl = ''
|
||||||
|
def version
|
||||||
|
def build_no
|
||||||
|
|
||||||
|
load "$HOME/env.groovy"
|
||||||
|
|
||||||
|
try {
|
||||||
|
|
||||||
|
stage('Git & Dependencies') {
|
||||||
|
slackSend color: 'good', message: 'Nightly build started. ' + env.BUILD_URL
|
||||||
|
|
||||||
|
checkout scm
|
||||||
|
|
||||||
|
sh 'git fetch --tags'
|
||||||
|
sh 'rm -rf node_modules'
|
||||||
|
sh 'cp .env.nightly.staging.fleet .env'
|
||||||
|
|
||||||
|
sh 'scripts/prepare-for-platform.sh mobile'
|
||||||
|
version = readFile("${env.WORKSPACE}/VERSION").trim()
|
||||||
|
installJSDeps()
|
||||||
|
|
||||||
|
sh 'mvn -f modules/react-native-status/ios/RCTStatus dependency:unpack'
|
||||||
|
sh 'cd ios && pod install && cd ..'
|
||||||
|
}
|
||||||
|
|
||||||
|
stage('Tag Build') {
|
||||||
|
withCredentials([[
|
||||||
|
$class: 'UsernamePasswordMultiBinding',
|
||||||
|
credentialsId: 'status-im-auto',
|
||||||
|
usernameVariable: 'GIT_USER',
|
||||||
|
passwordVariable: 'GIT_PASS'
|
||||||
|
]]) {
|
||||||
|
build_no = sh(
|
||||||
|
returnStdout: true,
|
||||||
|
script: './scripts/build_no.sh --increment'
|
||||||
|
).trim()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
stage('Tests') {
|
||||||
|
sh 'lein test-cljs'
|
||||||
|
}
|
||||||
|
|
||||||
|
stage('Build') {
|
||||||
|
sh 'lein prod-build'
|
||||||
|
}
|
||||||
|
|
||||||
|
stage('Build (Android)') {
|
||||||
|
sh 'cd android && ./gradlew react-native-android:installArchives && ./gradlew assembleRelease'
|
||||||
|
}
|
||||||
|
|
||||||
|
stage('Deploy (Android)') {
|
||||||
|
def artifact_dir = pwd() + '/android/app/build/outputs/apk/release/'
|
||||||
|
println (artifact_dir + 'app-release.apk')
|
||||||
|
def artifact = (artifact_dir + 'app-release.apk')
|
||||||
|
def server = Artifactory.server('artifacts')
|
||||||
|
shortCommit = sh(returnStdout: true, script: 'git rev-parse HEAD').trim().take(6)
|
||||||
|
def filename = 'im.status.ethereum-' + shortCommit + '-n-fl' + '.apk'
|
||||||
|
def newArtifact = (artifact_dir + filename)
|
||||||
|
sh ('cp ' + artifact + ' ' + newArtifact)
|
||||||
|
def uploadSpec = '{ "files": [ { "pattern": "*apk/release/' + filename + '", "target": "nightlies-local" }]}'
|
||||||
|
def buildInfo = server.upload(uploadSpec)
|
||||||
|
apkUrl = 'http://artifacts.status.im:8081/artifactory/nightlies-local/' + filename
|
||||||
|
|
||||||
|
sh ('echo ARTIFACT Android: ' + apkUrl)
|
||||||
|
withCredentials([
|
||||||
|
string(
|
||||||
|
credentialsId: "SUPPLY_JSON_KEY_DATA",
|
||||||
|
variable: 'GOOGLE_PLAY_JSON_KEY'
|
||||||
|
),
|
||||||
|
string(
|
||||||
|
credentialsId: "SLACK_URL",
|
||||||
|
variable: 'SLACK_URL'
|
||||||
|
)
|
||||||
|
]) {
|
||||||
|
sh ('bundle exec fastlane android nightly')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
stage('Build & TestFlight (iOS)') {
|
||||||
|
withCredentials([
|
||||||
|
string(credentialsId: "slave-pass-${env.NODE_NAME}", variable: 'KEYCHAIN_PASSWORD'),
|
||||||
|
string(credentialsId: "SLACK_URL", variable: 'SLACK_URL'),
|
||||||
|
string(credentialsId: 'FASTLANE_PASSWORD', variable: 'FASTLANE_PASSWORD'),
|
||||||
|
string(credentialsId: 'APPLE_ID', variable: 'APPLE_ID'),
|
||||||
|
string(credentialsId: 'fastlane-match-password', variable:'MATCH_PASSWORD')]) {
|
||||||
|
|
||||||
|
sh "plutil -replace CFBundleShortVersionString -string ${version} ios/StatusIm/Info.plist"
|
||||||
|
sh "plutil -replace CFBundleVersion -string ${build_no} ios/StatusIm/Info.plist"
|
||||||
|
sh 'fastlane ios nightly'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
stage('Deploy diawi (iOS)') {
|
||||||
|
withCredentials([
|
||||||
|
string(credentialsId: 'diawi-token', variable: 'DIAWI_TOKEN'),
|
||||||
|
string(credentialsId: 'GIT_HUB_TOKEN', variable: 'GITHUB_TOKEN'),
|
||||||
|
string(credentialsId: 'SLACK_JENKINS_WEBHOOK', variable: 'SLACK_URL')
|
||||||
|
]) {
|
||||||
|
sh 'fastlane ios upload_diawi'
|
||||||
|
|
||||||
|
env.WORKSPACE = pwd()
|
||||||
|
ipaUrl = readFile "${env.WORKSPACE}/fastlane/diawi.out"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
slackSend color: 'bad', message: 'Nightly build (develop) failed to build. ' + env.BUILD_URL
|
||||||
|
throw e
|
||||||
|
}
|
||||||
|
|
||||||
|
stage('Run status-nightly-publish-link job') {
|
||||||
|
build(
|
||||||
|
job: 'misc/status-im.github.io-update_env',
|
||||||
|
parameters: [
|
||||||
|
[$class: 'StringParameterValue', name: 'APK_URL', value: apkUrl],
|
||||||
|
[$class: 'StringParameterValue', name: 'IOS_URL', value: ipaUrl]
|
||||||
|
]
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
stage('Build (Android) for e2e tests') {
|
||||||
|
sh 'cd android && mv app/build/outputs/apk/release/app-release.apk app/build/outputs/apk/release/app-release.original.apk && ENVFILE=.env.e2e ./gradlew assembleRelease'
|
||||||
|
}
|
||||||
|
|
||||||
|
stage('Upload apk for e2e tests') {
|
||||||
|
env.SAUCE_LABS_APK = 'im.status.ethereum-e2e-' + shortCommit + '.apk'
|
||||||
|
withCredentials([
|
||||||
|
string(credentialsId: 'SAUCE_ACCESS_KEY', variable: 'SAUCE_ACCESS_KEY'),
|
||||||
|
string(credentialsId: 'SAUCE_USERNAME', variable: 'SAUCE_USERNAME'),
|
||||||
|
string(credentialsId: 'diawi-token', variable: 'DIAWI_TOKEN'),
|
||||||
|
string(credentialsId: 'GIT_HUB_TOKEN', variable: 'GITHUB_TOKEN'),
|
||||||
|
string(credentialsId: 'SLACK_JENKINS_WEBHOOK', variable: 'SLACK_URL')
|
||||||
|
]) {
|
||||||
|
sh 'fastlane android saucelabs'
|
||||||
|
sh 'fastlane android upload_diawi'
|
||||||
|
testApkUrl = readFile "${env.WORKSPACE}/fastlane/diawi.out"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
stage('Slack Notification') {
|
||||||
|
slackSend color: 'good', message: 'Nightly build (develop) \nAndroid: ' + apkUrl + '\n iOS: ' + ipaUrl + '\n Android for e2e: ' + testApkUrl
|
||||||
|
}
|
||||||
|
|
||||||
|
stage('Run extended e2e tests') {
|
||||||
|
build job: 'end-to-end-tests/status-app-nightly', parameters: [string(name: 'apk', value: '--apk=' + env.SAUCE_LABS_APK)], wait: false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -43,6 +43,7 @@ timeout(90) {
|
|||||||
sh 'echo MAINNET_NETWORKS_ENABLED=' + MAINNET_NETWORKS_ENABLED + '>>' + '.env'
|
sh 'echo MAINNET_NETWORKS_ENABLED=' + MAINNET_NETWORKS_ENABLED + '>>' + '.env'
|
||||||
sh 'echo LOG_LEVEL=' + LOG_LEVEL + '>>' + '.env'
|
sh 'echo LOG_LEVEL=' + LOG_LEVEL + '>>' + '.env'
|
||||||
sh 'echo LOG_LEVEL_STATUS_GO=' + LOG_LEVEL_STATUS_GO + '>>' + '.env'
|
sh 'echo LOG_LEVEL_STATUS_GO=' + LOG_LEVEL_STATUS_GO + '>>' + '.env'
|
||||||
|
sh 'echo FLEET=' + FLEET + '>>' + '.env'
|
||||||
sh 'echo OFFLINE_INBOX_ENABLED=' + OFFLINE_INBOX_ENABLED + '>>' + '.env'
|
sh 'echo OFFLINE_INBOX_ENABLED=' + OFFLINE_INBOX_ENABLED + '>>' + '.env'
|
||||||
sh 'echo POW_TARGET=' + POW_TARGET + '>>' + '.env'
|
sh 'echo POW_TARGET=' + POW_TARGET + '>>' + '.env'
|
||||||
sh 'echo POW_TIME=' + POW_TIME + '>>' + '.env'
|
sh 'echo POW_TIME=' + POW_TIME + '>>' + '.env'
|
||||||
|
@ -16,7 +16,7 @@ dependencies {
|
|||||||
implementation 'com.instabug.library:instabug:3+'
|
implementation 'com.instabug.library:instabug:3+'
|
||||||
implementation 'status-im:function:0.0.1'
|
implementation 'status-im:function:0.0.1'
|
||||||
|
|
||||||
String statusGoVersion = 'tags-v0.11.0^0-g4afd9e6c-302'
|
String statusGoVersion = 'develop-g19b53030'
|
||||||
final String statusGoGroup = 'status-im', statusGoName = 'status-go'
|
final String statusGoGroup = 'status-im', statusGoName = 'status-go'
|
||||||
|
|
||||||
// Check if the local status-go jar exists, and compile against that if it does
|
// Check if the local status-go jar exists, and compile against that if it does
|
||||||
|
@ -38,6 +38,8 @@ class StatusModule extends ReactContextBaseJavaModule implements LifecycleEventL
|
|||||||
|
|
||||||
private static final String TAG = "StatusModule";
|
private static final String TAG = "StatusModule";
|
||||||
|
|
||||||
|
private final static int TESTNET_NETWORK_ID = 3;
|
||||||
|
|
||||||
private HashMap<String, Callback> callbacks = new HashMap<>();
|
private HashMap<String, Callback> callbacks = new HashMap<>();
|
||||||
|
|
||||||
private static StatusModule module;
|
private static StatusModule module;
|
||||||
@ -115,7 +117,7 @@ class StatusModule extends ReactContextBaseJavaModule implements LifecycleEventL
|
|||||||
this.getReactApplicationContext().getJSModule(DeviceEventManagerModule.RCTDeviceEventEmitter.class).emit("gethEvent", params);
|
this.getReactApplicationContext().getJSModule(DeviceEventManagerModule.RCTDeviceEventEmitter.class).emit("gethEvent", params);
|
||||||
}
|
}
|
||||||
|
|
||||||
private String prepareLogsFile() {
|
private static String prepareLogsFile() {
|
||||||
String gethLogFileName = "geth.log";
|
String gethLogFileName = "geth.log";
|
||||||
File pubDirectory = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS);
|
File pubDirectory = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS);
|
||||||
File logFile = new File(pubDirectory, gethLogFileName);
|
File logFile = new File(pubDirectory, gethLogFileName);
|
||||||
@ -151,12 +153,96 @@ class StatusModule extends ReactContextBaseJavaModule implements LifecycleEventL
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void doStartNode(final String defaultConfig) {
|
private String generateConfig(final String dataDir, final int networkId, final String keystoreDir, final String fleet, final Object upstreamConfig) throws JSONException {
|
||||||
|
|
||||||
|
JSONObject jsonConfig = new JSONObject(
|
||||||
|
Statusgo.GenerateConfig(dataDir, fleet, networkId));
|
||||||
|
|
||||||
|
jsonConfig.put("NetworkId", networkId);
|
||||||
|
jsonConfig.put("DataDir", dataDir);
|
||||||
|
jsonConfig.put("KeyStoreDir", keystoreDir);
|
||||||
|
|
||||||
|
if (upstreamConfig != null) {
|
||||||
|
Log.d(TAG, "UpstreamConfig is not null");
|
||||||
|
jsonConfig.put("UpstreamConfig", upstreamConfig);
|
||||||
|
}
|
||||||
|
|
||||||
|
final String gethLogFilePath = TextUtils.isEmpty(this.logLevel) ? null : prepareLogsFile();
|
||||||
|
final boolean logsEnabled = (gethLogFilePath != null);
|
||||||
|
|
||||||
|
jsonConfig.put("LogEnabled", logsEnabled);
|
||||||
|
jsonConfig.put("LogFile", gethLogFilePath);
|
||||||
|
jsonConfig.put("LogLevel", TextUtils.isEmpty(this.logLevel) ? "ERROR" : this.logLevel.toUpperCase());
|
||||||
|
|
||||||
|
|
||||||
|
// Setting up whisper config
|
||||||
|
JSONObject whisperConfig = jsonConfig.optJSONObject("WhisperConfig");
|
||||||
|
if (whisperConfig == null) {
|
||||||
|
whisperConfig = new JSONObject();
|
||||||
|
}
|
||||||
|
whisperConfig.put("LightClient", true);
|
||||||
|
jsonConfig.put("WhisperConfig", whisperConfig);
|
||||||
|
|
||||||
|
|
||||||
|
// Setting up cluster config
|
||||||
|
JSONObject clusterConfig = jsonConfig.optJSONObject("ClusterConfig");
|
||||||
|
if (clusterConfig != null) {
|
||||||
|
Log.d(TAG, "ClusterConfig is not null");
|
||||||
|
clusterConfig.put("Fleet", fleet);
|
||||||
|
jsonConfig.put("ClusterConfig", clusterConfig);
|
||||||
|
} else {
|
||||||
|
Log.w(TAG, "ClusterConfig: Cannot find ClusterConfig: doesn't exist or not a JSON object");
|
||||||
|
Log.w(TAG, "ClusterConfig: Fleet will be set to defaults");
|
||||||
|
}
|
||||||
|
|
||||||
|
return jsonConfig.toString();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private String generateConfigFromDefaultConfig(final String root, final String keystoreDir, final String fleet, final String defaultConfig) {
|
||||||
|
try {
|
||||||
|
JSONObject customConfig = new JSONObject(defaultConfig);
|
||||||
|
|
||||||
|
// parameters from config
|
||||||
|
final String dataDir = root + customConfig.get("DataDir");
|
||||||
|
final int networkId = customConfig.getInt("NetworkId");
|
||||||
|
final Object upstreamConfig = customConfig.opt("UpstreamConfig");
|
||||||
|
|
||||||
|
return generateConfig(dataDir, networkId, keystoreDir, fleet, upstreamConfig);
|
||||||
|
|
||||||
|
} catch (JSONException e) {
|
||||||
|
Log.d(TAG, "Something went wrong " + e.getMessage());
|
||||||
|
Log.d(TAG, "Default configuration will be used: ropsten, beta fleet");
|
||||||
|
return Statusgo.GenerateConfig(this.getTestnetDataDir(root), "eth.beta", TESTNET_NETWORK_ID);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void prettyPrintConfig(final String config) {
|
||||||
|
Log.d(TAG, "startNode() with config (see below)");
|
||||||
|
String configOutput = config;
|
||||||
|
final int maxOutputLen = 4000;
|
||||||
|
Log.d(TAG, "********************** NODE CONFIG ****************************");
|
||||||
|
while (!configOutput.isEmpty()) {
|
||||||
|
Log.d(TAG, "Node config:" + configOutput.substring(0, Math.min(maxOutputLen, configOutput.length())));
|
||||||
|
if (configOutput.length() > maxOutputLen) {
|
||||||
|
configOutput = configOutput.substring(maxOutputLen);
|
||||||
|
} else {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Log.d(TAG, "******************* ENDOF NODE CONFIG *************************");
|
||||||
|
}
|
||||||
|
|
||||||
|
private String getTestnetDataDir(final String root) {
|
||||||
|
return root + "/ethereum/testnet";
|
||||||
|
}
|
||||||
|
|
||||||
|
private void doStartNode(final String defaultConfig, final String fleet) {
|
||||||
|
|
||||||
Activity currentActivity = getCurrentActivity();
|
Activity currentActivity = getCurrentActivity();
|
||||||
|
|
||||||
String root = currentActivity.getApplicationInfo().dataDir;
|
final String root = currentActivity.getApplicationInfo().dataDir;
|
||||||
String dataFolder = root + "/ethereum/testnet";
|
final String dataFolder = this.getTestnetDataDir(root);
|
||||||
Log.d(TAG, "Starting Geth node in folder: " + dataFolder);
|
Log.d(TAG, "Starting Geth node in folder: " + dataFolder);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@ -187,8 +273,7 @@ class StatusModule extends ReactContextBaseJavaModule implements LifecycleEventL
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int testnetNetworkId = 3;
|
String testnetDataDir = dataFolder;
|
||||||
String testnetDataDir = root + "/ethereum/testnet";
|
|
||||||
String oldKeystoreDir = testnetDataDir + "/keystore";
|
String oldKeystoreDir = testnetDataDir + "/keystore";
|
||||||
String newKeystoreDir = root + "/keystore";
|
String newKeystoreDir = root + "/keystore";
|
||||||
final File oldKeystore = new File(oldKeystoreDir);
|
final File oldKeystore = new File(oldKeystoreDir);
|
||||||
@ -209,73 +294,9 @@ class StatusModule extends ReactContextBaseJavaModule implements LifecycleEventL
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
String config;
|
final String config = this.generateConfigFromDefaultConfig(root, newKeystoreDir, fleet, defaultConfig);
|
||||||
try {
|
|
||||||
JSONObject customConfig = new JSONObject(defaultConfig);
|
|
||||||
|
|
||||||
String dataDir = root + customConfig.get("DataDir");
|
prettyPrintConfig(config);
|
||||||
|
|
||||||
config = Statusgo.GenerateConfig(dataDir, customConfig.getInt("NetworkId"));
|
|
||||||
|
|
||||||
JSONObject jsonConfig = new JSONObject(config);
|
|
||||||
|
|
||||||
String gethLogFilePath = TextUtils.isEmpty(this.logLevel) ? null : prepareLogsFile();
|
|
||||||
boolean logsEnabled = (gethLogFilePath != null);
|
|
||||||
|
|
||||||
jsonConfig.put("LogEnabled", logsEnabled);
|
|
||||||
jsonConfig.put("LogFile", gethLogFilePath);
|
|
||||||
jsonConfig.put("LogLevel", TextUtils.isEmpty(this.logLevel) ? "ERROR" : this.logLevel.toUpperCase());
|
|
||||||
jsonConfig.put("DataDir", dataDir);
|
|
||||||
jsonConfig.put("NetworkId", customConfig.get("NetworkId"));
|
|
||||||
try {
|
|
||||||
Object upstreamConfig = customConfig.get("UpstreamConfig");
|
|
||||||
if (upstreamConfig != null) {
|
|
||||||
Log.d(TAG, "UpstreamConfig is not null");
|
|
||||||
jsonConfig.put("UpstreamConfig", upstreamConfig);
|
|
||||||
}
|
|
||||||
} catch (Exception e) {
|
|
||||||
|
|
||||||
}
|
|
||||||
try {
|
|
||||||
JSONObject whisperConfig = (JSONObject) jsonConfig.get("WhisperConfig");
|
|
||||||
if (whisperConfig == null) {
|
|
||||||
whisperConfig = new JSONObject();
|
|
||||||
}
|
|
||||||
whisperConfig.put("LightClient", true);
|
|
||||||
jsonConfig.put("WhisperConfig", whisperConfig);
|
|
||||||
} catch (Exception e) {
|
|
||||||
|
|
||||||
}
|
|
||||||
try {
|
|
||||||
Object clusterConfig = customConfig.get("ClusterConfig");
|
|
||||||
if (clusterConfig != null) {
|
|
||||||
Log.d(TAG, "ClusterConfig is not null");
|
|
||||||
jsonConfig.put("ClusterConfig", clusterConfig);
|
|
||||||
}
|
|
||||||
} catch (Exception e) {
|
|
||||||
Log.w(TAG, "Something went wrong parsing cluster config" + e.getMessage());
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
jsonConfig.put("KeyStoreDir", newKeystoreDir);
|
|
||||||
|
|
||||||
config = jsonConfig.toString();
|
|
||||||
} catch (JSONException e) {
|
|
||||||
config = Statusgo.GenerateConfig(testnetDataDir, testnetNetworkId);
|
|
||||||
Log.d(TAG, "Something went wrong " + e.getMessage());
|
|
||||||
Log.d(TAG, "Default configuration will be used");
|
|
||||||
}
|
|
||||||
|
|
||||||
String configOutput = config;
|
|
||||||
final int maxOutputLen = 4000;
|
|
||||||
while (!configOutput.isEmpty()) {
|
|
||||||
Log.d(TAG, "Node config:" + configOutput.substring(0, Math.min(maxOutputLen, configOutput.length())));
|
|
||||||
if (configOutput.length() > maxOutputLen) {
|
|
||||||
configOutput = configOutput.substring(maxOutputLen);
|
|
||||||
} else {
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
String res = Statusgo.StartNode(config);
|
String res = Statusgo.StartNode(config);
|
||||||
if (res.startsWith("{\"error\":\"\"")) {
|
if (res.startsWith("{\"error\":\"\"")) {
|
||||||
@ -369,7 +390,7 @@ class StatusModule extends ReactContextBaseJavaModule implements LifecycleEventL
|
|||||||
}
|
}
|
||||||
|
|
||||||
@ReactMethod
|
@ReactMethod
|
||||||
public void startNode(final String config) {
|
public void startNode(final String config, final String fleet) {
|
||||||
Log.d(TAG, "startNode");
|
Log.d(TAG, "startNode");
|
||||||
if (!checkAvailability()) {
|
if (!checkAvailability()) {
|
||||||
return;
|
return;
|
||||||
@ -378,7 +399,7 @@ class StatusModule extends ReactContextBaseJavaModule implements LifecycleEventL
|
|||||||
Runnable r = new Runnable() {
|
Runnable r = new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
doStartNode(config);
|
doStartNode(config, fleet);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -65,7 +65,8 @@ RCT_EXPORT_MODULE();
|
|||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
#pragma mark - startNode
|
#pragma mark - startNode
|
||||||
//////////////////////////////////////////////////////////////////// startNode
|
//////////////////////////////////////////////////////////////////// startNode
|
||||||
RCT_EXPORT_METHOD(startNode:(NSString *)configString) {
|
RCT_EXPORT_METHOD(startNode:(NSString *)configString
|
||||||
|
fleet:(NSString *)fleet) {
|
||||||
#if DEBUG
|
#if DEBUG
|
||||||
NSLog(@"StartNode() method called");
|
NSLog(@"StartNode() method called");
|
||||||
#endif
|
#endif
|
||||||
@ -116,7 +117,7 @@ RCT_EXPORT_METHOD(startNode:(NSString *)configString) {
|
|||||||
NSString *networkDir = [rootUrl.path stringByAppendingString:dataDir];
|
NSString *networkDir = [rootUrl.path stringByAppendingString:dataDir];
|
||||||
NSString *devCluster = [ReactNativeConfig envFor:@"ETHEREUM_DEV_CLUSTER"];
|
NSString *devCluster = [ReactNativeConfig envFor:@"ETHEREUM_DEV_CLUSTER"];
|
||||||
NSString *logLevel = [[ReactNativeConfig envFor:@"LOG_LEVEL_STATUS_GO"] uppercaseString];
|
NSString *logLevel = [[ReactNativeConfig envFor:@"LOG_LEVEL_STATUS_GO"] uppercaseString];
|
||||||
char *configChars = GenerateConfig((char *)[networkDir UTF8String], networkId);
|
char *configChars = GenerateConfig((char *)[networkDir UTF8String], (char *)[fleet UTF8String], networkId);
|
||||||
NSString *config = [NSString stringWithUTF8String: configChars];
|
NSString *config = [NSString stringWithUTF8String: configChars];
|
||||||
configData = [config dataUsingEncoding:NSUTF8StringEncoding];
|
configData = [config dataUsingEncoding:NSUTF8StringEncoding];
|
||||||
NSDictionary *resultingConfigJson = [NSJSONSerialization JSONObjectWithData:configData options:NSJSONReadingMutableContainers error:nil];
|
NSDictionary *resultingConfigJson = [NSJSONSerialization JSONObjectWithData:configData options:NSJSONReadingMutableContainers error:nil];
|
||||||
@ -139,6 +140,9 @@ RCT_EXPORT_METHOD(startNode:(NSString *)configString) {
|
|||||||
[resultingConfigJson setValue:bootnodes forKeyPath:@"ClusterConfig.BootNodes"];
|
[resultingConfigJson setValue:bootnodes forKeyPath:@"ClusterConfig.BootNodes"];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if([fleet length] > 0) {
|
||||||
|
[resultingConfigJson setValue:fleet forKeyPath:@"ClusterConfig.Fleet"];
|
||||||
|
}
|
||||||
|
|
||||||
NSString *resultingConfig = [resultingConfigJson bv_jsonStringWithPrettyPrint:NO];
|
NSString *resultingConfig = [resultingConfigJson bv_jsonStringWithPrettyPrint:NO];
|
||||||
NSLog(@"node config %@", resultingConfig);
|
NSLog(@"node config %@", resultingConfig);
|
||||||
|
@ -25,7 +25,7 @@
|
|||||||
<artifactItem>
|
<artifactItem>
|
||||||
<groupId>status-im</groupId>
|
<groupId>status-im</groupId>
|
||||||
<artifactId>status-go-ios-simulator</artifactId>
|
<artifactId>status-go-ios-simulator</artifactId>
|
||||||
<version>tags-v0.11.0^0-g4afd9e6c-302</version>
|
<version>develop-g19b53030</version>
|
||||||
<type>zip</type>
|
<type>zip</type>
|
||||||
<overWrite>true</overWrite>
|
<overWrite>true</overWrite>
|
||||||
<outputDirectory>./</outputDirectory>
|
<outputDirectory>./</outputDirectory>
|
||||||
|
@ -83,81 +83,63 @@
|
|||||||
(merge testnet-networks mainnet-networks))))
|
(merge testnet-networks mainnet-networks))))
|
||||||
|
|
||||||
(def default-wnodes-without-custom
|
(def default-wnodes-without-custom
|
||||||
{:testnet {"mailserver-a" {:id "mailserver-a" ;mail-01.do-ams3.eth.beta
|
{"eth.beta" {"mailserver-a" {:id "mailserver-a" ;mail-01.do-ams3.eth.beta
|
||||||
:name "Status mailserver A"
|
:name "Status mailserver A"
|
||||||
:password inbox-password
|
:password inbox-password
|
||||||
:address "enode://c42f368a23fa98ee546fd247220759062323249ef657d26d357a777443aec04db1b29a3a22ef3e7c548e18493ddaf51a31b0aed6079bd6ebe5ae838fcfaf3a49@206.189.243.162:30504"}
|
:address "enode://c42f368a23fa98ee546fd247220759062323249ef657d26d357a777443aec04db1b29a3a22ef3e7c548e18493ddaf51a31b0aed6079bd6ebe5ae838fcfaf3a49@206.189.243.162:30504"}
|
||||||
"mailserver-b" {:id "mailserver-b" ;mail-02.do-ams3.eth.beta
|
"mailserver-b" {:id "mailserver-b" ;mail-02.do-ams3.eth.beta
|
||||||
:name "Status mailserver B"
|
:name "Status mailserver B"
|
||||||
:password inbox-password
|
:password inbox-password
|
||||||
:address "enode://7aa648d6e855950b2e3d3bf220c496e0cae4adfddef3e1e6062e6b177aec93bc6cdcf1282cb40d1656932ebfdd565729da440368d7c4da7dbd4d004b1ac02bf8@206.189.243.169:30504"}
|
:address "enode://7aa648d6e855950b2e3d3bf220c496e0cae4adfddef3e1e6062e6b177aec93bc6cdcf1282cb40d1656932ebfdd565729da440368d7c4da7dbd4d004b1ac02bf8@206.189.243.169:30504"}
|
||||||
"mailserver-c" {:id "mailserver-c" ;mail-03.do-ams3.eth.beta
|
"mailserver-c" {:id "mailserver-c" ;mail-03.do-ams3.eth.beta
|
||||||
:name "Status mailserver C"
|
:name "Status mailserver C"
|
||||||
:password inbox-password
|
:password inbox-password
|
||||||
:address "enode://8a64b3c349a2e0ef4a32ea49609ed6eb3364be1110253c20adc17a3cebbc39a219e5d3e13b151c0eee5d8e0f9a8ba2cd026014e67b41a4ab7d1d5dd67ca27427@206.189.243.168:30504"}
|
:address "enode://8a64b3c349a2e0ef4a32ea49609ed6eb3364be1110253c20adc17a3cebbc39a219e5d3e13b151c0eee5d8e0f9a8ba2cd026014e67b41a4ab7d1d5dd67ca27427@206.189.243.168:30504"}
|
||||||
"mailserver-d" {:id "mailserver-d" ;mail-01.gc-us-central1-a.eth.beta
|
"mailserver-d" {:id "mailserver-d" ;mail-01.gc-us-central1-a.eth.beta
|
||||||
:name "Status mailserver D"
|
:name "Status mailserver D"
|
||||||
:password inbox-password
|
:password inbox-password
|
||||||
:address "enode://7de99e4cb1b3523bd26ca212369540646607c721ad4f3e5c821ed9148150ce6ce2e72631723002210fac1fd52dfa8bbdf3555e05379af79515e1179da37cc3db@35.188.19.210:30504"}
|
:address "enode://7de99e4cb1b3523bd26ca212369540646607c721ad4f3e5c821ed9148150ce6ce2e72631723002210fac1fd52dfa8bbdf3555e05379af79515e1179da37cc3db@35.188.19.210:30504"}
|
||||||
"mailserver-e" {:id "mailserver-e" ;mail-02.gc-us-central1-a.eth.beta
|
"mailserver-e" {:id "mailserver-e" ;mail-02.gc-us-central1-a.eth.beta
|
||||||
:name "Status mailserver E"
|
:name "Status mailserver E"
|
||||||
:password inbox-password
|
:password inbox-password
|
||||||
:address "enode://015e22f6cd2b44c8a51bd7a23555e271e0759c7d7f52432719665a74966f2da456d28e154e836bee6092b4d686fe67e331655586c57b718be3997c1629d24167@35.226.21.19:30504"}
|
:address "enode://015e22f6cd2b44c8a51bd7a23555e271e0759c7d7f52432719665a74966f2da456d28e154e836bee6092b4d686fe67e331655586c57b718be3997c1629d24167@35.226.21.19:30504"}
|
||||||
"mailserver-f" {:id "mailserver-f" ;mail-03.gc-us-central1-a.eth.beta
|
"mailserver-f" {:id "mailserver-f" ;mail-03.gc-us-central1-a.eth.beta
|
||||||
:name "Status mailserver F"
|
:name "Status mailserver F"
|
||||||
:password inbox-password
|
:password inbox-password
|
||||||
:address "enode://531e252ec966b7e83f5538c19bf1cde7381cc7949026a6e499b6e998e695751aadf26d4c98d5a4eabfb7cefd31c3c88d600a775f14ed5781520a88ecd25da3c6@35.225.227.79:30504"}}
|
:address "enode://531e252ec966b7e83f5538c19bf1cde7381cc7949026a6e499b6e998e695751aadf26d4c98d5a4eabfb7cefd31c3c88d600a775f14ed5781520a88ecd25da3c6@35.225.227.79:30504"}}
|
||||||
:mainnet {"mailserver-a" {:id "mailserver-a" ;mail-01.do-ams3.eth.beta
|
"eth.staging" {"mailserver-a" {:id "mailserver-a" ;mail-01.gc-us-central1-a.eth.staging
|
||||||
:name "Status mailserver A"
|
:name "Status mailserver A"
|
||||||
:password inbox-password
|
:password inbox-password
|
||||||
:address "enode://c42f368a23fa98ee546fd247220759062323249ef657d26d357a777443aec04db1b29a3a22ef3e7c548e18493ddaf51a31b0aed6079bd6ebe5ae838fcfaf3a49@206.189.243.162:30504"}
|
:address "enode://e4fc10c1f65c8aed83ac26bc1bfb21a45cc1a8550a58077c8d2de2a0e0cd18e40fd40f7e6f7d02dc6cd06982b014ce88d6e468725ffe2c138e958788d0002a7f@35.239.193.41:30504"}
|
||||||
"mailserver-b" {:id "mailserver-b" ;mail-02.do-ams3.eth.beta
|
"mailserver-b" {:id "mailserver-b" ;mail-01.do-ams3.eth.staging
|
||||||
:name "Status mailserver B"
|
:name "Status mailserver B"
|
||||||
:password inbox-password
|
:password inbox-password
|
||||||
:address "enode://7aa648d6e855950b2e3d3bf220c496e0cae4adfddef3e1e6062e6b177aec93bc6cdcf1282cb40d1656932ebfdd565729da440368d7c4da7dbd4d004b1ac02bf8@206.189.243.169:30504"}
|
:address "enode://69f72baa7f1722d111a8c9c68c39a31430e9d567695f6108f31ccb6cd8f0adff4991e7fdca8fa770e75bc8a511a87d24690cbc80e008175f40c157d6f6788d48@206.189.240.16:30504"}
|
||||||
"mailserver-c" {:id "mailserver-c" ;mail-03.do-ams3.eth.beta
|
"mailserver-c" {:id "mailserver-c" ;mail-01.ac-cn-hongkong-c.eth.staging
|
||||||
:name "Status mailserver C"
|
:name "Status mailserver C"
|
||||||
:password inbox-password
|
:password inbox-password
|
||||||
:address "enode://8a64b3c349a2e0ef4a32ea49609ed6eb3364be1110253c20adc17a3cebbc39a219e5d3e13b151c0eee5d8e0f9a8ba2cd026014e67b41a4ab7d1d5dd67ca27427@206.189.243.168:30504"}
|
:address "enode://b74859176c9751d314aeeffc26ec9f866a412752e7ddec91b19018a18e7cca8d637cfe2cedcb972f8eb64d816fbd5b4e89c7e8c7fd7df8a1329fa43db80b0bfe@47.75.159.188:30504"}}
|
||||||
"mailserver-d" {:id "mailserver-d" ;mail-01.gc-us-central1-a.eth.beta
|
"eth.test" {"mailserver-a" {:id "mailserver-a" ;mail-01.gc-us-central1-a.eth.test
|
||||||
:name "Status mailserver D"
|
:name "Status mailserver A"
|
||||||
:password inbox-password
|
:password inbox-password
|
||||||
:address "enode://7de99e4cb1b3523bd26ca212369540646607c721ad4f3e5c821ed9148150ce6ce2e72631723002210fac1fd52dfa8bbdf3555e05379af79515e1179da37cc3db@35.188.19.210:30504"}
|
:address "enode://707e57453acd3e488c44b9d0e17975371e2f8fb67525eae5baca9b9c8e06c86cde7c794a6c2e36203bf9f56cae8b0e50f3b33c4c2b694a7baeea1754464ce4e3@35.192.229.172:30504"}
|
||||||
"mailserver-e" {:id "mailserver-e" ;mail-02.gc-us-central1-a.eth.beta
|
"mailserver-b" {:id "mailserver-b" ;mail-01.do-ams3.eth.test
|
||||||
:name "Status mailserver E"
|
:name "Status mailserver B"
|
||||||
:password inbox-password
|
:password inbox-password
|
||||||
:address "enode://015e22f6cd2b44c8a51bd7a23555e271e0759c7d7f52432719665a74966f2da456d28e154e836bee6092b4d686fe67e331655586c57b718be3997c1629d24167@35.226.21.19:30504"}
|
:address "enode://e4865fe6c2a9c1a563a6447990d8e9ce672644ae3e08277ce38ec1f1b690eef6320c07a5d60c3b629f5d4494f93d6b86a745a0bf64ab295bbf6579017adc6ed8@206.189.243.161:30504"}
|
||||||
"mailserver-f" {:id "mailserver-f" ;mail-03.gc-us-central1-a.eth.beta
|
"mailserver-c" {:id "mailserver-c" ;mail-01.ac-cn-hongkong-c.eth.test
|
||||||
:name "Status mailserver F"
|
:name "Status mailserver C"
|
||||||
:password inbox-password
|
:password inbox-password
|
||||||
:address "enode://531e252ec966b7e83f5538c19bf1cde7381cc7949026a6e499b6e998e695751aadf26d4c98d5a4eabfb7cefd31c3c88d600a775f14ed5781520a88ecd25da3c6@35.225.227.79:30504"}}
|
:address "enode://954c06603a6e755bffe9992615f4755848bda9aadda74d920aa31d1d8e4f6022dc556dca6768f8a0f9459f57b729509db3c8b3bb80acfbd8a2123087f6cbd7bd@47.52.251.180:30504"}}})
|
||||||
:rinkeby {"mailserver-a" {:id "mailserver-a" ;mail-01.do-ams3.eth.beta
|
|
||||||
:name "Status mailserver A"
|
|
||||||
:password inbox-password
|
|
||||||
:address "enode://c42f368a23fa98ee546fd247220759062323249ef657d26d357a777443aec04db1b29a3a22ef3e7c548e18493ddaf51a31b0aed6079bd6ebe5ae838fcfaf3a49@206.189.243.162:30504"}
|
|
||||||
"mailserver-b" {:id "mailserver-b" ;mail-02.do-ams3.eth.beta
|
|
||||||
:name "Status mailserver B"
|
|
||||||
:password inbox-password
|
|
||||||
:address "enode://7aa648d6e855950b2e3d3bf220c496e0cae4adfddef3e1e6062e6b177aec93bc6cdcf1282cb40d1656932ebfdd565729da440368d7c4da7dbd4d004b1ac02bf8@206.189.243.169:30504"}
|
|
||||||
"mailserver-c" {:id "mailserver-c" ;mail-03.do-ams3.eth.beta
|
|
||||||
:name "Status mailserver C"
|
|
||||||
:password inbox-password
|
|
||||||
:address "enode://8a64b3c349a2e0ef4a32ea49609ed6eb3364be1110253c20adc17a3cebbc39a219e5d3e13b151c0eee5d8e0f9a8ba2cd026014e67b41a4ab7d1d5dd67ca27427@206.189.243.168:30504"}
|
|
||||||
"mailserver-d" {:id "mailserver-d" ;mail-01.gc-us-central1-a.eth.beta
|
|
||||||
:name "Status mailserver D"
|
|
||||||
:password inbox-password
|
|
||||||
:address "enode://7de99e4cb1b3523bd26ca212369540646607c721ad4f3e5c821ed9148150ce6ce2e72631723002210fac1fd52dfa8bbdf3555e05379af79515e1179da37cc3db@35.188.19.210:30504"}
|
|
||||||
"mailserver-e" {:id "mailserver-e" ;mail-02.gc-us-central1-a.eth.beta
|
|
||||||
:name "Status mailserver E"
|
|
||||||
:password inbox-password
|
|
||||||
:address "enode://015e22f6cd2b44c8a51bd7a23555e271e0759c7d7f52432719665a74966f2da456d28e154e836bee6092b4d686fe67e331655586c57b718be3997c1629d24167@35.226.21.19:30504"}
|
|
||||||
"mailserver-f" {:id "mailserver-f" ;mail-03.gc-us-central1-a.eth.beta
|
|
||||||
:name "Status mailserver F"
|
|
||||||
:password inbox-password
|
|
||||||
:address "enode://531e252ec966b7e83f5538c19bf1cde7381cc7949026a6e499b6e998e695751aadf26d4c98d5a4eabfb7cefd31c3c88d600a775f14ed5781520a88ecd25da3c6@35.225.227.79:30504"}}})
|
|
||||||
|
|
||||||
(def default-wnodes
|
(def default-wnodes
|
||||||
(assoc default-wnodes-without-custom :custom (:testnet default-wnodes-without-custom)))
|
;; We use the same set of mailservers for every network now
|
||||||
|
;; They are only dependent on the selected fleet (test, stage, beta)
|
||||||
|
(let [nodes-for-fleet (get default-wnodes-without-custom config/fleet)]
|
||||||
|
{:custom nodes-for-fleet
|
||||||
|
:testnet nodes-for-fleet
|
||||||
|
:mainnet nodes-for-fleet
|
||||||
|
:rinkeby nodes-for-fleet}))
|
||||||
|
|
||||||
(defn default-account-settings []
|
(defn default-account-settings []
|
||||||
{:wallet {:visible-tokens {:testnet #{:STT :HND}
|
{:wallet {:visible-tokens {:testnet #{:STT :HND}
|
||||||
|
@ -3,8 +3,8 @@
|
|||||||
|
|
||||||
(def adjust-resize 16)
|
(def adjust-resize 16)
|
||||||
|
|
||||||
(defn start-node [config]
|
(defn start-node [config fleet]
|
||||||
(native-module/start-node config))
|
(native-module/start-node config fleet))
|
||||||
|
|
||||||
(defn stop-node []
|
(defn stop-node []
|
||||||
(native-module/stop-node))
|
(native-module/stop-node))
|
||||||
|
@ -58,9 +58,9 @@
|
|||||||
(when status
|
(when status
|
||||||
(call-module #(.stopNode status))))
|
(call-module #(.stopNode status))))
|
||||||
|
|
||||||
(defn start-node [config]
|
(defn start-node [config fleet]
|
||||||
(when status
|
(when status
|
||||||
(call-module #(.startNode status config))))
|
(call-module #(.startNode status config fleet))))
|
||||||
|
|
||||||
(defonce account-creation? (atom false))
|
(defonce account-creation? (atom false))
|
||||||
|
|
||||||
|
@ -110,7 +110,7 @@
|
|||||||
(re-frame/reg-fx
|
(re-frame/reg-fx
|
||||||
:initialize-geth-fx
|
:initialize-geth-fx
|
||||||
(fn [config]
|
(fn [config]
|
||||||
(status/start-node (types/clj->json config))))
|
(status/start-node (types/clj->json config) config/fleet)))
|
||||||
|
|
||||||
(re-frame/reg-fx
|
(re-frame/reg-fx
|
||||||
::status-module-initialized-fx
|
::status-module-initialized-fx
|
||||||
|
@ -26,6 +26,7 @@
|
|||||||
string/lower-case
|
string/lower-case
|
||||||
keyword))
|
keyword))
|
||||||
|
|
||||||
|
(def fleet (get-config :FLEET "eth.beta"))
|
||||||
(def add-custom-mailservers-enabled? (enabled? (get-config :ADD_CUSTOM_MAILSERVERS_ENABLED "1")))
|
(def add-custom-mailservers-enabled? (enabled? (get-config :ADD_CUSTOM_MAILSERVERS_ENABLED "1")))
|
||||||
(def rn-bridge-threshold-warnings-enabled? (enabled? (get-config :RN_BRIDGE_THRESHOLD_WARNINGS 0)))
|
(def rn-bridge-threshold-warnings-enabled? (enabled? (get-config :RN_BRIDGE_THRESHOLD_WARNINGS 0)))
|
||||||
(def default-network (get-config :DEFAULT_NETWORK))
|
(def default-network (get-config :DEFAULT_NETWORK))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user