Skip to content

Commit

Permalink
made xnetwork to work with v1.7.0
Browse files Browse the repository at this point in the history
  • Loading branch information
gfusee committed Mar 11, 2024
1 parent a0d06dc commit 4b37089
Show file tree
Hide file tree
Showing 12 changed files with 452 additions and 50 deletions.
4 changes: 2 additions & 2 deletions containers/api/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ RUN curl -fsSL https://deb.nodesource.com/setup_18.x | sudo -E bash - && sudo ap
RUN sudo apt install git -y
RUN sudo apt install ffmpeg -y
RUN sudo npm install -g @nestjs/cli
RUN git clone https://github.com/multiversx/mx-api-service.git -b development
RUN cd mx-api-service && git checkout 8cc3910
RUN git clone https://github.com/multiversx/mx-api-service.git -b main
RUN cd mx-api-service && git checkout 93a9abd0033050e46242836c6cf12e7b396e294c
RUN cd mx-api-service && npm install
RUN rm -rf mx-api-service/config/config.devnet.json
COPY api-config.devnet.yaml mx-api-service/config/config.devnet.yaml
Expand Down
50 changes: 37 additions & 13 deletions containers/api/api-config.devnet.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ metaChainShardId: 4294967295
api:
public: true
private: false
auth: false
cron:
transactionProcessor: true
transactionProcessorMaxLookBehind: 100
Expand All @@ -15,21 +14,52 @@ cron:
fastWarm: true
queueWorker: true
elasticUpdater: false
statusChecker: false
flags:
useRequestCaching: true
useKeepAliveAgent: true
useTracing: true
useRequestLogging: true
useVmQueryTracing: true
useTracing: false
useRequestLogging: false
useVmQueryTracing: false
processNfts: false
indexer-v3: true
collectionPropertiesFromGateway: false
features:
eventsNotifier:
enabled: false
port: 5674
url: 'amqp://guest:[email protected]:5672'
url: 'amqp://guest:[email protected]:5673'
exchange: 'all_events'
queue: 'api-process-logs-and-events'
guestCaching:
enabled: false
hitsThreshold: 100
ttl: 12
transactionPool:
enabled: true
transactionPoolWarmer:
enabled: true
cronExpression: '*/5 * * * * *'
ttlInSeconds: 60
updateCollectionExtraDetails:
enabled: false
marketplace:
enabled: false
serviceUrl: 'https://devnet-nfts-graph.multiversx.com/graphql'
exchange:
enabled: false
serviceUrl: 'https://devnet-graph.xexchange.com/graphql'
dataApi:
enabled: false
serviceUrl: 'https://devnet-data-api.multiversx.com'
auth:
enabled: false
maxExpirySeconds: 86400
acceptedOrigins:
- ''
admins:
- ''
jwtSecret: ''
image:
width: 600
height: 600
Expand All @@ -40,12 +70,12 @@ aws:
s3Bucket: 'devnet-media.elrond.com'
s3Region: ''
urls:
api:
- 'http://localhost:3001'
self: 'http://localhost:3001'
elastic:
- 'http://elastic:9200'
gateway:
- 'http://localnet:7950'
verifier: 'https://play-api.multiversx.com'
redis: 'redis'
rabbitmq: 'amqp://rabbitmq:5672'
providers: 'https://devnet-delegation-api.multiversx.com/providers'
Expand Down Expand Up @@ -90,12 +120,6 @@ inflation:
- 1130177
- 924690
- 719203
security:
admins:
jwtSecret:
nftProcess:
parallelism: 1
maxRetries: 3
transaction-action:
mex:
microServiceUrl: ''
4 changes: 3 additions & 1 deletion containers/localnet/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ COPY replace_localnet_toml.py replace_localnet_toml.py
COPY genesis.json genesis.json
COPY create_wallet.py create_wallet.py
COPY change_genesis.py change_genesis.py
COPY temp_copy_libs.py temp_copy_libs.py
COPY economics.toml economics.toml
COPY replace_economics.py replace_economics.py
COPY add_result.py add_result.py
Expand All @@ -26,6 +25,9 @@ COPY pause.sh pause.sh
COPY handle_signal.sh handle_signal.sh
COPY mxops-init mxops-init
COPY run_mxops.py run_mxops.py
COPY temp_replace_enable_epochs.py temp_replace_enable_epochs.py
COPY temp_replace_genesis_smart_contracts.py temp_replace_genesis_smart_contracts.py
COPY tempGenesisContracts genesisContracts

RUN sudo chmod +x pause.sh
RUN sudo chmod +x handle_signal.sh
Expand Down
3 changes: 2 additions & 1 deletion containers/localnet/change_prefs.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
should_use_elastic = sys.argv[1] == 'true'

