Skip to content

Commit

Permalink
Merge pull request #5497 from mysteriumnetwork/update-e2e
Browse files Browse the repository at this point in the history
bump our services in e2e tests
  • Loading branch information
Guillembonet authored Oct 3, 2022
2 parents 9fbb79a + 14fa868 commit cf8e197
Show file tree
Hide file tree
Showing 9 changed files with 275 additions and 275 deletions.
103 changes: 22 additions & 81 deletions docker-compose.e2e-basic.yml
Original file line number Diff line number Diff line change
Expand Up @@ -108,44 +108,33 @@ services:
- 9999:1080

transactordatabase:
image: 'mongo:4.2.3'
environment:
- MONGO_INITDB_ROOT_PASSWORD=root
- MONGO_INITDB_ROOT_USERNAME=root
- MONGO_INITDB_DATABASE=transactor
- MONGO_NON_ROOT_USERNAME=transactor
- MONGO_NON_ROOT_PASSWORD=transactor
image: postgres:13-alpine
expose:
- 27017
- 27018
- 27019
volumes:
- ./e2e/mongo-init.e2e.js:/docker-entrypoint-initdb.d/mongo-init.js:ro
- 5432
environment:
- POSTGRES_USER=transactor
- POSTGRES_DB=transactor
- POSTGRES_PASSWORD=transactor
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 10s
timeout: 5s
retries: 5

transactor-sidecar:
image: mysteriumnetwork/transactor-sidecar:2.7.4
image: mysteriumnetwork/transactor-sidecar:3.0.10
depends_on:
- transactordatabase
- redis
- http-mock
command: >
"/usr/bin/sidecar"
-redisAddress="redis:6379"
-MongoUser=transactor
-MongoPass=transactor
-MongoHost=transactordatabase:27017
-MongoDatabase=transactor
-MongoReplSet ""
-geckoUrl=http://http-mock:1080/gecko
-ethStaticGasPrice=0.001
-maticStaticGasPrice=0.001
-gasPriceUpdateInterval 2s
-gasStationOverrideChainsEth ""
-gasStationOverrideChainsMatic ""
-feeUpdateInterval 2s
/usr/bin/sidecar
-configPaths=/transactor/sidecar_config.yaml
volumes:
- ./e2e/transactor:/transactor

transactor:
image: mysteriumnetwork/transactor:2.7.4
image: mysteriumnetwork/transactor:3.0.10
environment:
PORT: 8888
expose:
Expand All @@ -158,32 +147,10 @@ services:
- http-mock
- transactor-sidecar
command: >
-settlementThrottleTime=1ms
-stakeAmount 62000000000000000000
-topUpAmount 7000000000000000000
-chain1MystSCAddress 0x4D1d104AbD4F4351a0c51bE1e9CA0750BbCa1665
-chain1Registries 0x241F6e1d0bB17f45767DC60A6Bd3D21Cdb543a0c
-chain1RPCEndpoint http://ganache:8545
-chain1ChainID 5
-chain2MystSCAddress 0x4D1d104AbD4F4351a0c51bE1e9CA0750BbCa1665
-chain2Registries 0x241F6e1d0bB17f45767DC60A6Bd3D21Cdb543a0c
-chain2RPCEndpoint ws://ganache2:8545
-chain2ChainID 80001
-freeRegistration=true
-registrationGasLimit=450000
-settlementCheckInterval=50ms
-ourIdentity 0x3d2cdbab09d2c8d613556769f37b47c82a5e13bf
-balanceCheckInterval 1s
-MongoUser transactor
-MongoPass transactor
-MongoHost transactordatabase:27017
-MongoReplSet ""
-redisAddress "redis:6379"
-observerBaseURI=""
-hermesesWithEnabledWithdrawals="0x676b9a084aC11CEeF680AF6FFbE99b24106F47e7"
-fallbackChainHermeses="5=0x676b9a084aC11CEeF680AF6FFbE99b24106F47e7,0x66D0a6DD6c1120B0e11513A4bA439f6eaed0E0Ed;80001=0x676b9a084aC11CEeF680AF6FFbE99b24106F47e7,0x66D0a6DD6c1120B0e11513A4bA439f6eaed0E0Ed"
-configPaths=/transactor/config.yaml
volumes:
- ./e2e/blockchain/keystore:/keystore
- ./e2e/transactor:/transactor

