Offline inboxing: End to end MVP

- Turns on flag for dev and Jenkins
- Change enode to peer in requestMessages arg
- Upgrades status-go to get ssh_requestMessages
- Use status-cluster enode
- Fix Android AddPeer binding bug
This commit is contained in:
Oskar Thoren 2017-12-08 12:37:50 +01:00
parent 460f6a38e8
commit ce3d5936ec
No known key found for this signature in database
GPG Key ID: 5128AB0637CD85AF
7 changed files with 13 additions and 8 deletions

2
.env
View File

@ -5,6 +5,6 @@ STUB_STATUS_GO=0
ETHEREUM_DEV_CLUSTER=1
MAINNET_NETWORKS_ENABLED=1
ERC20_ENABLED=1
OFFLINE_INBOX_ENABLED=0
OFFLINE_INBOX_ENABLED=1
LOG_LEVEL=debug
JSC_ENABLED=1

View File

@ -5,6 +5,6 @@ STUB_STATUS_GO=0
ETHEREUM_DEV_CLUSTER=1
MAINNET_NETWORKS_ENABLED=1
ERC20_ENABLED=1
OFFLINE_INBOX_ENABLED=0
OFFLINE_INBOX_ENABLED=1
LOG_LEVEL=debug
JSC_ENABLED=1

View File

@ -17,5 +17,5 @@ dependencies {
compile 'com.instabug.library:instabug:3+'
compile 'com.github.ericwlange:AndroidJSCore:3.0.1'
compile 'status-im:function:0.0.1'
compile(group: 'status-im', name: 'status-go', version: 'develop-g5446a090', ext: 'aar')
compile(group: 'status-im', name: 'status-go', version: 'develop-gba6c9653', ext: 'aar')
}

View File

@ -414,7 +414,7 @@ class StatusModule extends ReactContextBaseJavaModule implements LifecycleEventL
Thread thread = new Thread() {
@Override
public void run() {
String res = Statusgo.Notify(enode);
String res = Statusgo.AddPeer(enode);
callback.invoke(res);
}

View File

@ -25,7 +25,7 @@
<artifactItem>
<groupId>status-im</groupId>
<artifactId>status-go-ios-simulator</artifactId>
<version>develop-g5446a090</version>
<version>develop-gba6c9653</version>
<type>zip</type>
<overWrite>true</overWrite>
<outputDirectory>./</outputDirectory>

View File

@ -102,7 +102,7 @@
(l/message-listener listener-options))
(inbox/request-messages!
web3
{}
{:enode inbox/cluster-enode}
#(log/info "offline inbox: request-messages response" %)))
(f/add-filter!
web3

View File

@ -14,8 +14,10 @@
;; TODO(oskarth): Hardcoded to local enode for preMVP, will be in bootnodes later
(def default-enode "enode://0f51d75c9469de0852571c4618fe151265d4930ea35f968eb1a12e69c12f7cbabed856a12b31268a825ca2c9bafa47ef665b1b17be1ab71de83338c4b7439b24@127.0.0.1:30303")
;; adamb's status-cluster enode
(def cluster-enode "enode://08d8eb6177b187049f6c97ed3f6c74fbbefb94c7ad10bafcaf4b65ce89c314dcfee0a8bc4e7a5b824dfa08b45b360cc78f34f0aff981f8386caa07652d2e601b@163.172.177.138:40404")
;; TODO(oskarth): Rewrite callback-heavy code with CSP and/or coeffects
;; NOTE(oskarth): Exact params still being determined
;; TODO(oskarth): Memoize addPeer and markTrusted, similar to keys/get-sym-key
;; TODO(oskarth): Actually deal with errors, all in same cb - outside scope of this
(defn request-messages! [web3 {:keys [enode topic password]
@ -42,13 +44,16 @@
(let [args {:jsonrpc "2.0"
:id 2
:method "shh_requestMessages"
:params [{:enode enode
:params [{:peer enode
:topic topic
:symKeyID sym-key-id
:from 0
:to 1612505820}]}
payload (.stringify js/JSON (clj->js args))]
(log/info "offline inbox: request-messages request")
(log/info "offline inbox: request-messages args" (pr-str args))
(log/info "offline inbox: request-messages payload" (pr-str payload))
(status/call-web3 payload callback))))))))))
;; TODO(oskarth): Use web3 binding to do (.markTrustedPeer web3 enode cb)