Compare commits
3 Commits
6159cd56b8
...
5059892bc0
Author | SHA1 | Date | |
---|---|---|---|
|
5059892bc0 | ||
|
aa07b04dd3 | ||
|
05e716e563 |
1
.gitignore
vendored
1
.gitignore
vendored
@ -34,6 +34,7 @@ node_modules
|
|||||||
|
|
||||||
# InteliJ
|
# InteliJ
|
||||||
.idea/workspace.xml
|
.idea/workspace.xml
|
||||||
|
.idea/shelf
|
||||||
.vscode
|
.vscode
|
||||||
|
|
||||||
lib/
|
lib/
|
||||||
|
12
README.md
12
README.md
@ -24,14 +24,22 @@ If you want to learn more about EventSourcing/EventModeling, you can join one of
|
|||||||
|
|
||||||
Install using `npm install node-eventstore-client`
|
Install using `npm install node-eventstore-client`
|
||||||
|
|
||||||
|
Versions to install to match EventStore versions:
|
||||||
|
|
||||||
|
- 0.1.x for ES prior to 3.9.4
|
||||||
|
- 0.2.x for ES from 3.9.4 to 20.10
|
||||||
|
- 21.10.x for ES 21.10
|
||||||
|
|
||||||
|
*I am working on making version match LTS and latest release of EventStore so that TCP protocol matches*
|
||||||
|
|
||||||
### Dependencies
|
### Dependencies
|
||||||
|
|
||||||
- Node.js >= 4.0
|
- Node.js >= 12
|
||||||
- Modules: [long](https://www.npmjs.org/package/long), [protobufjs](https://www.npmjs.org/package/protobufjs), [uuid](https://www.npmjs.org/package/uuid), [strict-event-emitter-types](https://www.npmjs.com/package/strict-event-emitter-types) (installed via `npm install`)
|
- Modules: [long](https://www.npmjs.org/package/long), [protobufjs](https://www.npmjs.org/package/protobufjs), [uuid](https://www.npmjs.org/package/uuid), [strict-event-emitter-types](https://www.npmjs.com/package/strict-event-emitter-types) (installed via `npm install`)
|
||||||
|
|
||||||
### Install and run an Eventstore on localhost
|
### Install and run an Eventstore on localhost
|
||||||
|
|
||||||
See https://eventstore.org/docs/introduction/4.1.0/
|
See https://eventstore.com
|
||||||
|
|
||||||
*Note: If you are using a version of EventStore prior to 3.9.4, you need to use version 0.1.x of this package `npm install node-eventstore-client@^0.1`.*
|
*Note: If you are using a version of EventStore prior to 3.9.4, you need to use version 0.1.x of this package `npm install node-eventstore-client@^0.1`.*
|
||||||
|
|
||||||
|
23
certs/ca/ca.crt
Normal file
23
certs/ca/ca.crt
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
-----BEGIN CERTIFICATE-----
|
||||||
|
MIIDzTCCArWgAwIBAgIRAJD0c8z8ITssbEkzjx4ZmRowDQYJKoZIhvcNAQELBQAw
|
||||||
|
YjELMAkGA1UEBhMCVUsxGDAWBgNVBAoTD0V2ZW50IFN0b3JlIEx0ZDE5MDcGA1UE
|
||||||
|
AxMwRXZlbnRTdG9yZURCIENBIDkwZjQ3M2NjZmMyMTNiMmM2YzQ5MzM4ZjFlMTk5
|
||||||
|
OTFhMB4XDTIyMTAyMjEzNTA1N1oXDTI3MTAyMjEzNTA1N1owYjELMAkGA1UEBhMC
|
||||||
|
VUsxGDAWBgNVBAoTD0V2ZW50IFN0b3JlIEx0ZDE5MDcGA1UEAxMwRXZlbnRTdG9y
|
||||||
|
ZURCIENBIDkwZjQ3M2NjZmMyMTNiMmM2YzQ5MzM4ZjFlMTk5OTFhMIIBIjANBgkq
|
||||||
|
hkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA17JM4jAG4fM4dtA6mpatLVkYhS42wwHC
|
||||||
|
RbG7dQINSE9wMKpoy2u4sDvZQrsudOvdeclPkIL1JgUtk7lDlqRMXZ6HnP7zTCKn
|
||||||
|
SQCXzvc3IIU0cGlkffuIS/kuAGBePvmmTwFE3ByDneydlHpSUGEvQY1KEAKwpgSO
|
||||||
|
LX1NtthP3kKT+bq0NdQlgOjm9dEkSYWwfCM7Of9cJdh8bCO4zJ1taGqchxluWlpo
|
||||||
|
DJL6TTHsZDvDjhfzBxhjuRax4S8B8xLaq6LirTFEFGpqFBhqzGGhRl42ZylKqVo9
|
||||||
|
fKhhywwq81ItROmB14OGKa8gyJi7pWGSKRI4M6Ngn89D50Q49K1QdQIDAQABo34w
|
||||||
|
fDAOBgNVHQ8BAf8EBAMCAQYwEgYDVR0TAQH/BAgwBgEB/wIBAjApBgNVHQ4EIgQg
|
||||||
|
/3vmZ5JvcSlcqyaNXgrQZ5FOXlZ9HvYr9x+Tbrs3Mx4wKwYDVR0jBCQwIoAg/3vm
|
||||||
|
Z5JvcSlcqyaNXgrQZ5FOXlZ9HvYr9x+Tbrs3Mx4wDQYJKoZIhvcNAQELBQADggEB
|
||||||
|
AIMQR/3BHnVYAuG6DSdDPVYkPR9Fvwi9G9U1nybMHY9uSnEOp6yASrRc/cD7pIbP
|
||||||
|
Ax7cvD5f0829fAUFupXtp2T/yNOA7/eis7l6Y0ZZf+QEk9XhZXHVTFLFDb9Fyc6r
|
||||||
|
+i/lXnatGsYwOns0RFSG6tzxi2lxUPwlXauacwTBW4jrphtn0vC3q/n85JOEi2ib
|
||||||
|
aIlXaXUTREJFiFnS22/SX4dSRaeimL34rrd9AjX53Ne6pUiVBGgd2aSUkBh65EYk
|
||||||
|
VCIZwuWLx0jgcT8NI/EeId7FN4CWq73dze5eY2QU00rXidyYDeC2aZcU5e2RTQqn
|
||||||
|
5dGqFGAd/xCopGYdWfusqKM=
|
||||||
|
-----END CERTIFICATE-----
|
27
certs/ca/ca.key
Normal file
27
certs/ca/ca.key
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
-----BEGIN RSA PRIVATE KEY-----
|
||||||
|
MIIEpQIBAAKCAQEA17JM4jAG4fM4dtA6mpatLVkYhS42wwHCRbG7dQINSE9wMKpo
|
||||||
|
y2u4sDvZQrsudOvdeclPkIL1JgUtk7lDlqRMXZ6HnP7zTCKnSQCXzvc3IIU0cGlk
|
||||||
|
ffuIS/kuAGBePvmmTwFE3ByDneydlHpSUGEvQY1KEAKwpgSOLX1NtthP3kKT+bq0
|
||||||
|
NdQlgOjm9dEkSYWwfCM7Of9cJdh8bCO4zJ1taGqchxluWlpoDJL6TTHsZDvDjhfz
|
||||||
|
BxhjuRax4S8B8xLaq6LirTFEFGpqFBhqzGGhRl42ZylKqVo9fKhhywwq81ItROmB
|
||||||
|
14OGKa8gyJi7pWGSKRI4M6Ngn89D50Q49K1QdQIDAQABAoIBAQCbeiKBSC0t4avp
|
||||||
|
uN8FX2clMPvDxDQlDLeElUCSbxAz907fRXaUaumN3xYUS+iIzxuuFbYMbNlYtpLL
|
||||||
|
0NcvVu7U7NjECeJGFxSOQqcqwHg0MNBD1zRgu1bbrJnEG7LTohCHElsYblVRGKXd
|
||||||
|
yO5ckjEGB1pDgCzk/pOdppzGF9Y6Vl/6WfZQgdGV6B1Qh9Vxs+1CGbK/6YqMM3av
|
||||||
|
9AJTEXgXbHOPyqNwixjxihpz79hXx0lOznL/CeosHKj7+ZY/knWZcDBmNq3ZA3Nz
|
||||||
|
w3p0fDkBtY7zQglh5nTSYoLtpcJvzkAI8uD6eJ4ThwIGUbLlvq0c3yaHZwIqrmEq
|
||||||
|
py09FA8BAoGBAPnuy+ehTBXV5k8icPZjI50Bjr5Alres01OjHxAA5bZJACwVbjMQ
|
||||||
|
a2464yb6DMA6NDrUevfHvKn3rw8OoceNrlaEua0qE5IweRpROf+ENqW9Yhcg4O1G
|
||||||
|
bSUPf5M1JusCSznAJu+gKsqHq0pTtdssh8Xb655xgd3gNMi0lLPlw5+tAoGBANzu
|
||||||
|
vidC8LRH+4JRrb+7PUZi1AR8vtCpabkLuVe7AZJl1wXFvYJTyFcW/e0WTvETcclf
|
||||||
|
9dhy1c0lH44571L4kpKRRKF4U3lcESbiLPDwjvfnls1rYzfzjY1YWoERwGYxL54H
|
||||||
|
2BBYPjKocnHZOnyiBxYn4ysK2O3dYlFxgJy/1GzpAoGBAM4HzW1HqRoC91Va1fY2
|
||||||
|
aaA/LXWmdtg5DwhOWwftRXAMI6kzjWFo8rauspxp2uMH2BB7Ildp/xu6A0SNUk3X
|
||||||
|
fNTzmsCmA/YqIVrRhNcfHZFpWhgo0WKoAMdhTFCEq21lua+EuFQnG79TMaAW+74O
|
||||||
|
qmovzb8SYPUPo1OkkUTvbmENAoGAODTg2Zo1JJhfiyL+ghW/nAWOjOmzneBLzlEG
|
||||||
|
QSSJXNZd4tEQynRINqfZyBRx1vEsdJ/eKsfkTsGQCp4AneoxV+pvPGkhS3G5x1up
|
||||||
|
NU7uAHHBstcMMfLbY0dEFywN97GxvJGgTWA1yquCGia6s3SBOwjAyXWEBNfaqH+o
|
||||||
|
ybgf8ekCgYEA3/Vx/CZ/VB0Fr47cpZGckJWH6lDWkzBEcaAT22VYlhL4CZ0CRDWj
|
||||||
|
6+LSiQDuI3+JwEhZlIkTvfZSo5bhNeUHoEL+15yg2RvsWFzorDxBfvZ//29BQg/Q
|
||||||
|
bN+vlKHpn7V7T9LQg/Tp107mfW6Z/TG4UYIVJyxY/JUjXjQLcFPvTVE=
|
||||||
|
-----END RSA PRIVATE KEY-----
|
20
certs/eventstore-local.crt
Normal file
20
certs/eventstore-local.crt
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
-----BEGIN CERTIFICATE-----
|
||||||
|
MIIDSzCCAjMCFAxEesn/oIrU2T7DOU9cWCyoCCqfMA0GCSqGSIb3DQEBCwUAMGIx
|
||||||
|
CzAJBgNVBAYTAkNBMQswCQYDVQQIDAJCQzESMBAGA1UEBwwJVmFuY291dmVyMRcw
|
||||||
|
FQYDVQQKDA5BZGFwdGVjaCBHcm91cDEZMBcGA1UEAwwQZXZlbnRzdG9yZS5sb2Nh
|
||||||
|
bDAeFw0yMTA1MDYyMDAyMzZaFw0zMTA1MDQyMDAyMzZaMGIxCzAJBgNVBAYTAkNB
|
||||||
|
MQswCQYDVQQIDAJCQzESMBAGA1UEBwwJVmFuY291dmVyMRcwFQYDVQQKDA5BZGFw
|
||||||
|
dGVjaCBHcm91cDEZMBcGA1UEAwwQZXZlbnRzdG9yZS5sb2NhbDCCASIwDQYJKoZI
|
||||||
|
hvcNAQEBBQADggEPADCCAQoCggEBANbNrVQ91TFVsrfFV39/1MjxM/UIP78FaX+S
|
||||||
|
kxAzcpAJKP9PbHLwFXxkl0Bam+3ekE6+hc3qT8o4ksOdzwz+dJbdZF8gblLda7vq
|
||||||
|
JnPjkAZuhojRLPfXvaJZbManEkB30+JIvb/XWhMf34+kvyZaOnKqidzNAuLAFQ+6
|
||||||
|
KCCXYnTUFimumr6AsrZvA9UzN3edrk1pqxMYNT+8MBOUnNfkdHX78aTzdWvq4+Ro
|
||||||
|
+58MT3NpqdI+1cY423JlG2qj8PAqPsgdE4XvmtqDtLndH+VflR1M1Rkn41cofgSh
|
||||||
|
lo7PE2SNn4hSv8m+1HJMfcegJEXKE3LIGHJtV6qT6S+pRtJd9mcCAwEAATANBgkq
|
||||||
|
hkiG9w0BAQsFAAOCAQEAlhKziHmYm81vrx+EHqIZXvmoUp3I1A9STvFqUdHrv9sa
|
||||||
|
8tKD7wW0owTVaxXBW3380ZFRpG3JVJFUgOyFIhi4IccWoqVsBCE0BBR96tlRXrKT
|
||||||
|
UZTAHLEk/SdLL+qfhKgY7F7+M9Wtf5HldiRfNoTqYn6YVXMJMgcwehhHho/fCHzj
|
||||||
|
tzOMfKFjGAq+n8cScLrTaW92JbbxjFPJJ7uQDH4OjAHx6pT885+RJf0rNqboAErA
|
||||||
|
lRLcEjtihslWKD7nelOlJE1egkum/m7MLVFpZPqEBp+x1zXdwacENwIhiRrQQhKi
|
||||||
|
8Qw36BuSCZ3CZK18kGyhtxl/uUP/wx7XXc1U0W2Wtw==
|
||||||
|
-----END CERTIFICATE-----
|
BIN
certs/eventstore.p12
Normal file
BIN
certs/eventstore.p12
Normal file
Binary file not shown.
23
certs/node1/node1.crt
Normal file
23
certs/node1/node1.crt
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
-----BEGIN CERTIFICATE-----
|
||||||
|
MIID0zCCArugAwIBAgIRAICyIvDoMRsOp8HOeD9x6k0wDQYJKoZIhvcNAQELBQAw
|
||||||
|
YjELMAkGA1UEBhMCVUsxGDAWBgNVBAoTD0V2ZW50IFN0b3JlIEx0ZDE5MDcGA1UE
|
||||||
|
AxMwRXZlbnRTdG9yZURCIENBIDkwZjQ3M2NjZmMyMTNiMmM2YzQ5MzM4ZjFlMTk5
|
||||||
|
OTFhMB4XDTIyMTAyMjEzNTIwMloXDTIzMTAyMjEzNTIwMlowHDEaMBgGA1UEAxMR
|
||||||
|
ZXZlbnRzdG9yZWRiLW5vZGUwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIB
|
||||||
|
AQC5EvroAGtYYso6BHH1Ik9IeTV7fQZfpKqolGKtDyw8UBdJiss5OfQYB35I0lbw
|
||||||
|
QOYU5oC4kto1ku4Y+kEuv/4RHPNEykurjYtGAcBRMT8JB96dW6rrKtGkISJlmtfa
|
||||||
|
0OoAcPySKHnjrgsT3FYpvD5Sm8aP7YuZlaZbUIyg66h0Nd932bAZN8i7UoiAKxse
|
||||||
|
3m1a/rJvHCcMma9tJwuzfc7GU8yyRhl9a9doUtwh0uGU7sfiXR0yQB7xYKroXl3R
|
||||||
|
YBvqoteZ3beTSBM5mAxfRKK3JS3NlK4ys4DXp2YVWTUkoEv9oDqLr7DJSnPA1ZQk
|
||||||
|
MwZGByQohPDF6vz9ok2rX6W3AgMBAAGjgckwgcYwDgYDVR0PAQH/BAQDAgWgMB0G
|
||||||
|
A1UdJQQWMBQGCCsGAQUFBwMCBggrBgEFBQcDATAMBgNVHRMBAf8EAjAAMCkGA1Ud
|
||||||
|
DgQiBCBAtQuI/026tsHlRnIi4NJRD6gZWAb/lf7D2zow/ACgkjArBgNVHSMEJDAi
|
||||||
|
gCD/e+Znkm9xKVyrJo1eCtBnkU5eVn0e9iv3H5NuuzczHjAvBgNVHREEKDAmgiQq
|
||||||
|
LnRlc3RzLm5vZGUtZXZlbnRzdG9yZS1jbGllbnQubG9jYWwwDQYJKoZIhvcNAQEL
|
||||||
|
BQADggEBAMDQE0GqALLeMixp7ZbKepN+BvqLvQYF22U0wr+rBdo4UvEKTAtZ1Jku
|
||||||
|
vwhPy6fmlq8vwf9YGrwJHwQHRIbg/H0gFV3M+Xk4LNg7anptBQ+K0Q1tSo997uoS
|
||||||
|
jNKZTD9szy2dLfJK3xaJT5tU2qcTxPFr7/ztDhc1qXX094rqcVJc6GIQXZdvh9FD
|
||||||
|
kNjRpCVnHNWX8CWRYdod+Lq9IUDwTsWi8BVPIxJUB2qbiK40tX77+NGV6MFmhGFE
|
||||||
|
aLdso5mwegpqOQXM8m/JRDrJNVAZAbDT4Myy1+UcDu/91jw/xuPmCLZMXEbsFIGu
|
||||||
|
IKF8Kr6IXObMJpr7M8t/vb1eb6BQufk=
|
||||||
|
-----END CERTIFICATE-----
|
27
certs/node1/node1.key
Normal file
27
certs/node1/node1.key
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
-----BEGIN RSA PRIVATE KEY-----
|
||||||
|
MIIEpAIBAAKCAQEAuRL66ABrWGLKOgRx9SJPSHk1e30GX6SqqJRirQ8sPFAXSYrL
|
||||||
|
OTn0GAd+SNJW8EDmFOaAuJLaNZLuGPpBLr/+ERzzRMpLq42LRgHAUTE/CQfenVuq
|
||||||
|
6yrRpCEiZZrX2tDqAHD8kih5464LE9xWKbw+UpvGj+2LmZWmW1CMoOuodDXfd9mw
|
||||||
|
GTfIu1KIgCsbHt5tWv6ybxwnDJmvbScLs33OxlPMskYZfWvXaFLcIdLhlO7H4l0d
|
||||||
|
MkAe8WCq6F5d0WAb6qLXmd23k0gTOZgMX0SityUtzZSuMrOA16dmFVk1JKBL/aA6
|
||||||
|
i6+wyUpzwNWUJDMGRgckKITwxer8/aJNq1+ltwIDAQABAoIBADGUkR0YB6ntBUoX
|
||||||
|
qMPIBj9fIWHMs6lpvsJcxjagivQ5bJOqGBljmi3ZzA4MM3g3mqvcuH058jVKAHk2
|
||||||
|
icHRc2n4PH+gRjdWOwptK61UqRNtRUkYpqhLl1AGBGX93nfjYdzuZ+tr5oOFO7h9
|
||||||
|
XaPepz+QNdiXBcAGZEOwR4xQtZcz5l5Iioqq7r63Q2MBGhsVwYIWvBCfLwK/ANUz
|
||||||
|
63LW/g9lRhS9MN9RPkJnIeobfz0s8qwTHoYvU16x4m9yvrjIzq0dPxSa+ZQY5G9y
|
||||||
|
AXs3bGNVDTKiMjMhOsE/M/0i0qe0yunoSxJlrex36Z7D4ipWYAhjK9TYcUc/JUo3
|
||||||
|
5LU75pkCgYEA7ywJp0aCBt+lITz+l2oKg47iBcou+cO2GAkYIQ1x48+izue1Bc8R
|
||||||
|
Z+Dh3BrPIT0SqLqQbnxcR214fE+IQnrDG/j0Mi53+sGZQQskAHc3HRCNxtsZ4zgP
|
||||||
|
jGk9NKwMmww8PMrcsvAyy7ec4L1D8IKLPr4Zok4HuYsEWUlUt+f1YiMCgYEAxhiI
|
||||||
|
RNmv+iVtp0T5jVAEJ0X94H1G4pKCOZ3vJkYvIfF3axdCW/sxoR/dxTQuSzuVnB1v
|
||||||
|
eLKgQ9o1aoU44GTWMdO72pHYzwtb2M+Y0jD5ZDDUBcTVy7uG++ATLyzr9irFZMOy
|
||||||
|
Wn9+7nUFdAEzDYBfnL0sxXc3ltt55onmC7yrdV0CgYEAqcZP3+7b8/cjZ7G9Y0wB
|
||||||
|
xJtTdBquN9umUe96slOx6a2Fe2vdAw+W4m8uxKg/KfAJY75zMgqTEpzxrwRhzBcK
|
||||||
|
kruo1EpKHrT4jcRTvQTjGX2btnHnMXSlDN3TdaU/mXwY8mpqOZbp59QhxyJyrLJu
|
||||||
|
F46n8Z+EOkAlSSAVxCoi9JMCgYEAtgundzZiTUyGJ7jwaRgGqRzeQaZ/NQqU2GQ2
|
||||||
|
eYL4H4ZrSyQV3LfMlRjW0jqw7Hx2cgBvB4mIVLK8cga6DSU93o6JTUTI7QSwRGAL
|
||||||
|
Pea52YQx5JdOLqtIUkJK/wiWVCRcQMzDI/2U5YjvGPtdMmQt+bmz4kg78swBi4Zg
|
||||||
|
vZqGKxUCgYBdBMRd4nxwAk9aphiCB0/OS/WSfc0CqegcwFG9ireb8iD9xvayqsNt
|
||||||
|
s4NI6cncnZXOTKm2mEd3E4yo8N9LieyNZV6kIhKxDMfgrRxLMBC17ur8R5z3uNzl
|
||||||
|
F69As0W69+VqyoM/pS9hDJ72DiA4YblWkWiZuZzhqi0Jwh9VEY2Oew==
|
||||||
|
-----END RSA PRIVATE KEY-----
|
23
certs/node2/node2.crt
Normal file
23
certs/node2/node2.crt
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
-----BEGIN CERTIFICATE-----
|
||||||
|
MIID0jCCArqgAwIBAgIQb+tOqV1PR8uW4adXZE8bMjANBgkqhkiG9w0BAQsFADBi
|
||||||
|
MQswCQYDVQQGEwJVSzEYMBYGA1UEChMPRXZlbnQgU3RvcmUgTHRkMTkwNwYDVQQD
|
||||||
|
EzBFdmVudFN0b3JlREIgQ0EgOTBmNDczY2NmYzIxM2IyYzZjNDkzMzhmMWUxOTk5
|
||||||
|
MWEwHhcNMjIxMDIyMTM1MjAzWhcNMjMxMDIyMTM1MjAzWjAcMRowGAYDVQQDExFl
|
||||||
|
dmVudHN0b3JlZGItbm9kZTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEB
|
||||||
|
ANCHpO7KZQLnelCEa2QW12Eko39w3yCDdq12CINuRVIxZ9hDaXY0QXg2EjsKgnWe
|
||||||
|
WNbhGT5kwDRZbR9/EFwP0TsujcLmF7JdiJ4oerXdrqp7uTZWZq70BDqhKZo/PnFB
|
||||||
|
c/OHJwwZdhDd24b6Id13MAa3JM4I5bbc5o4jrwwxqimXaR0Iw7D7IchQ/QReN/jR
|
||||||
|
JArZIkjHw/M5ljX8LdSMpT2Acy8f3hcfUja0OGgjWNOy37DLDX0GJCzwQa0NvdiG
|
||||||
|
PfwRny7PQEyaRER2vPhuqKb1+8+C4rSBEixBUHm0rPImCCL8QAkQdfzHLeCAbtez
|
||||||
|
z+/bvzqjzmRNQJ/A8isSgmECAwEAAaOByTCBxjAOBgNVHQ8BAf8EBAMCBaAwHQYD
|
||||||
|
VR0lBBYwFAYIKwYBBQUHAwIGCCsGAQUFBwMBMAwGA1UdEwEB/wQCMAAwKQYDVR0O
|
||||||
|
BCIEIAZeYK8mSU7E3tNmG5Xf4qDwU5i5Cdvm491RSMI0CsU2MCsGA1UdIwQkMCKA
|
||||||
|
IP975meSb3EpXKsmjV4K0GeRTl5WfR72K/cfk267NzMeMC8GA1UdEQQoMCaCJCou
|
||||||
|
dGVzdHMubm9kZS1ldmVudHN0b3JlLWNsaWVudC5sb2NhbDANBgkqhkiG9w0BAQsF
|
||||||
|
AAOCAQEAi8ZoFfa143InqWLYsvPVVKCD++cVLv/kXO735m0kGex1Ri3KJChxLAkQ
|
||||||
|
v1873PtB0eK6Xe7xhcMp08bg/jKM2CSJ4wyxhgbAybkJTjASvWzbzv7SJL1rslkl
|
||||||
|
j+ZS3i3EEve48CLOZ8YqoZ5UPUF51SMlr/aXbZehHA8xOeVPL8ImtUZ94y7SgeP8
|
||||||
|
VQFvGYQV6ysBahR/x/D6OHhIcl22RrRD44zz/t/5qgFNCwiR4l7Kd33gX3SJtFA1
|
||||||
|
x3KCKSQl5j2j0ME9J0ro9QsJxhhAHk/YIW1+VfO4Q6TBmopscXea6uNq5wQBeIcQ
|
||||||
|
8M4M9MYa3Xy4FUquonpnSYiYtLEdvQ==
|
||||||
|
-----END CERTIFICATE-----
|
27
certs/node2/node2.key
Normal file
27
certs/node2/node2.key
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
-----BEGIN RSA PRIVATE KEY-----
|
||||||
|
MIIEpQIBAAKCAQEA0Iek7splAud6UIRrZBbXYSSjf3DfIIN2rXYIg25FUjFn2ENp
|
||||||
|
djRBeDYSOwqCdZ5Y1uEZPmTANFltH38QXA/ROy6NwuYXsl2Inih6td2uqnu5NlZm
|
||||||
|
rvQEOqEpmj8+cUFz84cnDBl2EN3bhvoh3XcwBrckzgjlttzmjiOvDDGqKZdpHQjD
|
||||||
|
sPshyFD9BF43+NEkCtkiSMfD8zmWNfwt1IylPYBzLx/eFx9SNrQ4aCNY07LfsMsN
|
||||||
|
fQYkLPBBrQ292IY9/BGfLs9ATJpERHa8+G6opvX7z4LitIESLEFQebSs8iYIIvxA
|
||||||
|
CRB1/Mct4IBu17PP79u/OqPOZE1An8DyKxKCYQIDAQABAoIBAQDPsjrxZ/9B7EJk
|
||||||
|
je/UqfdtlyuNlGN4o9gBny2NkrhSzEitGz+gbx3CWMDBs48LDWNY6qzU+06BFYzd
|
||||||
|
sRYfS9XPB2hE9h4mFokrVhAasij1PvPTji0KFptbtgeUzWcpMNMHfNbEc1uoIwEz
|
||||||
|
KFGwnrTkC2gKGsyJ3O16J0qDb7gXYR4Ws566NGJDbjz14p7CTIoXhp3K/hvrowEx
|
||||||
|
UHjnFsaSrcbWZ+CHT9fKkQFYUqh0ab0dFo9L293ikRxs+rsvcaKqX7h3XTHlnOEd
|
||||||
|
89c25UPb8w7rQGWti0bRMMmS1knHEHQz2Bw6zby/JLw+9tmb5+/ooAtAoYKZmfM3
|
||||||
|
XK+j2uSRAoGBAOk0Vo6WBIZwhvETa8htXk7Yf7FGmWWvgsZrytTFLPmzLKVQsLPb
|
||||||
|
NEKHpvz0ysq9qAszpZgayi6ie0jsmMeAQi2ADO5faRiGKx2/axm1T0jWAlEE3BU7
|
||||||
|
iF5HkGK9Ohjgy2WJWLk8L/l+jLdNwo+6xTTqZakm08qtUtxyWVTuMC1FAoGBAOTp
|
||||||
|
2q3wVQgk5qm5sISyF+8hucjqMgMQ/SuxkpT55hjuZntlKtCdXAjClVlQdv1WZT8l
|
||||||
|
DvoUGiNQsRULNgUCClWEY9b6OiiohuH8V049tF73325KqP7HTJsS63SkZSmeeUeT
|
||||||
|
if6yM1JlbbJrDlCN1SpE8dtjTUs1whj3aapTsAxtAoGBAKloE9jQscjXxa8q5Ilc
|
||||||
|
qb2tGFW3a4eqz91EQLv/4IQj3LLawwJkoroRwQTQ7uAIliJNCmZMT8NA1T5MYU/L
|
||||||
|
pEdZVgtz0+y0ym15uFucklPe4x/n39isvot+gSy5OZMI+bhw5brqNg+QFriyDDxM
|
||||||
|
+SVPgTo3snLxJdhuWOaRgP3hAoGAeTecpR7u6DEiNB4waxQjuG2Tg+EAOr90UP7n
|
||||||
|
MBxkzC7x9cXMtkudwMXJcFI7sEtfseBd3e9nJ+xC2XHmWSCLeF1ywRQgWAdl5aVK
|
||||||
|
VhQ2v1Ni7XR7qO7Akh2isVGcgD1623w1Rrn2k1tCi4hFPELe7lMz/4jGFV2SOsZJ
|
||||||
|
HfjS8MECgYEAjyl5rJuFtAy7JewI6HgokgMAtmfyV6fRIbEIdb+rfn3uUDPleRFg
|
||||||
|
WJIN6T6xywGOYJFx0j7hnywQ+d9zXph2KILFQO1vYMwWCMzLA0TfYGNHaoW9J5Ja
|
||||||
|
3gqhj1DQKWaPTXP9Q9pKQOe8eO4AS1XJlNBY3Q28bZcAhOZq5KUHj1Y=
|
||||||
|
-----END RSA PRIVATE KEY-----
|
23
certs/node3/node3.crt
Normal file
23
certs/node3/node3.crt
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
-----BEGIN CERTIFICATE-----
|
||||||
|
MIID0zCCArugAwIBAgIRAIrgk9b8CiaOIhKw0UVCnw0wDQYJKoZIhvcNAQELBQAw
|
||||||
|
YjELMAkGA1UEBhMCVUsxGDAWBgNVBAoTD0V2ZW50IFN0b3JlIEx0ZDE5MDcGA1UE
|
||||||
|
AxMwRXZlbnRTdG9yZURCIENBIDkwZjQ3M2NjZmMyMTNiMmM2YzQ5MzM4ZjFlMTk5
|
||||||
|
OTFhMB4XDTIyMTAyMjEzNTIwM1oXDTIzMTAyMjEzNTIwM1owHDEaMBgGA1UEAxMR
|
||||||
|
ZXZlbnRzdG9yZWRiLW5vZGUwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIB
|
||||||
|
AQDmS3u8Mx1OUbXqFlDSU25sthiBI8p5sUq5/VvuKVEAvBuSQydTwbCU3cfaUNCk
|
||||||
|
wLkIEVJInqtzsUnUWkPRDg3W4bFzEoXzP1/1OffqcgjwDl+hym/k0HWGvt4UzXnw
|
||||||
|
7MXHxlMUj6E+GK9JvleKIo9C/zWg7o7ZaC4s/cYkkkmHHzHVCcapuKCJEbUKJgzt
|
||||||
|
JnJ8wZCPvmEHWoTT7255drMMh1cwzZvOqCWpZ0Qk1+KZc6C7QcbGrnPv1PIKT53o
|
||||||
|
7XDZnAXTGfbah0/e5zIM4/Ms3JauObbcXv/oSb8KeiMrYmM12CfAJ9LAu7sm8uOz
|
||||||
|
tuVvpaT9lH0v91Aat1G4k19/AgMBAAGjgckwgcYwDgYDVR0PAQH/BAQDAgWgMB0G
|
||||||
|
A1UdJQQWMBQGCCsGAQUFBwMCBggrBgEFBQcDATAMBgNVHRMBAf8EAjAAMCkGA1Ud
|
||||||
|
DgQiBCCla0cvcjb+WYGvsdw50JZcKNTFFj4je4cHn8xci9SQqTArBgNVHSMEJDAi
|
||||||
|
gCD/e+Znkm9xKVyrJo1eCtBnkU5eVn0e9iv3H5NuuzczHjAvBgNVHREEKDAmgiQq
|
||||||
|
LnRlc3RzLm5vZGUtZXZlbnRzdG9yZS1jbGllbnQubG9jYWwwDQYJKoZIhvcNAQEL
|
||||||
|
BQADggEBAJtCYINTvOQXOYIhEUZLjyPKqAKc5Ey117WNj1BJ1OAlrddwiMGUZg1L
|
||||||
|
g3Md2oKJXrsKrNBgePEnfa/gCt1kBUpNfO5ILVJtVzuifQAsePtbjvkRA5suzll3
|
||||||
|
FP1QrvC8ZCq9oDW9+/WEGEi2Bjp2RPKlRBKj1wP/4MYKwjoGY2ezrb/rutKVpdIm
|
||||||
|
3UEoaJG1VpT7IkdcIcLSCyPS5BDd/Jf1428ZZuq6DlbSOIRjCo8w9hazfizeJ+iE
|
||||||
|
kGDygYYg5RkPsl8ACcXsZDCPr6gS2yFa1v0eQOV3CPeO8i6aiQToZekEoAVGrJ9/
|
||||||
|
HpLfDap2pVqf8gSnX59XIsE/WwMVWjc=
|
||||||
|
-----END CERTIFICATE-----
|
27
certs/node3/node3.key
Normal file
27
certs/node3/node3.key
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
-----BEGIN RSA PRIVATE KEY-----
|
||||||
|
MIIEpAIBAAKCAQEA5kt7vDMdTlG16hZQ0lNubLYYgSPKebFKuf1b7ilRALwbkkMn
|
||||||
|
U8GwlN3H2lDQpMC5CBFSSJ6rc7FJ1FpD0Q4N1uGxcxKF8z9f9Tn36nII8A5focpv
|
||||||
|
5NB1hr7eFM158OzFx8ZTFI+hPhivSb5XiiKPQv81oO6O2WguLP3GJJJJhx8x1QnG
|
||||||
|
qbigiRG1CiYM7SZyfMGQj75hB1qE0+9ueXazDIdXMM2bzqglqWdEJNfimXOgu0HG
|
||||||
|
xq5z79TyCk+d6O1w2ZwF0xn22odP3ucyDOPzLNyWrjm23F7/6Em/CnojK2JjNdgn
|
||||||
|
wCfSwLu7JvLjs7blb6Wk/ZR9L/dQGrdRuJNffwIDAQABAoIBAHmEOO0sd3k9CmVT
|
||||||
|
kx/4IBtC1plF3m/qCgkr1BdOO8zMdSvvPVAnstpKUEs1O3LDsp68LRPejY+Fa/Se
|
||||||
|
EIy+ArVw76ZNjtq0hRirltJhi6/HldSUMgilqm4IRrzpUz+6X/4y+uGtjCJs+glK
|
||||||
|
Y3yjEb8DVTPuzPeQzlS1L5lai2u9HKBBOOY5At6lwDa9ckZd3Xyf3xUPGiK/Vdyd
|
||||||
|
HscVpr/PBQeMkXODhUCRIyY2nfSncYOv1d+TM2r7PXi4v/zrPnfybz8D7eseo6YR
|
||||||
|
NS/70rNJSfn2snhTS1iFaAPvG8AU6nLwGlj/8m8J69IFS34znmj+T6bcCSSyV40o
|
||||||
|
YqOPRzECgYEA6LVYbuZqkeqCtW4cGOJ5AShhl8CCG7BLR61/A2Vd1aQYUchlYi3R
|
||||||
|
PNoH8F4lD6HT61zL25e4IRlTkYllblRldN3PzMHxyDVKak9UclW70KbP37e7Ta49
|
||||||
|
HQAz45ewM3nOnJN8lHgSxP3IVUGXZolhjqis+3/Afr+hhzj7GDaAcicCgYEA/VhL
|
||||||
|
6DKhacYfXvwnQuQ35n/MNkbBCH8mcytoGDGrJ62Mh8Lu0UEJ5R2HhvMrZsOsuLbR
|
||||||
|
tAV2AGmeV1ixcdiZZoZb1J0V4BP5T1QP89DSlO9N5xwJTvV8r3rdXJUMbntcXl2F
|
||||||
|
eUJ0L3Hi4/13wb/ohsfTIce2IWtmstFBwJ529ukCgYAvhwIlvEedv6Csf22bo32F
|
||||||
|
QAMWpEmucAYgAI5FWkmc3aPd6CjUsXjfjcQ7Um8NT0bh9hTop4cCs5J+0en2a6RB
|
||||||
|
ByBuuFmyQzgMmGEt7NasGbWxAmxtxB1VM/plDFD/YmxRTEoQZKmotBBbYUcTuRFE
|
||||||
|
uqyBvSjKekb6QCgAXPlE1wKBgQCSc4Fl2CbhG2u1H/SeQYljEMt/MMWT4NTcTOJe
|
||||||
|
4g9732JWdMRTaNKMhNZ8l4OmY0UsflqZQ3LkaCnlelsRYdHDp7XcIXas0z8SsZiL
|
||||||
|
LFMfT3rsN5PV9ik+07q1M2A9WciasFthLp41cxNjEnoxIXwMteUCKQ3LIef7ROZK
|
||||||
|
sBA7SQKBgQDBxdbUQCpwLs9iJQH+ddPhIGKXLGNw/3f4quKBGz6fO1X4E9STFWoa
|
||||||
|
diu+C27608WmPEnDLy58yCameZ4sk/Pt269yhHerEuPrSFKrqVQOyyO9utCQHbRY
|
||||||
|
9wjvymJnXAvJE4CgXvdYLIFvaog86KmhpVX830gnyFdJ+d7EDpUU9w==
|
||||||
|
-----END RSA PRIVATE KEY-----
|
@ -2,124 +2,109 @@ version: '3.4'
|
|||||||
|
|
||||||
services:
|
services:
|
||||||
eventstore.db:
|
eventstore.db:
|
||||||
image: eventstore/eventstore:release-5.0.8
|
image: eventstore/eventstore:21.10.8-buster-slim
|
||||||
environment:
|
environment:
|
||||||
- EVENTSTORE_WORKER_THREADS=5
|
|
||||||
- EVENTSTORE_CLUSTER_SIZE=3
|
- EVENTSTORE_CLUSTER_SIZE=3
|
||||||
|
- EVENTSTORE_CLUSTER_DNS=cluster.tests.node-eventstore-client.local
|
||||||
|
- EVENTSTORE_ADVERTISE_HOST_TO_CLIENT_AS=node1.tests.node-eventstore-client.local
|
||||||
|
- EVENTSTORE_ADVERTISE_HTTP_PORT_TO_CLIENT_AS=2113
|
||||||
|
- EVENTSTORE_ADVERTISE_TCP_PORT_TO_CLIENT_AS=1113
|
||||||
|
# - EVENTSTORE_DISCOVER_VIA_DNS=false
|
||||||
|
# - EVENTSTORE_GOSSIP_SEED=192.168.33.10:2113,192.168.33.11:2113,192.168.33.12:2113
|
||||||
- EVENTSTORE_RUN_PROJECTIONS=All
|
- EVENTSTORE_RUN_PROJECTIONS=All
|
||||||
- EVENTSTORE_DB=/var/lib/eventstore-data
|
- EVENTSTORE_START_STANDARD_PROJECTIONS=True
|
||||||
- EVENTSTORE_INDEX=/var/lib/eventstore-index
|
- EVENTSTORE_ENABLE_EXTERNAL_TCP=true
|
||||||
- EVENTSTORE_LOG=/var/log/eventstore
|
|
||||||
- EVENTSTORE_CLUSTER_GOSSIP_PORT=2112
|
|
||||||
- EVENTSTORE_INT_TCP_PORT=1112
|
|
||||||
- EVENTSTORE_EXT_TCP_PORT=1113
|
- EVENTSTORE_EXT_TCP_PORT=1113
|
||||||
- EVENTSTORE_INT_HTTP_PORT=2112
|
- EVENTSTORE_HTTP_PORT=2113
|
||||||
- EVENTSTORE_EXT_HTTP_PORT=2113
|
|
||||||
- EVENTSTORE_DISCOVER_VIA_DNS=true
|
|
||||||
- EVENTSTORE_CLUSTER_DNS=eventstore.local
|
|
||||||
- EVENTSTORE_INT_IP=192.168.33.10
|
- EVENTSTORE_INT_IP=192.168.33.10
|
||||||
- EVENTSTORE_EXT_IP=192.168.33.10
|
- EVENTSTORE_EXT_IP=192.168.33.10
|
||||||
|
- EVENTSTORE_CERTIFICATE_FILE=/etc/eventstore/certs/node1/node1.crt
|
||||||
|
- EVENTSTORE_CERTIFICATE_PRIVATE_KEY_FILE=/etc/eventstore/certs/node1/node1.key
|
||||||
|
- EVENTSTORE_TRUSTED_ROOT_CERTIFICATES_PATH=/etc/eventstore/certs/ca
|
||||||
ports:
|
ports:
|
||||||
- "1112:1112"
|
- "1112:1112"
|
||||||
- "1113:1113"
|
- "1113:1113"
|
||||||
- "2112:2112"
|
|
||||||
- "2113:2113"
|
- "2113:2113"
|
||||||
networks:
|
networks:
|
||||||
app_net:
|
app_net:
|
||||||
aliases:
|
aliases:
|
||||||
- eventstore.local
|
- cluster.tests.node-eventstore-client.local
|
||||||
|
- node1.tests.node-eventstore-client.local
|
||||||
ipv4_address: 192.168.33.10
|
ipv4_address: 192.168.33.10
|
||||||
volumes:
|
volumes:
|
||||||
- type: volume
|
- eventstore1-data:/var/lib/eventstore
|
||||||
source: eventstore-volume-data
|
- ./certs:/etc/eventstore/certs:ro
|
||||||
target: /var/lib/eventstore-data
|
|
||||||
- type: volume
|
|
||||||
source: eventstore-volume-index
|
|
||||||
target: /var/lib/eventstore-index
|
|
||||||
- type: volume
|
|
||||||
source: eventstore-volume-logs
|
|
||||||
target: /var/log/eventstore
|
|
||||||
|
|
||||||
eventstore.db2:
|
eventstore.db2:
|
||||||
image: eventstore/eventstore:release-5.0.8
|
image: eventstore/eventstore:21.10.8-buster-slim
|
||||||
environment:
|
environment:
|
||||||
- EVENTSTORE_WORKER_THREADS=5
|
|
||||||
- EVENTSTORE_CLUSTER_SIZE=3
|
- EVENTSTORE_CLUSTER_SIZE=3
|
||||||
|
- EVENTSTORE_CLUSTER_DNS=cluster.tests.node-eventstore-client.local
|
||||||
|
- EVENTSTORE_ADVERTISE_HOST_TO_CLIENT_AS=node2.tests.node-eventstore-client.local
|
||||||
|
- EVENTSTORE_ADVERTISE_HTTP_PORT_TO_CLIENT_AS=2113
|
||||||
|
- EVENTSTORE_ADVERTISE_TCP_PORT_TO_CLIENT_AS=1113
|
||||||
|
# - EVENTSTORE_DISCOVER_VIA_DNS=false
|
||||||
|
# - EVENTSTORE_GOSSIP_SEED=192.168.33.10:2113,192.168.33.11:2113,192.168.33.12:2113
|
||||||
- EVENTSTORE_RUN_PROJECTIONS=All
|
- EVENTSTORE_RUN_PROJECTIONS=All
|
||||||
- EVENTSTORE_DB=/var/lib/eventstore-data
|
- EVENTSTORE_START_STANDARD_PROJECTIONS=True
|
||||||
- EVENTSTORE_INDEX=/var/lib/eventstore-index
|
- EVENTSTORE_ENABLE_EXTERNAL_TCP=true
|
||||||
- EVENTSTORE_LOG=/var/log/eventstore
|
|
||||||
- EVENTSTORE_CLUSTER_GOSSIP_PORT=2112
|
|
||||||
- EVENTSTORE_INT_TCP_PORT=1112
|
|
||||||
- EVENTSTORE_EXT_TCP_PORT=1113
|
- EVENTSTORE_EXT_TCP_PORT=1113
|
||||||
- EVENTSTORE_INT_HTTP_PORT=2112
|
- EVENTSTORE_HTTP_PORT=2113
|
||||||
- EVENTSTORE_EXT_HTTP_PORT=2113
|
|
||||||
- EVENTSTORE_DISCOVER_VIA_DNS=true
|
|
||||||
- EVENTSTORE_CLUSTER_DNS=eventstore.local
|
|
||||||
- EVENTSTORE_INT_IP=192.168.33.11
|
- EVENTSTORE_INT_IP=192.168.33.11
|
||||||
- EVENTSTORE_EXT_IP=192.168.33.11
|
- EVENTSTORE_EXT_IP=192.168.33.11
|
||||||
|
- EVENTSTORE_CERTIFICATE_FILE=/etc/eventstore/certs/node2/node2.crt
|
||||||
|
- EVENTSTORE_CERTIFICATE_PRIVATE_KEY_FILE=/etc/eventstore/certs/node2/node2.key
|
||||||
|
- EVENTSTORE_TRUSTED_ROOT_CERTIFICATES_PATH=/etc/eventstore/certs/ca
|
||||||
expose:
|
expose:
|
||||||
- "1113"
|
- "1113"
|
||||||
- "1112"
|
- "1112"
|
||||||
- "2112"
|
|
||||||
- "2113"
|
- "2113"
|
||||||
networks:
|
networks:
|
||||||
app_net:
|
app_net:
|
||||||
aliases:
|
aliases:
|
||||||
- eventstore.local
|
- cluster.tests.node-eventstore-client.local
|
||||||
|
- node2.tests.node-eventstore-client.local
|
||||||
ipv4_address: 192.168.33.11
|
ipv4_address: 192.168.33.11
|
||||||
volumes:
|
volumes:
|
||||||
- type: volume
|
- eventstore2-data:/var/lib/eventstore
|
||||||
source: eventstore-volume-data2
|
- ./certs:/etc/eventstore/certs:ro
|
||||||
target: /var/lib/eventstore-data
|
|
||||||
- type: volume
|
|
||||||
source: eventstore-volume-index2
|
|
||||||
target: /var/lib/eventstore-index
|
|
||||||
- type: volume
|
|
||||||
source: eventstore-volume-logs2
|
|
||||||
target: /var/log/eventstore
|
|
||||||
|
|
||||||
eventstore.db3:
|
eventstore.db3:
|
||||||
image: eventstore/eventstore:release-5.0.8
|
image: eventstore/eventstore:21.10.8-buster-slim
|
||||||
environment:
|
environment:
|
||||||
- EVENTSTORE_WORKER_THREADS=5
|
|
||||||
- EVENTSTORE_CLUSTER_SIZE=3
|
- EVENTSTORE_CLUSTER_SIZE=3
|
||||||
|
- EVENTSTORE_CLUSTER_DNS=cluster.tests.node-eventstore-client.local
|
||||||
|
- EVENTSTORE_ADVERTISE_HOST_TO_CLIENT_AS=node3.tests.node-eventstore-client.local
|
||||||
|
- EVENTSTORE_ADVERTISE_HTTP_PORT_TO_CLIENT_AS=2113
|
||||||
|
- EVENTSTORE_ADVERTISE_TCP_PORT_TO_CLIENT_AS=1113
|
||||||
|
# - EVENTSTORE_DISCOVER_VIA_DNS=false
|
||||||
|
# - EVENTSTORE_GOSSIP_SEED=192.168.33.10:2113,192.168.33.11:2113,192.168.33.12:2113
|
||||||
- EVENTSTORE_RUN_PROJECTIONS=All
|
- EVENTSTORE_RUN_PROJECTIONS=All
|
||||||
- EVENTSTORE_DB=/var/lib/eventstore-data
|
- EVENTSTORE_START_STANDARD_PROJECTIONS=True
|
||||||
- EVENTSTORE_INDEX=/var/lib/eventstore-index
|
- EVENTSTORE_ENABLE_EXTERNAL_TCP=true
|
||||||
- EVENTSTORE_LOG=/var/log/eventstore
|
|
||||||
- EVENTSTORE_CLUSTER_GOSSIP_PORT=2112
|
|
||||||
- EVENTSTORE_INT_TCP_PORT=1112
|
|
||||||
- EVENTSTORE_EXT_TCP_PORT=1113
|
- EVENTSTORE_EXT_TCP_PORT=1113
|
||||||
- EVENTSTORE_INT_HTTP_PORT=2112
|
- EVENTSTORE_HTTP_PORT=2113
|
||||||
- EVENTSTORE_EXT_HTTP_PORT=2113
|
|
||||||
- EVENTSTORE_DISCOVER_VIA_DNS=true
|
|
||||||
- EVENTSTORE_CLUSTER_DNS=eventstore.local
|
|
||||||
- EVENTSTORE_INT_IP=192.168.33.12
|
- EVENTSTORE_INT_IP=192.168.33.12
|
||||||
- EVENTSTORE_EXT_IP=192.168.33.12
|
- EVENTSTORE_EXT_IP=192.168.33.12
|
||||||
|
- EVENTSTORE_CERTIFICATE_FILE=/etc/eventstore/certs/node3/node3.crt
|
||||||
|
- EVENTSTORE_CERTIFICATE_PRIVATE_KEY_FILE=/etc/eventstore/certs/node3/node3.key
|
||||||
|
- EVENTSTORE_TRUSTED_ROOT_CERTIFICATES_PATH=/etc/eventstore/certs/ca
|
||||||
expose:
|
expose:
|
||||||
- "1113"
|
- "1113"
|
||||||
- "1112"
|
- "1112"
|
||||||
- "2112"
|
|
||||||
- "2113"
|
- "2113"
|
||||||
networks:
|
networks:
|
||||||
app_net:
|
app_net:
|
||||||
aliases:
|
aliases:
|
||||||
- eventstore.local
|
- cluster.tests.node-eventstore-client.local
|
||||||
|
- node3.tests.node-eventstore-client.local
|
||||||
ipv4_address: 192.168.33.12
|
ipv4_address: 192.168.33.12
|
||||||
volumes:
|
volumes:
|
||||||
- type: volume
|
- eventstore3-data:/var/lib/eventstore-data
|
||||||
source: eventstore-volume-data3
|
- ./certs:/etc/eventstore/certs:ro
|
||||||
target: /var/lib/eventstore-data
|
|
||||||
- type: volume
|
|
||||||
source: eventstore-volume-index3
|
|
||||||
target: /var/lib/eventstore-index
|
|
||||||
- type: volume
|
|
||||||
source: eventstore-volume-logs3
|
|
||||||
target: /var/log/eventstore
|
|
||||||
|
|
||||||
nodejs:
|
nodejs:
|
||||||
image: node:14
|
image: node:12
|
||||||
working_dir: /var/code
|
working_dir: /var/code
|
||||||
volumes:
|
volumes:
|
||||||
- .:/var/code
|
- .:/var/code
|
||||||
@ -129,19 +114,13 @@ services:
|
|||||||
- app_net
|
- app_net
|
||||||
|
|
||||||
volumes:
|
volumes:
|
||||||
eventstore-volume-data:
|
eventstore1-data:
|
||||||
eventstore-volume-index:
|
eventstore2-data:
|
||||||
eventstore-volume-logs:
|
eventstore3-data:
|
||||||
eventstore-volume-data2:
|
|
||||||
eventstore-volume-index2:
|
|
||||||
eventstore-volume-logs2:
|
|
||||||
eventstore-volume-data3:
|
|
||||||
eventstore-volume-index3:
|
|
||||||
eventstore-volume-logs3:
|
|
||||||
|
|
||||||
networks:
|
networks:
|
||||||
app_net:
|
app_net:
|
||||||
ipam:
|
ipam:
|
||||||
driver: default
|
driver: default
|
||||||
config:
|
config:
|
||||||
- subnet: "192.168.33.0/24"
|
- subnet: "192.168.33.0/24"
|
||||||
|
@ -2,37 +2,31 @@ version: '3.4'
|
|||||||
|
|
||||||
services:
|
services:
|
||||||
eventstore.db:
|
eventstore.db:
|
||||||
image: eventstore/eventstore:release-5.0.8
|
image: eventstore/eventstore:21.10.8-buster-slim
|
||||||
environment:
|
environment:
|
||||||
- EVENTSTORE_CLUSTER_SIZE=1
|
- EVENTSTORE_CLUSTER_SIZE=1
|
||||||
- EVENTSTORE_RUN_PROJECTIONS=All
|
- EVENTSTORE_RUN_PROJECTIONS=All
|
||||||
- EVENTSTORE_START_STANDARD_PROJECTIONS=True
|
- EVENTSTORE_START_STANDARD_PROJECTIONS=True
|
||||||
- EVENTSTORE_DB=/var/lib/eventstore-data
|
- EVENTSTORE_ENABLE_EXTERNAL_TCP=true
|
||||||
- EVENTSTORE_INDEX=/var/lib/eventstore-index
|
|
||||||
- EVENTSTORE_LOG=/var/log/eventstore
|
|
||||||
- EVENTSTORE_EXT_TCP_PORT=1113
|
- EVENTSTORE_EXT_TCP_PORT=1113
|
||||||
- EVENTSTORE_EXT_HTTP_PORT=2113
|
- EVENTSTORE_HTTP_PORT=2113
|
||||||
- EVENTSTORE_INT_IP=192.168.33.10
|
- EVENTSTORE_INT_IP=192.168.33.10
|
||||||
- EVENTSTORE_EXT_IP=192.168.33.10
|
- EVENTSTORE_EXT_IP=192.168.33.10
|
||||||
|
- EVENTSTORE_CERTIFICATE_FILE=/etc/eventstore/certs/node1/node1.crt
|
||||||
|
- EVENTSTORE_CERTIFICATE_PRIVATE_KEY_FILE=/etc/eventstore/certs/node1/node1.key
|
||||||
|
- EVENTSTORE_TRUSTED_ROOT_CERTIFICATES_PATH=/etc/eventstore/certs/ca
|
||||||
ports:
|
ports:
|
||||||
- "1113:1113"
|
- "1113:1113"
|
||||||
- "2113:2113"
|
- "2113:2113"
|
||||||
volumes:
|
volumes:
|
||||||
- type: volume
|
- eventstore-data:/var/lib/eventstore
|
||||||
source: eventstore-volume-data
|
- ./certs:/etc/eventstore/certs:ro
|
||||||
target: /var/lib/eventstore-data
|
|
||||||
- type: volume
|
|
||||||
source: eventstore-volume-index
|
|
||||||
target: /var/lib/eventstore-index
|
|
||||||
- type: volume
|
|
||||||
source: eventstore-volume-logs
|
|
||||||
target: /var/log/eventstore
|
|
||||||
networks:
|
networks:
|
||||||
app_net:
|
app_net:
|
||||||
ipv4_address: 192.168.33.10
|
ipv4_address: 192.168.33.10
|
||||||
|
|
||||||
nodejs:
|
nodejs:
|
||||||
image: node:14
|
image: node:12
|
||||||
working_dir: /var/code
|
working_dir: /var/code
|
||||||
volumes:
|
volumes:
|
||||||
- .:/var/code
|
- .:/var/code
|
||||||
@ -42,13 +36,11 @@ services:
|
|||||||
- app_net
|
- app_net
|
||||||
|
|
||||||
volumes:
|
volumes:
|
||||||
eventstore-volume-data:
|
eventstore-data:
|
||||||
eventstore-volume-index:
|
|
||||||
eventstore-volume-logs:
|
|
||||||
|
|
||||||
networks:
|
networks:
|
||||||
app_net:
|
app_net:
|
||||||
ipam:
|
ipam:
|
||||||
driver: default
|
driver: default
|
||||||
config:
|
config:
|
||||||
- subnet: "192.168.33.0/24"
|
- subnet: "192.168.33.0/24"
|
||||||
|
2476
package-lock.json
generated
2476
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
16
package.json
16
package.json
@ -1,11 +1,11 @@
|
|||||||
{
|
{
|
||||||
"name": "node-eventstore-client",
|
"name": "node-eventstore-client",
|
||||||
"version": "0.2.17",
|
"version": "21.10.0",
|
||||||
"description": "A port of the EventStore .Net ClientAPI to Node.js",
|
"description": "A port of the EventStore .Net ClientAPI to Node.js",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"types": "index.d.ts",
|
"types": "index.d.ts",
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=5.10"
|
"node": ">=12"
|
||||||
},
|
},
|
||||||
"engineStrict": true,
|
"engineStrict": true,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
@ -23,7 +23,7 @@
|
|||||||
"compose:cluster:start": "docker-compose -f docker-compose-cluster.yaml up --build -d",
|
"compose:cluster:start": "docker-compose -f docker-compose-cluster.yaml up --build -d",
|
||||||
"compose:single:stop": "docker-compose -f docker-compose-single.yaml down -v --remove-orphans",
|
"compose:single:stop": "docker-compose -f docker-compose-single.yaml down -v --remove-orphans",
|
||||||
"compose:cluster:stop": "docker-compose -f docker-compose-cluster.yaml down -v --remove-orphans",
|
"compose:cluster:stop": "docker-compose -f docker-compose-cluster.yaml down -v --remove-orphans",
|
||||||
"compose:wait": "while [[ \"$(curl -s -o /dev/null -w ''%{http_code}'' localhost:2113/ping)\" != \"200\" ]]; do sleep 5; done",
|
"compose:wait": "while [ \"$(curl -s -o /dev/null -w ''%{http_code}'' -k https://localhost:2113/ping)\" != \"200\" ]; do sleep 5; done",
|
||||||
"compose:single:test": "docker-compose -f docker-compose-single.yaml exec nodejs bash -c \"npm i && npm run build && EVENTSTORE_CONNECTION_TYPE=tcp EVENTSTORE_HOST=192.168.33.10 npm run test-debug\"",
|
"compose:single:test": "docker-compose -f docker-compose-single.yaml exec nodejs bash -c \"npm i && npm run build && EVENTSTORE_CONNECTION_TYPE=tcp EVENTSTORE_HOST=192.168.33.10 npm run test-debug\"",
|
||||||
"compose:cluster:test": "docker-compose -f docker-compose-cluster.yaml exec nodejs bash -c \"npm i && npm run build && EVENTSTORE_CONNECTION_TYPE=gossip EVENTSTORE_HOST=192.168.33.10 EVENTSTORE_HOST_1=192.168.33.10 EVENTSTORE_HOST_2=192.168.33.11 EVENTSTORE_HOST_3=192.168.33.12 npm run test-debug\"",
|
"compose:cluster:test": "docker-compose -f docker-compose-cluster.yaml exec nodejs bash -c \"npm i && npm run build && EVENTSTORE_CONNECTION_TYPE=gossip EVENTSTORE_HOST=192.168.33.10 EVENTSTORE_HOST_1=192.168.33.10 EVENTSTORE_HOST_2=192.168.33.11 EVENTSTORE_HOST_3=192.168.33.12 npm run test-debug\"",
|
||||||
"compose:gossip:test": "docker-compose -f docker-compose-cluster.yaml exec nodejs bash -c \"npm i && npm run build && EVENTSTORE_CONNECTION_TYPE=dns EVENTSTORE_HOST=192.168.33.10 npm run test-debug\"",
|
"compose:gossip:test": "docker-compose -f docker-compose-cluster.yaml exec nodejs bash -c \"npm i && npm run build && EVENTSTORE_CONNECTION_TYPE=dns EVENTSTORE_HOST=192.168.33.10 npm run test-debug\"",
|
||||||
@ -58,12 +58,12 @@
|
|||||||
},
|
},
|
||||||
"homepage": "https://github.com/nicdex/node-eventstore-client#readme",
|
"homepage": "https://github.com/nicdex/node-eventstore-client#readme",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@types/long": "^3.0.32",
|
"@types/node": ">=12",
|
||||||
"@types/node": ">=5.10",
|
"long": "^5.2.0",
|
||||||
"long": "^3.2.0",
|
"protobufjs": "^7.1.2",
|
||||||
"protobufjs": "^6.8.8",
|
"protobufjs-cli": "^1.0.2",
|
||||||
"strict-event-emitter-types": "^1.2.0",
|
"strict-event-emitter-types": "^1.2.0",
|
||||||
"uuid": "^3.0.1"
|
"uuid": "^9.0.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"jest": "^26.4.2",
|
"jest": "^26.4.2",
|
||||||
|
@ -37,7 +37,7 @@ AppendToStreamOperation.prototype._createRequestDto = function() {
|
|||||||
eventStreamId: this._stream,
|
eventStreamId: this._stream,
|
||||||
expectedVersion: this._expectedVersion,
|
expectedVersion: this._expectedVersion,
|
||||||
events: dtos,
|
events: dtos,
|
||||||
requireMaster: this._requireMaster});
|
requireLeader: this._requireMaster});
|
||||||
};
|
};
|
||||||
|
|
||||||
AppendToStreamOperation.prototype._inspectResponse = function(response) {
|
AppendToStreamOperation.prototype._inspectResponse = function(response) {
|
||||||
@ -79,4 +79,4 @@ AppendToStreamOperation.prototype.toString = function() {
|
|||||||
return util.format("Stream: %s, ExpectedVersion: %d", this._stream, this._expectedVersion);
|
return util.format("Stream: %s, ExpectedVersion: %d", this._stream, this._expectedVersion);
|
||||||
};
|
};
|
||||||
|
|
||||||
module.exports = AppendToStreamOperation;
|
module.exports = AppendToStreamOperation;
|
||||||
|
@ -24,7 +24,7 @@ util.inherits(CommitTransactionOperation, OperationBase);
|
|||||||
CommitTransactionOperation.prototype._createRequestDto = function() {
|
CommitTransactionOperation.prototype._createRequestDto = function() {
|
||||||
return new ClientMessage.TransactionCommit({
|
return new ClientMessage.TransactionCommit({
|
||||||
transactionId: this._transactionId,
|
transactionId: this._transactionId,
|
||||||
requireMaster: this._requireMaster
|
requireLeader: this._requireMaster
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -66,4 +66,4 @@ CommitTransactionOperation.prototype.toString = function() {
|
|||||||
return util.format("TransactionId: %s", this._transactionId);
|
return util.format("TransactionId: %s", this._transactionId);
|
||||||
};
|
};
|
||||||
|
|
||||||
module.exports = CommitTransactionOperation;
|
module.exports = CommitTransactionOperation;
|
||||||
|
@ -27,7 +27,7 @@ DeleteStreamOperation.prototype._createRequestDto = function() {
|
|||||||
return new ClientMessage.DeleteStream({
|
return new ClientMessage.DeleteStream({
|
||||||
eventStreamId: this._stream,
|
eventStreamId: this._stream,
|
||||||
expectedVersion: this._expectedVersion,
|
expectedVersion: this._expectedVersion,
|
||||||
requireMaster: this._requireMaster,
|
requireLeader: this._requireMaster,
|
||||||
hardDelete: this._hardDelete
|
hardDelete: this._hardDelete
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
@ -69,4 +69,4 @@ DeleteStreamOperation.prototype.toString = function() {
|
|||||||
return util.format("Stream: %s, ExpectedVersion: %s.", this._stream, this._expectedVersion);
|
return util.format("Stream: %s, ExpectedVersion: %s.", this._stream, this._expectedVersion);
|
||||||
};
|
};
|
||||||
|
|
||||||
module.exports = DeleteStreamOperation;
|
module.exports = DeleteStreamOperation;
|
||||||
|
@ -117,9 +117,9 @@ OperationBase.prototype._inspectNotHandled = function(pkg)
|
|||||||
case ClientMessage.NotHandled.NotHandledReason.TooBusy:
|
case ClientMessage.NotHandled.NotHandledReason.TooBusy:
|
||||||
return new InspectionResult(InspectionDecision.Retry, "NotHandled - TooBusy");
|
return new InspectionResult(InspectionDecision.Retry, "NotHandled - TooBusy");
|
||||||
|
|
||||||
case ClientMessage.NotHandled.NotHandledReason.NotMaster:
|
case ClientMessage.NotHandled.NotHandledReason.NotLeader:
|
||||||
var masterInfo = ClientMessage.NotHandled.MasterInfo.decode(message.additionalInfo);
|
var masterInfo = ClientMessage.NotHandled.LeaderInfo.decode(message.additionalInfo);
|
||||||
return new InspectionResult(InspectionDecision.Reconnect, "NotHandled - NotMaster",
|
return new InspectionResult(InspectionDecision.Reconnect, "NotHandled - NotLeader",
|
||||||
{host: masterInfo.externalTcpAddress, port: masterInfo.externalTcpPort},
|
{host: masterInfo.externalTcpAddress, port: masterInfo.externalTcpPort},
|
||||||
{host: masterInfo.externalSecureTcpAddress, port: masterInfo.externalSecureTcpPort});
|
{host: masterInfo.externalSecureTcpAddress, port: masterInfo.externalSecureTcpPort});
|
||||||
|
|
||||||
@ -145,4 +145,4 @@ OperationBase.prototype._inspectUnexpectedCommand = function(pkg, expectedComman
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
module.exports = OperationBase;
|
module.exports = OperationBase;
|
||||||
|
@ -29,7 +29,7 @@ ReadAllEventsBackwardOperation.prototype._createRequestDto = function() {
|
|||||||
preparePosition: this._position.preparePosition,
|
preparePosition: this._position.preparePosition,
|
||||||
maxCount: this._maxCount,
|
maxCount: this._maxCount,
|
||||||
resolveLinkTos: this._resolveLinkTos,
|
resolveLinkTos: this._resolveLinkTos,
|
||||||
requireMaster: this._requireMaster
|
requireLeader: this._requireMaster
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -64,4 +64,4 @@ ReadAllEventsBackwardOperation.prototype.toString = function() {
|
|||||||
this._position, this._maxCount, this._resolveLinkTos, this._requireMaster);
|
this._position, this._maxCount, this._resolveLinkTos, this._requireMaster);
|
||||||
};
|
};
|
||||||
|
|
||||||
module.exports = ReadAllEventsBackwardOperation;
|
module.exports = ReadAllEventsBackwardOperation;
|
||||||
|
@ -29,7 +29,7 @@ ReadAllEventsForwardOperation.prototype._createRequestDto = function() {
|
|||||||
preparePosition: this._position.preparePosition,
|
preparePosition: this._position.preparePosition,
|
||||||
maxCount: this._maxCount,
|
maxCount: this._maxCount,
|
||||||
resolveLinkTos: this._resolveLinkTos,
|
resolveLinkTos: this._resolveLinkTos,
|
||||||
requireMaster: this._requireMaster
|
requireLeader: this._requireMaster
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -64,4 +64,4 @@ ReadAllEventsForwardOperation.prototype.toString = function() {
|
|||||||
this._position, this._maxCount, this._resolveLinkTos, this._requireMaster);
|
this._position, this._maxCount, this._resolveLinkTos, this._requireMaster);
|
||||||
};
|
};
|
||||||
|
|
||||||
module.exports = ReadAllEventsForwardOperation;
|
module.exports = ReadAllEventsForwardOperation;
|
||||||
|
@ -25,7 +25,7 @@ ReadEventOperation.prototype._createRequestDto = function() {
|
|||||||
eventStreamId: this._stream,
|
eventStreamId: this._stream,
|
||||||
eventNumber: this._eventNumber,
|
eventNumber: this._eventNumber,
|
||||||
resolveLinkTos: this._resolveLinkTos,
|
resolveLinkTos: this._resolveLinkTos,
|
||||||
requireMaster: this._requireMaster
|
requireLeader: this._requireMaster
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -81,4 +81,4 @@ ReadEventOperation.prototype.toString = function() {
|
|||||||
this._stream, this._eventNumber, this._resolveLinkTos, this._requireMaster);
|
this._stream, this._eventNumber, this._resolveLinkTos, this._requireMaster);
|
||||||
};
|
};
|
||||||
|
|
||||||
module.exports = ReadEventOperation;
|
module.exports = ReadEventOperation;
|
||||||
|
@ -31,7 +31,7 @@ ReadStreamEventsBackwardOperation.prototype._createRequestDto = function() {
|
|||||||
fromEventNumber: this._fromEventNumber,
|
fromEventNumber: this._fromEventNumber,
|
||||||
maxCount: this._maxCount,
|
maxCount: this._maxCount,
|
||||||
resolveLinkTos: this._resolveLinkTos,
|
resolveLinkTos: this._resolveLinkTos,
|
||||||
requireMaster: this._requireMaster
|
requireLeader: this._requireMaster
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -76,4 +76,4 @@ ReadStreamEventsBackwardOperation.prototype.toString = function() {
|
|||||||
this._stream, this._fromEventNumber, this._maxCount, this._resolveLinkTos, this._requireMaster);
|
this._stream, this._fromEventNumber, this._maxCount, this._resolveLinkTos, this._requireMaster);
|
||||||
};
|
};
|
||||||
|
|
||||||
module.exports = ReadStreamEventsBackwardOperation;
|
module.exports = ReadStreamEventsBackwardOperation;
|
||||||
|
@ -31,7 +31,7 @@ ReadStreamEventsForwardOperation.prototype._createRequestDto = function() {
|
|||||||
fromEventNumber: this._fromEventNumber,
|
fromEventNumber: this._fromEventNumber,
|
||||||
maxCount: this._maxCount,
|
maxCount: this._maxCount,
|
||||||
resolveLinkTos: this._resolveLinkTos,
|
resolveLinkTos: this._resolveLinkTos,
|
||||||
requireMaster: this._requireMaster
|
requireLeader: this._requireMaster
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -76,4 +76,4 @@ ReadStreamEventsForwardOperation.prototype.toString = function() {
|
|||||||
this._stream, this._fromEventNumber, this._maxCount, this._resolveLinkTos, this._requireMaster);
|
this._stream, this._fromEventNumber, this._maxCount, this._resolveLinkTos, this._requireMaster);
|
||||||
};
|
};
|
||||||
|
|
||||||
module.exports = ReadStreamEventsForwardOperation;
|
module.exports = ReadStreamEventsForwardOperation;
|
||||||
|
@ -25,7 +25,7 @@ StartTransactionOperation.prototype._createRequestDto = function() {
|
|||||||
return new ClientMessage.TransactionStart({
|
return new ClientMessage.TransactionStart({
|
||||||
eventStreamId: this._stream,
|
eventStreamId: this._stream,
|
||||||
expectedVersion: this._expectedVersion,
|
expectedVersion: this._expectedVersion,
|
||||||
requireMaster: this._requireMaster
|
requireLeader: this._requireMaster
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -66,4 +66,4 @@ StartTransactionOperation.prototype.toString = function() {
|
|||||||
return util.format("Stream: %s, ExpectedVersion: %d", this._stream, this._expectedVersion);
|
return util.format("Stream: %s, ExpectedVersion: %d", this._stream, this._expectedVersion);
|
||||||
};
|
};
|
||||||
|
|
||||||
module.exports = StartTransactionOperation;
|
module.exports = StartTransactionOperation;
|
||||||
|
@ -137,9 +137,9 @@ SubscriptionOperation.prototype.inspectPackage = function(pkg) {
|
|||||||
case ClientMessage.NotHandled.NotHandledReason.TooBusy:
|
case ClientMessage.NotHandled.NotHandledReason.TooBusy:
|
||||||
return new InspectionResult(InspectionDecision.Retry, "NotHandled - TooBusy");
|
return new InspectionResult(InspectionDecision.Retry, "NotHandled - TooBusy");
|
||||||
|
|
||||||
case ClientMessage.NotHandled.NotHandledReason.NotMaster:
|
case ClientMessage.NotHandled.NotHandledReason.NotLeader:
|
||||||
var masterInfo = ClientMessage.NotHandled.MasterInfo.decode(message.additionalInfo);
|
var masterInfo = ClientMessage.NotHandled.LeaderInfo.decode(message.additionalInfo);
|
||||||
return new InspectionResult(InspectionDecision.Reconnect, "NotHandled - NotMaster",
|
return new InspectionResult(InspectionDecision.Reconnect, "NotHandled - NotLeader",
|
||||||
{host: masterInfo.externalTcpAddress, port: masterInfo.externalTcpPort},
|
{host: masterInfo.externalTcpAddress, port: masterInfo.externalTcpPort},
|
||||||
{host: masterInfo.externalSecureTcpAddress, port: masterInfo.externalSecureTcpPort});
|
{host: masterInfo.externalSecureTcpAddress, port: masterInfo.externalSecureTcpPort});
|
||||||
|
|
||||||
@ -279,4 +279,4 @@ SubscriptionOperation.prototype.toString = function() {
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
module.exports = SubscriptionOperation;
|
module.exports = SubscriptionOperation;
|
||||||
|
@ -32,7 +32,7 @@ TransactionalWriteOperation.prototype._createRequestDto = function() {
|
|||||||
return new ClientMessage.TransactionWrite({
|
return new ClientMessage.TransactionWrite({
|
||||||
transactionId: this._transactionId,
|
transactionId: this._transactionId,
|
||||||
events: dtos,
|
events: dtos,
|
||||||
requireMaster: this._requireMaster
|
requireLeader: this._requireMaster
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -64,4 +64,4 @@ TransactionalWriteOperation.prototype.toString = function() {
|
|||||||
return util.format("TransactionId: %s", this._transactionId);
|
return util.format("TransactionId: %s", this._transactionId);
|
||||||
};
|
};
|
||||||
|
|
||||||
module.exports = TransactionalWriteOperation;
|
module.exports = TransactionalWriteOperation;
|
||||||
|
@ -78,7 +78,7 @@ ClusterDiscoverer.prototype._getGossipCandidates = async function (managerExtern
|
|||||||
this._settings.seeds && this._settings.seeds.length > 0
|
this._settings.seeds && this._settings.seeds.length > 0
|
||||||
? this._settings.seeds
|
? this._settings.seeds
|
||||||
: (await this._resolveDns(this._settings.clusterDns)).map(
|
: (await this._resolveDns(this._settings.clusterDns)).map(
|
||||||
(address) => new GossipSeed({ host: address, port: managerExternalHttpPort }, undefined)
|
(address) => new GossipSeed({ host: address, port: managerExternalHttpPort }, address, this._settings.clusterDns)
|
||||||
);
|
);
|
||||||
return shuffle(gossipSeeds);
|
return shuffle(gossipSeeds);
|
||||||
};
|
};
|
||||||
@ -109,12 +109,14 @@ ClusterDiscoverer.prototype._resolveDns = async function (clusterDns) {
|
|||||||
* @returns {Promise.<ClusterInfo>}
|
* @returns {Promise.<ClusterInfo>}
|
||||||
*/
|
*/
|
||||||
ClusterDiscoverer.prototype._clusterInfo = async function (candidate, timeout) {
|
ClusterDiscoverer.prototype._clusterInfo = async function (candidate, timeout) {
|
||||||
|
var self = this;
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
const options = {
|
const options = {
|
||||||
host: candidate.endPoint.host,
|
host: candidate.endPoint.host,
|
||||||
port: candidate.endPoint.port,
|
port: candidate.endPoint.port,
|
||||||
path: '/gossip?format=json',
|
path: '/gossip?format=json',
|
||||||
timeout: timeout,
|
timeout: timeout,
|
||||||
|
rejectUnauthorized: self._settings.rejectUnauthorized
|
||||||
};
|
};
|
||||||
if (candidate.hostHeader) {
|
if (candidate.hostHeader) {
|
||||||
options.headers = {
|
options.headers = {
|
||||||
|
@ -2,16 +2,21 @@ const MemberInfo = require('./memberInfo.js');
|
|||||||
|
|
||||||
const VNodeStates = Object.freeze({
|
const VNodeStates = Object.freeze({
|
||||||
Initializing: 0,
|
Initializing: 0,
|
||||||
Unknown: 1,
|
DiscoverLeader: 1,
|
||||||
PreReplica: 2,
|
Unknown: 2,
|
||||||
CatchingUp: 3,
|
PreReplica: 3,
|
||||||
Clone: 4,
|
CatchingUp: 4,
|
||||||
Slave: 5,
|
Clone: 5,
|
||||||
PreMaster: 6,
|
Follower: 6,
|
||||||
Master: 7,
|
PreLeader: 7,
|
||||||
Manager: 8,
|
Leader: 8,
|
||||||
ShuttingDown: 9,
|
Manager: 9,
|
||||||
Shutdown: 10
|
ShuttingDown: 10,
|
||||||
|
Shutdown: 11,
|
||||||
|
ReadOnlyLeaderless: 12,
|
||||||
|
PreReadOnlyReplica: 13,
|
||||||
|
ReadOnlyReplica: 14,
|
||||||
|
ResigningLeader: 15,
|
||||||
});
|
});
|
||||||
|
|
||||||
function ClusterInfo(members) {
|
function ClusterInfo(members) {
|
||||||
@ -33,4 +38,4 @@ ClusterInfo.prototype._getBestNode = function () {
|
|||||||
})[0];
|
})[0];
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = ClusterInfo;
|
module.exports = ClusterInfo;
|
||||||
|
@ -6,6 +6,7 @@ var ensure = require('./common/utils/ensure');
|
|||||||
|
|
||||||
const util = require('util');
|
const util = require('util');
|
||||||
const http = require('http');
|
const http = require('http');
|
||||||
|
const https = require('https');
|
||||||
const dns = require('dns');
|
const dns = require('dns');
|
||||||
|
|
||||||
const dnsService = {
|
const dnsService = {
|
||||||
@ -95,13 +96,14 @@ function createFromClusterDns(connectionSettings, clusterDns, externalGossipPort
|
|||||||
managerExternalHttpPort: externalGossipPort,
|
managerExternalHttpPort: externalGossipPort,
|
||||||
maxDiscoverAttempts: mergedSettings.maxDiscoverAttempts,
|
maxDiscoverAttempts: mergedSettings.maxDiscoverAttempts,
|
||||||
discoverDelay: mergedSettings.discoverDelay,
|
discoverDelay: mergedSettings.discoverDelay,
|
||||||
gossipTimeout: mergedSettings.gossipTimeout
|
gossipTimeout: mergedSettings.gossipTimeout,
|
||||||
|
rejectUnauthorized: connectionSettings.useSslConnection ? connectionSettings.validateServer : undefined
|
||||||
};
|
};
|
||||||
var endPointDiscoverer = new ClusterDiscoverer(
|
var endPointDiscoverer = new ClusterDiscoverer(
|
||||||
mergedSettings.log,
|
mergedSettings.log,
|
||||||
clusterSettings,
|
clusterSettings,
|
||||||
dnsService,
|
dnsService,
|
||||||
http
|
connectionSettings.useSslConnection ? https : http
|
||||||
);
|
);
|
||||||
return new EventStoreNodeConnection(mergedSettings, clusterSettings, endPointDiscoverer, connectionName);
|
return new EventStoreNodeConnection(mergedSettings, clusterSettings, endPointDiscoverer, connectionName);
|
||||||
}
|
}
|
||||||
@ -116,13 +118,14 @@ function createFromGossipSeeds(connectionSettings, gossipSeeds, connectionName)
|
|||||||
externalGossipPort: 0,
|
externalGossipPort: 0,
|
||||||
maxDiscoverAttempts: mergedSettings.maxDiscoverAttempts,
|
maxDiscoverAttempts: mergedSettings.maxDiscoverAttempts,
|
||||||
discoverDelay: mergedSettings.discoverDelay,
|
discoverDelay: mergedSettings.discoverDelay,
|
||||||
gossipTimeout: mergedSettings.gossipTimeout
|
gossipTimeout: mergedSettings.gossipTimeout,
|
||||||
|
rejectUnauthorized: connectionSettings.useSslConnection ? connectionSettings.validateServer : undefined
|
||||||
};
|
};
|
||||||
var endPointDiscoverer = new ClusterDiscoverer(
|
var endPointDiscoverer = new ClusterDiscoverer(
|
||||||
mergedSettings.log,
|
mergedSettings.log,
|
||||||
clusterSettings,
|
clusterSettings,
|
||||||
dnsService,
|
dnsService,
|
||||||
http
|
connectionSettings.useSslConnection ? https : http
|
||||||
);
|
);
|
||||||
return new EventStoreNodeConnection(mergedSettings, clusterSettings, endPointDiscoverer, connectionName);
|
return new EventStoreNodeConnection(mergedSettings, clusterSettings, endPointDiscoverer, connectionName);
|
||||||
}
|
}
|
||||||
@ -162,4 +165,4 @@ module.exports.create = function(settings, endPointOrGossipSeeds, connectionName
|
|||||||
if (typeof endPointOrGossipSeeds === 'object') return createFromTcpEndpoint(settings, endPointOrGossipSeeds, connectionName);
|
if (typeof endPointOrGossipSeeds === 'object') return createFromTcpEndpoint(settings, endPointOrGossipSeeds, connectionName);
|
||||||
if (typeof endPointOrGossipSeeds === 'string') return createFromStringEndpoint(settings, endPointOrGossipSeeds, connectionName);
|
if (typeof endPointOrGossipSeeds === 'string') return createFromStringEndpoint(settings, endPointOrGossipSeeds, connectionName);
|
||||||
throw new TypeError('endPointOrGossipSeeds must be an object, a string or an array.');
|
throw new TypeError('endPointOrGossipSeeds must be an object, a string or an array.');
|
||||||
};
|
};
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -1,3 +1,5 @@
|
|||||||
|
syntax = "proto2";
|
||||||
|
|
||||||
package EventStore.Client.Messages;
|
package EventStore.Client.Messages;
|
||||||
|
|
||||||
enum OperationResult
|
enum OperationResult
|
||||||
@ -50,7 +52,7 @@ message WriteEvents {
|
|||||||
required string event_stream_id = 1;
|
required string event_stream_id = 1;
|
||||||
required int64 expected_version = 2;
|
required int64 expected_version = 2;
|
||||||
repeated NewEvent events = 3;
|
repeated NewEvent events = 3;
|
||||||
required bool require_master = 4;
|
required bool require_leader = 4;
|
||||||
}
|
}
|
||||||
|
|
||||||
message WriteEventsCompleted {
|
message WriteEventsCompleted {
|
||||||
@ -66,7 +68,7 @@ message WriteEventsCompleted {
|
|||||||
message DeleteStream {
|
message DeleteStream {
|
||||||
required string event_stream_id = 1;
|
required string event_stream_id = 1;
|
||||||
required int64 expected_version = 2;
|
required int64 expected_version = 2;
|
||||||
required bool require_master = 3;
|
required bool require_leader = 3;
|
||||||
optional bool hard_delete = 4;
|
optional bool hard_delete = 4;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -75,12 +77,13 @@ message DeleteStreamCompleted {
|
|||||||
optional string message = 2;
|
optional string message = 2;
|
||||||
optional int64 prepare_position = 3;
|
optional int64 prepare_position = 3;
|
||||||
optional int64 commit_position = 4;
|
optional int64 commit_position = 4;
|
||||||
|
optional int64 current_version = 5;
|
||||||
}
|
}
|
||||||
|
|
||||||
message TransactionStart {
|
message TransactionStart {
|
||||||
required string event_stream_id = 1;
|
required string event_stream_id = 1;
|
||||||
required int64 expected_version = 2;
|
required int64 expected_version = 2;
|
||||||
required bool require_master = 3;
|
required bool require_leader = 3;
|
||||||
}
|
}
|
||||||
|
|
||||||
message TransactionStartCompleted {
|
message TransactionStartCompleted {
|
||||||
@ -92,7 +95,7 @@ message TransactionStartCompleted {
|
|||||||
message TransactionWrite {
|
message TransactionWrite {
|
||||||
required int64 transaction_id = 1;
|
required int64 transaction_id = 1;
|
||||||
repeated NewEvent events = 2;
|
repeated NewEvent events = 2;
|
||||||
required bool require_master = 3;
|
required bool require_leader = 3;
|
||||||
}
|
}
|
||||||
|
|
||||||
message TransactionWriteCompleted {
|
message TransactionWriteCompleted {
|
||||||
@ -103,7 +106,7 @@ message TransactionWriteCompleted {
|
|||||||
|
|
||||||
message TransactionCommit {
|
message TransactionCommit {
|
||||||
required int64 transaction_id = 1;
|
required int64 transaction_id = 1;
|
||||||
required bool require_master = 2;
|
required bool require_leader = 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
message TransactionCommitCompleted {
|
message TransactionCommitCompleted {
|
||||||
@ -120,7 +123,7 @@ message ReadEvent {
|
|||||||
required string event_stream_id = 1;
|
required string event_stream_id = 1;
|
||||||
required int64 event_number = 2;
|
required int64 event_number = 2;
|
||||||
required bool resolve_link_tos = 3;
|
required bool resolve_link_tos = 3;
|
||||||
required bool require_master = 4;
|
required bool require_leader = 4;
|
||||||
}
|
}
|
||||||
|
|
||||||
message ReadEventCompleted {
|
message ReadEventCompleted {
|
||||||
@ -145,7 +148,7 @@ message ReadStreamEvents {
|
|||||||
required int64 from_event_number = 2;
|
required int64 from_event_number = 2;
|
||||||
required int32 max_count = 3;
|
required int32 max_count = 3;
|
||||||
required bool resolve_link_tos = 4;
|
required bool resolve_link_tos = 4;
|
||||||
required bool require_master = 5;
|
required bool require_leader = 5;
|
||||||
}
|
}
|
||||||
|
|
||||||
message ReadStreamEventsCompleted {
|
message ReadStreamEventsCompleted {
|
||||||
@ -174,7 +177,7 @@ message ReadAllEvents {
|
|||||||
required int64 prepare_position = 2;
|
required int64 prepare_position = 2;
|
||||||
required int32 max_count = 3;
|
required int32 max_count = 3;
|
||||||
required bool resolve_link_tos = 4;
|
required bool resolve_link_tos = 4;
|
||||||
required bool require_master = 5;
|
required bool require_leader = 5;
|
||||||
}
|
}
|
||||||
|
|
||||||
message ReadAllEventsCompleted {
|
message ReadAllEventsCompleted {
|
||||||
@ -196,6 +199,54 @@ message ReadAllEventsCompleted {
|
|||||||
optional string error = 7;
|
optional string error = 7;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
message Filter{
|
||||||
|
|
||||||
|
enum FilterContext {
|
||||||
|
StreamId = 0;
|
||||||
|
EventType = 1;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
enum FilterType {
|
||||||
|
Regex = 0;
|
||||||
|
Prefix = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
required FilterContext context = 1;
|
||||||
|
required FilterType type = 2;
|
||||||
|
repeated string data = 3;
|
||||||
|
}
|
||||||
|
|
||||||
|
message FilteredReadAllEvents {
|
||||||
|
required int64 commit_position = 1;
|
||||||
|
required int64 prepare_position = 2;
|
||||||
|
required int32 max_count = 3;
|
||||||
|
optional int32 max_search_window = 4;
|
||||||
|
required bool resolve_link_tos = 5;
|
||||||
|
required bool require_leader = 6;
|
||||||
|
required Filter filter = 7;
|
||||||
|
}
|
||||||
|
|
||||||
|
message FilteredReadAllEventsCompleted {
|
||||||
|
|
||||||
|
enum FilteredReadAllResult {
|
||||||
|
Success = 0;
|
||||||
|
NotModified = 1;
|
||||||
|
Error = 2;
|
||||||
|
AccessDenied = 3;
|
||||||
|
}
|
||||||
|
|
||||||
|
required int64 commit_position = 1;
|
||||||
|
required int64 prepare_position = 2;
|
||||||
|
repeated ResolvedEvent events = 3;
|
||||||
|
required int64 next_commit_position = 4;
|
||||||
|
required int64 next_prepare_position = 5;
|
||||||
|
required bool is_end_of_stream = 6;
|
||||||
|
|
||||||
|
optional FilteredReadAllResult result = 7 [default = Success];
|
||||||
|
optional string error = 8;
|
||||||
|
}
|
||||||
|
|
||||||
message CreatePersistentSubscription {
|
message CreatePersistentSubscription {
|
||||||
required string subscription_group_name = 1;
|
required string subscription_group_name = 1;
|
||||||
required string event_stream_id = 2;
|
required string event_stream_id = 2;
|
||||||
@ -307,6 +358,7 @@ message PersistentSubscriptionConfirmation {
|
|||||||
|
|
||||||
message PersistentSubscriptionStreamEventAppeared {
|
message PersistentSubscriptionStreamEventAppeared {
|
||||||
required ResolvedIndexedEvent event = 1;
|
required ResolvedIndexedEvent event = 1;
|
||||||
|
optional int32 retryCount = 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
message SubscribeToStream {
|
message SubscribeToStream {
|
||||||
@ -314,6 +366,18 @@ message SubscribeToStream {
|
|||||||
required bool resolve_link_tos = 2;
|
required bool resolve_link_tos = 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
message FilteredSubscribeToStream {
|
||||||
|
required string event_stream_id = 1;
|
||||||
|
required bool resolve_link_tos = 2;
|
||||||
|
required Filter filter = 3;
|
||||||
|
required int32 checkpoint_interval = 4;
|
||||||
|
}
|
||||||
|
|
||||||
|
message CheckpointReached {
|
||||||
|
required int64 commit_position = 1;
|
||||||
|
required int64 prepare_position = 2;
|
||||||
|
}
|
||||||
|
|
||||||
message SubscriptionConfirmation {
|
message SubscriptionConfirmation {
|
||||||
required int64 last_commit_position = 1;
|
required int64 last_commit_position = 1;
|
||||||
optional int64 last_event_number = 2;
|
optional int64 last_event_number = 2;
|
||||||
@ -344,17 +408,18 @@ message NotHandled {
|
|||||||
enum NotHandledReason {
|
enum NotHandledReason {
|
||||||
NotReady = 0;
|
NotReady = 0;
|
||||||
TooBusy = 1;
|
TooBusy = 1;
|
||||||
NotMaster = 2;
|
NotLeader = 2;
|
||||||
|
IsReadOnly = 3;
|
||||||
}
|
}
|
||||||
|
|
||||||
required NotHandledReason reason = 1;
|
required NotHandledReason reason = 1;
|
||||||
optional bytes additional_info = 2;
|
optional bytes additional_info = 2;
|
||||||
|
|
||||||
message MasterInfo {
|
message LeaderInfo {
|
||||||
required string external_tcp_address = 1;
|
optional string external_tcp_address = 1;
|
||||||
required int32 external_tcp_port = 2;
|
optional int32 external_tcp_port = 2;
|
||||||
required string external_http_address = 3;
|
required string http_address = 3;
|
||||||
required int32 external_http_port = 4;
|
required int32 http_port = 4;
|
||||||
optional string external_secure_tcp_address = 5;
|
optional string external_secure_tcp_address = 5;
|
||||||
optional int32 external_secure_tcp_port = 6;
|
optional int32 external_secure_tcp_port = 6;
|
||||||
}
|
}
|
||||||
@ -363,18 +428,17 @@ message NotHandled {
|
|||||||
message ScavengeDatabase {
|
message ScavengeDatabase {
|
||||||
}
|
}
|
||||||
|
|
||||||
message ScavengeDatabaseCompleted {
|
message ScavengeDatabaseResponse {
|
||||||
|
|
||||||
enum ScavengeResult {
|
enum ScavengeResult {
|
||||||
Success = 0;
|
Started = 0;
|
||||||
InProgress = 1;
|
InProgress = 1;
|
||||||
Failed = 2;
|
Unauthorized = 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
required ScavengeResult result = 1;
|
required ScavengeResult result = 1;
|
||||||
optional string error = 2;
|
optional string scavengeId = 2;
|
||||||
required int32 total_time_ms = 3;
|
|
||||||
required int64 total_space_saved = 4;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
message IdentifyClient {
|
message IdentifyClient {
|
||||||
@ -383,4 +447,4 @@ message IdentifyClient {
|
|||||||
}
|
}
|
||||||
|
|
||||||
message ClientIdentified {
|
message ClientIdentified {
|
||||||
}
|
}
|
||||||
|
@ -15,9 +15,10 @@ function safeParseJson(json) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function ProjectionsClient(log, operationTimeout) {
|
function ProjectionsClient(log, operationTimeout, rejectUnauthorized) {
|
||||||
this._log = log;
|
this._log = log;
|
||||||
this._operationTimeout = operationTimeout;
|
this._operationTimeout = operationTimeout;
|
||||||
|
this._rejectUnauthorized = typeof rejectUnauthorized === 'undefined' ? true : !!rejectUnauthorized;
|
||||||
}
|
}
|
||||||
|
|
||||||
ProjectionsClient.prototype.enable = function(httpEndPoint, name, userCredentials) {
|
ProjectionsClient.prototype.enable = function(httpEndPoint, name, userCredentials) {
|
||||||
@ -118,6 +119,9 @@ ProjectionsClient.prototype.request = function(method, _url, data, userCredentia
|
|||||||
if (userCredentials) {
|
if (userCredentials) {
|
||||||
options.auth = [userCredentials.username, userCredentials.password].join(':');
|
options.auth = [userCredentials.username, userCredentials.password].join(':');
|
||||||
}
|
}
|
||||||
|
if (!this._rejectUnauthorized) {
|
||||||
|
options.rejectUnauthorized = false;
|
||||||
|
}
|
||||||
var self = this;
|
var self = this;
|
||||||
return new Promise(function (resolve, reject) {
|
return new Promise(function (resolve, reject) {
|
||||||
const timeout = setTimeout(function () {
|
const timeout = setTimeout(function () {
|
||||||
|
@ -6,12 +6,13 @@ const ProjectionsClient = require('./projectionsClient');
|
|||||||
* @param {Logger} log Instance of Logger to use for logging.
|
* @param {Logger} log Instance of Logger to use for logging.
|
||||||
* @param {string} httpEndPoint HTTP endpoint of an Event Store server.
|
* @param {string} httpEndPoint HTTP endpoint of an Event Store server.
|
||||||
* @param {number} operationTimeout Operation timeout in milliseconds.
|
* @param {number} operationTimeout Operation timeout in milliseconds.
|
||||||
|
* @param {boolean} [rejectUnauthorized] Reject authorized SSL certs (if using SSL) - set to false is using self-signed certs
|
||||||
* @constructor
|
* @constructor
|
||||||
*/
|
*/
|
||||||
function ProjectionsManager(log, httpEndPoint, operationTimeout) {
|
function ProjectionsManager(log, httpEndPoint, operationTimeout, rejectUnauthorized) {
|
||||||
ensure.notNull(log, "log");
|
ensure.notNull(log, "log");
|
||||||
ensure.notNull(httpEndPoint, "httpEndPoint");
|
ensure.notNull(httpEndPoint, "httpEndPoint");
|
||||||
this._client = new ProjectionsClient(log, operationTimeout);
|
this._client = new ProjectionsClient(log, operationTimeout, rejectUnauthorized);
|
||||||
this._httpEndPoint = httpEndPoint;
|
this._httpEndPoint = httpEndPoint;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -211,4 +212,4 @@ ProjectionsManager.prototype.delete = function(name, deleteEmittedStreams, delet
|
|||||||
return this._client.delete(this._httpEndPoint, name, deleteEmittedStreams, deleteStateStream, deleteCheckpointStream, userCredentials);
|
return this._client.delete(this._httpEndPoint, name, deleteEmittedStreams, deleteStateStream, deleteCheckpointStream, userCredentials);
|
||||||
};
|
};
|
||||||
|
|
||||||
module.exports = ProjectionsManager;
|
module.exports = ProjectionsManager;
|
||||||
|
@ -12,6 +12,8 @@ protobufJS.configure();
|
|||||||
|
|
||||||
var settings = {
|
var settings = {
|
||||||
log: new NoopLogger(),
|
log: new NoopLogger(),
|
||||||
|
useSslConnection: true,
|
||||||
|
validateServer: false
|
||||||
};
|
};
|
||||||
if (process.env.TESTS_VERBOSE_LOGGING === '1') {
|
if (process.env.TESTS_VERBOSE_LOGGING === '1') {
|
||||||
settings.verboseLogging = true;
|
settings.verboseLogging = true;
|
||||||
@ -53,7 +55,7 @@ function setUpWithGossipSeeds(cb) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function setUpWithDns(cb) {
|
function setUpWithDns(cb) {
|
||||||
var clusterDns = 'discover://eventstore.local:2113';
|
var clusterDns = 'discover://' + process.env.EVENTSTORE_HOST + ':2113';
|
||||||
this.log = settings.log;
|
this.log = settings.log;
|
||||||
this.testStreamName = 'test-' + uuid.v4();
|
this.testStreamName = 'test-' + uuid.v4();
|
||||||
var connected = false;
|
var connected = false;
|
||||||
|
@ -27,7 +27,7 @@ switch(evenstStoreType){
|
|||||||
done();
|
done();
|
||||||
});
|
});
|
||||||
conn.on('error', done);
|
conn.on('error', done);
|
||||||
|
|
||||||
function done(err) {
|
function done(err) {
|
||||||
conn.close();
|
conn.close();
|
||||||
if (err) return test.done(err);
|
if (err) return test.done(err);
|
||||||
@ -41,7 +41,7 @@ switch(evenstStoreType){
|
|||||||
new GossipSeed({host: '1.2.3.4', port: 1113}),
|
new GossipSeed({host: '1.2.3.4', port: 1113}),
|
||||||
new GossipSeed({host: '2.3.4.5', port: 2113}),
|
new GossipSeed({host: '2.3.4.5', port: 2113}),
|
||||||
new GossipSeed({host: '3.4.5.6', port: 3113})
|
new GossipSeed({host: '3.4.5.6', port: 3113})
|
||||||
];
|
];
|
||||||
var conn = client.EventStoreConnection.create(testBase.settings({maxDiscoverAttempts: 1}), gossipSeeds);
|
var conn = client.EventStoreConnection.create(testBase.settings({maxDiscoverAttempts: 1}), gossipSeeds);
|
||||||
conn.connect()
|
conn.connect()
|
||||||
.catch(function (err) {
|
.catch(function (err) {
|
||||||
@ -62,7 +62,7 @@ switch(evenstStoreType){
|
|||||||
case 'dns':
|
case 'dns':
|
||||||
module.exports['Connect to Cluster using dns discover'] = function (test) {
|
module.exports['Connect to Cluster using dns discover'] = function (test) {
|
||||||
test.expect(1);
|
test.expect(1);
|
||||||
var clusterDns = 'discover://eventstore.local:2113';
|
var clusterDns = 'discover://' + process.env.EVENTSTORE_HOST + ':2113';
|
||||||
var conn = client.EventStoreConnection.create(testBase.settings(), clusterDns);
|
var conn = client.EventStoreConnection.create(testBase.settings(), clusterDns);
|
||||||
conn.connect()
|
conn.connect()
|
||||||
.catch(function(err) {
|
.catch(function(err) {
|
||||||
@ -73,7 +73,7 @@ switch(evenstStoreType){
|
|||||||
done();
|
done();
|
||||||
});
|
});
|
||||||
conn.on('error', done);
|
conn.on('error', done);
|
||||||
|
|
||||||
function done(err) {
|
function done(err) {
|
||||||
conn.close();
|
conn.close();
|
||||||
if (err) return test.done(err);
|
if (err) return test.done(err);
|
||||||
@ -83,7 +83,7 @@ switch(evenstStoreType){
|
|||||||
|
|
||||||
module.exports['Connect To Cluster with bad dns discover'] = function (test) {
|
module.exports['Connect To Cluster with bad dns discover'] = function (test) {
|
||||||
test.expect(3);
|
test.expect(3);
|
||||||
var clusterDns = 'discover://eventstore-bad.local:2113';
|
var clusterDns = 'discover://abc.def.com:2113';
|
||||||
var conn = client.EventStoreConnection.create(testBase.settings({maxDiscoverAttempts: 1}), clusterDns);
|
var conn = client.EventStoreConnection.create(testBase.settings({maxDiscoverAttempts: 1}), clusterDns);
|
||||||
conn.connect()
|
conn.connect()
|
||||||
.catch(function (err) {
|
.catch(function (err) {
|
||||||
@ -91,6 +91,7 @@ switch(evenstStoreType){
|
|||||||
});
|
});
|
||||||
conn.on('connected', function () {
|
conn.on('connected', function () {
|
||||||
test.ok(false, 'Should not be able to connect.');
|
test.ok(false, 'Should not be able to connect.');
|
||||||
|
conn.close();
|
||||||
});
|
});
|
||||||
conn.on('error', function (err) {
|
conn.on('error', function (err) {
|
||||||
test.ok(err.message.indexOf('Failed to discover candidate in 1 attempts') === 0, 'Wrong expected reason.');
|
test.ok(err.message.indexOf('Failed to discover candidate in 1 attempts') === 0, 'Wrong expected reason.');
|
||||||
@ -116,7 +117,7 @@ switch(evenstStoreType){
|
|||||||
done();
|
done();
|
||||||
});
|
});
|
||||||
conn.on('error', done);
|
conn.on('error', done);
|
||||||
|
|
||||||
function done(err) {
|
function done(err) {
|
||||||
conn.close();
|
conn.close();
|
||||||
if (err) return test.done(err);
|
if (err) return test.done(err);
|
||||||
@ -144,7 +145,7 @@ switch(evenstStoreType){
|
|||||||
test.done();
|
test.done();
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
module.exports['Create a connection with tcp://host:port string'] = function (test) {
|
module.exports['Create a connection with tcp://host:port string'] = function (test) {
|
||||||
var conn = client.createConnection({}, `tcp://${process.env.EVENTSTORE_HOST || 'localhost'}:1113`);
|
var conn = client.createConnection({}, `tcp://${process.env.EVENTSTORE_HOST || 'localhost'}:1113`);
|
||||||
conn.close();
|
conn.close();
|
||||||
|
@ -41,7 +41,7 @@ module.exports = {
|
|||||||
done();
|
done();
|
||||||
}
|
}
|
||||||
var self = this;
|
var self = this;
|
||||||
this.conn.connectToPersistentSubscription(testStreamName, 'consumer-1', eventAppeared, subscriptionDropped)
|
this.conn.connectToPersistentSubscription(testStreamName, 'consumer-1', eventAppeared, subscriptionDropped, adminCredentials)
|
||||||
.then(function(subscription) {
|
.then(function(subscription) {
|
||||||
test.ok(subscription, "Subscription is null.");
|
test.ok(subscription, "Subscription is null.");
|
||||||
return self.conn.appendToStream(testStreamName, client.expectedVersion.any, [createRandomEvent(), createRandomEvent()]);
|
return self.conn.appendToStream(testStreamName, client.expectedVersion.any, [createRandomEvent(), createRandomEvent()]);
|
||||||
|
@ -2,7 +2,7 @@ const client = require('../lib/dist');
|
|||||||
const userCredentials = new client.UserCredentials('admin', 'changeit');
|
const userCredentials = new client.UserCredentials('admin', 'changeit');
|
||||||
|
|
||||||
const log = new client.NoopLogger();
|
const log = new client.NoopLogger();
|
||||||
const httpEndpoint = `http://${process.env.EVENTSTORE_HOST || "localhost"}:2113`;
|
const httpEndpoint = `https://${process.env.EVENTSTORE_HOST || "localhost"}:2113`;
|
||||||
const operationTimeout = 5000;
|
const operationTimeout = 5000;
|
||||||
|
|
||||||
const simpleProjection = "\
|
const simpleProjection = "\
|
||||||
@ -21,7 +21,7 @@ fromStream('$stats-127.0.0.1:2113')\
|
|||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
setUp: function(cb) {
|
setUp: function(cb) {
|
||||||
this.projectionsManager = new client.ProjectionsManager(log, httpEndpoint, operationTimeout);
|
this.projectionsManager = new client.ProjectionsManager(log, httpEndpoint, operationTimeout, false);
|
||||||
cb();
|
cb();
|
||||||
},
|
},
|
||||||
'Create One Time Projection Happy Path': function(test) {
|
'Create One Time Projection Happy Path': function(test) {
|
||||||
|
Loading…
Reference in New Issue
Block a user