redis:
image: bitnami/redis:6.2.6
Expand Down Expand Up @@ -267,7 +234,7 @@ services:
- ./e2e/pilvytis:/home/wiremock

hermes2:
image: mysteriumnetwork/hermes:3.2.10
image: mysteriumnetwork/hermes:3.3.15
environment:
LOG_LEVEL: trace
expose:
Expand All @@ -276,38 +243,12 @@ services:
- ganache
- ganache2
- redis
- mongodb
- transactor
command: >
-identityPassphrase ""
-operator 0x761f2bb3e7ad6385a4c7833c5a26a8ddfdabf9f3
-Chain1Myst 0x4D1d104AbD4F4351a0c51bE1e9CA0750BbCa1665
-Chain1RPCEndpoint http://ganache:8545
-Chain1ChainID 5
-Chain1Registry 0x241F6e1d0bB17f45767DC60A6Bd3D21Cdb543a0c
-Chain1HermesAddress 0x599d43715DF3070f83355D9D90AE62c159E62A75
-Chain1chImplementation 0xAA9C4E723609Cb913430143fbc86D3CBe7ADCa21
-Chain2Myst 0x4D1d104AbD4F4351a0c51bE1e9CA0750BbCa1665
-Chain2RPCEndpoint ws://ganache2:8545
-Chain2ChainID 80001
-Chain2Registry 0x241F6e1d0bB17f45767DC60A6Bd3D21Cdb543a0c
-Chain2HermesAddress 0x599d43715DF3070f83355D9D90AE62c159E62A75
-Chain2chImplementation 0xAA9C4E723609Cb913430143fbc86D3CBe7ADCa21
-keystoreDir /keystore
-bcDataRefreshInterval 1ns
-MongoUser hermes2
-MongoReplSet rs0
-MongoPass hermes2
-MongoHost "mongodb:27017"
-MongoDatabase hermes2
-MongoReplSet ""
-transactorBaseUri "http://transactor:8888/api/v1/"
-redisAddresses "redis:6379"
-bindAddr="0.0.0.0:8889"
-pilvytisBaseURL http://pilvytis-mock:8080
-enablePayAndSettle true
-configPaths=/hermes/config.yaml
volumes:
- ./e2e/blockchain/keystore:/keystore
- ./e2e/hermes:/hermes

myst-provider:
build:
Expand Down
103 changes: 22 additions & 81 deletions docker-compose.e2e-traversal.yml
Original file line number Diff line number Diff line change
Expand Up @@ -225,19 +225,18 @@ services:


transactordatabase:
image: 'mongo:4.2.3'
environment:
- MONGO_INITDB_ROOT_PASSWORD=root
- MONGO_INITDB_ROOT_USERNAME=root
- MONGO_INITDB_DATABASE=transactor
- MONGO_NON_ROOT_USERNAME=transactor
- MONGO_NON_ROOT_PASSWORD=transactor
image: postgres:13-alpine
expose:
- 27017
- 27018
- 27019
volumes:
- ./e2e/mongo-init.e2e.js:/docker-entrypoint-initdb.d/mongo-init.js:ro
- 5432
environment:
- POSTGRES_USER=transactor
- POSTGRES_DB=transactor
- POSTGRES_PASSWORD=transactor
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 10s
timeout: 5s
retries: 5
dns: 172.30.0.254
networks:
public0:
Expand All @@ -246,7 +245,7 @@ services:
ipv4_address: 172.31.0.210

