Merge branch 'ping-pub:master' into master

This commit is contained in:
ithfay 2023-08-23 21:27:59 +08:00 committed by GitHub
commit 6f2fda712f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
19 changed files with 245 additions and 30 deletions

View File

@ -13,7 +13,7 @@
"base": "ppica",
"symbol": "PICA",
"exponent": "12",
"coingecko_id": "",
"coingecko_id": "picasso",
"logo": "/logos/composable.jpg"
}]
}

View File

@ -1,8 +1,8 @@
{
"chain_name": "haqq",
"coingecko": "",
"api": ["https://rest.cosmos.haqq.network/", "https://m-s1-sdk.haqq.sh","https://api.haqq.nodestake.top"],
"rpc": ["https://rpc.tm.haqq.network/", "https://m-s1-tm.haqq.sh","https://rpc.haqq.nodestake.top"],
"api": ["https://rest.cosmos.haqq.network/", "https://m-s1-sdk.haqq.sh", "https://haqq-rest.publicnode.com"],
"rpc": ["https://rpc.tm.haqq.network/", "https://m-s1-tm.haqq.sh", "https://haqq-rpc.publicnode.com/"],
"snapshot_provider": "",
"sdk_version": "0.46.10",
"coin_type": "60",

View File

@ -1,10 +1,10 @@
{
"chain_name": "juno",
"coingecko": "juno-network",
"api": ["https://api-juno-ia.cosmosia.notional.ventures", "https://juno-api.polkachu.com", "https://lcd-juno.itastakers.com", "https://rest-juno.goldenratiostaking.net"],
"rpc": ["https://rpc-juno-ia.cosmosia.notional.ventures:443", "https://juno-rpc.polkachu.com:443", "https://rpc-juno.itastakers.com:443", "https://rpc-juno.itastakers.com:443", "https://rpc-juno.goldenratiostaking.net"],
"api": ["https://api-juno-ia.cosmosia.notional.ventures", "https://juno-api.polkachu.com", "https://lcd-juno.itastakers.com", "https://rest-juno.goldenratiostaking.net", "https://juno-api.reece.sh"],
"rpc": ["https://rpc-juno-ia.cosmosia.notional.ventures:443", "https://juno-rpc.polkachu.com:443", "https://rpc-juno.itastakers.com:443", "https://rpc-juno.itastakers.com:443", "https://rpc-juno.goldenratiostaking.net", "https://juno-rpc.reece.sh"],
"snapshot_provider": "",
"sdk_version": "0.45.8",
"sdk_version": "0.47.3",
"coin_type": "118",
"min_tx_fee": "3000",
"addr_prefix": "juno",

22
chains/mainnet/mun.json Normal file
View File

@ -0,0 +1,22 @@
{
"chain_name": "mun",
"coingecko": "",
"api": ["https://mainnet1.mun.money"],
"rpc": ["https://mainnet1rpc.mun.money"],
"snapshot_provider": "",
"sdk_version": "0.45.16",
"coin_type": "118",
"min_tx_fee": "8000",
"addr_prefix": "mun",
"logo": "/logos/mun.png",
"assets": [
{
"base": "umun",
"symbol": "MUN",
"exponent": "6",
"coingecko_id": "",
"logo": "/logos/mun.png"
}
]
}

View File

@ -2,7 +2,10 @@
"chain_name": "stride",
"api": ["https://stride-api.polkachu.com", "https://api.stride.nodestake.top", "https://api-stride.nodeist.net", "https://stride.api.kjnodes.com"],
"rpc": ["https://stride-rpc.polkachu.com:443", "https://rpc.stride.nodestake.top", "https://rpc-stride.nodeist.net", "https://stride.rpc.kjnodes.com:443"],
"snapshot_provider": "",
"provider_chain": {
"api": ["https://api-cosmoshub-ia.cosmosia.notional.ventures"]
},
"features": ["dashboard","governance", "blocks", "ibc", "cosmwasm", "uptime", "parameters", "state-sync", "consensus", "supply", "widget"],
"sdk_version": "0.45.5",
"coin_type": "118",
"min_tx_fee": "800",

View File

@ -0,0 +1,25 @@
{
"chain_name": "injective-888",
"api": ["https://testnet.lcd.injective.network"],
"rpc": ["https://tesnet.tm.injective.network"],
"snapshot_provider": "",
"sdk_version": "v0.45.5",
"coin_type": "60",
"min_tx_fee": "5000",
"addr_prefix": "inj",
"excludes": "",
"logo": "/logos/injective.jpg",
"keplr_features": ["ibc-transfer", "ibc-go", "eth-address-gen", "eth-key-sign"],
"keplr_price_step": {
"low": 100000000000,
"average": 200000000000,
"high": 30000000000000
},
"assets": [{
"base": "inj",
"symbol": "INJ",
"exponent": "18",
"coingecko_id": "injective-protocol",
"logo": "/logos/injective.jpg"
}]
}

View File

@ -1,8 +1,8 @@
{
"chain_name": "juno",
"api": ["https://api.uni.junonetwork.io"],
"rpc": [""],
"sdk_version": "0.46.1",
"api": ["https://api.uni.junonetwork.io", "https://uni-api.reece.sh"],
"rpc": ["https://uni-rpc.reece.sh"],
"sdk_version": "0.47.3",
"coin_type": "118",
"min_tx_fee": "3000",
"addr_prefix": "juno",

View File

@ -1,14 +1,13 @@
{
"chain_name": "side",
"api": ["https://rest.testnet.side.one"],
"rpc": ["https://rpc.testnet.side.one"],
"snapshot_provider": "",
"registry_name": "SIDE",
"api": ["https://testnet-rest.side.exchange/"],
"rpc": ["https://testnet-rpc.side.exchange/"],
"sdk_version": "0.46.4",
"coin_type": "60",
"coin_type": "118",
"min_tx_fee": "800",
"addr_prefix": "side",
"logo": "/logos/side.jpeg",
"keplr_features": ["ibc-transfer", "ibc-go", "eth-address-gen", "eth-key-sign"],
"assets": [{
"base": "aside",
"symbol": "SIDE",

82
installation.md Normal file
View File

@ -0,0 +1,82 @@
# Prerequisites
1. Node and Yarn - Acquired using Node Version Manager (https://github.com/nvm-sh/nvm)
# Quick Install for Prerequisites
1. Install Node Version Manager
```sh
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.4/install.sh | bash
```
2. Install the latest version of NodeJS
```sh
nvm install node # "node" is an alias for the latest version
```
3. Install the latest version of NPM for Node
```sh
nvm install-latest-npm # get the latest supported npm version on the current node version
```
4. Install Yarn
```sh
npm install --global yarn
```
# Installation:
1. Running with yarn
```sh
yarn --ignore-engines && yarn serve
```
2. Building for web servers, like nginx, apache
```sh
yarn --ignore-engines && yarn build
cp -r ./dist/* <ROOT_OF_WEB_SERVER>
```
3. Running with docker
```sh
./docker.sh
docker run -d -p 8088:80 ping.pub/dashboard
```
# Enable LCD for Ping.pub (do this on the config for your chain)
1. Set `enable = true` in `./config/app.toml`
```
###############################################################################
### API Configuration ###
###############################################################################
[api]
# Enable defines if the API server should be enabled.
enable = true
# Swagger defines if swagger documentation should automatically be registered.
swagger = false
# Address defines the API server to listen on.
address = "tcp://0.0.0.0:1317"
# MaxOpenConnections defines the number of maximum open connections.
max-open-connections = 1000
```
2. add proxy server and enable CORS. NOTE: You must enable https as well.
```
server {
server_name juno.api.ping.pub;
listen 443;
location / {
add_header Access-Control-Allow-Origin *;
add_header Access-Control-Max-Age 3600;
add_header Access-Control-Expose-Headers Content-Length;
proxy_pass http://<HOST>:1317;
}
}
```
3. config your blockchain in [./src/chains]()

BIN
public/logos/mun.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 43 KiB

View File

Before

Width:  |  Height:  |  Size: 189 KiB

After

Width:  |  Height:  |  Size: 189 KiB

View File

@ -14,8 +14,8 @@ const pages = computed(() => {
if (total > 0 && props.limit && total > props.limit) {
let page = 0
while (true) {
if (page * props.limit > total) break
page += 1
if (page * props.limit > total) break
if (total / props.limit > 10 && page > showSize && page < (total / props.limit - showSize + 1)) {
if (!(page >= current.value - 1 && page <= current.value + 1)) {
continue

View File

@ -25,14 +25,14 @@ const bars = computed(() => {
});
</script>
<template>
<div class="flex items-center justify-evenly">
<div class="flex items-center justify-evenly gap-0.5">
<div class="cursor-default" v-for="(item, index) in bars" :key="index">
<div class="tooltip" :data-tip="item.height">
<span
<div class="tooltip"
:data-tip="item.height"
:class="item.color"
style="width: 1.2%"
>&nbsp;
</span>
style="width: 4px;"
>
&nbsp;
</div>
</div>
</div>

View File

@ -254,7 +254,7 @@ export class CosmosRestClient extends BaseRestClient<RequestRegistry> {
// tx
async getTxsBySender(sender: string, page?: PageRequest) {
if(!page) page = new PageRequest()
const query = `?order_by=ORDER_BY_DESC&events=message.sender='${sender}'`;
const query = `?order_by=2&events=message.sender='${sender}'&pagination.limit=${page.limit}&pagination.offset=${page.offset||0}`;
return this.request(this.registry.tx_txs, {}, query);
}
// query ibc sending msgs

View File

@ -7,7 +7,7 @@ import type {
PaginabledContracts,
} from '../types';
import DynamicComponent from '@/components/dynamic/DynamicComponent.vue';
import { useBankStore, useBlockchain, useFormatter, useTxDialog } from '@/stores';
import { useBlockchain, useFormatter, useTxDialog } from '@/stores';
import PaginationBar from '@/components/PaginationBar.vue';
import { PageRequest, type PaginatedBalances } from '@/types';
@ -159,11 +159,17 @@ const result = ref('');
</label>
<label
for="wasm_execute_contract"
class="btn btn-primary btn-xs text-xs"
class="btn btn-primary btn-xs text-xs mr-2"
@click="dialog.open('wasm_execute_contract', { contract: v })"
>
{{ $t('cosmwasm.btn_execute') }}
</label>
<RouterLink
:to="`transactions?contract=${v}`"
class="btn btn-primary btn-xs text-xs"
>
{{ $t('cosmwasm.btn_transactions') }}
</RouterLink>
</td>
</tr>
</tbody>

View File

@ -0,0 +1,77 @@
<script lang="ts" setup>
import PaginationBar from '@/components/PaginationBar.vue';
import { useBlockchain, useFormatter } from '@/stores';
import { PageRequest, type PaginatedTxs } from '@/types';
import { Icon } from '@iconify/vue';
import { onMounted, ref } from 'vue';
import { useWasmStore } from '../WasmStore';
import DynamicComponent from '@/components/dynamic/DynamicComponent.vue';
import { useRoute } from 'vue-router';
const chainStore = useBlockchain();
const format = useFormatter();
const wasmStore = useWasmStore();
const route = useRoute()
const page = ref(new PageRequest())
const txs = ref<PaginatedTxs>({ txs: [], tx_responses: [], pagination: { total: "0" } });
const info = ref<any>(null);
onMounted(() => {
const address = String(route.query.contract)
wasmStore.wasmClient.getWasmContracts(address).then((x) => {
info.value = x.contract_info;
});
chainStore.rpc.getTxs("?order_by=2&events=execute._contract_address='{address}'", { address }, page.value).then(res => {
txs.value = res
})
})
function pageload(pageNum: number) {
page.value.setPage(pageNum)
const address = String(route.query.contract)
chainStore.rpc.getTxs("?order_by=2&events=execute._contract_address='{address}'", { address }, page.value).then(res => {
txs.value = res
})
}
</script>
<template>
<div>
<h2 class="card-title truncate w-full">
<RouterLink to="contracts"><span class="btn btn-sm"> &lt; </span> </RouterLink>{{ $t('cosmwasm.contract_detail') }}
</h2>
<DynamicComponent :value="info" />
<h2 class="card-title truncate w-full mt-4">Transactions</h2>
<table class="table">
<thead>
<tr>
<td> {{ $t('ibc.height') }}</td>
<td>{{ $t('ibc.txhash') }}</td>
<td> {{ $t('ibc.messages') }}</td>
<td>{{ $t('ibc.time') }}</td>
</tr>
</thead>
<tbody>
<tr v-for="resp in txs?.tx_responses">
<td>{{ resp.height }}</td>
<td>
<div class="text-xs truncate text-primary dark:invert">
<RouterLink :to="`/${chainStore.chainName}/tx/${resp.txhash}`">{{ resp.txhash }}</RouterLink>
</div>
</td>
<td>
<div class="flex">
{{ format.messages(resp.tx.body.messages) }}
<Icon v-if="resp.code === 0" icon="mdi-check" class="text-success text-lg" />
<Icon v-else icon="mdi-multiply" class="text-error text-lg" />
</div>
</td>
<td>{{ format.toLocaleDate(resp.timestamp) }}</td>
</tr>
</tbody>
</table>
<PaginationBar :limit="page.limit" :total="txs.pagination?.total" :callback="pageload" />
</div>
</template>

View File

@ -68,7 +68,7 @@ function fetchSendingTxs(channel: string, port: string, pageNum = 0) {
channel_id.value = channel
port_id.value = port
txs.value = {} as PaginatedTxs
chainStore.rpc.getTxs("?order_by=ORDER_BY_DESC&events=send_packet.packet_src_channel='{channel}'&events=send_packet.packet_src_port='{port}'", { channel, port }, page.value).then(res => {
chainStore.rpc.getTxs("?order_by=2&events=send_packet.packet_src_channel='{channel}'&events=send_packet.packet_src_port='{port}'", { channel, port }, page.value).then(res => {
txs.value = res
})
.finally(() => loading.value = false)
@ -80,7 +80,7 @@ function fetchRecevingTxs(channel: string, port: string, pageNum = 0) {
channel_id.value = channel
port_id.value = port
txs.value = {} as PaginatedTxs
chainStore.rpc.getTxs("?order_by=ORDER_BY_DESC&events=recv_packet.packet_dst_channel='{channel}'&events=recv_packet.packet_dst_port='{port}'", { channel, port }, page.value).then(res => {
chainStore.rpc.getTxs("?order_by=2&events=recv_packet.packet_dst_channel='{channel}'&events=recv_packet.packet_dst_port='{port}'", { channel, port }, page.value).then(res => {
txs.value = res
})
.finally(() => loading.value = false)

View File

@ -153,7 +153,7 @@ function changeTab(v: string) {
:class="tab === '2' ? '' : 'hidden'"
>
<div v-for="({ v, signing, hex }, i) in list" :key="i">
<div class="flex items-center justify-between py-0 w-72">
<div class="flex items-center justify-between py-0 w-[298px]">
<label class="truncate text-sm">
<span class="ml-1 text-black dark:text-white"
>{{ i + 1 }}.{{ v.description.moniker }}</span
@ -161,13 +161,13 @@ function changeTab(v: string) {
</label>
<div
v-if="Number(signing?.missed_blocks_counter || 0) > 10"
class="badge badge-sm bg-transparent border-0 text-red-500"
class="badge badge-sm bg-transparent border-0 text-red-500 font-bold"
>
{{ signing?.missed_blocks_counter }}
</div>
<div
v-else
class="badge badge-sm bg-transparent text-green-600 border-0"
class="badge badge-sm bg-transparent text-green-600 border-0 font-bold"
>
{{ signing?.missed_blocks_counter }}
</div>

View File

@ -113,6 +113,7 @@
"btn_fees": "Fees",
"btn_query": "Query",
"btn_execute": "Execute",
"btn_transactions": "Txs",
"instantiate_contract": "Instantiate Contract",
"contract_detail": "Contract Detail",
"contract_balances": "Contract Balances",