Almerico (tribute to Almerico from Schio) is the official Commercio.network explorer.
In order to properly build the project, first you have to install all of its dependencies. To do so run:
npm installIn order to run this project as a developer with the hot reload option enabled, you have to:
-
Create a file named
.env.development.localinside the project root folder; -
Inside the
.env.development.localfile add the following data:VUE_APP_API_VERSION=VALUE (e.g., v1) VUE_APP_API_VERSION_COSMWASM=VALUE (e.g., v1) VUE_APP_ANCESTORS=VALUE (e.g., [{"lcd_ledger":"http://lcd.com", "lcd": "http://lcd.com", "ver": "0.12"}]) VUE_APP_BACKEND=VALUE (e.g., http://backend.com) VUE_APP_BACKEND_WS=VALUE (e.g., ws://backend.com/websocket) VUE_APP_CONNECTIONS=VALUE (e.g., [{"id":"connection-10","chain_id":"osmo-test-5"}]) VUE_APP_CONTRACT_DEX=VALUE (e.g., did:com:1yva23huwtu5f5tzm9vu3ce4h4y7x9j0q59wvse4t0lrzhhv68tzq5vps96) VUE_APP_FIRST_CONVERSION_RATE=VALUE (e.g., 1) VUE_APP_FIRST_HEIGHT=VALUE (e.g., 1234) VUE_APP_HAS_POOLS=VALUE (e.g., true) VUE_APP_LCD=VALUE (e.g., http://lcd.com) VUE_APP_MAIN_TITLE=VALUE (e.g., Testnet) VUE_APP_WASM_CW20_CODE_ID=VALUE (e.g., '7') VUE_APP_WASM_SWAP_CODE_ID=VALUE (e.g., '4') VUE_APP_WS=VALUE (e.g., ws://rpc.com/websocket)
To execute the explorer run:
npm run serveThis will start a local web server and publish a web page to http://localhost:8080
Create a file named .env.production inside the project root folder
and set the following data with your values:
VUE_APP_API_VERSION=VALUE (e.g., v1)
VUE_APP_API_VERSION_COSMWASM=VALUE (e.g., v1)
VUE_APP_ANCESTORS=VALUE (e.g., [{"lcd_ledger":"https://lcd.com",
"lcd": "https://lcd.com", "ver": "0.12"}])
VUE_APP_BACKEND=VALUE (e.g., https://backend.com)
VUE_APP_BACKEND_WS=VALUE (e.g., wss://backend.com/websocket)
VUE_APP_CONNECTIONS=VALUE (e.g., [{"id":"connection-8","chain_id":"osmosis-1"}])
VUE_APP_CONTRACT_DEX=VALUE (e.g., did:com:1yva23huwtu5f5tzm9vu3ce4h4y7x9j0q59wvse4t0lrzhhv68tzq5vps96)
VUE_APP_FIRST_CONVERSION_RATE=VALUE (e.g., 1)
VUE_APP_FIRST_HEIGHT=VALUE (e.g., 1)
VUE_APP_HAS_POOLS=VALUE (e.g., false)
VUE_APP_LCD=VALUE (e.g., https://lcd.com)
VUE_APP_MAIN_TITLE=VALUE (e.g., Mainnet)
VUE_APP_WASM_CW20_CODE_ID=VALUE (e.g., '1')
VUE_APP_WASM_SWAP_CODE_ID=VALUE (e.g., '2')
VUE_APP_WS=VALUE (e.g., wss://rpc.com/websocket)To build the project run:
npm run buildTo test the code base run:
npm run testnpm run lintdocker build -t almerico \
--build-arg ANCESTORS_LIST=<Ancestors list> \
--build-arg API_VERSION=<API version> \
--build-arg API_VERSION_COSMWASM=<API version> \
--build-arg BACKEND=<Backend url> \
--build-arg BACKEND_WS=<Backend WebSocket URL> \
--build-arg CONNECTIONS=<Connections list> \
--build-arg CONTRACT_DEX=<DEX contract address> \
--build-arg FIRST_CONVERSION_RATE=<First conversion rate> \
--build-arg FIRST_HEIGHT=<First height> \
--build-arg HAS_POOLS=<boolean> \
--build-arg LCD_URL=<LCD URL> \
--build-arg MAIN_TITLE=<App title> \
--build-arg WASM_CW20_CODE_ID=<Wasm CW20 code_id> \
--build-arg WASM_SWAP_CODE_ID=<Wasm SWAP code_id> \
--build-arg WS_URL=<WebSocket URL> \
.docker run --name almerico --rm almericoTo customize the configuration edit the config.json file
which is in the /src/config folder.
In order to properly customize the Vue.js CLI configuration please refer to the official configuration page.