transactor-sidecar:
image: mysteriumnetwork/transactor-sidecar:2.7.4
image: mysteriumnetwork/transactor-sidecar:3.0.10
sysctls:
- net.ipv4.conf.default.rp_filter=0
- net.ipv4.conf.all.rp_filter=0
Expand All @@ -257,20 +256,10 @@ services:
- redis
- http-mock
command: >
"/usr/bin/sidecar"
-redisAddress="redis:6379"
-MongoUser=transactor
-MongoPass=transactor
-MongoHost=transactordatabase:27017
-MongoDatabase=transactor
-MongoReplSet ""
-geckoUrl=http://http-mock:1080/gecko
-ethStaticGasPrice=0.001
-maticStaticGasPrice=0.001
-gasPriceUpdateInterval 2s
-gasStationOverrideChainsEth ""
-gasStationOverrideChainsMatic ""
-feeUpdateInterval 2s
/usr/bin/sidecar
-configPaths=/transactor/sidecar_config.yaml
volumes:
- ./e2e/transactor:/transactor
dns: 172.30.0.254
networks:
public0:
Expand All @@ -279,7 +268,7 @@ services:
ipv4_address: 172.31.0.212

transactor:
image: mysteriumnetwork/transactor:2.7.4
image: mysteriumnetwork/transactor:3.0.10
environment:
PORT: 8888
expose:
Expand All @@ -297,32 +286,10 @@ services:
- http-mock
- transactor-sidecar
command: >
-settlementThrottleTime=1ms
-chain1RPCEndpoint http://ganache:8545
-chain1ChainID 5
-stakeAmount 62000000000000000000
-topUpAmount 7000000000000000000
-chain2MystSCAddress 0x4D1d104AbD4F4351a0c51bE1e9CA0750BbCa1665
-chain2Registries 0x241F6e1d0bB17f45767DC60A6Bd3D21Cdb543a0c
-chain2RPCEndpoint ws://ganache2:8545
-chain2ChainID 80001
-registrationGasLimit=450000
-settlementCheckInterval=50ms
-chain1MystSCAddress 0x4D1d104AbD4F4351a0c51bE1e9CA0750BbCa1665
-chain1Registries 0x241F6e1d0bB17f45767DC60A6Bd3D21Cdb543a0c
-ourIdentity 0x3d2cdbab09d2c8d613556769f37b47c82a5e13bf
-balanceCheckInterval 1s
-MongoUser transactor
-MongoPass transactor
-MongoHost transactordatabase:27017
-MongoReplSet ""
-freeRegistration=true
-redisAddress "redis:6379"
-observerBaseURI=""
-hermesesWithEnabledWithdrawals="0x676b9a084aC11CEeF680AF6FFbE99b24106F47e7"
-fallbackChainHermeses="5=0x676b9a084aC11CEeF680AF6FFbE99b24106F47e7,0x66D0a6DD6c1120B0e11513A4bA439f6eaed0E0Ed;80001=0x676b9a084aC11CEeF680AF6FFbE99b24106F47e7,0x66D0a6DD6c1120B0e11513A4bA439f6eaed0E0Ed"
-configPaths=/transactor/config.yaml
volumes:
- ./e2e/blockchain/keystore:/keystore
- ./e2e/transactor:/transactor
dns: 172.30.0.254
networks:
public0:
Expand Down Expand Up @@ -500,7 +467,7 @@ services:
ipv4_address: 10.100.1.105

