mirror of https://github.com/status-im/go-waku.git
bump examples
This commit is contained in:
parent
ed9ea40668
commit
01328daae6
|
@ -5,5 +5,5 @@ go 1.15
|
|||
require (
|
||||
github.com/ethereum/go-ethereum v1.9.5
|
||||
github.com/ipfs/go-log v1.0.5
|
||||
github.com/status-im/go-waku v0.0.0-20210412175941-fa79f9a864bb
|
||||
github.com/status-im/go-waku v0.0.0-20210415021931-ed9ea4066839
|
||||
)
|
||||
|
|
|
@ -184,6 +184,7 @@ github.com/ipfs/go-cid v0.0.7/go.mod h1:6Ux9z5e+HpkQdckYoX1PG/6xqKspzlEIR5SDmgqg
|
|||
github.com/ipfs/go-datastore v0.0.1/go.mod h1:d4KVXhMt913cLBEI/PXAy6ko+W7e9AhyAKBGh803qeE=
|
||||
github.com/ipfs/go-datastore v0.4.0/go.mod h1:SX/xMIKoCszPqp+z9JhPYCmoOoXTvaa13XEbGtsFUhA=
|
||||
github.com/ipfs/go-datastore v0.4.1/go.mod h1:SX/xMIKoCszPqp+z9JhPYCmoOoXTvaa13XEbGtsFUhA=
|
||||
github.com/ipfs/go-datastore v0.4.4 h1:rjvQ9+muFaJ+QZ7dN5B1MSDNQ0JVZKkkES/rMZmA8X8=
|
||||
github.com/ipfs/go-datastore v0.4.4/go.mod h1:SX/xMIKoCszPqp+z9JhPYCmoOoXTvaa13XEbGtsFUhA=
|
||||
github.com/ipfs/go-detect-race v0.0.1/go.mod h1:8BNT7shDZPo99Q74BpGMK+4D8Mn4j46UU0LZ723meps=
|
||||
github.com/ipfs/go-ds-badger v0.0.2/go.mod h1:Y3QpeSFWQf6MopLTiZD+VT6IC1yZqaGmjvRcKeSGij8=
|
||||
|
@ -193,6 +194,8 @@ github.com/ipfs/go-ds-badger v0.2.3/go.mod h1:pEYw0rgg3FIrywKKnL+Snr+w/LjJZVMTBR
|
|||
github.com/ipfs/go-ds-leveldb v0.0.1/go.mod h1:feO8V3kubwsEF22n0YRQCffeb79OOYIykR4L04tMOYc=
|
||||
github.com/ipfs/go-ds-leveldb v0.4.1/go.mod h1:jpbku/YqBSsBc1qgME8BkWS4AxzF2cEu1Ii2r79Hh9s=
|
||||
github.com/ipfs/go-ds-leveldb v0.4.2/go.mod h1:jpbku/YqBSsBc1qgME8BkWS4AxzF2cEu1Ii2r79Hh9s=
|
||||
github.com/ipfs/go-ds-sql v0.2.0 h1:ZUHUbU5IydNuBWzcRMOZYkBUwTg+L56o23fEVcbWC7o=
|
||||
github.com/ipfs/go-ds-sql v0.2.0/go.mod h1:/c47NpRiHobwn+8F8EpW0yBy8d3Mx/j/tIlrVN1e1Ec=
|
||||
github.com/ipfs/go-ipfs-delay v0.0.0-20181109222059-70721b86a9a8/go.mod h1:8SP1YXK1M1kXuc4KJZINY3TQQ03J2rwBG9QfXmbRPrw=
|
||||
github.com/ipfs/go-ipfs-util v0.0.1/go.mod h1:spsl5z8KUnrve+73pOhSVZND1SIxPW5RyBCNzQxlJBc=
|
||||
github.com/ipfs/go-ipfs-util v0.0.2 h1:59Sswnk1MFaiq+VcaknX7aYEyGyGDAA73ilhEK2POp8=
|
||||
|
@ -245,6 +248,7 @@ github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORN
|
|||
github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI=
|
||||
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
|
||||
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
|
||||
github.com/lib/pq v1.3.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo=
|
||||
github.com/libp2p/go-addr-util v0.0.1/go.mod h1:4ac6O7n9rIAKB1dnd+s8IbbMXkt+oBpzX4/+RACcnlQ=
|
||||
github.com/libp2p/go-addr-util v0.0.2 h1:7cWK5cdA5x72jX0g8iLrQWm5TRJZ6CzGdPEhWj7plWU=
|
||||
github.com/libp2p/go-addr-util v0.0.2/go.mod h1:Ecd6Fb3yIuLzq4bD7VcywcVSBtefcAwnUISBM3WG15E=
|
||||
|
@ -601,6 +605,8 @@ github.com/status-im/go-waku v0.0.0-20210411234359-f9e7589ffdd9 h1:smFp8UIU5OYZu
|
|||
github.com/status-im/go-waku v0.0.0-20210411234359-f9e7589ffdd9/go.mod h1:2fHIqaNF8M8W/DQL5J3R9dXbrTLpOefvD5tbKSvoxBg=
|
||||
github.com/status-im/go-waku v0.0.0-20210412175941-fa79f9a864bb h1:Nw2aNm6JgjHbCvIneCBP0Cju66mhVXfEP5VyfAK2TQk=
|
||||
github.com/status-im/go-waku v0.0.0-20210412175941-fa79f9a864bb/go.mod h1:J+Pvtku93TXlU/X3CzLwD4C7bXUFVpIiF4iPQksbUBY=
|
||||
github.com/status-im/go-waku v0.0.0-20210415021931-ed9ea4066839 h1:YmwrP2oky+SioqddpsZwXZV7GA6C1Dy9Y3ijKIUKaU8=
|
||||
github.com/status-im/go-waku v0.0.0-20210415021931-ed9ea4066839/go.mod h1:GjrbwNCdtae7sFmvFyXJPSRgnrcmJp3wVSjDZWOG8+s=
|
||||
github.com/status-im/go-wakurelay-pubsub v0.4.2 h1:F4UGcP80H0PGaeJ0mRMzA1Ux3DKYiyv/qu3bOR/efTg=
|
||||
github.com/status-im/go-wakurelay-pubsub v0.4.2/go.mod h1:LSCVYR7mnBBsxVJghrGpQ3yJAAATEe6XeQQqGCZhwrE=
|
||||
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
|
||||
|
|
|
@ -10,6 +10,6 @@ require (
|
|||
github.com/ipfs/go-log/v2 v2.1.1
|
||||
github.com/libp2p/go-libp2p-core v0.8.5
|
||||
github.com/rivo/tview v0.0.0-20210312174852-ae9464cc3598
|
||||
github.com/status-im/go-waku v0.0.0-20210412175941-fa79f9a864bb
|
||||
github.com/status-im/go-waku v0.0.0-20210415021931-ed9ea4066839
|
||||
google.golang.org/protobuf v1.25.0
|
||||
)
|
||||
|
|
|
@ -286,6 +286,7 @@ github.com/ipfs/go-cid v0.0.7/go.mod h1:6Ux9z5e+HpkQdckYoX1PG/6xqKspzlEIR5SDmgqg
|
|||
github.com/ipfs/go-datastore v0.0.1/go.mod h1:d4KVXhMt913cLBEI/PXAy6ko+W7e9AhyAKBGh803qeE=
|
||||
github.com/ipfs/go-datastore v0.4.0/go.mod h1:SX/xMIKoCszPqp+z9JhPYCmoOoXTvaa13XEbGtsFUhA=
|
||||
github.com/ipfs/go-datastore v0.4.1/go.mod h1:SX/xMIKoCszPqp+z9JhPYCmoOoXTvaa13XEbGtsFUhA=
|
||||
github.com/ipfs/go-datastore v0.4.4 h1:rjvQ9+muFaJ+QZ7dN5B1MSDNQ0JVZKkkES/rMZmA8X8=
|
||||
github.com/ipfs/go-datastore v0.4.4/go.mod h1:SX/xMIKoCszPqp+z9JhPYCmoOoXTvaa13XEbGtsFUhA=
|
||||
github.com/ipfs/go-detect-race v0.0.1/go.mod h1:8BNT7shDZPo99Q74BpGMK+4D8Mn4j46UU0LZ723meps=
|
||||
github.com/ipfs/go-ds-badger v0.0.2/go.mod h1:Y3QpeSFWQf6MopLTiZD+VT6IC1yZqaGmjvRcKeSGij8=
|
||||
|
@ -295,6 +296,8 @@ github.com/ipfs/go-ds-badger v0.2.3/go.mod h1:pEYw0rgg3FIrywKKnL+Snr+w/LjJZVMTBR
|
|||
github.com/ipfs/go-ds-leveldb v0.0.1/go.mod h1:feO8V3kubwsEF22n0YRQCffeb79OOYIykR4L04tMOYc=
|
||||
github.com/ipfs/go-ds-leveldb v0.4.1/go.mod h1:jpbku/YqBSsBc1qgME8BkWS4AxzF2cEu1Ii2r79Hh9s=
|
||||
github.com/ipfs/go-ds-leveldb v0.4.2/go.mod h1:jpbku/YqBSsBc1qgME8BkWS4AxzF2cEu1Ii2r79Hh9s=
|
||||
github.com/ipfs/go-ds-sql v0.2.0 h1:ZUHUbU5IydNuBWzcRMOZYkBUwTg+L56o23fEVcbWC7o=
|
||||
github.com/ipfs/go-ds-sql v0.2.0/go.mod h1:/c47NpRiHobwn+8F8EpW0yBy8d3Mx/j/tIlrVN1e1Ec=
|
||||
github.com/ipfs/go-ipfs-delay v0.0.0-20181109222059-70721b86a9a8/go.mod h1:8SP1YXK1M1kXuc4KJZINY3TQQ03J2rwBG9QfXmbRPrw=
|
||||
github.com/ipfs/go-ipfs-util v0.0.1/go.mod h1:spsl5z8KUnrve+73pOhSVZND1SIxPW5RyBCNzQxlJBc=
|
||||
github.com/ipfs/go-ipfs-util v0.0.2 h1:59Sswnk1MFaiq+VcaknX7aYEyGyGDAA73ilhEK2POp8=
|
||||
|
@ -362,6 +365,7 @@ github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+
|
|||
github.com/leanovate/gopter v0.2.8/go.mod h1:gNcbPWNEWRe4lm+bycKqxUYoH5uoVje5SkOJ3uoLer8=
|
||||
github.com/leanovate/gopter v0.2.9/go.mod h1:U2L/78B+KVFIx2VmW6onHJQzXtFb+p5y3y2Sh+Jxxv8=
|
||||
github.com/lib/pq v1.0.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo=
|
||||
github.com/lib/pq v1.3.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo=
|
||||
github.com/libp2p/go-addr-util v0.0.1/go.mod h1:4ac6O7n9rIAKB1dnd+s8IbbMXkt+oBpzX4/+RACcnlQ=
|
||||
github.com/libp2p/go-addr-util v0.0.2 h1:7cWK5cdA5x72jX0g8iLrQWm5TRJZ6CzGdPEhWj7plWU=
|
||||
github.com/libp2p/go-addr-util v0.0.2/go.mod h1:Ecd6Fb3yIuLzq4bD7VcywcVSBtefcAwnUISBM3WG15E=
|
||||
|
@ -676,6 +680,7 @@ github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFSt
|
|||
github.com/opentracing/opentracing-go v1.2.0 h1:uEJPy/1a5RIPAJ0Ov+OIO8OxWu77jEv+1B0VhjKrZUs=
|
||||
github.com/opentracing/opentracing-go v1.2.0/go.mod h1:GxEUsuufX4nBwe+T+Wl9TAgYrxe9dPLANfrWvHYVTgc=
|
||||
github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc=
|
||||
github.com/pascaldekloe/latest v1.0.0/go.mod h1:z9u6IbZ43GNcHixToUWbHbaPzl9IX7bhiuaXRAkmBLQ=
|
||||
github.com/paulbellamy/ratecounter v0.2.0/go.mod h1:Hfx1hDpSGoqxkVVpBi/IlYD7kChlfo5C6hzIHwPqfFE=
|
||||
github.com/pborman/uuid v0.0.0-20170112150404-1b00554d8222/go.mod h1:VyrYX9gd7irzKovcSS6BIIEwPRkP2Wm2m9ufcdFSJ34=
|
||||
github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic=
|
||||
|
@ -778,6 +783,8 @@ github.com/status-im/go-waku v0.0.0-20210411234359-f9e7589ffdd9 h1:smFp8UIU5OYZu
|
|||
github.com/status-im/go-waku v0.0.0-20210411234359-f9e7589ffdd9/go.mod h1:2fHIqaNF8M8W/DQL5J3R9dXbrTLpOefvD5tbKSvoxBg=
|
||||
github.com/status-im/go-waku v0.0.0-20210412175941-fa79f9a864bb h1:Nw2aNm6JgjHbCvIneCBP0Cju66mhVXfEP5VyfAK2TQk=
|
||||
github.com/status-im/go-waku v0.0.0-20210412175941-fa79f9a864bb/go.mod h1:J+Pvtku93TXlU/X3CzLwD4C7bXUFVpIiF4iPQksbUBY=
|
||||
github.com/status-im/go-waku v0.0.0-20210415021931-ed9ea4066839 h1:YmwrP2oky+SioqddpsZwXZV7GA6C1Dy9Y3ijKIUKaU8=
|
||||
github.com/status-im/go-waku v0.0.0-20210415021931-ed9ea4066839/go.mod h1:GjrbwNCdtae7sFmvFyXJPSRgnrcmJp3wVSjDZWOG8+s=
|
||||
github.com/status-im/go-wakurelay-pubsub v0.4.2 h1:F4UGcP80H0PGaeJ0mRMzA1Ux3DKYiyv/qu3bOR/efTg=
|
||||
github.com/status-im/go-wakurelay-pubsub v0.4.2/go.mod h1:LSCVYR7mnBBsxVJghrGpQ3yJAAATEe6XeQQqGCZhwrE=
|
||||
github.com/status-im/keycard-go v0.0.0-20190316090335-8537d3370df4/go.mod h1:RZLeN1LMWmRsyYjvAu+I6Dm9QmlDaIIt+Y+4Kd7Tp+Q=
|
||||
|
|
|
@ -19,6 +19,7 @@ import (
|
|||
logging "github.com/ipfs/go-log"
|
||||
"github.com/libp2p/go-libp2p-core/peer"
|
||||
"github.com/status-im/go-waku/waku/v2/node"
|
||||
store "github.com/status-im/go-waku/waku/v2/protocol/waku_store"
|
||||
)
|
||||
|
||||
var DefaultContentTopic string = "dingpu"
|
||||
|
@ -56,7 +57,7 @@ func main() {
|
|||
}
|
||||
|
||||
wakuNode.MountRelay()
|
||||
wakuNode.MountStore(nil)
|
||||
wakuNode.MountStore(false, nil)
|
||||
|
||||
// use the nickname from the cli flag, or a default if blank
|
||||
nick := *nickFlag
|
||||
|
@ -85,8 +86,7 @@ func main() {
|
|||
|
||||
staticnode := *staticNodeFlag
|
||||
storenode := *storeNodeFlag
|
||||
//storenode = "/ip4/104.154.239.128/tcp/30303/p2p/16Uiu2HAmJb2e28qLXxT5kZxVUUoJt72EMzNGXB47Rxx5hw3q4YjS"
|
||||
storenode = "/ip4/127.0.0.1/tcp/60000/p2p/16Uiu2HAmULUvzjx7r5jcD8mtw6eGynjtAaDYUHFFbkbgcc3GNetZ"
|
||||
|
||||
var fleetData []byte
|
||||
if len(staticnode) == 0 || len(storenode) == 0 {
|
||||
fleetData = getFleetData()
|
||||
|
@ -111,7 +111,7 @@ func main() {
|
|||
storenode = getRandomFleetNode(fleetData)
|
||||
}
|
||||
|
||||
err := wakuNode.AddStorePeer(storenode)
|
||||
storeNodeId, err := wakuNode.AddStorePeer(storenode)
|
||||
if err != nil {
|
||||
ui.displayMessage("Could not connect to storenode: " + err.Error())
|
||||
return
|
||||
|
@ -121,7 +121,12 @@ func main() {
|
|||
|
||||
time.Sleep(300 * time.Millisecond)
|
||||
ui.displayMessage("Querying historic messages")
|
||||
response, err := wakuNode.Query(DefaultContentTopic, true, 0)
|
||||
|
||||
response, err := wakuNode.Query([]string{DefaultContentTopic}, 0, 0,
|
||||
store.WithAutomaticRequestId(),
|
||||
store.WithPeer(string(*storeNodeId)),
|
||||
store.WithPaging(true, 0))
|
||||
|
||||
if err != nil {
|
||||
ui.displayMessage("Could not query storenode: " + err.Error())
|
||||
} else {
|
||||
|
|
Loading…
Reference in New Issue