Replace RPC and rest URLS in network JSON with values from config

This commit is contained in:
IshaVenikar 2025-05-27 19:30:52 +05:30
parent 7f53b422f3
commit 6899b0ecf4
3 changed files with 17 additions and 5 deletions

View File

@ -390,7 +390,8 @@
- Update env values in `cosmos-multisig-vars.yml` withyour node RPC URL
```bash
next_public_node_addresses: '<node_rpc_url>'
next_public_node_addresses: '["http://localhost:26657"]'
node_rest_endpoint: 'http://localhost:1317'
next_public_is_http_enabled: true
```

View File

@ -9,6 +9,7 @@
spec_output: "{{data_directory}}/cosmos-multisig-ui-spec.yml"
spec_template: "./templates/specs/cosmos-multisig-app-spec-template.yml.j2"
network_json: "{{ lookup('env', 'NETWORK_JSON_PATH') }}"
temp_network_json: "{{data_directory}}/temp_network.json"
tasks:
- name: Fail if DATA_DIRECTORY env var is not set
fail:
@ -45,6 +46,7 @@
NEXT_PUBLIC_CHAIN_ID={{ next_public_chain_id }}
NEXT_PUBLIC_CHAIN_DISPLAY_NAME={{ next_public_chain_display_name }}
NEXT_PUBLIC_NODE_ADDRESSES={{ next_public_node_addresses }}
NODE_REST_ENDPOINT={{ node_rest_endpoint }}
NEXT_PUBLIC_DENOM={{ next_public_denom }}
NEXT_PUBLIC_DISPLAY_DENOM={{ next_public_display_denom }}
NEXT_PUBLIC_DISPLAY_DENOM_EXPONENT={{ next_public_display_denom_exponent }}
@ -60,12 +62,22 @@
msg: "Environment variable NETWORK_JSON_PATH is not set. Please export it before running the playbook."
when: lookup('env', 'NETWORK_JSON_PATH') == ''
- name: Copy network JSON to deployment config directory
- name: Update network.json with environment endpoints
shell: |
jq --arg rpc "$NEXT_PUBLIC_NODE_ADDRESSES" --arg rest "$NODE_REST_ENDPOINT" \
'.rpc = $rpc | .rest = $rest' "{{ lookup('env', 'NETWORK_JSON_PATH') }}" > "{{ temp_network_json }}"
- name: Copy modified network JSON to deployment config directory
copy:
src: "{{ lookup('env', 'NETWORK_JSON_PATH') }}"
src: "{{ temp_network_json }}"
dest: "{{data_directory}}/{{ multisig_deployment_dir }}/config/cosmos-multisig-ui/network.json"
mode: '0644'
- name: Clean up temporary network.json
file:
path: "{{ temp_network_json }}"
state: absent
- name: Start the deployment
shell: |
laconic-so deployment --dir {{data_directory}}/{{ multisig_deployment_dir }} start

View File

@ -3,11 +3,10 @@ next_public_registry_name: "laconic"
next_public_logo: ""
next_public_chain_id: "laconic-mainnet"
next_public_chain_display_name: "Laconic Network"
next_public_node_addresses: '["http://localhost:26657"]'
next_public_denom: "alnt"
next_public_display_denom: "ALNT"
next_public_display_denom_exponent: 18
next_public_assets: '[{"denom_units":[{"denom":"alnt","exponent":0},{"denom":"alnt","exponent":6}],"base":"alnt","name":"Laconic Token","display":"ALNT","symbol":"alnt"}]'
next_public_gas_price: "0.01alnt"
next_public_address_prefix: "laconic"
next_public_is_http_enabled: true
next_public_is_http_enabled: false