hermes2:
image: mysteriumnetwork/hermes:3.2.10
image: mysteriumnetwork/hermes:3.3.15
sysctls:
- net.ipv4.conf.default.rp_filter=0
- net.ipv4.conf.all.rp_filter=0
Expand All @@ -514,38 +481,12 @@ services:
- ganache
- ganache2
- redis
- mongodb
- transactor
command: >
-identityPassphrase ""
-Chain1Myst 0x4D1d104AbD4F4351a0c51bE1e9CA0750BbCa1665
-Chain1RPCEndpoint http://ganache:8545
-Chain1ChainID 5
-Chain1HermesAddress 0x599d43715DF3070f83355D9D90AE62c159E62A75
-Chain2Myst 0x4D1d104AbD4F4351a0c51bE1e9CA0750BbCa1665
-Chain2RPCEndpoint ws://ganache2:8545
-Chain2ChainID 80001
-Chain2Registry 0x241F6e1d0bB17f45767DC60A6Bd3D21Cdb543a0c
-Chain2HermesAddress 0x599d43715DF3070f83355D9D90AE62c159E62A75
-Chain2chImplementation 0xAA9C4E723609Cb913430143fbc86D3CBe7ADCa21
-Chain1Registry 0x241F6e1d0bB17f45767DC60A6Bd3D21Cdb543a0c
-operator 0x761f2bb3e7ad6385a4c7833c5a26a8ddfdabf9f3
-Chain1chImplementation 0xAA9C4E723609Cb913430143fbc86D3CBe7ADCa21
-keystoreDir /keystore
-bcDataRefreshInterval 1ns
-MongoUser hermes2
-MongoPass hermes2
-MongoReplSet rs0
-transactorBaseUri "http://transactor:8888/api/v1/"
-MongoHost "mongodb:27017"
-MongoDatabase hermes2
-MongoReplSet ""
-redisAddresses "redis:6379"
-bindAddr "0.0.0.0:8889"
-pilvytisBaseURL http://pilvytis-mock:8080
-enablePayAndSettle true
-configPaths=/hermes/config.yaml
volumes:
- ./e2e/blockchain/keystore:/keystore
- ./e2e/hermes:/hermes
dns: 172.30.0.254
networks:
public0:
Expand Down
17 changes: 1 addition & 16 deletions e2e/connection_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ var (
ethClient *ethclient.Client
ethClientL2 *ethclient.Client
ethSignerBuilder func(client *ethclient.Client) func(address common.Address, tx *types.Transaction) (*types.Transaction, error)
transactorMongo *Mongo
)

var (
Expand Down Expand Up @@ -123,7 +122,6 @@ var consumersToTest = []*consumer{

func TestConsumerConnectsToProvider(t *testing.T) {
initEthClient(t)
initTransactorMongo(t)

tequilapiProvider := newTequilapiProvider()
t.Run("Provider has a registered identity", func(t *testing.T) {
Expand Down Expand Up @@ -315,9 +313,6 @@ func TestConsumerConnectsToProvider(t *testing.T) {
err = c.tequila().Unlock(id.Address, "")
assert.NoError(t, err)

err = transactorMongo.InsertRegistrationBounty(common.HexToAddress(id.Address))
assert.NoError(t, err)

status, err := c.tequila().IdentityRegistrationStatus(id.Address)
assert.NoError(t, err)
assert.Equal(t, "Unregistered", status.Status)
Expand All @@ -341,9 +336,6 @@ func TestConsumerConnectsToProvider(t *testing.T) {
err = c.tequila().Unlock(id.Address, "")
assert.NoError(t, err)

err = transactorMongo.InsertRegistrationBounty(common.HexToAddress(id.Address))
assert.NoError(t, err)

status, err := c.tequila().IdentityRegistrationStatus(id.Address)
assert.NoError(t, err)
assert.Equal(t, "Unregistered", status.Status)
Expand Down Expand Up @@ -413,12 +405,6 @@ func identityCreateFlow(t *testing.T, tequilapi *tequilapi_client.Client, idPass
return id.Address
}

func initTransactorMongo(t *testing.T) {
tm, err := NewMongo()
assert.NoError(t, err)
transactorMongo = tm
}

func initEthClient(t *testing.T) {
addr := common.HexToAddress(addressForTopups)
ks := keystore.NewKeyStore("/node/keystore", keystore.StandardScryptN, keystore.StandardScryptP)
Expand Down Expand Up @@ -475,7 +461,7 @@ func providerRegistrationFlow(t *testing.T, tequilapi *tequilapi_client.Client,

assert.Eventually(t, func() bool {
idStatus, _ := tequilapi.Identity(id)
return "Registered" == idStatus.RegistrationStatus
return idStatus.RegistrationStatus == "Registered"
}, time.Second*30, time.Millisecond*500)

// once we're registered, check some other information
Expand All @@ -495,7 +481,6 @@ func providerRegistrationFlow(t *testing.T, tequilapi *tequilapi_client.Client,

func topUpConsumer(t *testing.T, id string, hermesID common.Address, registrationFee *big.Int) {
// TODO: once free registration is a thing of the past, remove this return
return

// chid, err := crypto.GenerateChannelAddress(id, hermesID.Hex(), registryAddress, channelImplementation)
// assert.NoError(t, err)
Expand Down
Loading

0 comments on commit cf8e197

Please sign in to comment.