Merge pull request #118 from status-im/bug/#115
workaround for adding peer to geth
This commit is contained in:
commit
44c98d68c1
|
@ -13,6 +13,9 @@ import com.bitgo.randombytes.RandomBytesPackage;
|
||||||
import com.BV.LinearGradient.LinearGradientPackage;
|
import com.BV.LinearGradient.LinearGradientPackage;
|
||||||
import com.centaurwarchief.smslistener.SmsListener;
|
import com.centaurwarchief.smslistener.SmsListener;
|
||||||
|
|
||||||
|
import android.os.Handler;
|
||||||
|
import android.util.Log;
|
||||||
|
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Properties;
|
import java.util.Properties;
|
||||||
|
@ -23,6 +26,8 @@ import io.realm.react.RealmReactPackage;
|
||||||
|
|
||||||
public class MainActivity extends ReactActivity {
|
public class MainActivity extends ReactActivity {
|
||||||
|
|
||||||
|
final Handler handler = new Handler();
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
|
@ -43,11 +48,19 @@ public class MainActivity extends ReactActivity {
|
||||||
getApplicationInfo().dataDir;
|
getApplicationInfo().dataDir;
|
||||||
|
|
||||||
// Launch!
|
// Launch!
|
||||||
|
final Runnable addPeer = new Runnable() {
|
||||||
|
public void run() {
|
||||||
|
Log.w("Geth", "adding peer");
|
||||||
|
Geth.run("--exec admin.addPeer(\"enode://e2f28126720452aa82f7d3083e49e6b3945502cb94d9750a15e27ee310eed6991618199f878e5fbc7dfa0e20f0af9554b41f491dc8f1dbae8f0f2d37a3a613aa@139.162.13.89:55555\") attach http://localhost:8545");
|
||||||
|
}
|
||||||
|
};
|
||||||
new Thread(new Runnable() {
|
new Thread(new Runnable() {
|
||||||
public void run() {
|
public void run() {
|
||||||
Geth.run("--bootnodes enode://e2f28126720452aa82f7d3083e49e6b3945502cb94d9750a15e27ee310eed6991618199f878e5fbc7dfa0e20f0af9554b41f491dc8f1dbae8f0f2d37a3a613aa@139.162.13.89:30303 --shh --ipcdisable --nodiscover --rpc --rpcapi db,eth,net,web3,shh,admin --fast --datadir=" + dataFolder);
|
Geth.run("--shh --ipcdisable --nodiscover --rpc --rpcapi db,eth,net,web3,shh,admin --fast --datadir=" + dataFolder);
|
||||||
|
|
||||||
}
|
}
|
||||||
}).start();
|
}).start();
|
||||||
|
handler.postDelayed(addPeer, 5000);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -36,7 +36,7 @@
|
||||||
[drawer-view
|
[drawer-view
|
||||||
[view st/chats-container
|
[view st/chats-container
|
||||||
[chats-list-toolbar]
|
[chats-list-toolbar]
|
||||||
[list-view {:dataSource (to-datasource (vals @chats))
|
[list-view {:dataSource (to-datasource @chats)
|
||||||
:renderRow (fn [row _ _]
|
:renderRow (fn [row _ _]
|
||||||
(list-item [chat-list-item row]))
|
(list-item [chat-list-item row]))
|
||||||
:style st/list-container}]
|
:style st/list-container}]
|
||||||
|
|
|
@ -8,10 +8,11 @@
|
||||||
[status-im.chats-list.views.inner-item :refer
|
[status-im.chats-list.views.inner-item :refer
|
||||||
[chat-list-item-inner-view]]))
|
[chat-list-item-inner-view]]))
|
||||||
|
|
||||||
(defn chat-list-item [{:keys [chat-id] :as chat}]
|
(defn chat-list-item [[chat-id chat]]
|
||||||
[touchable-highlight
|
[touchable-highlight
|
||||||
{:on-press #(dispatch [:navigate-to :chat chat-id])}
|
{:on-press #(dispatch [:navigate-to :chat chat-id])}
|
||||||
[view [chat-list-item-inner-view (merge chat
|
[view [chat-list-item-inner-view (merge chat
|
||||||
;; TODO stub data
|
;; TODO stub data
|
||||||
{:new-messages-count 3
|
{:chat-id chat-id
|
||||||
|
:new-messages-count 3
|
||||||
:online true})]]])
|
:online true})]]])
|
||||||
|
|
Loading…
Reference in New Issue