-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
871aec5
commit 361d97d
Showing
10 changed files
with
345 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,140 @@ | ||
version: "3.9" | ||
|
||
services: | ||
rabbitmq: | ||
ports: | ||
- 127.0.0.1:5672:5672 | ||
- 127.0.0.1:15672:15672 | ||
container_name: rabbitmq-container | ||
image: "rabbitmq:3-management" | ||
healthcheck: | ||
test: rabbitmq-diagnostics -q ping | ||
interval: 10s | ||
timeout: 5s | ||
retries: 5 | ||
|
||
redis: | ||
image: "redis:alpine" | ||
command: redis-server | ||
ports: | ||
- "127.0.0.1:6379:6379" | ||
environment: | ||
- REDIS_REPLICATION_MODE=master | ||
|
||
events-notifier: | ||
container_name: events-notifier-container | ||
image: multiversx/events-notifier:latest | ||
depends_on: | ||
rabbitmq: | ||
condition: service_healthy | ||
entrypoint: > | ||
/bin/bash -c "apt-get update && apt-get install curl -y | ||
&& sed -i '/Enabled will determine if websocket connector will be enabled or not/{n;s/Enabled = false/Enabled = true/}' ./config/config.toml | ||
&& sed -i 's|localhost:22111|0.0.0.0:22111|g' ./config/config.toml | ||
&& sed -i 's|localhost:6379|redis:6379|g' ./config/config.toml | ||
&& sed -i 's|amqp://guest:guest@localhost:5672|amqp://guest:guest@rabbitmq:5672|g' ./config/config.toml | ||
&& cat ./config/config.toml | ||
&& ./notifier --check-duplicates=false --api-type=rabbit-api" | ||
healthcheck: | ||
test: ["CMD", "curl", "-f", "http://127.0.0.1:5000/status/metrics"] | ||
interval: 10s | ||
timeout: 5s | ||
retries: 5 | ||
|
||
elasticsearch: | ||
ports: | ||
- 127.0.0.1:9200:9200 | ||
container_name: elasticsearch-container | ||
image: docker.elastic.co/elasticsearch/elasticsearch:7.16.1 | ||
environment: | ||
- "discovery.type=single-node" | ||
- "xpack.security.enabled=false" | ||
- "ES_JAVA_OPTS=-Xms512m -Xmx512m" | ||
ulimits: | ||
memlock: | ||
soft: -1 | ||
hard: -1 | ||
healthcheck: | ||
test: ["CMD", "curl", "-f", "http://127.0.0.1:9200"] | ||
interval: 10s | ||
timeout: 5s | ||
retries: 5 | ||
|
||
# TODO use the websockets based elastic indexer when the communication problems are solved | ||
elastic-indexer: | ||
#ports: 22112 | ||
container_name: elastic-indexer | ||
image: multiversx/elastic-indexer:latest | ||
depends_on: | ||
elasticsearch: | ||
condition: service_healthy | ||
entrypoint: > | ||
/bin/bash -c "sed -i 's|http://localhost:9200|http://elasticsearch:9200|g' ./config/prefs.toml | ||
&& sed -i 's|url = \"localhost:22111\"|url = \"0.0.0.0:22111\"|g' ./config/prefs.toml | ||
&& cat ./config/prefs.toml | ||
&& ./elasticindexer -log-level *:DEBUG" | ||
chain-simulator: | ||
container_name: chain-simulator | ||
ports: | ||
- 8085:8085 | ||
image: multiversx/chainsimulator:latest | ||
environment: | ||
EVENTS_NOTIFIER_URL: 'events-notifier:22111' | ||
ELASTIC_SEARCH_URL: 'elasticsearch:9200' # just a dummy string for now | ||
depends_on: | ||
elasticsearch: | ||
condition: service_healthy | ||
events-notifier: | ||
condition: service_healthy | ||
entrypoint: > | ||
/bin/bash -c " sed -i 's|http://localhost:9200|http://elasticsearch:9200|g' ./config/node/config/external.toml | ||
&& ./start-with-services.sh -log-level *:INFO" | ||
healthcheck: | ||
test: [ "CMD", "curl", "-f", "http://127.0.0.1:8085/simulator/observers" ] | ||
interval: 10s | ||
timeout: 5s | ||
retries: 5 | ||
|
||
api: | ||
ports: | ||
- 127.0.0.1:3001:3001 | ||
container_name: api | ||
image: multiversx/mx-api-service:test1 | ||
environment: | ||
MVX_ENV: devnet | ||
REDIS_IP: redis | ||
GATEWAY_URL: http://chain-simulator:8085 | ||
ELASTICSEARCH_URL: http://elasticsearch:9200 | ||
depends_on: | ||
elasticsearch: | ||
condition: service_healthy | ||
redis: | ||
condition: service_started | ||
|
||
explorer: | ||
ports: | ||
- 3002:80 | ||
container_name: explorer | ||
image: multiversx/mx-explorer-dapp:main | ||
environment: | ||
START_NAME_STOP: devnet | ||
START_CHAIN_ID_STOP: D | ||
START_EGLD_LABEL_STOP: xEGLD | ||
START_WALLET_ADDRESS_STOP: https://devnet-wallet.multiversx.com | ||
START_EXPLORER_ADDRESS_STOP: https://devnet-explorer.multiversx.com | ||
START_NFT_EXPLORER_ADDRESS_STOP: https://devnet.xspotlight.com | ||
START_API_ADDRESS_STOP: http://127.0.0.1:3001 | ||
|
||
lite-wallet: | ||
ports: | ||
- 3003:80 | ||
container_name: lite-wallet | ||
image: multiversx/mx-lite-wallet-dapp:main | ||
environment: | ||
START_NETWORK_ID_STOP: custom | ||
START_NETWORK_NAME_STOP: custom | ||
START_API_ADDRESS_STOP: http://127.0.0.1:3001 | ||
START_GATEWAY_URL_STOP: http://127.0.0.1:8085 | ||
START_WALLET_ADDRESS_STOP: https://testnet-wallet.multiversx.com | ||
START_WEGLD_ID_STOP: xEGLD |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
#!/bin/bash | ||
|
||
# Call the endpoint and store the response in a variable | ||
response=$(curl -s "http://localhost:8085/simulator/initial-wallets") | ||
|
||
# Use jq to extract the "bech32" address from the JSON response | ||
bech32_address=$(echo "$response" | jq -r '.data.balanceWallets | to_entries[0].value.address.bech32') | ||
|
||
# Print the address to verify it was extracted correctly | ||
echo "Extracted Bech32 Address: $bech32_address" | ||
|
||
# Get account information | ||
account_info_response=$(curl -s --request GET \ | ||
--url "http://localhost:8085/address/$bech32_address" \ | ||
--header 'User-Agent: insomnia/10.0.0') | ||
|
||
# Print the response for debugging | ||
echo "Account info response: $account_info_response" | ||
|
||
# Step 2: Extract the nonce using jq | ||
nonce=$(echo "$account_info_response" | jq -r '.data.account.nonce') | ||
|
||
# Check if nonce is not empty | ||
if [ -n "$nonce" ]; then | ||
echo "Extracted nonce: $nonce" | ||
else | ||
echo "Error: No nonce found in the account info response." | ||
exit 1 | ||
fi | ||
|
||
tx_send_response=$(curl -s --request POST \ | ||
--url http://localhost:8085/transaction/send \ | ||
--header 'Content-Type: application/json' \ | ||
--header 'User-Agent: insomnia/10.0.0' \ | ||
--data '{ | ||
"nonce": '$nonce', | ||
"value": "50000000000000000000", | ||
"sender": "'$bech32_address'", | ||
"receiver": "erd12js50s7ycclwpac4qpx7lty3prhpu8hy00thjgz9f67p33w7m94qmzttem", | ||
"gasLimit": 50000, | ||
"gasPrice": 1000000000, | ||
"chainId": "chain", | ||
"signature": "aa", | ||
"version": 1 | ||
}') | ||
|
||
echo $tx_send_response | ||
|
||
# Extract txHash using jq | ||
tx_hash=$(echo "$tx_send_response" | jq -r '.data.txHash') | ||
|
||
# Print the extracted txHash | ||
echo "Extracted txHash: $tx_hash" | ||
|
||
sleep 2 | ||
|
||
# Make the second call to generate blocks until the transaction is processed | ||
generate_blocks_response=$(curl -s --request POST \ | ||
--url "http://localhost:8085/simulator/generate-blocks-until-transaction-processed/$tx_hash" \ | ||
--header 'Content-Type: application/json' \ | ||
--header 'User-Agent: insomnia/10.0.0') | ||
|
||
# Print the response from the second call | ||
echo "Response from generate blocks: $generate_blocks_response" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.