From f83eedfd5f8b197935acc12c279f2058ddbd220b Mon Sep 17 00:00:00 2001 From: Marko Tagliavia Date: Tue, 28 Jan 2020 18:23:45 +0100 Subject: [PATCH 1/6] Singleton moved to threadsafe map where pk is key and client is value Signed-off-by: Marko Tagliavia --- client-instance.go | 33 ++++++++++++++++----------------- 1 file changed, 16 insertions(+), 17 deletions(-) diff --git a/client-instance.go b/client-instance.go index 91ea99c..825e41d 100644 --- a/client-instance.go +++ b/client-instance.go @@ -11,27 +11,26 @@ import ( ) var ( - singleton *dmsg.Client - once sync.Once + clients = struct { + sync.RWMutex + entries map[cipher.PubKey]*dmsg.Client + }{entries: make(map[cipher.PubKey]*dmsg.Client)} - usedPub cipher.PubKey - usedSec cipher.SecKey - - errWrongPubKeyUsed error = errors.New("dmsg client already initialized with different pub key") - errWrongSecKeyUsed error = errors.New("dmsg client already initialized with different sec key") + errCreate error = errors.New("dmsg client don't exists and was not created successfully") ) func getClient(pubKey cipher.PubKey, secKey cipher.SecKey) (*dmsg.Client, error) { - once.Do(func() { - singleton = dmsg.NewClient(pubKey, secKey, disc.NewHTTP(DefaultDiscoveryURL), dmsg.DefaultConfig()) - usedPub = pubKey - usedSec = secKey - }) - if pubKey != usedPub { - return nil, errWrongPubKeyUsed + if val, ok := clients.entries[pubKey]; ok { + return val, nil } - if secKey != usedSec { - return nil, errWrongSecKeyUsed + + clients.Lock() + clients.entries[pubKey] = dmsg.NewClient(pubKey, secKey, disc.NewHTTP(DefaultDiscoveryURL), dmsg.DefaultConfig()) + clients.Unlock() + + if clients.entries[pubKey] != nil { + return clients.entries[pubKey], nil } - return singleton, nil + + return nil, errCreate } From 1f2da6e79d9366f6476fb9e8b1838c4cad9f7acd Mon Sep 17 00:00:00 2001 From: Marko Tagliavia Date: Wed, 29 Jan 2020 18:25:03 +0100 Subject: [PATCH 2/6] Tests for clients map Signed-off-by: Marko Tagliavia --- client-instance.go | 2 +- dmsg-http_test.go | 90 ++++++++++++++++++++++++++++++++++++++++++++-- go.mod | 2 -- server.go | 2 +- transport.go | 2 +- 5 files changed, 91 insertions(+), 7 deletions(-) diff --git a/client-instance.go b/client-instance.go index 825e41d..7dd6817 100644 --- a/client-instance.go +++ b/client-instance.go @@ -19,7 +19,7 @@ var ( errCreate error = errors.New("dmsg client don't exists and was not created successfully") ) -func getClient(pubKey cipher.PubKey, secKey cipher.SecKey) (*dmsg.Client, error) { +func GetClient(pubKey cipher.PubKey, secKey cipher.SecKey) (*dmsg.Client, error) { if val, ok := clients.entries[pubKey]; ok { return val, nil } diff --git a/dmsg-http_test.go b/dmsg-http_test.go index 57aefe6..32d0ac6 100644 --- a/dmsg-http_test.go +++ b/dmsg-http_test.go @@ -5,6 +5,7 @@ import ( "io/ioutil" "net/http" "testing" + "time" "github.com/SkycoinProject/dmsg" "github.com/SkycoinProject/dmsg/cipher" @@ -19,6 +20,91 @@ const ( testPort uint16 = 8081 ) +func TestClientsMapNotConcurent(t *testing.T) { + pk, sk := cipher.GenerateKeyPair() + ppk, ssk := cipher.GenerateKeyPair() + pppk, sssk := cipher.GenerateKeyPair() + c, _ := dmsghttp.GetClient(pk, sk) + ca, _ := dmsghttp.GetClient(ppk, ssk) + cb, _ := dmsghttp.GetClient(pk, sk) + cc, _ := dmsghttp.GetClient(pppk, sssk) + cd, _ := dmsghttp.GetClient(ppk, ssk) + ce, _ := dmsghttp.GetClient(pppk, sssk) + + fmt.Println("Client 1 and 3 should be equal") + fmt.Println("PK Client 1 : ", c.EntityCommon.LocalPK()) + fmt.Println("PK Client 3 : ", cb.EntityCommon.LocalPK()) + require.Equal(t, c.EntityCommon.LocalPK(), cb.EntityCommon.LocalPK()) + require.Equal(t, c, cb) + + fmt.Println("Client 2 and 5 should be equal") + fmt.Println("PK Client 2 : ", ca.EntityCommon.LocalPK()) + fmt.Println("PK Client 5 : ", cd.EntityCommon.LocalPK()) + require.Equal(t, ca.EntityCommon.LocalPK(), cd.EntityCommon.LocalPK()) + require.Equal(t, ca, cd) + + fmt.Println("Client 4 and 6 should be equal") + fmt.Println("PK Client 4 : ", cc.EntityCommon.LocalPK()) + fmt.Println("PK Client 6 : ", ce.EntityCommon.LocalPK()) + require.Equal(t, cc.EntityCommon.LocalPK(), ce.EntityCommon.LocalPK()) + require.Equal(t, cc, ce) +} + +func TestClientsMapConcurent(t *testing.T) { + pk, sk := cipher.GenerateKeyPair() + ppk, ssk := cipher.GenerateKeyPair() + pppk, sssk := cipher.GenerateKeyPair() + + var c, ca, cb, cc, cd, ce *dmsg.Client + + go func() { + c, _ = dmsghttp.GetClient(pk, sk) + ca, _ = dmsghttp.GetClient(ppk, ssk) + cb, _ = dmsghttp.GetClient(pk, sk) + cc, _ = dmsghttp.GetClient(pppk, sssk) + cd, _ = dmsghttp.GetClient(ppk, ssk) + ce, _ = dmsghttp.GetClient(pppk, sssk) + }() + + go func() { + c, _ = dmsghttp.GetClient(pk, sk) + ca, _ = dmsghttp.GetClient(ppk, ssk) + cb, _ = dmsghttp.GetClient(pk, sk) + cc, _ = dmsghttp.GetClient(pppk, sssk) + cd, _ = dmsghttp.GetClient(ppk, ssk) + ce, _ = dmsghttp.GetClient(pppk, sssk) + }() + + go func() { + c, _ = dmsghttp.GetClient(pk, sk) + ca, _ = dmsghttp.GetClient(ppk, ssk) + cb, _ = dmsghttp.GetClient(pk, sk) + cc, _ = dmsghttp.GetClient(pppk, sssk) + cd, _ = dmsghttp.GetClient(ppk, ssk) + ce, _ = dmsghttp.GetClient(pppk, sssk) + }() + + time.Sleep(1 * time.Second) + + fmt.Println("Client 1 and 3 should be equal") + fmt.Println("PK Client 1 : ", c.EntityCommon.LocalPK()) + fmt.Println("PK Client 3 : ", cb.EntityCommon.LocalPK()) + require.Equal(t, c.EntityCommon.LocalPK(), cb.EntityCommon.LocalPK()) + require.Equal(t, c, cb) + + fmt.Println("Client 2 and 5 should be equal") + fmt.Println("PK Client 2 : ", ca.EntityCommon.LocalPK()) + fmt.Println("PK Client 5 : ", cd.EntityCommon.LocalPK()) + require.Equal(t, ca.EntityCommon.LocalPK(), cd.EntityCommon.LocalPK()) + require.Equal(t, ca, cd) + + fmt.Println("Client 4 and 6 should be equal") + fmt.Println("PK Client 4 : ", cc.EntityCommon.LocalPK()) + fmt.Println("PK Client 6 : ", ce.EntityCommon.LocalPK()) + require.Equal(t, cc.EntityCommon.LocalPK(), ce.EntityCommon.LocalPK()) + require.Equal(t, cc, ce) +} + func TestDMSGClient(t *testing.T) { dmsgD := disc.NewMock() dmsgS, dmsgSErr := createDmsgSrv(t, dmsgD) @@ -206,11 +292,11 @@ func createDmsgSrv(t *testing.T, dc disc.APIClient) (srv *dmsg.Server, srvErr <- require.NoError(t, err) l, err := nettest.NewLocalListener("tcp") require.NoError(t, err) - srv, err = dmsg.NewServer(pk, sk, "", l, dc) + srv = dmsg.NewServer(pk, sk, dc) require.NoError(t, err) errCh := make(chan error, 1) go func() { - errCh <- srv.Serve() + errCh <- srv.Serve(l, "") close(errCh) }() return srv, errCh diff --git a/go.mod b/go.mod index cb97a1a..c8b4d4b 100644 --- a/go.mod +++ b/go.mod @@ -4,8 +4,6 @@ go 1.13 require ( github.com/SkycoinProject/dmsg v0.0.0-20200127093622-ba9543931922 - github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect - github.com/modern-go/reflect2 v1.0.1 // indirect github.com/stretchr/testify v1.4.0 golang.org/x/net v0.0.0-20191204025024-5ee1b9f4859a ) diff --git a/server.go b/server.go index 19f0581..1daaa17 100644 --- a/server.go +++ b/server.go @@ -27,7 +27,7 @@ type Server struct { func (s *Server) Serve(handler http.Handler) error { s.hs = &http.Server{Handler: handler} - client, err := getClient(s.PubKey, s.SecKey) + client, err := GetClient(s.PubKey, s.SecKey) if err != nil { return err } diff --git a/transport.go b/transport.go index 97109a4..c1a2cfe 100644 --- a/transport.go +++ b/transport.go @@ -44,7 +44,7 @@ func (t DMSGTransport) RoundTrip(req *http.Request) (*http.Response, error) { port := uint16(rPort) serverAddress := dmsg.Addr{PK: pk, Port: port} - dmsgC, err := getClient(t.PubKey, t.SecKey) + dmsgC, err := GetClient(t.PubKey, t.SecKey) if err != nil { return nil, err } From 15837673220a781855f870601240c2cfe3539780 Mon Sep 17 00:00:00 2001 From: Marko Tagliavia Date: Thu, 20 Feb 2020 23:29:44 +0100 Subject: [PATCH 3/6] EOF showcase test moved to dmsg-http unit tests --- client-instance.go | 1 + dmsg-http_test.go | 72 ++++++++++++++++++++++++++++++ test-preparation.go | 105 ++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 178 insertions(+) create mode 100644 test-preparation.go diff --git a/client-instance.go b/client-instance.go index 7dd6817..08d2ace 100644 --- a/client-instance.go +++ b/client-instance.go @@ -19,6 +19,7 @@ var ( errCreate error = errors.New("dmsg client don't exists and was not created successfully") ) +//GetClient returns DMSG client instance. func GetClient(pubKey cipher.PubKey, secKey cipher.SecKey) (*dmsg.Client, error) { if val, ok := clients.entries[pubKey]; ok { return val, nil diff --git a/dmsg-http_test.go b/dmsg-http_test.go index 32d0ac6..56427c0 100644 --- a/dmsg-http_test.go +++ b/dmsg-http_test.go @@ -1,9 +1,11 @@ package dmsghttp_test import ( + "bytes" "fmt" "io/ioutil" "net/http" + "regexp" "testing" "time" @@ -20,6 +22,11 @@ const ( testPort uint16 = 8081 ) +var ( + expectedSmallContent = "small content, small content, small content, small content, small content, " + expectedLargeContent = "" // populated at the start of main, not to keep 1000 occurrences here +) + func TestClientsMapNotConcurent(t *testing.T) { pk, sk := cipher.GenerateKeyPair() ppk, ssk := cipher.GenerateKeyPair() @@ -287,6 +294,11 @@ func TestDMSGClientWithMultipleRoutes(t *testing.T) { require.Equal(t, "Routes really do Work!", string(respB)) } +func TestEofShowcase(t *testing.T) { + createDmsgSrvForEofShowcase() + createDmsgClientForEofShowcase() +} + func createDmsgSrv(t *testing.T, dc disc.APIClient) (srv *dmsg.Server, srvErr <-chan error) { pk, sk, err := cipher.GenerateDeterministicKeyPair([]byte("s")) require.NoError(t, err) @@ -301,3 +313,63 @@ func createDmsgSrv(t *testing.T, dc disc.APIClient) (srv *dmsg.Server, srvErr <- }() return srv, errCh } + +func createDmsgSrvForEofShowcase() { + port := uint16(9091) // use any port you like here, make sure it's referenced in the cmd/client/http-client.go + // dmsgD := disc.NewHTTP("http://dmsg.discovery.skywire.skycoin.com") + dmsgD := disc.NewHTTP("http://localhost:9090") + + sPK, sSK := cipher.GenerateKeyPair() + // note down public key printed out bellow and use the value in cmd/client/http-client.go 'serverPubKey' value + fmt.Printf("Starting http server on public key: %s and port: %v", sPK.Hex(), port) + + httpS := dmsghttp.Server{ + PubKey: sPK, + SecKey: sSK, + Port: port, + Discovery: dmsgD, + } + + // prepare server route handling + mux := http.NewServeMux() + mux.HandleFunc("/small", SmallRequestHandler) + mux.HandleFunc("/large", LargeRequestHandler) + + // run the server + sErr := make(chan error, 1) + sErr <- httpS.Serve(mux) + close(sErr) +} + +func createDmsgClientForEofShowcase() { + var b bytes.Buffer + countExpectedLargeContent := 1000 // how many times we expect 'large content, ' phrase to appear in the response + for i := countExpectedLargeContent; i > 0; i-- { + b.WriteString("large content, ") + } + expectedLargeContent = b.String() + + sPK, sSK := cipher.GenerateKeyPair() + // disc := disc.NewHTTP("http://dmsg.discovery.skywire.skycoin.com") + disc := disc.NewHTTP("http://localhost:9090") + client := dmsghttp.DMSGClient(disc, sPK, sSK) + + // this one is returned ok + resp := MakeRequest("small", client) + if resp != expectedSmallContent { + fmt.Printf("Received small content is not what's expected. Expected %s but received %s\n", expectedSmallContent, resp) + return + } + fmt.Println("Small content is ok") + + // this one fails with following message "Error reading data: http: unexpected EOF reading trailer" + resp = MakeRequest("large", client) + if resp != expectedLargeContent { + largeContentRegex := regexp.MustCompile("large content,") + matches := largeContentRegex.FindAllStringIndex(resp, -1) + countActual := len(matches) // how many times we received expected phrase, + fmt.Printf("Received large content is not what's expected. Expected %v but received %v 'large content' occurrences\n", countExpectedLargeContent, countActual) + return + } + fmt.Print("Large content is ok") +} diff --git a/test-preparation.go b/test-preparation.go new file mode 100644 index 0000000..0dfac6e --- /dev/null +++ b/test-preparation.go @@ -0,0 +1,105 @@ +package dmsghttp + +import ( + "bytes" + "encoding/json" + "fmt" + "io/ioutil" + "net/http" + "time" +) + +var ( + serverPubKey = "" // write down value printed out by server/http-server.go + serverPort = "9091" +) + +/*********************Server functions*******************/ + +//SmallRequestHandler generates string with 5 occurrecnes of 'small content, ' phrase +func SmallRequestHandler(w http.ResponseWriter, r *http.Request) { + var b bytes.Buffer + for i := 5; i > 0; i-- { + b.WriteString("small content, ") + } + + requestHandler(b.String(), w, r) +} + +//LargeRequestHandler generates string with 1000 occurrecnes of 'large content, ' phrase +func LargeRequestHandler(w http.ResponseWriter, r *http.Request) { + var b bytes.Buffer + for i := 1000; i > 0; i-- { + b.WriteString("large content, ") + } + + requestHandler(b.String(), w, r) +} + +// writes the response and header +func requestHandler(content string, w http.ResponseWriter, r *http.Request) { + data := ExampleResponse{ + Content: content, + Timestamp: time.Now(), + } + + fmt.Println("Returning content ", content) + resp, err := json.Marshal(data) + fmt.Println("Data object bytes: ", resp) + if err != nil { + fmt.Printf("Marshal data error: %v", err) + http.Error(w, err.Error(), http.StatusInternalServerError) + return + } + + _, err = w.Write(resp) + if err != nil { + fmt.Printf("Writing response failed due to error: %v", err) + http.Error(w, err.Error(), http.StatusInternalServerError) + return + } +} + +/******************Client functions************************/ + +//MakeRequest makes request to the server. +func MakeRequest(path string, client *http.Client) string { + url := "dmsg://" + serverPubKey + ":" + serverPort + "/" + path + req, err := http.NewRequest("GET", url, nil) + if err != nil { + fmt.Println("error creating request for path: ", path) + return "" + } + + resp, err := client.Do(req) + if err != nil { + fmt.Println("requestData request failed due to error: ", err) + return "" + } + defer func() { + if err := resp.Body.Close(); err != nil { + panic(err) + } + }() + + bytes, err := ioutil.ReadAll(resp.Body) + if err != nil { + fmt.Printf("Error reading data: %v", err) + return "" + } + + var data ExampleResponse + if dataObjectErr := json.Unmarshal(bytes, &data); dataObjectErr != nil { + fmt.Println("error unmarshaling received data object for path: ", path) + return "" + } + + fmt.Printf("Received content %s generated at %v\n", data.Content, data.Timestamp) + return data.Content +} + +//ExampleResponse is model for response message. +type ExampleResponse struct { + Content string `json:"content"` + Timestamp time.Time `json:"timestamp"` +} From fa781a307f4c554d9d72de40e0c1e129b5095aa2 Mon Sep 17 00:00:00 2001 From: Marko Tagliavia Date: Fri, 21 Feb 2020 18:19:12 +0100 Subject: [PATCH 4/6] Eof showcase unit test --- dmsg-http_test.go | 45 ++++++++++++++--------- go.mod | 3 +- go.sum | 88 +++++++++++++++++++++++++++++++++++++++++++++ test-preparation.go | 2 +- 4 files changed, 120 insertions(+), 18 deletions(-) diff --git a/dmsg-http_test.go b/dmsg-http_test.go index 56427c0..29fdad1 100644 --- a/dmsg-http_test.go +++ b/dmsg-http_test.go @@ -23,6 +23,8 @@ const ( ) var ( + publicKey = "036c4441b76aad343a9073d12f72d024009feabd8a0ccc92d3f88dacc93aafca65" + secretKey = "c483329a1057a578d0f1b93a5bb190a3bebd71c03f19df73dd9852066c22fc7b" expectedSmallContent = "small content, small content, small content, small content, small content, " expectedLargeContent = "" // populated at the start of main, not to keep 1000 occurrences here ) @@ -295,8 +297,8 @@ func TestDMSGClientWithMultipleRoutes(t *testing.T) { } func TestEofShowcase(t *testing.T) { + go createDmsgClientForEofShowcase(t) createDmsgSrvForEofShowcase() - createDmsgClientForEofShowcase() } func createDmsgSrv(t *testing.T, dc disc.APIClient) (srv *dmsg.Server, srvErr <-chan error) { @@ -316,24 +318,28 @@ func createDmsgSrv(t *testing.T, dc disc.APIClient) (srv *dmsg.Server, srvErr <- func createDmsgSrvForEofShowcase() { port := uint16(9091) // use any port you like here, make sure it's referenced in the cmd/client/http-client.go - // dmsgD := disc.NewHTTP("http://dmsg.discovery.skywire.skycoin.com") - dmsgD := disc.NewHTTP("http://localhost:9090") + dmsgD := disc.NewHTTP("http://http://dmsg.discovery.skywire.cc/") + //dmsgD := disc.NewHTTP("http://localhost:9090") + + pK := cipher.PubKey{} + sK := cipher.SecKey{} + pK.UnmarshalText([]byte(publicKey)) + sK.UnmarshalText([]byte(secretKey)) - sPK, sSK := cipher.GenerateKeyPair() // note down public key printed out bellow and use the value in cmd/client/http-client.go 'serverPubKey' value - fmt.Printf("Starting http server on public key: %s and port: %v", sPK.Hex(), port) + fmt.Printf("Starting http server on public key: %s and port: %v", pK.Hex(), port) httpS := dmsghttp.Server{ - PubKey: sPK, - SecKey: sSK, + PubKey: pK, + SecKey: sK, Port: port, Discovery: dmsgD, } // prepare server route handling mux := http.NewServeMux() - mux.HandleFunc("/small", SmallRequestHandler) - mux.HandleFunc("/large", LargeRequestHandler) + mux.HandleFunc("/small", dmsghttp.SmallRequestHandler) + mux.HandleFunc("/large", dmsghttp.LargeRequestHandler) // run the server sErr := make(chan error, 1) @@ -341,7 +347,8 @@ func createDmsgSrvForEofShowcase() { close(sErr) } -func createDmsgClientForEofShowcase() { +func createDmsgClientForEofShowcase(t *testing.T) { + time.Sleep(5 * time.Second) var b bytes.Buffer countExpectedLargeContent := 1000 // how many times we expect 'large content, ' phrase to appear in the response for i := countExpectedLargeContent; i > 0; i-- { @@ -349,26 +356,32 @@ func createDmsgClientForEofShowcase() { } expectedLargeContent = b.String() - sPK, sSK := cipher.GenerateKeyPair() - // disc := disc.NewHTTP("http://dmsg.discovery.skywire.skycoin.com") - disc := disc.NewHTTP("http://localhost:9090") - client := dmsghttp.DMSGClient(disc, sPK, sSK) + //sPK, sSK := cipher.GenerateKeyPair() + disc := disc.NewHTTP("http://http://dmsg.discovery.skywire.cc/") + //disc := disc.NewHTTP("http://localhost:9090") + pK := cipher.PubKey{} + sK := cipher.SecKey{} + pK.UnmarshalText([]byte(publicKey)) + sK.UnmarshalText([]byte(secretKey)) + client := dmsghttp.DMSGClient(disc, pK, sK) // this one is returned ok - resp := MakeRequest("small", client) + resp := dmsghttp.MakeRequest("small", client) if resp != expectedSmallContent { fmt.Printf("Received small content is not what's expected. Expected %s but received %s\n", expectedSmallContent, resp) + t.Fail() return } fmt.Println("Small content is ok") // this one fails with following message "Error reading data: http: unexpected EOF reading trailer" - resp = MakeRequest("large", client) + resp = dmsghttp.MakeRequest("large", client) if resp != expectedLargeContent { largeContentRegex := regexp.MustCompile("large content,") matches := largeContentRegex.FindAllStringIndex(resp, -1) countActual := len(matches) // how many times we received expected phrase, fmt.Printf("Received large content is not what's expected. Expected %v but received %v 'large content' occurrences\n", countExpectedLargeContent, countActual) + t.Fail() return } fmt.Print("Large content is ok") diff --git a/go.mod b/go.mod index c8b4d4b..723ecf5 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,8 @@ module github.com/SkycoinProject/dmsg-http go 1.13 require ( - github.com/SkycoinProject/dmsg v0.0.0-20200127093622-ba9543931922 + github.com/SkycoinProject/dmsg v0.0.0-20200220122410-79d9d7bac617 + github.com/go-playground/locales v0.13.0 // indirect github.com/stretchr/testify v1.4.0 golang.org/x/net v0.0.0-20191204025024-5ee1b9f4859a ) diff --git a/go.sum b/go.sum index ccbcdde..59e6095 100644 --- a/go.sum +++ b/go.sum @@ -1,8 +1,12 @@ +cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= +github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= github.com/SkycoinProject/dmsg v0.0.0-20191023060159-6681cbc57b0b h1:wSMRUF788IfkTuvNdh4nXi+pstswUgUdo6bDVfLCUXQ= github.com/SkycoinProject/dmsg v0.0.0-20191023060159-6681cbc57b0b/go.mod h1:kIUD2Nw2766W5lq6Bswb6UjZFDEo5Gry6m8OSngXU3A= github.com/SkycoinProject/dmsg v0.0.0-20200127093622-ba9543931922 h1:u2puzXjAqvGoTAat3jJiIqsVGBqMHB8ZOVNMKJ5UXa4= github.com/SkycoinProject/dmsg v0.0.0-20200127093622-ba9543931922/go.mod h1:/nTdcMBrMHE39N6fxm300DtMly3UvZXPfwxBa9U8oGs= +github.com/SkycoinProject/dmsg v0.0.0-20200220122410-79d9d7bac617 h1:dTlZiB/kaSMezzwyEsOs2fjbbDkgoLzdLSwh7GmOIK4= +github.com/SkycoinProject/dmsg v0.0.0-20200220122410-79d9d7bac617/go.mod h1:eCoemDDyfyfNTFrapYKNEItwtRIj54UGpu4Ffcznuds= github.com/SkycoinProject/skycoin v0.26.0 h1:8/ZRZb2VM2DM4YTIitRJMZ3Yo/3H1FFmbCMx5o6ekmA= github.com/SkycoinProject/skycoin v0.26.0/go.mod h1:xqPLOKh5B6GBZlGA7B5IJfQmCy7mwimD9NlqxR3gMXo= github.com/SkycoinProject/yamux v0.0.0-20191213015001-a36efeefbf6a h1:6nHCJqh7trsuRcpMC5JmtDukUndn2VC9sY64K6xQ7hQ= @@ -15,36 +19,70 @@ github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5 github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= +github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= +github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= +github.com/coreos/bbolt v1.3.2/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk= github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= github.com/coreos/go-etcd v2.0.0+incompatible/go.mod h1:Jez6KQU2B/sWsbdaef3ED8NzMklzPG4d5KIOhIy30Tk= github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= +github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= +github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= github.com/cpuguy83/go-md2man v1.0.10/go.mod h1:SmD6nW6nTyfqj6ABTjUi3V3JVMnlJmwcJI5acqYI6dE= +github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= +github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no= github.com/flynn/noise v0.0.0-20180327030543-2492fe189ae6 h1:u/UEqS66A5ckRmS4yNpjmVH56sVtS/RfclBAYocb4as= github.com/flynn/noise v0.0.0-20180327030543-2492fe189ae6/go.mod h1:1i71OnUq3iUe1ma7Lr6yG6/rjvM3emb6yoL7xLFzcVQ= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= +github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= +github.com/go-playground/locales v0.13.0 h1:HyWk6mgj5qFqCT5fjGBuRArbVDfE4hi8+e8ceBS/t7Q= +github.com/go-playground/locales v0.13.0/go.mod h1:taPMhCMXrRLJO55olJkUXHZBHCxTMfnGwq/HNwmWNS8= github.com/go-redis/redis v6.15.6+incompatible/go.mod h1:NAIEuMOZ/fxfXJIrKDQDz8wamY7mA7PouImQ2Jvg6kA= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= +github.com/gobwas/httphead v0.0.0-20180130184737-2c6c146eadee/go.mod h1:L0fX3K22YWvt/FAX9NnzrNzcI4wNYi9Yku4O0LKYflo= +github.com/gobwas/pool v0.2.0/go.mod h1:q8bcK0KcYlCgd9e7WYLm9LpyS+YeLd8JVDW6WezmKEw= +github.com/gobwas/ws v1.0.2/go.mod h1:szmBTxLgaFppYjEmNtny/v3w89xOydFnnZMcgRRu/EM= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= +github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4= +github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= +github.com/golang/groupcache v0.0.0-20190129154638-5b532d6fd5ef/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= +github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= +github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= +github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= github.com/gorilla/handlers v1.4.2/go.mod h1:Qkdc/uu4tH4g6mTK6auzZ766c4CA0Ng8+o/OAirnOIQ= +github.com/gorilla/websocket v1.4.0/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= +github.com/gorilla/websocket v1.4.1/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= +github.com/grpc-ecosystem/go-grpc-middleware v1.0.0/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= +github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk= +github.com/grpc-ecosystem/grpc-gateway v1.9.0/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= github.com/hashicorp/yamux v0.0.0-20190923154419-df201c70410d/go.mod h1:+NfK9FKeTrX5uv1uIXGdwYDTeHna2qgaIlx54MXqjAM= github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= +github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= github.com/json-iterator/go v1.1.8/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= +github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= +github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q= +github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= +github.com/klauspost/compress v1.10.0/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= github.com/konsorten/go-windows-terminal-sequences v1.0.1 h1:mweAR1A6xJ3oS2pRaGiHgQ4OO8tzTaLawm8vnODuwDk= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= @@ -54,6 +92,7 @@ github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= +github.com/magiconair/properties v1.8.1/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/mattn/go-colorable v0.1.2 h1:/bC9yWikZXAL9uJdulbSfyVNIR3n3trXl+v8+1sx8mU= github.com/mattn/go-colorable v0.1.2/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= github.com/mattn/go-colorable v0.1.4 h1:snbPLB8fVfU9iwbbo30TPtbLRzwWu6aJS6Xh4eaaviA= @@ -70,50 +109,76 @@ github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJ github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= +github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U= github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= +github.com/prometheus/client_golang v0.9.3/go.mod h1:/TN21ttK/J9q6uSwhBd54HahCDft0ttaMvbicHlPoso= github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= github.com/prometheus/client_golang v1.3.0/go.mod h1:hJaj2vgQTGQmVCsAACORcieXFeDPbaTKGT+JTgUa3og= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.1.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/prometheus/common v0.0.0-20181113130724-41aa239b4cce/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= +github.com/prometheus/common v0.4.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.7.0/go.mod h1:DjGbpBbp5NYNiECxcL/VnbXCCaQpKd3tt26CguLLsqA= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= +github.com/prometheus/procfs v0.0.0-20190507164030-5867b95ac084/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/prometheus/procfs v0.0.8/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+GxbHq6oeK9A= +github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU= +github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg= github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/sirupsen/logrus v1.4.2 h1:SPIRibHv4MatM3XXNO2BJeFLZwZ2LvZgfQ5+UNI2im4= github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= github.com/skycoin/skycoin v0.26.0 h1:xDxe2r8AclMntZ550Y/vUQgwgLtwrf9Wu5UYiYcN5/o= github.com/skycoin/skycoin v0.26.0/go.mod h1:78nHjQzd8KG0jJJVL/j0xMmrihXi70ti63fh8vXScJw= +github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= +github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= +github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM= +github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ= github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= github.com/spf13/cobra v0.0.5/go.mod h1:3K3wKZymM7VvHMDS9+Akkh4K60UwM26emMESw8tLCHU= github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo= github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/spf13/viper v1.3.2/go.mod h1:ZiWeW+zYFKm7srdB9IoDzzZXaJaI5eL9QjNiN/DMA2s= +github.com/spf13/viper v1.6.2/go.mod h1:t3iDnF5Jlj76alVNuyFBk5oUMCvsrkbvZK0WQdfDi5k= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0 h1:2E4SXV/wtOkTonXsotYi4li6zVWxYlZuYNCXe9XRJyk= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= +github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= +github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= +github.com/ugorji/go v1.1.4/go.mod h1:uQMGLiO92mf5W77hV/PUCpI3pbzQx3CRekS0kk+RGrc= github.com/ugorji/go/codec v0.0.0-20181204163529-d75b2dcb6bc8/go.mod h1:VFNgLljTbGfSG7qAOspJ7OScBnGdDN/yBr0sguwnwf0= +github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q= +go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= +go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= +go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= +go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550 h1:ObdrDkeb4kJdCP557AjRjq69pTHfNouLtWZG7j9rPN8= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= +golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= +golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20181220203305-927f97764cc3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190522155817-f3200d17e092/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20191014212845-da9a3fd4c582/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= @@ -121,11 +186,15 @@ golang.org/x/net v0.0.0-20191028085509-fe3aa8a45271 h1:N66aaryRB3Ax92gH0v3hp1QYZ golang.org/x/net v0.0.0-20191028085509-fe3aa8a45271/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20191204025024-5ee1b9f4859a h1:+HHJiFUXVOIS9mr1ThqkQD1N8vpFCfCShqADBM12KTc= golang.org/x/net v0.0.0-20191204025024-5ee1b9f4859a/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= +golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181205085412-a5c9d58dba9a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -138,7 +207,13 @@ golang.org/x/sys v0.0.0-20191220142924-d4481acd189f h1:68K/z8GLUxV76xGSqwTWw2gyk golang.org/x/sys v0.0.0-20191220142924-d4481acd189f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= +golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190328211700-ab21143f2384/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20191014205221-18e3458ac98b/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191206204035-259af5ff87bd/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20200115044656-831fdb1e1868/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= @@ -146,10 +221,23 @@ golang.org/x/tools v0.0.0-20200116062425-473961ec044c/go.mod h1:TB2adYChydJhpapK golang.org/x/tools v0.0.0-20200124021010-5c352bb417e0/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= +google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= +google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= +google.golang.org/grpc v1.21.0/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/ini.v1 v1.51.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= +gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo= +gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74= gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.2 h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.4 h1:/eiJrUcujPVeJ3xlSWaiNi3uSVmDGBK1pDHUHAnao1I= +gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +nhooyr.io/websocket v1.8.2/go.mod h1:LiqdCg1Cu7TPWxEvPjPa0TGYxCsy4pHNTN9gGluwBpQ= diff --git a/test-preparation.go b/test-preparation.go index 0dfac6e..52cec61 100644 --- a/test-preparation.go +++ b/test-preparation.go @@ -10,7 +10,7 @@ import ( ) var ( - serverPubKey = "" // write down value printed out by server/http-server.go + serverPubKey = "036c4441b76aad343a9073d12f72d024009feabd8a0ccc92d3f88dacc93aafca65" // write down value printed out by server/http-server.go serverPort = "9091" ) From 93db5ed5a3b7ca5d3471196b323d81a82873ef99 Mon Sep 17 00:00:00 2001 From: Marko Tagliavia Date: Tue, 25 Feb 2020 18:22:14 +0100 Subject: [PATCH 5/6] Eof showcase unit test switched to local discovery --- dmsg-http_test.go | 8 ++++---- go.mod | 2 +- go.sum | 2 ++ transport.go | 3 ++- 4 files changed, 9 insertions(+), 6 deletions(-) diff --git a/dmsg-http_test.go b/dmsg-http_test.go index 29fdad1..b565e2f 100644 --- a/dmsg-http_test.go +++ b/dmsg-http_test.go @@ -318,8 +318,8 @@ func createDmsgSrv(t *testing.T, dc disc.APIClient) (srv *dmsg.Server, srvErr <- func createDmsgSrvForEofShowcase() { port := uint16(9091) // use any port you like here, make sure it's referenced in the cmd/client/http-client.go - dmsgD := disc.NewHTTP("http://http://dmsg.discovery.skywire.cc/") - //dmsgD := disc.NewHTTP("http://localhost:9090") + //dmsgD := disc.NewHTTP("http://http://dmsg.discovery.skywire.cc/") + dmsgD := disc.NewHTTP("http://localhost:9090") pK := cipher.PubKey{} sK := cipher.SecKey{} @@ -357,8 +357,8 @@ func createDmsgClientForEofShowcase(t *testing.T) { expectedLargeContent = b.String() //sPK, sSK := cipher.GenerateKeyPair() - disc := disc.NewHTTP("http://http://dmsg.discovery.skywire.cc/") - //disc := disc.NewHTTP("http://localhost:9090") + //disc := disc.NewHTTP("http://http://dmsg.discovery.skywire.cc/") + disc := disc.NewHTTP("http://localhost:9090") pK := cipher.PubKey{} sK := cipher.SecKey{} pK.UnmarshalText([]byte(publicKey)) diff --git a/go.mod b/go.mod index 723ecf5..a95ca7b 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module github.com/SkycoinProject/dmsg-http go 1.13 require ( - github.com/SkycoinProject/dmsg v0.0.0-20200220122410-79d9d7bac617 + github.com/SkycoinProject/dmsg v0.0.0-20200224064625-1b539081519c github.com/go-playground/locales v0.13.0 // indirect github.com/stretchr/testify v1.4.0 golang.org/x/net v0.0.0-20191204025024-5ee1b9f4859a diff --git a/go.sum b/go.sum index 59e6095..728a1d7 100644 --- a/go.sum +++ b/go.sum @@ -7,6 +7,8 @@ github.com/SkycoinProject/dmsg v0.0.0-20200127093622-ba9543931922 h1:u2puzXjAqvG github.com/SkycoinProject/dmsg v0.0.0-20200127093622-ba9543931922/go.mod h1:/nTdcMBrMHE39N6fxm300DtMly3UvZXPfwxBa9U8oGs= github.com/SkycoinProject/dmsg v0.0.0-20200220122410-79d9d7bac617 h1:dTlZiB/kaSMezzwyEsOs2fjbbDkgoLzdLSwh7GmOIK4= github.com/SkycoinProject/dmsg v0.0.0-20200220122410-79d9d7bac617/go.mod h1:eCoemDDyfyfNTFrapYKNEItwtRIj54UGpu4Ffcznuds= +github.com/SkycoinProject/dmsg v0.0.0-20200224064625-1b539081519c h1:TBwm7dzyUYnOG/Ycb3HBh7JshQavePHHfh5NOAzlNww= +github.com/SkycoinProject/dmsg v0.0.0-20200224064625-1b539081519c/go.mod h1:eCoemDDyfyfNTFrapYKNEItwtRIj54UGpu4Ffcznuds= github.com/SkycoinProject/skycoin v0.26.0 h1:8/ZRZb2VM2DM4YTIitRJMZ3Yo/3H1FFmbCMx5o6ekmA= github.com/SkycoinProject/skycoin v0.26.0/go.mod h1:xqPLOKh5B6GBZlGA7B5IJfQmCy7mwimD9NlqxR3gMXo= github.com/SkycoinProject/yamux v0.0.0-20191213015001-a36efeefbf6a h1:6nHCJqh7trsuRcpMC5JmtDukUndn2VC9sY64K6xQ7hQ= diff --git a/transport.go b/transport.go index c1a2cfe..f69fb76 100644 --- a/transport.go +++ b/transport.go @@ -17,7 +17,8 @@ import ( // Defaults for dmsg configuration, such as discovery URL const ( - DefaultDiscoveryURL = "http://dmsg.discovery.skywire.cc" + //DefaultDiscoveryURL = "http://dmsg.discovery.skywire.cc" + DefaultDiscoveryURL = "http://localhost:9090" ) // DMSGTransport holds information about client who is initiating communication. From 647d1316e0eab8a212657b987c050869ce991746 Mon Sep 17 00:00:00 2001 From: Marko Tagliavia Date: Thu, 27 Feb 2020 18:56:37 +0100 Subject: [PATCH 6/6] Eof showcase test moved to real dmsg server address --- dmsg-http_test.go | 16 ++++++++++------ transport.go | 4 ++-- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/dmsg-http_test.go b/dmsg-http_test.go index b565e2f..c0800b3 100644 --- a/dmsg-http_test.go +++ b/dmsg-http_test.go @@ -297,8 +297,9 @@ func TestDMSGClientWithMultipleRoutes(t *testing.T) { } func TestEofShowcase(t *testing.T) { - go createDmsgClientForEofShowcase(t) - createDmsgSrvForEofShowcase() + go createDmsgSrvForEofShowcase() + time.Sleep(5 * time.Second) + createDmsgClientForEofShowcase(t) } func createDmsgSrv(t *testing.T, dc disc.APIClient) (srv *dmsg.Server, srvErr <-chan error) { @@ -318,8 +319,10 @@ func createDmsgSrv(t *testing.T, dc disc.APIClient) (srv *dmsg.Server, srvErr <- func createDmsgSrvForEofShowcase() { port := uint16(9091) // use any port you like here, make sure it's referenced in the cmd/client/http-client.go - //dmsgD := disc.NewHTTP("http://http://dmsg.discovery.skywire.cc/") - dmsgD := disc.NewHTTP("http://localhost:9090") + dmsgD := disc.NewHTTP("http://http://dmsg.discovery.skywire.cc/") + //dmsgD := disc.NewHTTP("http://localhost:9090") + + //sPK, sSK := cipher.GenerateKeyPair() pK := cipher.PubKey{} sK := cipher.SecKey{} @@ -345,6 +348,7 @@ func createDmsgSrvForEofShowcase() { sErr := make(chan error, 1) sErr <- httpS.Serve(mux) close(sErr) + fmt.Println(sErr) } func createDmsgClientForEofShowcase(t *testing.T) { @@ -357,8 +361,8 @@ func createDmsgClientForEofShowcase(t *testing.T) { expectedLargeContent = b.String() //sPK, sSK := cipher.GenerateKeyPair() - //disc := disc.NewHTTP("http://http://dmsg.discovery.skywire.cc/") - disc := disc.NewHTTP("http://localhost:9090") + disc := disc.NewHTTP("http://http://dmsg.discovery.skywire.cc/") + //disc := disc.NewHTTP("http://localhost:9090") pK := cipher.PubKey{} sK := cipher.SecKey{} pK.UnmarshalText([]byte(publicKey)) diff --git a/transport.go b/transport.go index f69fb76..75a69bb 100644 --- a/transport.go +++ b/transport.go @@ -17,8 +17,8 @@ import ( // Defaults for dmsg configuration, such as discovery URL const ( - //DefaultDiscoveryURL = "http://dmsg.discovery.skywire.cc" - DefaultDiscoveryURL = "http://localhost:9090" + DefaultDiscoveryURL = "http://dmsg.discovery.skywire.cc" + //DefaultDiscoveryURL = "http://localhost:9090" ) // DMSGTransport holds information about client who is initiating communication.