Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

modify the default RPC and remove the vdf_difficulty query. #5

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
4 changes: 2 additions & 2 deletions src/api/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import { TESTNET_SEED_NODES } from '../constants'
import { apiReady, apiUrl, apiUrlNote } from '../store'
import type { EventObj, ViewObj } from './payloads/types'

// const DEBUG_URL: string = 'https://rpc.openlibra.space:8080/v1/'
const DEBUG_URL: string = 'http://138.197.32.103:8080/v1/'
const DEBUG_URL: string = 'https://rpc.openlibra.space:8080/v1/'
// const DEBUG_URL: string = 'http://138.197.32.103:8080/v1/'

export let api

Expand Down
5 changes: 0 additions & 5 deletions src/api/payloads/system.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,6 @@ export const epoch_length_payload: ViewObj = {
arguments: [],
}

export const vdf_difficulty: ViewObj = {
function: '0x1::tower_state::get_difficulty',
type_arguments: [],
arguments: [],
}

export const infra_balance: ViewObj = {
function: '0x1::infra_escrow::infra_escrow_balance',
Expand Down
4 changes: 1 addition & 3 deletions src/store/get_system_info.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,13 +84,12 @@ export const getSystemInfo = async () => {
const requests = [
postViewFunc(systemPayloads.fees_collected_payload),
postViewFunc(systemPayloads.epoch_length_payload),
postViewFunc(systemPayloads.vdf_difficulty),
postViewFunc(systemPayloads.infra_balance),
getAccountResource('0x1', '0x1::musical_chairs::Chairs'),
getAccountResource('0x1', '0x1::epoch_boundary::BoundaryStatus'),
getAccountResource('0x1', '0x1::proof_of_fee::ConsensusReward'),
]
const [fees, epochResponse, vdfDifficulty, infraBalance, chairs, boundaryStatus, cr] =
const [fees, epochResponse, infraBalance, chairs, boundaryStatus, cr] =
await Promise.all(requests)

const duration = moment.duration(Number(epochResponse[0]), 'seconds') // Cast to Number
Expand All @@ -102,7 +101,6 @@ export const getSystemInfo = async () => {
consensus_reward: cr.nominal_reward,
fees: fees[0],
epoch_duration: epoch,
vdf: vdfDifficulty,
infra_escrow: infraBalance[0],
validator_seats: chairs.seats_offered,
boundary_status: boundaryStatus,
Expand Down
1 change: 0 additions & 1 deletion src/types/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ export interface SystemInfo {
git_hash: string
infra_escrow: number
validator_seats: number
vdf: number[]
boundary_status: object
}

Expand Down
2 changes: 0 additions & 2 deletions src/ui/SystemInfo.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@
<li>Epoch Duration: {$systemInfo.epoch_duration}</li>
</ul>
<ul>
<li>VDF Difficulty: {$systemInfo.vdf[0]}</li>
<li>VDF Security: {$systemInfo.vdf[1]}</li>
<li>Infra Escrow: {scaleCoin($systemInfo.infra_escrow)}</li>

</ul>
Expand Down