Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 0 additions & 51 deletions .github/workflows/docker.yaml

This file was deleted.

28 changes: 0 additions & 28 deletions .github/workflows/mainnet-deploy.yaml.disabled

This file was deleted.

27 changes: 0 additions & 27 deletions .github/workflows/testnet-deploy.yaml

This file was deleted.

20 changes: 20 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Use an official Node.js runtime as the base image
FROM node:23-alpine

# Set the working directory inside the container
WORKDIR /app

# Copy only the dependency files first (for efficient caching)
COPY package.json yarn.lock ./

# Install dependencies
RUN yarn install

# Copy the rest of the application code
COPY . .

# Expose the port (optional, depends on your app configuration)
EXPOSE 5173

# Run the development server
CMD ["yarn", "start"]
22 changes: 22 additions & 0 deletions chains/mainnet/ssv.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"chain_name": "ssv",
"registry_name": "ssvchain",
"api": [
{"provider": "localhost", "address": "http://localhost:1317"}
],
"rpc": [
{"provider": "localhost", "address": "http://localhost:26657"}
],
"sdk_version": "0.50.11",
"coin_type": "118",
"min_tx_fee": "800",
"addr_prefix": "ssv",
"logo": "https://ssv.network/wp-content/uploads/2024/09/Symbol.png",
"assets": [{
"base": "ssv",
"symbol": "SSV",
"exponent": "6",
"coingecko_id": "ssv-network",
"logo": "https://ssv.network/wp-content/uploads/2024/09/Symbol.png"
}]
}
14 changes: 7 additions & 7 deletions src/modules/[chain]/block/[height].vue
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@ const current = ref({} as Block)
const target = ref(Number(props.height || 0))

const height = computed(() => {
return Number(current.value.block?.header?.height || props.height || 0);
return Number(current.value.sdk_block?.header?.height || props.height || 0);
});

const isFutureBlock = computed({
get: () => {
const latest = store.latest?.block?.header.height
const latest = store.latest?.sdk_block?.header.height
const isFuture = latest ? target.value > Number(latest) : true
if (!isFuture && !current.value.block_id) store.fetchBlock(target.value).then(x => current.value = x)
return isFuture
Expand All @@ -33,7 +33,7 @@ const isFutureBlock = computed({
})

const remainingBlocks = computed(() => {
const latest = store.latest?.block?.header.height
const latest = store.latest?.sdk_block?.header.height
return latest ? Number(target.value) - Number(latest) : 0
})

Expand Down Expand Up @@ -107,7 +107,7 @@ onBeforeRouteUpdate(async (to, from, next) => {
<div v-else>
<div class="bg-base-100 px-4 pt-3 pb-4 rounded mb-4 shadow">
<h2 class="card-title flex flex-row justify-between">
<p class="">#{{ current.block?.header?.height }}</p>
<p class="">#{{ current.sdk_block?.header?.height }}</p>
<div class="flex" v-if="props.height">
<RouterLink :to="`/${store.blockchain.chainName}/block/${height - 1}`"
class="btn btn-primary btn-sm p-1 text-2xl mr-2">
Expand All @@ -126,17 +126,17 @@ onBeforeRouteUpdate(async (to, from, next) => {

<div class="bg-base-100 px-4 pt-3 pb-4 rounded mb-4 shadow">
<h2 class="card-title flex flex-row justify-between">{{ $t('block.block_header') }}</h2>
<DynamicComponent :value="current.block?.header" />
<DynamicComponent :value="current.sdk_block?.header" />
</div>

<div class="bg-base-100 px-4 pt-3 pb-4 rounded mb-4 shadow">
<h2 class="card-title flex flex-row justify-between">{{ $t('account.transactions') }}</h2>
<TxsElement :value="current.block?.data?.txs" />
<TxsElement :value="current.sdk_block?.data?.txs" />
</div>

<div class="bg-base-100 px-4 pt-3 pb-4 rounded shadow">
<h2 class="card-title flex flex-row justify-between">{{ $t('block.last_commit') }}</h2>
<DynamicComponent :value="current.block?.last_commit" />
<DynamicComponent :value="current.sdk_block?.last_commit" />
</div>
</div>
</div></template>
2 changes: 1 addition & 1 deletion src/modules/[chain]/block/block.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export const useBlockModule = defineStore('blockModule', {
txsInRecents() {
const txs = [] as { hash: string; tx: DecodedTxRaw }[];
this.recents.forEach((x) =>
x.block?.data?.txs.forEach((tx: Uint8Array) => {
x.sdk_block?.data?.txs.forEach((tx: Uint8Array) => {
if (tx) {
try {
txs.push({
Expand Down
20 changes: 10 additions & 10 deletions src/stores/useBaseStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@ export const useBaseStore = defineStore('baseStore', {
blocktime(): number {
if (this.earlest && this.latest) {
if (
this.latest.block?.header?.height !==
this.earlest.block?.header?.height
this.latest.sdk_block?.header?.height !==
this.earlest.sdk_block?.header?.height
) {
const diff = dayjs(this.latest.block?.header?.time).diff(
this.earlest.block?.header?.time
const diff = dayjs(this.latest.sdk_block?.header?.time).diff(
this.earlest.sdk_block?.header?.time
);
const blocks = Number(this.latest.block.header.height) - Number(this.earlest.block.header.height)
const blocks = Number(this.latest.sdk_block.header.height) - Number(this.earlest.sdk_block.header.height)
return diff / (blocks);
}
}
Expand All @@ -39,7 +39,7 @@ export const useBaseStore = defineStore('baseStore', {
return useBlockchain();
},
currentChainId(): string {
return this.latest.block?.header.chain_id || '';
return this.latest.sdk_block?.header.chain_id || '';
},
txsInRecents() {
const txs = [] as {
Expand All @@ -48,12 +48,12 @@ export const useBaseStore = defineStore('baseStore', {
tx: DecodedTxRaw;
}[];
this.recents.forEach((b) =>
b.block?.data?.txs.forEach((tx: string) => {
b.sdk_block?.data?.txs.forEach((tx: string) => {
if (tx) {
const raw = fromBase64(tx);
try {
txs.push({
height: b.block.header.height,
height: b.sdk_block.header.height,
hash: hashTx(raw),
tx: decodeTxRaw(raw),
});
Expand Down Expand Up @@ -82,8 +82,8 @@ export const useBaseStore = defineStore('baseStore', {
}
if (
!this.earlest ||
this.earlest?.block?.header?.chain_id !=
this.latest?.block?.header?.chain_id
this.earlest?.sdk_block?.header?.chain_id !=
this.latest?.sdk_block?.header?.chain_id
) {
//reset earlest and recents
this.earlest = this.latest;
Expand Down
2 changes: 1 addition & 1 deletion src/types/base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ export interface Signature

export interface Block {
block_id: BlockId,
block: {
sdk_block: {
header: {
version: {
block: string,
Expand Down