starpc 0.1.1 → 0.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Makefile +140 -0
- package/README.md +16 -8
- package/dist/srpc/conn.d.ts +1 -1
- package/dist/srpc/conn.js +1 -1
- package/e2e/e2e.go +1 -0
- package/e2e/e2e_test.go +158 -0
- package/go.mod +49 -0
- package/go.sum +210 -0
- package/integration/integration.bash +25 -0
- package/integration/integration.go +30 -0
- package/integration/integration.ts +54 -0
- package/integration/tsconfig.json +11 -0
- package/package.json +17 -8
- package/patches/@libp2p+mplex+2.0.0.patch +23 -0
- package/patches/ts-poet+4.12.0.patch +72 -0
- package/srpc/conn.ts +2 -2
package/Makefile
ADDED
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
PROTOWRAP=hack/bin/protowrap
|
|
2
|
+
PROTOC_GEN_GO=hack/bin/protoc-gen-go
|
|
3
|
+
PROTOC_GEN_VTPROTO=hack/bin/protoc-gen-go-vtproto
|
|
4
|
+
PROTOC_GEN_STARPC=hack/bin/protoc-gen-go-starpc
|
|
5
|
+
GOIMPORTS=hack/bin/goimports
|
|
6
|
+
GOLANGCI_LINT=hack/bin/golangci-lint
|
|
7
|
+
GO_MOD_OUTDATED=hack/bin/go-mod-outdated
|
|
8
|
+
export GO111MODULE=on
|
|
9
|
+
GOLIST=go list -f "{{ .Dir }}" -m
|
|
10
|
+
|
|
11
|
+
all:
|
|
12
|
+
|
|
13
|
+
vendor:
|
|
14
|
+
go mod vendor
|
|
15
|
+
|
|
16
|
+
$(PROTOC_GEN_GO):
|
|
17
|
+
cd ./hack; \
|
|
18
|
+
go build -v \
|
|
19
|
+
-o ./bin/protoc-gen-go \
|
|
20
|
+
github.com/golang/protobuf/protoc-gen-go
|
|
21
|
+
|
|
22
|
+
$(PROTOC_GEN_VTPROTO):
|
|
23
|
+
cd ./hack; \
|
|
24
|
+
go build -v \
|
|
25
|
+
-o ./bin/protoc-gen-go-vtproto \
|
|
26
|
+
github.com/planetscale/vtprotobuf/cmd/protoc-gen-go-vtproto
|
|
27
|
+
|
|
28
|
+
$(PROTOC_GEN_STARPC):
|
|
29
|
+
cd ./hack; \
|
|
30
|
+
go build -v \
|
|
31
|
+
-o ./bin/protoc-gen-go-starpc \
|
|
32
|
+
github.com/aperturerobotics/starpc/cmd/protoc-gen-go-starpc
|
|
33
|
+
|
|
34
|
+
$(GOIMPORTS):
|
|
35
|
+
cd ./hack; \
|
|
36
|
+
go build -v \
|
|
37
|
+
-o ./bin/goimports \
|
|
38
|
+
golang.org/x/tools/cmd/goimports
|
|
39
|
+
|
|
40
|
+
$(PROTOWRAP):
|
|
41
|
+
cd ./hack; \
|
|
42
|
+
go build -v \
|
|
43
|
+
-o ./bin/protowrap \
|
|
44
|
+
github.com/square/goprotowrap/cmd/protowrap
|
|
45
|
+
|
|
46
|
+
$(GOLANGCI_LINT):
|
|
47
|
+
cd ./hack; \
|
|
48
|
+
go build -v \
|
|
49
|
+
-o ./bin/golangci-lint \
|
|
50
|
+
github.com/golangci/golangci-lint/cmd/golangci-lint
|
|
51
|
+
|
|
52
|
+
$(GO_MOD_OUTDATED):
|
|
53
|
+
cd ./hack; \
|
|
54
|
+
go build -v \
|
|
55
|
+
-o ./bin/go-mod-outdated \
|
|
56
|
+
github.com/psampaz/go-mod-outdated
|
|
57
|
+
|
|
58
|
+
.PHONY: gengo
|
|
59
|
+
gengo: $(GOIMPORTS) $(PROTOWRAP) $(PROTOC_GEN_GO) $(PROTOC_GEN_VTPROTO) $(PROTOC_GEN_STARPC)
|
|
60
|
+
go mod vendor
|
|
61
|
+
shopt -s globstar; \
|
|
62
|
+
set -eo pipefail; \
|
|
63
|
+
export PROJECT=$$(go list -m); \
|
|
64
|
+
export PATH=$$(pwd)/hack/bin:$${PATH}; \
|
|
65
|
+
mkdir -p $$(pwd)/vendor/$$(dirname $${PROJECT}); \
|
|
66
|
+
rm $$(pwd)/vendor/$${PROJECT} || true; \
|
|
67
|
+
ln -s $$(pwd) $$(pwd)/vendor/$${PROJECT} ; \
|
|
68
|
+
$(PROTOWRAP) \
|
|
69
|
+
-I $$(pwd)/vendor \
|
|
70
|
+
--go_out=$$(pwd)/vendor \
|
|
71
|
+
--go-starpc_out=$$(pwd)/vendor \
|
|
72
|
+
--go-vtproto_out=$$(pwd)/vendor \
|
|
73
|
+
--go-vtproto_opt=features=marshal+unmarshal+size+equal \
|
|
74
|
+
--proto_path $$(pwd)/vendor \
|
|
75
|
+
--print_structure \
|
|
76
|
+
--only_specified_files \
|
|
77
|
+
$$(\
|
|
78
|
+
git \
|
|
79
|
+
ls-files "*.proto" |\
|
|
80
|
+
xargs printf -- \
|
|
81
|
+
"$$(pwd)/vendor/$${PROJECT}/%s "); \
|
|
82
|
+
rm $$(pwd)/vendor/$${PROJECT} || true
|
|
83
|
+
$(GOIMPORTS) -w ./
|
|
84
|
+
|
|
85
|
+
node_modules:
|
|
86
|
+
yarn install
|
|
87
|
+
|
|
88
|
+
.PHONY: gents
|
|
89
|
+
gents: $(PROTOWRAP) node_modules
|
|
90
|
+
go mod vendor
|
|
91
|
+
shopt -s globstar; \
|
|
92
|
+
set -eo pipefail; \
|
|
93
|
+
export PROJECT=$$(go list -m); \
|
|
94
|
+
export PATH=$$(pwd)/hack/bin:$${PATH}; \
|
|
95
|
+
mkdir -p $$(pwd)/vendor/$$(dirname $${PROJECT}); \
|
|
96
|
+
rm $$(pwd)/vendor/$${PROJECT} || true; \
|
|
97
|
+
ln -s $$(pwd) $$(pwd)/vendor/$${PROJECT} ; \
|
|
98
|
+
$(PROTOWRAP) \
|
|
99
|
+
-I $$(pwd)/vendor \
|
|
100
|
+
--plugin=./node_modules/.bin/protoc-gen-ts_proto \
|
|
101
|
+
--ts_proto_out=$$(pwd)/vendor \
|
|
102
|
+
--ts_proto_opt=forceLong=long \
|
|
103
|
+
--ts_proto_opt=oneof=unions \
|
|
104
|
+
--ts_proto_opt=esModuleInterop=true \
|
|
105
|
+
--proto_path $$(pwd)/vendor \
|
|
106
|
+
--print_structure \
|
|
107
|
+
--only_specified_files \
|
|
108
|
+
$$(\
|
|
109
|
+
git \
|
|
110
|
+
ls-files "*.proto" |\
|
|
111
|
+
xargs printf -- \
|
|
112
|
+
"$$(pwd)/vendor/$${PROJECT}/%s "); \
|
|
113
|
+
go mod vendor
|
|
114
|
+
|
|
115
|
+
.PHONY: genproto
|
|
116
|
+
genproto: gengo gents
|
|
117
|
+
|
|
118
|
+
.PHONY: gen
|
|
119
|
+
gen: genproto
|
|
120
|
+
|
|
121
|
+
outdated: $(GO_MOD_OUTDATED)
|
|
122
|
+
go list -mod=mod -u -m -json all | $(GO_MOD_OUTDATED) -update -direct
|
|
123
|
+
|
|
124
|
+
list: $(GO_MOD_OUTDATED)
|
|
125
|
+
go list -mod=mod -u -m -json all | $(GO_MOD_OUTDATED)
|
|
126
|
+
|
|
127
|
+
lint: $(GOLANGCI_LINT)
|
|
128
|
+
$(GOLANGCI_LINT) run
|
|
129
|
+
|
|
130
|
+
fix: $(GOLANGCI_LINT)
|
|
131
|
+
$(GOLANGCI_LINT) run --fix
|
|
132
|
+
|
|
133
|
+
.PHONY: test
|
|
134
|
+
test:
|
|
135
|
+
go test -v ./...
|
|
136
|
+
|
|
137
|
+
.PHONY: integration
|
|
138
|
+
integration: node_modules vendor
|
|
139
|
+
cd ./integration && \
|
|
140
|
+
bash ./integration.bash
|
package/README.md
CHANGED
|
@@ -1,26 +1,34 @@
|
|
|
1
1
|
# Stream RPC
|
|
2
2
|
|
|
3
|
-
**starpc**
|
|
4
|
-
TypeScript and Go.
|
|
3
|
+
**starpc** implements [Proto3 services] in both TypeScript and Go.
|
|
5
4
|
|
|
6
5
|
[Proto3 services]: https://developers.google.com/protocol-buffers/docs/proto3#services
|
|
7
6
|
|
|
8
|
-
|
|
7
|
+
Supports **client-to-server streaming** RPCs in the web browser, currently not
|
|
8
|
+
supported by any of the major RPC libraries.
|
|
9
9
|
|
|
10
|
-
The [rpcproto](./srpc/rpcproto.proto) file
|
|
10
|
+
The [rpcproto](./srpc/rpcproto.proto) file describes the protocol.
|
|
11
11
|
|
|
12
|
-
|
|
13
|
-
HTTP/2 or [libp2p-mplex] over a WebSocket.
|
|
12
|
+
Uses any Stream multiplexer: defaults to [libp2p-mplex] over a WebSocket.
|
|
14
13
|
|
|
15
14
|
[libp2p-mplex]: https://github.com/libp2p/js-libp2p-mplex
|
|
16
15
|
|
|
17
16
|
The server side has not yet been implemented in TypeScript.
|
|
18
17
|
|
|
18
|
+
# Usage
|
|
19
|
+
|
|
20
|
+
Starting with the [protobuf-project] repository on the "starpc" branch.
|
|
21
|
+
|
|
22
|
+
Use "git add" to add your new .proto files, then `yarn gen` to generate the
|
|
23
|
+
TypeScript and Go code for them.
|
|
24
|
+
|
|
19
25
|
# Examples
|
|
20
26
|
|
|
21
27
|
See the [protobuf-project] template on the "starpc" branch.
|
|
22
28
|
|
|
23
|
-
|
|
29
|
+
The demo/boilerplate project implements the Echo example below.
|
|
30
|
+
|
|
31
|
+
[protobuf-project]: https://github.com/aperturerobotics/protobuf-project/tree/starpc
|
|
24
32
|
|
|
25
33
|
## Protobuf
|
|
26
34
|
|
|
@@ -143,7 +151,7 @@ Community contributions and discussion are welcomed!
|
|
|
143
151
|
|
|
144
152
|
Please open a [GitHub issue] with any questions / issues.
|
|
145
153
|
|
|
146
|
-
[GitHub issue]: https://github.com/aperturerobotics/
|
|
154
|
+
[GitHub issue]: https://github.com/aperturerobotics/starpc/issues/new
|
|
147
155
|
|
|
148
156
|
... or feel free to reach out on [Matrix Chat] or [Discord].
|
|
149
157
|
|
package/dist/srpc/conn.d.ts
CHANGED
package/dist/srpc/conn.js
CHANGED
package/e2e/e2e.go
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
package e2e
|
package/e2e/e2e_test.go
ADDED
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
package e2e
|
|
2
|
+
|
|
3
|
+
import (
|
|
4
|
+
"context"
|
|
5
|
+
"io"
|
|
6
|
+
"testing"
|
|
7
|
+
|
|
8
|
+
"github.com/aperturerobotics/starpc/echo"
|
|
9
|
+
"github.com/aperturerobotics/starpc/srpc"
|
|
10
|
+
"github.com/pkg/errors"
|
|
11
|
+
)
|
|
12
|
+
|
|
13
|
+
// RunE2E runs an end to end test with a callback.
|
|
14
|
+
func RunE2E(t *testing.T, cb func(client echo.SRPCEchoerClient) error) {
|
|
15
|
+
// construct the server
|
|
16
|
+
echoServer := &echo.EchoServer{}
|
|
17
|
+
mux := srpc.NewMux()
|
|
18
|
+
if err := echo.SRPCRegisterEchoer(mux, echoServer); err != nil {
|
|
19
|
+
t.Fatal(err.Error())
|
|
20
|
+
}
|
|
21
|
+
server := srpc.NewServer(mux)
|
|
22
|
+
|
|
23
|
+
// construct the client
|
|
24
|
+
openStream := srpc.NewServerPipe(server)
|
|
25
|
+
client := srpc.NewClient(openStream)
|
|
26
|
+
|
|
27
|
+
// construct the client rpc interface
|
|
28
|
+
clientEcho := echo.NewSRPCEchoerClient(client)
|
|
29
|
+
|
|
30
|
+
// call
|
|
31
|
+
if err := cb(clientEcho); err != nil {
|
|
32
|
+
t.Fatal(err.Error())
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
func TestE2E_Unary(t *testing.T) {
|
|
37
|
+
ctx := context.Background()
|
|
38
|
+
RunE2E(t, func(client echo.SRPCEchoerClient) error {
|
|
39
|
+
bodyTxt := "hello world"
|
|
40
|
+
out, err := client.Echo(ctx, &echo.EchoMsg{
|
|
41
|
+
Body: bodyTxt,
|
|
42
|
+
})
|
|
43
|
+
if err != nil {
|
|
44
|
+
t.Fatal(err.Error())
|
|
45
|
+
}
|
|
46
|
+
if out.GetBody() != bodyTxt {
|
|
47
|
+
t.Fatalf("expected %q got %q", bodyTxt, out.GetBody())
|
|
48
|
+
}
|
|
49
|
+
return nil
|
|
50
|
+
})
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
// CheckServerStream checks the server stream portion of the Echo test.
|
|
54
|
+
func CheckServerStream(t *testing.T, out echo.SRPCEchoer_EchoServerStreamClient, req *echo.EchoMsg) error {
|
|
55
|
+
// expect to rx 5, then close
|
|
56
|
+
expectedRx := 5
|
|
57
|
+
totalExpected := expectedRx
|
|
58
|
+
for {
|
|
59
|
+
echoMsg, err := out.Recv()
|
|
60
|
+
if err != nil {
|
|
61
|
+
if err == io.EOF {
|
|
62
|
+
break
|
|
63
|
+
}
|
|
64
|
+
return err
|
|
65
|
+
}
|
|
66
|
+
body := echoMsg.GetBody()
|
|
67
|
+
bodyTxt := req.GetBody()
|
|
68
|
+
if body != bodyTxt {
|
|
69
|
+
return errors.Errorf("expected %q got %q", bodyTxt, body)
|
|
70
|
+
}
|
|
71
|
+
t.Logf("server->client message %d/%d", totalExpected-expectedRx+1, totalExpected)
|
|
72
|
+
expectedRx--
|
|
73
|
+
}
|
|
74
|
+
if expectedRx < 0 {
|
|
75
|
+
return errors.Errorf("got %d more messages than expected", -1*expectedRx)
|
|
76
|
+
}
|
|
77
|
+
return nil
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
func TestE2E_ServerStream(t *testing.T) {
|
|
81
|
+
ctx := context.Background()
|
|
82
|
+
RunE2E(t, func(client echo.SRPCEchoerClient) error {
|
|
83
|
+
bodyTxt := "hello world"
|
|
84
|
+
req := &echo.EchoMsg{
|
|
85
|
+
Body: bodyTxt,
|
|
86
|
+
}
|
|
87
|
+
out, err := client.EchoServerStream(ctx, req)
|
|
88
|
+
if err != nil {
|
|
89
|
+
t.Fatal(err.Error())
|
|
90
|
+
}
|
|
91
|
+
return CheckServerStream(t, out, req)
|
|
92
|
+
})
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
// CheckClientStream checks the server stream portion of the Echo test.
|
|
96
|
+
func CheckClientStream(t *testing.T, out echo.SRPCEchoer_EchoClientStreamClient, req *echo.EchoMsg) error {
|
|
97
|
+
// send request
|
|
98
|
+
if err := out.MsgSend(req); err != nil {
|
|
99
|
+
return err
|
|
100
|
+
}
|
|
101
|
+
// expect 1 response
|
|
102
|
+
ret := &echo.EchoMsg{}
|
|
103
|
+
if err := out.MsgRecv(ret); err != nil {
|
|
104
|
+
return err
|
|
105
|
+
}
|
|
106
|
+
// check response
|
|
107
|
+
if ret.GetBody() != req.GetBody() {
|
|
108
|
+
return errors.Errorf("expected %q got %q", req.GetBody(), ret.GetBody())
|
|
109
|
+
}
|
|
110
|
+
_ = out.Close()
|
|
111
|
+
return nil
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
func TestE2E_ClientStream(t *testing.T) {
|
|
115
|
+
ctx := context.Background()
|
|
116
|
+
RunE2E(t, func(client echo.SRPCEchoerClient) error {
|
|
117
|
+
bodyTxt := "hello world"
|
|
118
|
+
req := &echo.EchoMsg{
|
|
119
|
+
Body: bodyTxt,
|
|
120
|
+
}
|
|
121
|
+
out, err := client.EchoClientStream(ctx)
|
|
122
|
+
if err != nil {
|
|
123
|
+
t.Fatal(err.Error())
|
|
124
|
+
}
|
|
125
|
+
return CheckClientStream(t, out, req)
|
|
126
|
+
})
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
func TestE2E_BidiStream(t *testing.T) {
|
|
130
|
+
ctx := context.Background()
|
|
131
|
+
RunE2E(t, func(client echo.SRPCEchoerClient) error {
|
|
132
|
+
strm, err := client.EchoBidiStream(ctx)
|
|
133
|
+
if err != nil {
|
|
134
|
+
t.Fatal(err.Error())
|
|
135
|
+
}
|
|
136
|
+
clientExpected := "hello from client"
|
|
137
|
+
if err := strm.MsgSend(&echo.EchoMsg{Body: clientExpected}); err != nil {
|
|
138
|
+
t.Fatal(err.Error())
|
|
139
|
+
}
|
|
140
|
+
msg, err := strm.Recv()
|
|
141
|
+
if err != nil {
|
|
142
|
+
t.Fatal(err.Error())
|
|
143
|
+
}
|
|
144
|
+
expected := "hello from server"
|
|
145
|
+
if msg.GetBody() != expected {
|
|
146
|
+
t.Fatalf("expected %q got %q", expected, msg.GetBody())
|
|
147
|
+
}
|
|
148
|
+
msg, err = strm.Recv()
|
|
149
|
+
if err != nil {
|
|
150
|
+
t.Fatal(err.Error())
|
|
151
|
+
}
|
|
152
|
+
if msg.GetBody() != clientExpected {
|
|
153
|
+
t.Fatalf("expected %q got %q", clientExpected, msg.GetBody())
|
|
154
|
+
}
|
|
155
|
+
// expect no error closing
|
|
156
|
+
return strm.Close()
|
|
157
|
+
})
|
|
158
|
+
}
|
package/go.mod
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
module github.com/aperturerobotics/starpc
|
|
2
|
+
|
|
3
|
+
go 1.18
|
|
4
|
+
|
|
5
|
+
require (
|
|
6
|
+
github.com/pkg/errors v0.9.1
|
|
7
|
+
google.golang.org/protobuf v1.27.1
|
|
8
|
+
nhooyr.io/websocket v1.8.8-0.20210410000328-8dee580a7f74
|
|
9
|
+
)
|
|
10
|
+
|
|
11
|
+
require (
|
|
12
|
+
github.com/libp2p/go-libp2p v0.20.1
|
|
13
|
+
github.com/libp2p/go-libp2p-core v0.16.1
|
|
14
|
+
github.com/sirupsen/logrus v1.8.2-0.20220112234510-85981c045988
|
|
15
|
+
)
|
|
16
|
+
|
|
17
|
+
require (
|
|
18
|
+
github.com/btcsuite/btcd v0.22.1 // indirect
|
|
19
|
+
github.com/btcsuite/btcd/btcec/v2 v2.1.3 // indirect
|
|
20
|
+
github.com/btcsuite/btcd/chaincfg/chainhash v1.0.1 // indirect
|
|
21
|
+
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.1 // indirect
|
|
22
|
+
github.com/gogo/protobuf v1.3.2 // indirect
|
|
23
|
+
github.com/ipfs/go-cid v0.1.0 // indirect
|
|
24
|
+
github.com/ipfs/go-log/v2 v2.5.1 // indirect
|
|
25
|
+
github.com/klauspost/compress v1.15.1 // indirect
|
|
26
|
+
github.com/klauspost/cpuid/v2 v2.0.12 // indirect
|
|
27
|
+
github.com/libp2p/go-buffer-pool v0.0.2 // indirect
|
|
28
|
+
github.com/libp2p/go-mplex v0.7.0 // indirect
|
|
29
|
+
github.com/libp2p/go-openssl v0.0.7 // indirect
|
|
30
|
+
github.com/mattn/go-isatty v0.0.14 // indirect
|
|
31
|
+
github.com/minio/blake2b-simd v0.0.0-20160723061019-3f5f724cb5b1 // indirect
|
|
32
|
+
github.com/minio/sha256-simd v1.0.0 // indirect
|
|
33
|
+
github.com/mr-tron/base58 v1.2.0 // indirect
|
|
34
|
+
github.com/multiformats/go-base32 v0.0.3 // indirect
|
|
35
|
+
github.com/multiformats/go-base36 v0.1.0 // indirect
|
|
36
|
+
github.com/multiformats/go-multiaddr v0.5.0 // indirect
|
|
37
|
+
github.com/multiformats/go-multibase v0.0.3 // indirect
|
|
38
|
+
github.com/multiformats/go-multicodec v0.4.1 // indirect
|
|
39
|
+
github.com/multiformats/go-multihash v0.1.0 // indirect
|
|
40
|
+
github.com/multiformats/go-varint v0.0.6 // indirect
|
|
41
|
+
github.com/spacemonkeygo/spacelog v0.0.0-20180420211403-2296661a0572 // indirect
|
|
42
|
+
github.com/spaolacci/murmur3 v1.1.0 // indirect
|
|
43
|
+
go.uber.org/atomic v1.7.0 // indirect
|
|
44
|
+
go.uber.org/multierr v1.6.0 // indirect
|
|
45
|
+
go.uber.org/zap v1.19.1 // indirect
|
|
46
|
+
golang.org/x/crypto v0.0.0-20220525230936-793ad666bf5e // indirect
|
|
47
|
+
golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a // indirect
|
|
48
|
+
lukechampine.com/blake3 v1.1.6 // indirect
|
|
49
|
+
)
|
package/go.sum
ADDED
|
@@ -0,0 +1,210 @@
|
|
|
1
|
+
github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA=
|
|
2
|
+
github.com/benbjohnson/clock v1.3.0 h1:ip6w0uFQkncKQ979AypyG0ER7mqUSBdKLOgAle/AT8A=
|
|
3
|
+
github.com/btcsuite/btcd v0.22.1 h1:CnwP9LM/M9xuRrGSCGeMVs9iv09uMqwsVX7EeIpgV2c=
|
|
4
|
+
github.com/btcsuite/btcd v0.22.1/go.mod h1:wqgTSL29+50LRkmOVknEdmt8ZojIzhuWvgu/iptuN7Y=
|
|
5
|
+
github.com/btcsuite/btcd/btcec/v2 v2.1.3 h1:xM/n3yIhHAhHy04z4i43C8p4ehixJZMsnrVJkgl+MTE=
|
|
6
|
+
github.com/btcsuite/btcd/btcec/v2 v2.1.3/go.mod h1:ctjw4H1kknNJmRN4iP1R7bTQ+v3GJkZBd6mui8ZsAZE=
|
|
7
|
+
github.com/btcsuite/btcd/chaincfg/chainhash v1.0.1 h1:q0rUy8C/TYNBQS1+CGKw68tLOFYSNEs0TFnxxnS9+4U=
|
|
8
|
+
github.com/btcsuite/btcd/chaincfg/chainhash v1.0.1/go.mod h1:7SFka0XMvUgj3hfZtydOrQY2mwhPclbT2snogU7SQQc=
|
|
9
|
+
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
|
10
|
+
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
|
|
11
|
+
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
|
12
|
+
github.com/decred/dcrd/crypto/blake256 v1.0.0 h1:/8DMNYp9SGi5f0w7uCm6d6M4OU2rGFK09Y2A4Xv7EE0=
|
|
13
|
+
github.com/decred/dcrd/crypto/blake256 v1.0.0/go.mod h1:sQl2p6Y26YV+ZOcSTP6thNdn47hh8kt6rqSlvmrXFAc=
|
|
14
|
+
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.1 h1:YLtO71vCjJRCBcrPMtQ9nqBsqpA1m5sE92cU+pd5Mcc=
|
|
15
|
+
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.1/go.mod h1:hyedUtir6IdtD/7lIxGeCxkaw7y45JueMRL4DIyJDKs=
|
|
16
|
+
github.com/gin-contrib/sse v0.1.0 h1:Y/yl/+YNO8GZSjAhjMsSuLt29uWRFHdHYUb5lYOV9qE=
|
|
17
|
+
github.com/gin-contrib/sse v0.1.0/go.mod h1:RHrZQHXnP2xjPF+u1gW/2HnVO7nvIa9PG3Gm+fLHvGI=
|
|
18
|
+
github.com/gin-gonic/gin v1.6.3 h1:ahKqKTFpO5KTPHxWZjEdPScmYaGtLo8Y4DMHoEsnp14=
|
|
19
|
+
github.com/gin-gonic/gin v1.6.3/go.mod h1:75u5sXoLsGZoRN5Sgbi1eraJ4GU3++wFwWzhwvtwp4M=
|
|
20
|
+
github.com/go-playground/assert/v2 v2.0.1/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4=
|
|
21
|
+
github.com/go-playground/locales v0.13.0 h1:HyWk6mgj5qFqCT5fjGBuRArbVDfE4hi8+e8ceBS/t7Q=
|
|
22
|
+
github.com/go-playground/locales v0.13.0/go.mod h1:taPMhCMXrRLJO55olJkUXHZBHCxTMfnGwq/HNwmWNS8=
|
|
23
|
+
github.com/go-playground/universal-translator v0.17.0 h1:icxd5fm+REJzpZx7ZfpaD876Lmtgy7VtROAbHHXk8no=
|
|
24
|
+
github.com/go-playground/universal-translator v0.17.0/go.mod h1:UkSxE5sNxxRwHyU+Scu5vgOQjsIJAF8j9muTVoKLVtA=
|
|
25
|
+
github.com/go-playground/validator/v10 v10.2.0 h1:KgJ0snyC2R9VXYN2rneOtQcw5aHQB1Vv0sFl1UcHBOY=
|
|
26
|
+
github.com/go-playground/validator/v10 v10.2.0/go.mod h1:uOYAAleCW8F/7oMFd6aG0GOhaH6EGOAJShg8Id5JGkI=
|
|
27
|
+
github.com/gobwas/httphead v0.0.0-20180130184737-2c6c146eadee h1:s+21KNqlpePfkah2I+gwHF8xmJWRjooY+5248k6m4A0=
|
|
28
|
+
github.com/gobwas/httphead v0.0.0-20180130184737-2c6c146eadee/go.mod h1:L0fX3K22YWvt/FAX9NnzrNzcI4wNYi9Yku4O0LKYflo=
|
|
29
|
+
github.com/gobwas/pool v0.2.0 h1:QEmUOlnSjWtnpRGHF3SauEiOsy82Cup83Vf2LcMlnc8=
|
|
30
|
+
github.com/gobwas/pool v0.2.0/go.mod h1:q8bcK0KcYlCgd9e7WYLm9LpyS+YeLd8JVDW6WezmKEw=
|
|
31
|
+
github.com/gobwas/ws v1.0.2 h1:CoAavW/wd/kulfZmSIBt6p24n4j7tHgNVCjsfHVNUbo=
|
|
32
|
+
github.com/gobwas/ws v1.0.2/go.mod h1:szmBTxLgaFppYjEmNtny/v3w89xOydFnnZMcgRRu/EM=
|
|
33
|
+
github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q=
|
|
34
|
+
github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q=
|
|
35
|
+
github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw=
|
|
36
|
+
github.com/golang/protobuf v1.3.5/go.mod h1:6O5/vntMXwX2lRkT1hjjk0nAC1IDOTvTlVgjlRvqsdk=
|
|
37
|
+
github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk=
|
|
38
|
+
github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw=
|
|
39
|
+
github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
|
|
40
|
+
github.com/google/go-cmp v0.5.5 h1:Khx7svrCpmxxtHBq5j2mp/xVjsi8hQMfNLvJFAlrGgU=
|
|
41
|
+
github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
|
|
42
|
+
github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
|
|
43
|
+
github.com/gorilla/websocket v1.4.1/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
|
|
44
|
+
github.com/gorilla/websocket v1.5.0 h1:PPwGk2jz7EePpoHN/+ClbZu8SPxiqlu12wZP/3sWmnc=
|
|
45
|
+
github.com/ipfs/go-cid v0.0.7/go.mod h1:6Ux9z5e+HpkQdckYoX1PG/6xqKspzlEIR5SDmgqgC/I=
|
|
46
|
+
github.com/ipfs/go-cid v0.1.0 h1:YN33LQulcRHjfom/i25yoOZR4Telp1Hr/2RU3d0PnC0=
|
|
47
|
+
github.com/ipfs/go-cid v0.1.0/go.mod h1:rH5/Xv83Rfy8Rw6xG+id3DYAMUVmem1MowoKwdXmN2o=
|
|
48
|
+
github.com/ipfs/go-log/v2 v2.5.1 h1:1XdUzF7048prq4aBjDQQ4SL5RxftpRGdXhNRwKSAlcY=
|
|
49
|
+
github.com/ipfs/go-log/v2 v2.5.1/go.mod h1:prSpmC1Gpllc9UYWxDiZDreBYw7zp4Iqp1kOLU9U5UI=
|
|
50
|
+
github.com/json-iterator/go v1.1.9 h1:9yzud/Ht36ygwatGx56VwCZtlI/2AD15T1X2sjSuGns=
|
|
51
|
+
github.com/json-iterator/go v1.1.9/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4=
|
|
52
|
+
github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8=
|
|
53
|
+
github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
|
|
54
|
+
github.com/klauspost/compress v1.10.3/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs=
|
|
55
|
+
github.com/klauspost/compress v1.15.1 h1:y9FcTHGyrebwfP0ZZqFiaxTaiDnUrGkJkI+f583BL1A=
|
|
56
|
+
github.com/klauspost/compress v1.15.1/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47etQ6QUkpK6sk=
|
|
57
|
+
github.com/klauspost/cpuid/v2 v2.0.4/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg=
|
|
58
|
+
github.com/klauspost/cpuid/v2 v2.0.9/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg=
|
|
59
|
+
github.com/klauspost/cpuid/v2 v2.0.12 h1:p9dKCg8i4gmOxtv35DvrYoWqYzQrvEVdjQ762Y0OqZE=
|
|
60
|
+
github.com/klauspost/cpuid/v2 v2.0.12/go.mod h1:g2LTdtYhdyuGPqyWyv7qRAmj1WBqxuObKfj5c0PQa7c=
|
|
61
|
+
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
|
|
62
|
+
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
|
|
63
|
+
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
|
|
64
|
+
github.com/leodido/go-urn v1.2.0 h1:hpXL4XnriNwQ/ABnpepYM/1vCLWNDfUNts8dX3xTG6Y=
|
|
65
|
+
github.com/leodido/go-urn v1.2.0/go.mod h1:+8+nEpDfqqsY+g338gtMEUOtuK+4dEMhiQEgxpxOKII=
|
|
66
|
+
github.com/libp2p/go-buffer-pool v0.0.2 h1:QNK2iAFa8gjAe1SPz6mHSMuCcjs+X1wlHzeOSqcmlfs=
|
|
67
|
+
github.com/libp2p/go-buffer-pool v0.0.2/go.mod h1:MvaB6xw5vOrDl8rYZGLFdKAuk/hRoRZd1Vi32+RXyFM=
|
|
68
|
+
github.com/libp2p/go-libp2p v0.20.1 h1:tCgC8yXtleyOg/mp+ZoCcA+aryAhueCfFmAVXURT/PM=
|
|
69
|
+
github.com/libp2p/go-libp2p v0.20.1/go.mod h1:XgJHsOhEBVBXp/2Sj9bm/yEyD94uunAaP6oaegdcKks=
|
|
70
|
+
github.com/libp2p/go-libp2p-core v0.16.1 h1:bWoiEBqVkpJ13hbv/f69tHODp86t6mvc4fBN4DkK73M=
|
|
71
|
+
github.com/libp2p/go-libp2p-core v0.16.1/go.mod h1:O3i/7y+LqUb0N+qhzXjBjjpchgptWAVMG1Voegk7b4c=
|
|
72
|
+
github.com/libp2p/go-libp2p-testing v0.9.2 h1:dCpODRtRaDZKF8HXT9qqqgON+OMEB423Knrgeod8j84=
|
|
73
|
+
github.com/libp2p/go-mplex v0.7.0 h1:BDhFZdlk5tbr0oyFq/xv/NPGfjbnrsDam1EvutpBDbY=
|
|
74
|
+
github.com/libp2p/go-mplex v0.7.0/go.mod h1:rW8ThnRcYWft/Jb2jeORBmPd6xuG3dGxWN/W168L9EU=
|
|
75
|
+
github.com/libp2p/go-openssl v0.0.7 h1:eCAzdLejcNVBzP/iZM9vqHnQm+XyCEbSSIheIPRGNsw=
|
|
76
|
+
github.com/libp2p/go-openssl v0.0.7/go.mod h1:unDrJpgy3oFr+rqXsarWifmJuNnJR4chtO1HmaZjggc=
|
|
77
|
+
github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU=
|
|
78
|
+
github.com/mattn/go-isatty v0.0.14 h1:yVuAays6BHfxijgZPzw+3Zlu5yQgKGP2/hcQbHb7S9Y=
|
|
79
|
+
github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94=
|
|
80
|
+
github.com/minio/blake2b-simd v0.0.0-20160723061019-3f5f724cb5b1 h1:lYpkrQH5ajf0OXOcUbGjvZxxijuBwbbmlSxLiuofa+g=
|
|
81
|
+
github.com/minio/blake2b-simd v0.0.0-20160723061019-3f5f724cb5b1/go.mod h1:pD8RvIylQ358TN4wwqatJ8rNavkEINozVn9DtGI3dfQ=
|
|
82
|
+
github.com/minio/sha256-simd v0.1.1-0.20190913151208-6de447530771/go.mod h1:B5e1o+1/KgNmWrSQK08Y6Z1Vb5pwIktudl0J58iy0KM=
|
|
83
|
+
github.com/minio/sha256-simd v1.0.0 h1:v1ta+49hkWZyvaKwrQB8elexRqm6Y0aMLjCNsrYxo6g=
|
|
84
|
+
github.com/minio/sha256-simd v1.0.0/go.mod h1:OuYzVNI5vcoYIAmbIvHPl3N3jUzVedXbKy5RFepssQM=
|
|
85
|
+
github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421 h1:ZqeYNhU3OHLH3mGKHDcjJRFFRrJa6eAM5H+CtDdOsPc=
|
|
86
|
+
github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
|
|
87
|
+
github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742 h1:Esafd1046DLDQ0W1YjYsBW+p8U2u7vzgW2SQVmlNazg=
|
|
88
|
+
github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0=
|
|
89
|
+
github.com/mr-tron/base58 v1.1.0/go.mod h1:xcD2VGqlgYjBdcBLw+TuYLr8afG+Hj8g2eTVqeSzSU8=
|
|
90
|
+
github.com/mr-tron/base58 v1.1.3/go.mod h1:BinMc/sQntlIE1frQmRFPUoPA1Zkr8VRgBdjWI2mNwc=
|
|
91
|
+
github.com/mr-tron/base58 v1.2.0 h1:T/HDJBh4ZCPbU39/+c3rRvE0uKBQlU27+QI8LJ4t64o=
|
|
92
|
+
github.com/mr-tron/base58 v1.2.0/go.mod h1:BinMc/sQntlIE1frQmRFPUoPA1Zkr8VRgBdjWI2mNwc=
|
|
93
|
+
github.com/multiformats/go-base32 v0.0.3 h1:tw5+NhuwaOjJCC5Pp82QuXbrmLzWg7uxlMFp8Nq/kkI=
|
|
94
|
+
github.com/multiformats/go-base32 v0.0.3/go.mod h1:pLiuGC8y0QR3Ue4Zug5UzK9LjgbkL8NSQj0zQ5Nz/AA=
|
|
95
|
+
github.com/multiformats/go-base36 v0.1.0 h1:JR6TyF7JjGd3m6FbLU2cOxhC0Li8z8dLNGQ89tUg4F4=
|
|
96
|
+
github.com/multiformats/go-base36 v0.1.0/go.mod h1:kFGE83c6s80PklsHO9sRn2NCoffoRdUUOENyW/Vv6sM=
|
|
97
|
+
github.com/multiformats/go-multiaddr v0.5.0 h1:i/JuOoVg4szYQ4YEzDGtb2h0o8M7CG/Yq6cGlcjWZpM=
|
|
98
|
+
github.com/multiformats/go-multiaddr v0.5.0/go.mod h1:3KAxNkUqLTJ20AAwN4XVX4kZar+bR+gh4zgbfr3SNug=
|
|
99
|
+
github.com/multiformats/go-multibase v0.0.3 h1:l/B6bJDQjvQ5G52jw4QGSYeOTZoAwIO77RblWplfIqk=
|
|
100
|
+
github.com/multiformats/go-multibase v0.0.3/go.mod h1:5+1R4eQrT3PkYZ24C3W2Ue2tPwIdYQD509ZjSb5y9Oc=
|
|
101
|
+
github.com/multiformats/go-multicodec v0.4.1 h1:BSJbf+zpghcZMZrwTYBGwy0CPcVZGWiC72Cp8bBd4R4=
|
|
102
|
+
github.com/multiformats/go-multicodec v0.4.1/go.mod h1:1Hj/eHRaVWSXiSNNfcEPcwZleTmdNP81xlxDLnWU9GQ=
|
|
103
|
+
github.com/multiformats/go-multihash v0.0.13/go.mod h1:VdAWLKTwram9oKAatUcLxBNUjdtcVwxObEQBtRfuyjc=
|
|
104
|
+
github.com/multiformats/go-multihash v0.0.14/go.mod h1:VdAWLKTwram9oKAatUcLxBNUjdtcVwxObEQBtRfuyjc=
|
|
105
|
+
github.com/multiformats/go-multihash v0.0.15/go.mod h1:D6aZrWNLFTV/ynMpKsNtB40mJzmCl4jb1alC0OvHiHg=
|
|
106
|
+
github.com/multiformats/go-multihash v0.1.0 h1:CgAgwqk3//SVEw3T+6DqI4mWMyRuDwZtOWcJT0q9+EA=
|
|
107
|
+
github.com/multiformats/go-multihash v0.1.0/go.mod h1:RJlXsxt6vHGaia+S8We0ErjhojtKzPP2AH4+kYM7k84=
|
|
108
|
+
github.com/multiformats/go-varint v0.0.5/go.mod h1:3Ls8CIEsrijN6+B7PbrXRPxHRPuXSrVKRY101jdMZYE=
|
|
109
|
+
github.com/multiformats/go-varint v0.0.6 h1:gk85QWKxh3TazbLxED/NlDVv8+q+ReFJk7Y2W/KhfNY=
|
|
110
|
+
github.com/multiformats/go-varint v0.0.6/go.mod h1:3Ls8CIEsrijN6+B7PbrXRPxHRPuXSrVKRY101jdMZYE=
|
|
111
|
+
github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
|
|
112
|
+
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
|
|
113
|
+
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
|
|
114
|
+
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
|
|
115
|
+
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
|
|
116
|
+
github.com/sirupsen/logrus v1.8.2-0.20220112234510-85981c045988 h1:MF2lii450TvZhyAadvfiBGAr37d/U/ug5+N8eMvK89o=
|
|
117
|
+
github.com/sirupsen/logrus v1.8.2-0.20220112234510-85981c045988/go.mod h1:x/wqQ2RFrvQZEw5sMa05JQ/UbAAIfbzwTyMeXz9S0YI=
|
|
118
|
+
github.com/spacemonkeygo/spacelog v0.0.0-20180420211403-2296661a0572 h1:RC6RW7j+1+HkWaX/Yh71Ee5ZHaHYt7ZP4sQgUrm6cDU=
|
|
119
|
+
github.com/spacemonkeygo/spacelog v0.0.0-20180420211403-2296661a0572/go.mod h1:w0SWMsp6j9O/dk4/ZpIhL+3CkG8ofA2vuv7k+ltqUMc=
|
|
120
|
+
github.com/spaolacci/murmur3 v1.1.0 h1:7c1g84S4BPRrfL5Xrdp6fOJ206sU9y293DDHaoy0bLI=
|
|
121
|
+
github.com/spaolacci/murmur3 v1.1.0/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA=
|
|
122
|
+
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
|
|
123
|
+
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
|
|
124
|
+
github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
|
|
125
|
+
github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY=
|
|
126
|
+
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
|
|
127
|
+
github.com/ugorji/go v1.1.7 h1:/68gy2h+1mWMrwZFeD1kQialdSzAb432dtpeJ42ovdo=
|
|
128
|
+
github.com/ugorji/go v1.1.7/go.mod h1:kZn38zHttfInRq0xu/PH0az30d+z6vm202qpg1oXVMw=
|
|
129
|
+
github.com/ugorji/go/codec v1.1.7 h1:2SvQaVZ1ouYrrKKwoSk2pzd4A9evlKJb9oTL+OaLUSs=
|
|
130
|
+
github.com/ugorji/go/codec v1.1.7/go.mod h1:Ax+UKWsSmolVDwsd+7N3ZtXu+yMGCf907BLYF3GoBXY=
|
|
131
|
+
github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
|
|
132
|
+
github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
|
|
133
|
+
github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k=
|
|
134
|
+
go.uber.org/atomic v1.7.0 h1:ADUqmZGgLDDfbSL9ZmPxKTybcoEYHgpYfELNoN+7hsw=
|
|
135
|
+
go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc=
|
|
136
|
+
go.uber.org/goleak v1.1.11-0.20210813005559-691160354723 h1:sHOAIxRGBp443oHZIPB+HsUGaksVCXVQENPxwTfQdH4=
|
|
137
|
+
go.uber.org/goleak v1.1.11-0.20210813005559-691160354723/go.mod h1:cwTWslyiVhfpKIDGSZEM2HlOvcqm+tG4zioyIeLoqMQ=
|
|
138
|
+
go.uber.org/multierr v1.6.0 h1:y6IPFStTAIT5Ytl7/XYmHvzXQ7S3g/IeZW9hyZ5thw4=
|
|
139
|
+
go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU=
|
|
140
|
+
go.uber.org/zap v1.19.1 h1:ue41HOKd1vGURxrmeKIgELGb3jPW9DMUDGtsinblHwI=
|
|
141
|
+
go.uber.org/zap v1.19.1/go.mod h1:j3DNczoxDZroyBnOT1L/Q79cfUMGZxlv/9dzN7SM1rI=
|
|
142
|
+
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
|
|
143
|
+
golang.org/x/crypto v0.0.0-20190611184440-5c40567a22f8/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
|
|
144
|
+
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
|
|
145
|
+
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
|
|
146
|
+
golang.org/x/crypto v0.0.0-20210220033148-5ea612d1eb83/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I=
|
|
147
|
+
golang.org/x/crypto v0.0.0-20210506145944-38f3c27a63bf/go.mod h1:P+XmwS30IXTQdn5tA2iutPOUgjI07+tq3H3K9MVA1s8=
|
|
148
|
+
golang.org/x/crypto v0.0.0-20220525230936-793ad666bf5e h1:T8NU3HyQ8ClP4SEE+KbFlg6n0NhuTsN4MyznaarGsZM=
|
|
149
|
+
golang.org/x/crypto v0.0.0-20220525230936-793ad666bf5e/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
|
|
150
|
+
golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
|
|
151
|
+
golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
|
|
152
|
+
golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
|
|
153
|
+
golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
|
|
154
|
+
golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
|
|
155
|
+
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
|
|
156
|
+
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
|
157
|
+
golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
|
158
|
+
golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
|
|
159
|
+
golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
|
|
160
|
+
golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM=
|
|
161
|
+
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
|
162
|
+
golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
|
163
|
+
golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
|
164
|
+
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
|
165
|
+
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
|
166
|
+
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
|
167
|
+
golang.org/x/sys v0.0.0-20190626221950-04f50cda93cb/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
|
168
|
+
golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
|
169
|
+
golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
|
170
|
+
golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
|
171
|
+
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
|
172
|
+
golang.org/x/sys v0.0.0-20210309074719-68d13333faf2/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
|
173
|
+
golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
|
174
|
+
golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
|
175
|
+
golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
|
176
|
+
golang.org/x/sys v0.0.0-20210910150752-751e447fb3d0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
|
177
|
+
golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a h1:dGzPydgVsqGcTRVwiLJ1jVbufYwmzD3LfVPLKsKg+0k=
|
|
178
|
+
golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
|
179
|
+
golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw=
|
|
180
|
+
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
|
|
181
|
+
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
|
182
|
+
golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
|
|
183
|
+
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
|
|
184
|
+
golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
|
|
185
|
+
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
|
|
186
|
+
golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
|
|
187
|
+
golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
|
|
188
|
+
golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
|
|
189
|
+
golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
|
|
190
|
+
golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk=
|
|
191
|
+
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
|
192
|
+
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
|
193
|
+
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
|
194
|
+
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE=
|
|
195
|
+
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
|
196
|
+
google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw=
|
|
197
|
+
google.golang.org/protobuf v1.27.1 h1:SnqbnDw1V7RiZcXPx5MEeqPv2s79L9i7BJUlG/+RurQ=
|
|
198
|
+
google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
|
|
199
|
+
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
|
200
|
+
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
|
201
|
+
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
|
202
|
+
gopkg.in/yaml.v2 v2.2.8 h1:obN1ZagJSUGI0Ek/LBmuj4SNLPfIny3KsKFopxRdj10=
|
|
203
|
+
gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
|
204
|
+
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
|
205
|
+
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b h1:h8qDotaEPuJATrMmW04NCwg7v22aHH28wwpauUhK9Oo=
|
|
206
|
+
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
|
207
|
+
lukechampine.com/blake3 v1.1.6 h1:H3cROdztr7RCfoaTpGZFQsrqvweFLrqS73j7L7cmR5c=
|
|
208
|
+
lukechampine.com/blake3 v1.1.6/go.mod h1:tkKEOtDkNtklkXtLNEOGNq5tcV90tJiA1vAA12R78LA=
|
|
209
|
+
nhooyr.io/websocket v1.8.8-0.20210410000328-8dee580a7f74 h1:V2XOYY4rGPHLTGQD4TiOMOfVwNd0zAuEPofzzEqiFWk=
|
|
210
|
+
nhooyr.io/websocket v1.8.8-0.20210410000328-8dee580a7f74/go.mod h1:B70DZP8IakI65RVQ51MsWP/8jndNma26DVA/nFSCgW0=
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
set -eo pipefail
|
|
3
|
+
|
|
4
|
+
echo "Compiling ts..."
|
|
5
|
+
# ../node_modules/.bin/tsc --out integration.js --project tsconfig.json
|
|
6
|
+
../node_modules/.bin/esbuild integration.ts --bundle --platform=node --outfile=integration.js
|
|
7
|
+
|
|
8
|
+
echo "Compiling go..."
|
|
9
|
+
go build -o integration -v ./
|
|
10
|
+
|
|
11
|
+
echo "Starting server..."
|
|
12
|
+
./integration &
|
|
13
|
+
PID=$!
|
|
14
|
+
|
|
15
|
+
function cleanup {
|
|
16
|
+
kill -9 ${PID}
|
|
17
|
+
}
|
|
18
|
+
trap cleanup EXIT
|
|
19
|
+
|
|
20
|
+
sleep 1
|
|
21
|
+
|
|
22
|
+
pushd ../
|
|
23
|
+
echo "Starting client..."
|
|
24
|
+
node ./integration/integration.js
|
|
25
|
+
popd
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
package main
|
|
2
|
+
|
|
3
|
+
import (
|
|
4
|
+
"fmt"
|
|
5
|
+
"net/http"
|
|
6
|
+
|
|
7
|
+
"github.com/aperturerobotics/starpc/echo"
|
|
8
|
+
"github.com/aperturerobotics/starpc/srpc"
|
|
9
|
+
"github.com/sirupsen/logrus"
|
|
10
|
+
)
|
|
11
|
+
|
|
12
|
+
func main() {
|
|
13
|
+
mux := srpc.NewMux()
|
|
14
|
+
|
|
15
|
+
echoServer := &echo.EchoServer{}
|
|
16
|
+
if err := echo.SRPCRegisterEchoer(mux, echoServer); err != nil {
|
|
17
|
+
logrus.Fatal(err.Error())
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
// listen at: ws://localhost:5000/demo
|
|
21
|
+
server, err := srpc.NewHTTPServer(mux, "/demo")
|
|
22
|
+
if err != nil {
|
|
23
|
+
logrus.Fatal(err.Error())
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
fmt.Print("listening on :5000\n")
|
|
27
|
+
if err := http.ListenAndServe(":5000", server); err != nil {
|
|
28
|
+
logrus.Fatal(err.Error())
|
|
29
|
+
}
|
|
30
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { WebSocketConn } from '../dist/srpc/websocket.js'
|
|
2
|
+
import { EchoerClientImpl, EchoMsg } from '../dist/echo/echo.js'
|
|
3
|
+
import WebSocket from 'isomorphic-ws'
|
|
4
|
+
import { Observable } from 'rxjs'
|
|
5
|
+
|
|
6
|
+
async function runRPC() {
|
|
7
|
+
const addr = 'ws://localhost:5000/demo'
|
|
8
|
+
console.log(`Connecting to ${addr}`)
|
|
9
|
+
const ws = new WebSocket(addr)
|
|
10
|
+
const channel = new WebSocketConn(ws)
|
|
11
|
+
const client = channel.buildClient()
|
|
12
|
+
const demoServiceClient = new EchoerClientImpl(client)
|
|
13
|
+
|
|
14
|
+
console.log('Calling Echo: unary call...')
|
|
15
|
+
let result = await demoServiceClient.Echo({
|
|
16
|
+
body: "Hello world!"
|
|
17
|
+
})
|
|
18
|
+
console.log('success: output', result.body)
|
|
19
|
+
|
|
20
|
+
// observable for client requests
|
|
21
|
+
const clientRequestStream = new Observable<EchoMsg>(subscriber => {
|
|
22
|
+
subscriber.next({body: 'Hello world from streaming request.'})
|
|
23
|
+
subscriber.complete()
|
|
24
|
+
})
|
|
25
|
+
|
|
26
|
+
console.log('Calling EchoClientStream: client -> server...')
|
|
27
|
+
result = await demoServiceClient.EchoClientStream(clientRequestStream)
|
|
28
|
+
console.log('success: output', result.body)
|
|
29
|
+
|
|
30
|
+
console.log('Calling EchoServerStream: server -> client...')
|
|
31
|
+
const serverStream = demoServiceClient.EchoServerStream({
|
|
32
|
+
body: 'Hello world from server to client streaming request.',
|
|
33
|
+
})
|
|
34
|
+
await new Promise<void>((resolve, reject) => {
|
|
35
|
+
serverStream.subscribe({
|
|
36
|
+
next(result) {
|
|
37
|
+
console.log('server: output', result.body)
|
|
38
|
+
},
|
|
39
|
+
complete() {
|
|
40
|
+
resolve()
|
|
41
|
+
},
|
|
42
|
+
error(err: Error) {
|
|
43
|
+
reject(err)
|
|
44
|
+
},
|
|
45
|
+
})
|
|
46
|
+
})
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
runRPC().then(() => {
|
|
50
|
+
process.exit(0)
|
|
51
|
+
}).catch((err) => {
|
|
52
|
+
console.error(err)
|
|
53
|
+
process.exit(1)
|
|
54
|
+
})
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "starpc",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.4",
|
|
4
4
|
"description": "Streaming protobuf RPC service protocol over any two-way channel.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": {
|
|
@@ -18,11 +18,17 @@
|
|
|
18
18
|
"main": "dist/srpc/index.js",
|
|
19
19
|
"types": "./dist/srpc/index.d.ts",
|
|
20
20
|
"files": [
|
|
21
|
-
"
|
|
22
|
-
"
|
|
23
|
-
"dist/srpc",
|
|
21
|
+
"!**/*.tsbuildinfo",
|
|
22
|
+
"Makefile",
|
|
24
23
|
"dist/echo",
|
|
25
|
-
"
|
|
24
|
+
"dist/srpc",
|
|
25
|
+
"e2e",
|
|
26
|
+
"echo",
|
|
27
|
+
"go.mod",
|
|
28
|
+
"go.sum",
|
|
29
|
+
"integration",
|
|
30
|
+
"patches",
|
|
31
|
+
"srpc"
|
|
26
32
|
],
|
|
27
33
|
"repository": {
|
|
28
34
|
"url": "git@github.com:aperturerobotics/starpc.git"
|
|
@@ -50,7 +56,7 @@
|
|
|
50
56
|
"@types/varint": "^6.0.0",
|
|
51
57
|
"@typescript-eslint/eslint-plugin": "^5.27.1",
|
|
52
58
|
"@typescript-eslint/parser": "^5.27.1",
|
|
53
|
-
"esbuild": "^0.14.
|
|
59
|
+
"esbuild": "^0.14.44",
|
|
54
60
|
"eslint": "^8.17.0",
|
|
55
61
|
"eslint-config-prettier": "^8.5.0",
|
|
56
62
|
"eslint-config-standard-with-typescript": "^21.0.1",
|
|
@@ -61,7 +67,9 @@
|
|
|
61
67
|
"typescript": "^4.7.3"
|
|
62
68
|
},
|
|
63
69
|
"dependencies": {
|
|
64
|
-
"@libp2p/
|
|
70
|
+
"@libp2p/components": "^1.0.0",
|
|
71
|
+
"@libp2p/interface-connection": "^1.0.1",
|
|
72
|
+
"@libp2p/mplex": "^2.0.0",
|
|
65
73
|
"event-iterator": "^2.0.0",
|
|
66
74
|
"isomorphic-ws": "^4.0.1",
|
|
67
75
|
"it-length-prefixed": "^7.0.1",
|
|
@@ -69,9 +77,10 @@
|
|
|
69
77
|
"it-pushable": "^3.0.0",
|
|
70
78
|
"it-stream-types": "^1.0.4",
|
|
71
79
|
"it-ws": "^5.0.2",
|
|
72
|
-
"protobufjs": "^6.11.3",
|
|
73
80
|
"patch-package": "^6.4.7",
|
|
81
|
+
"protobufjs": "^6.11.3",
|
|
74
82
|
"rxjs": "^7.5.5",
|
|
83
|
+
"ts-poet": "^4.12.0",
|
|
75
84
|
"ws": "^8.8.0"
|
|
76
85
|
}
|
|
77
86
|
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
diff --git a/node_modules/@libp2p/mplex/dist/src/index.d.ts b/node_modules/@libp2p/mplex/dist/src/index.d.ts
|
|
2
|
+
index 14c5f6e..32d0ee0 100644
|
|
3
|
+
--- a/node_modules/@libp2p/mplex/dist/src/index.d.ts
|
|
4
|
+
+++ b/node_modules/@libp2p/mplex/dist/src/index.d.ts
|
|
5
|
+
@@ -1,6 +1,7 @@
|
|
6
|
+
import { Components, Initializable } from '@libp2p/components';
|
|
7
|
+
import type { StreamMuxerFactory, StreamMuxerInit } from '@libp2p/interface-stream-muxer';
|
|
8
|
+
import { MplexStreamMuxer } from './mplex.js';
|
|
9
|
+
+export { MplexStreamMuxer } from './mplex.js';
|
|
10
|
+
export interface MplexInit {
|
|
11
|
+
/**
|
|
12
|
+
* The maximum size of message that can be sent in one go in bytes.
|
|
13
|
+
diff --git a/node_modules/@libp2p/mplex/dist/src/index.js b/node_modules/@libp2p/mplex/dist/src/index.js
|
|
14
|
+
index 4d692df..7bf592c 100644
|
|
15
|
+
--- a/node_modules/@libp2p/mplex/dist/src/index.js
|
|
16
|
+
+++ b/node_modules/@libp2p/mplex/dist/src/index.js
|
|
17
|
+
@@ -1,5 +1,6 @@
|
|
18
|
+
import { Components } from '@libp2p/components';
|
|
19
|
+
import { MplexStreamMuxer } from './mplex.js';
|
|
20
|
+
+export { MplexStreamMuxer } from './mplex.js';
|
|
21
|
+
export class Mplex {
|
|
22
|
+
constructor(init = {}) {
|
|
23
|
+
this.protocol = '/mplex/6.7.0';
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
diff --git a/node_modules/ts-poet/build/Import.js b/node_modules/ts-poet/build/Import.js
|
|
2
|
+
index 955a7eb..0ad3a67 100644
|
|
3
|
+
--- a/node_modules/ts-poet/build/Import.js
|
|
4
|
+
+++ b/node_modules/ts-poet/build/Import.js
|
|
5
|
+
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.sameModule = exports.maybeRelativePath = exports.emitImports = exports.SideEffect = exports.Augmented = exports.ImportsAll = exports.ImportsDefault = exports.ImportsName = exports.Imported = exports.Implicit = exports.Import = exports.importType = void 0;
|
|
7
|
+
const lodash_1 = __importDefault(require("lodash"));
|
|
8
|
+
const path_1 = __importDefault(require("path"));
|
|
9
|
+
+const path = require("path");
|
|
10
|
+
const Node_1 = require("./Node");
|
|
11
|
+
const typeImportMarker = '(?:t:)?';
|
|
12
|
+
const fileNamePattern = '(?:[a-zA-Z0-9._-]+)';
|
|
13
|
+
@@ -274,6 +275,15 @@ function emitImports(imports, ourModulePath, importMappings) {
|
|
14
|
+
return '';
|
|
15
|
+
}
|
|
16
|
+
let result = '';
|
|
17
|
+
+ const thisProject = process.env.PROJECT;
|
|
18
|
+
+ let ourModuleImportPath = path.normalize(ourModulePath);
|
|
19
|
+
+ // HACK: if this is an import from our project, set the path accordingly
|
|
20
|
+
+ // github.com/aperturerobotics/protobuf-project/example/example -> ./example/example
|
|
21
|
+
+ if (thisProject && ourModuleImportPath.startsWith(thisProject)) {
|
|
22
|
+
+ ourModuleImportPath = './' + ourModuleImportPath.substr(thisProject.length + 1);
|
|
23
|
+
+ }
|
|
24
|
+
+ // result += `// ourModulePath: ${ourModulePath}\n`;
|
|
25
|
+
+ // result += `// ourModuleImportPath: ${ourModuleImportPath}\n`;
|
|
26
|
+
const augmentImports = lodash_1.default.groupBy(filterInstances(imports, Augmented), (a) => a.augmented);
|
|
27
|
+
// Group the imports by source module they're imported from
|
|
28
|
+
const importsByModule = lodash_1.default.groupBy(imports.filter((it) => it.source !== undefined &&
|
|
29
|
+
@@ -288,7 +298,16 @@ function emitImports(imports, ourModulePath, importMappings) {
|
|
30
|
+
if (modulePath in importMappings) {
|
|
31
|
+
modulePath = importMappings[modulePath];
|
|
32
|
+
}
|
|
33
|
+
- const importPath = maybeRelativePath(ourModulePath, modulePath);
|
|
34
|
+
+ // HACK: if this is an import from a different project, use vendor/ tree.
|
|
35
|
+
+ if (thisProject && modulePath.startsWith('./')) {
|
|
36
|
+
+ if (!modulePath.substr(2).startsWith(thisProject)) {
|
|
37
|
+
+ modulePath = './vendor/' + path.normalize(modulePath);
|
|
38
|
+
+ } else {
|
|
39
|
+
+ modulePath = './' + modulePath.substr(3 + thisProject.length);
|
|
40
|
+
+ }
|
|
41
|
+
+ }
|
|
42
|
+
+ // result += `// modulePath: ${modulePath}\n`;
|
|
43
|
+
+ const importPath = maybeRelativePath(ourModuleImportPath, modulePath);
|
|
44
|
+
// Output star imports individually
|
|
45
|
+
unique(filterInstances(imports, ImportsAll).map((i) => i.symbol)).forEach((symbol) => {
|
|
46
|
+
result += `import * as ${symbol} from '${importPath}';\n`;
|
|
47
|
+
@@ -337,17 +356,15 @@ function maybeRelativePath(outputPath, importPath) {
|
|
48
|
+
if (!importPath.startsWith('./')) {
|
|
49
|
+
return importPath;
|
|
50
|
+
}
|
|
51
|
+
- // Drop the `./` prefix from the outputPath if it exists.
|
|
52
|
+
- const basePath = outputPath.replace(/^.\//, '');
|
|
53
|
+
- // Ideally we'd use a path library to do all this.
|
|
54
|
+
- const numberOfDirs = basePath.split('').filter((l) => l === '/').length;
|
|
55
|
+
- if (numberOfDirs === 0) {
|
|
56
|
+
- return importPath;
|
|
57
|
+
+ importPath = path.normalize(importPath);
|
|
58
|
+
+ outputPath = path.normalize(outputPath);
|
|
59
|
+
+ const outputPathDir = path.dirname(outputPath);
|
|
60
|
+
+ let relativePath = path.relative(outputPathDir, importPath);
|
|
61
|
+
+ if (!relativePath.startsWith('.')) {
|
|
62
|
+
+ // ensure the js compiler recognizes this is a relative path.
|
|
63
|
+
+ relativePath = './' + relativePath;
|
|
64
|
+
}
|
|
65
|
+
- // Make an array of `..` to get our importPath to the root directory.
|
|
66
|
+
- const a = new Array(numberOfDirs);
|
|
67
|
+
- const prefix = a.fill('..', 0, numberOfDirs).join('/');
|
|
68
|
+
- return prefix + importPath.substring(1);
|
|
69
|
+
+ return relativePath;
|
|
70
|
+
}
|
|
71
|
+
exports.maybeRelativePath = maybeRelativePath;
|
|
72
|
+
/** Checks if `path1 === path2` despite minor path differences like `./foo` and `foo`. */
|
package/srpc/conn.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { Stream } from '@libp2p/
|
|
1
|
+
import type { Stream } from '@libp2p/interface-connection'
|
|
2
2
|
import type { Duplex } from 'it-stream-types'
|
|
3
|
-
import { Components } from '@libp2p/
|
|
3
|
+
import { Components } from '@libp2p/components'
|
|
4
4
|
import { MplexStreamMuxer } from '@libp2p/mplex'
|
|
5
5
|
import type { Stream as SRPCStream } from './stream'
|
|
6
6
|
import { Client } from './client'
|