prefs_to_add = f"""
[Preferences]
OverridableConfigTomlValues = [
{{ File = "external.toml", Path = "ElasticSearchConnector.Enabled", Value = "{should_use_elastic}" }},
{{ File = "external.toml", Path = "ElasticSearchConnector.URL", Value = "http://elastic:9200" }},
Expand All @@ -21,7 +22,7 @@ def replace_in_files():
if os.path.exists(external_toml_path):
with open(external_toml_path, 'r') as file:
contents = file.read()
contents = contents + prefs_to_add
contents = prefs_to_add + contents.replace("[Preferences]", "")
with open(external_toml_path, 'w') as file:
file.write(contents)

Expand Down
2 changes: 1 addition & 1 deletion containers/localnet/replace_localnet_toml.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
port_proxy = 7950
[shards]
num_shards = 3
num_shards = {num_shards}
[software.mx_chain_go]
resolution = "local"
Expand Down
10 changes: 10 additions & 0 deletions containers/localnet/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ setup() {
cp systemSmartContractsConfig.toml localnet/systemSmartContractsConfig.toml
cp replace_system_contracts_config.py localnet/replace_system_contracts_config.py

cp temp_replace_enable_epochs.py localnet/temp_replace_enable_epochs.py # Workaround while mxpy doesn't support v1.7.0 localnet
cp temp_replace_genesis_smart_contracts.py localnet/temp_replace_genesis_smart_contracts.py # Workaround while mxpy doesn't support v1.7.0 localnet
cp -R genesisContracts localnet/genesisContracts # Workaround while mxpy doesn't support v1.7.0 localnet

echo "Changing nodes system contracts config..."
cd localnet && sudo python3 replace_system_contracts_config.py && cd ..

Expand All @@ -48,6 +52,12 @@ setup() {

echo "Changing nodes economics..."
cd localnet && sudo python3 replace_economics.py "$MX_RESULT_TOTAL_SUPPLY" && cd ..

echo "Applying workaround for enableEpochs..."
cd localnet && sudo python3 temp_replace_enable_epochs.py && cd ..

echo "Applying workaround for genesisContracts..."
cd localnet && sudo python3 temp_replace_genesis_smart_contracts.py && cd ..
}

if [ "$(python3 read_result.py "state")" != "paused" ]; then
Expand Down
18 changes: 9 additions & 9 deletions containers/localnet/systemSmartContractsConfig.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,24 @@
GenesisNodePrice = "2500000000000000000000" #2.5K eGLD
MinStakeValue = "100000000000000000000" #100 eGLD
MinUnstakeTokensValue = "10000000000000000000" #10eGLD
UnBondPeriod = 144000
UnBondPeriodInEpochs = 10
UnBondPeriod = 250
UnBondPeriodInEpochs = 1
MinStepValue = "100000000000000000000"
NumRoundsWithoutBleed = 100
MaximumPercentageToBleed = 0.5
BleedPercentagePerRound = 0.00001
MaxNumberOfNodesForStake = 2169
MaxNumberOfNodesForStake = 64
UnJailValue = "2500000000000000000" #0.1% of genesis node price
ActivateBLSPubKeyMessageVerification = true
ActivateBLSPubKeyMessageVerification = false
StakeLimitPercentage = 1.0 #fraction of value 1 - 100%, for the time being no stake limit
NodeLimitPercentage = 0.1 #fraction of value 0.1 - 10%

[ESDTSystemSCConfig]
BaseIssuingCost = "50000000000000000" #0.05 eGLD
OwnerAddress = "erd1ze6pgefwc7mdx0rhje3h50kkgt26ut3gx8ytezndkz8fjcf96gsqsd7ugw"
OwnerAddress = "erd1fpkcgel4gcmh8zqqdt043yfcn5tyx8373kg6q2qmkxzu4dqamc0swts65c"

[GovernanceSystemSCConfig]
OwnerAddress = "erd1qqqqqqqqqqqqqpgq0gq09608js3gje72v0yzc56k6glc852gl94sgtahk2"
OwnerAddress = "erd1vxy22x0fj4zv6hktmydg8vpfh6euv02cz4yg0aaws6rrad5a5awqgqky80" #should use a multisign contract instead of a wallet address
[GovernanceSystemSCConfig.V1]
NumNodes = 500
ProposalCost = "5000000000000000000" #5 eGLD
Expand All @@ -29,14 +29,14 @@ MinVetoThreshold = 50
[GovernanceSystemSCConfig.Active]
ProposalCost = "1000000000000000000000" #1000 eGLD
LostProposalFee = "10000000000000000000" #10 eGLD
MinQuorum = 0.2 #fraction of value 0.2 - 20%
MinQuorum = 0.2 #fraction of value 0.2 - 20%
MinPassThreshold = 0.5 #fraction of value 0.5 - 50%
MinVetoThreshold = 0.33 #fraction of value 0.33 - 33%

[DelegationManagerSystemSCConfig]
MinCreationDeposit = "1250000000000000000000" #1.25K eGLD
MinStakeAmount = "1000000000000000000" #1 eGLD
ConfigChangeAddress = "erd1qqqqqqqqqqqqqpgq0gq09608js3gje72v0yzc56k6glc852gl94sgtahk2"
MinStakeAmount = "10000000000000000000" #10 eGLD
ConfigChangeAddress = "erd1vxy22x0fj4zv6hktmydg8vpfh6euv02cz4yg0aaws6rrad5a5awqgqky80" #should use a multisign contract instead of a wallet address

[DelegationSystemSCConfig]
MinServiceFee = 0
Expand Down
Binary file not shown.
Binary file added containers/localnet/tempGenesisContracts/dns.wasm
Binary file not shown.
23 changes: 0 additions & 23 deletions containers/localnet/temp_copy_libs.py

This file was deleted.

Loading

0 comments on commit 4b37089

Please sign in to comment.