Skip to content

Commit

Permalink
Merge pull request #789 from autonomys/main
Browse files Browse the repository at this point in the history
Sync prod with main
  • Loading branch information
marc-aurele-besner authored Aug 2, 2024
2 parents 2a323dc + e8a6164 commit 9ea961d
Show file tree
Hide file tree
Showing 39 changed files with 976 additions and 634 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# Astral

- [Astral Block Explorer](https://explorer.subspace.network/) Astral Block Explorer
- [Astral Block Explorer](https://explorer.autonomys.xyz/) Astral Block Explorer
- [Astral Subsquid Playground](https://squid.gemini-3g.subspace.network/graphql) Astral Subspace SubSquid
- [Health Check](https://uptime.subspace.network/status/network) Subspace Network Status Page

Expand Down
2 changes: 1 addition & 1 deletion explorer/next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const nextConfig = {
remotePatterns: [
{
protocol: 'https',
hostname: 'docs.subspace.network',
hostname: 'docs.autonomys.xyz',
port: '',
pathname: '**',
},
Expand Down
4 changes: 1 addition & 3 deletions explorer/src/components/Farming/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ export const DownloadPage: FC = () => {
alt='Space Acres Screenshot Installation'
width={800}
height={400}
src='https://docs.subspace.network/assets/images/space-acres-setup-7-3490cba2e75635efdea0006d06da9936.png'
src='https://docs.autonomys.xyz/assets/images/space-acres-setup-7-3490cba2e75635efdea0006d06da9936.png'
className='mx-auto'
/>
</div>
Expand All @@ -198,8 +198,6 @@ export const DownloadPage: FC = () => {
By contributing storage and compute to the network, you play a crucial role in securing
it, while also earning rewards.
</h3>


</div>

<div className='mb-4 w-full rounded-[20px] border border-slate-100 bg-white px-3 py-4 shadow dark:border-none dark:bg-gradient-to-r dark:from-gradientTwilight dark:via-gradientDusk dark:to-gradientSunset sm:p-6'>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,10 @@ export const PendingTransactions: FC<PendingTransactionsProps> = ({
</span>
</div>
<div className='m-2 p-2'>
<StatusIcon status={tx.status !== TransactionStatus.Pending} />
<StatusIcon
status={tx.status === TransactionStatus.Success}
isPending={tx.status === TransactionStatus.Pending}
/>
</div>
<div className='m-2 p-2'>
<TrashIcon className='size-5' stroke='red' onClick={() => handleRemove(tx)} />
Expand Down
8 changes: 5 additions & 3 deletions explorer/src/components/common/StatusIcon.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
import { CheckCircleIcon, ClockIcon } from '@heroicons/react/24/outline'
import { CheckCircleIcon, ClockIcon, XCircleIcon } from '@heroicons/react/24/outline'
import { FC } from 'react'

type Props = {
status: boolean
isPending?: boolean
}

export const StatusIcon: FC<Props> = ({ status }) => {
export const StatusIcon: FC<Props> = ({ status, isPending }) => {
if (isPending) return <ClockIcon className='size-5' stroke='orange' />
return status ? (
<CheckCircleIcon className='size-5' stroke='#37D058' />
) : (
<ClockIcon className='size-5' stroke='orange' />
<XCircleIcon className='size-5' stroke='#D70040' />
)
}
2 changes: 1 addition & 1 deletion explorer/src/constants/metadata.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ const organization = 'Subspace Labs'
const description = 'Subspace Labs Gemini Block Explorer'
const keywords =
'Subspace, Subspace Network, Subspace Explorer, Subspace Labs, Subspace Labs Gemini, Subspace Labs Gemini Block Explorer'
export const url = process.env.NEXTAUTH_URL || 'https://explorer.subspace.network'
export const url = process.env.NEXTAUTH_URL || 'https://explorer.autonomys.xyz'
const twitter = '@SubspaceLabs'
const images = {
url: url + '/images/share.png',
Expand Down
4 changes: 2 additions & 2 deletions explorer/src/constants/routes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,9 @@ export const EXTERNAL_ROUTES = {
forum: 'https://forum.autonomys.xyz/',
gemini2guide:
'https://forum.autonomys.xyz/t/how-to-check-your-balance-for-gemini-ii-incentivized-testnet/1081',
docs: 'https://docs.subspace.network/',
docs: 'https://docs.autonomys.xyz/',
operatorDocs:
'https://docs.subspace.network/docs/farming-&-staking/staking/operators/register-operator',
'https://docs.autonomys.xyz/docs/farming-&-staking/staking/operators/register-operator',
social: {
twitter: 'https://x.com/AutonomysNet',
discord: 'https://discord.gg/subspace-network',
Expand Down
15 changes: 8 additions & 7 deletions explorer/src/hooks/useConsensusData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import useWallet from 'hooks/useWallet'
import { useCallback } from 'react'
import { useConsensusStates } from 'states/consensus'
import {
ConfirmedDomainBlock,
ConfirmedDomainExecutionReceipt,
DomainRegistry,
DomainStakingSummary,
PendingStakingOperationCount,
Expand All @@ -17,7 +17,7 @@ export const useConsensusData = () => {
setSystem,
setDomainRegistry,
setDomainStakingSummary,
setLatestConfirmedDomainBlock,
setLatestConfirmedDomainExecutionReceipt,
setNominatorCount,
setOperatorIdOwner,
setOperators,
Expand All @@ -41,7 +41,7 @@ export const useConsensusData = () => {
// domains
domainRegistry,
domainStakingSummary,
latestConfirmedDomainBlock,
latestConfirmedDomainExecutionReceipt,
nominatorCount,
operatorIdOwner,
operators,
Expand All @@ -53,9 +53,10 @@ export const useConsensusData = () => {
// system
api.rpc.system.chain(),
api.rpc.system.name(),
// domains
api.query.domains.domainRegistry.entries(),
api.query.domains.domainStakingSummary.entries(),
api.query.domains.latestConfirmedDomainBlock.entries(),
api.query.domains.latestConfirmedDomainExecutionReceipt.entries(),
api.query.domains.nominatorCount.entries(),
api.query.domains.operatorIdOwner.entries(),
api.query.domains.operators.entries(),
Expand Down Expand Up @@ -106,10 +107,10 @@ export const useConsensusData = () => {
setDomainStakingSummary(
domainStakingSummary.map((domain) => domain[1].toJSON() as DomainStakingSummary),
)
setLatestConfirmedDomainBlock(
latestConfirmedDomainBlock.map((domainBlock) => ({
setLatestConfirmedDomainExecutionReceipt(
latestConfirmedDomainExecutionReceipt.map((domainBlock) => ({
id: parseInt((domainBlock[0].toHuman() as string[])[0]),
...(domainBlock[1].toJSON() as Omit<ConfirmedDomainBlock, 'id'>),
...(domainBlock[1].toJSON() as Omit<ConfirmedDomainExecutionReceipt, 'id'>),
})),
)
setNominatorCount(
Expand Down
14 changes: 8 additions & 6 deletions explorer/src/states/consensus.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { Deposit, Withdrawal } from '@autonomys/auto-consensus'
import {
ConfirmedDomainBlock,
ConfirmedDomainExecutionReceipt,
Domain,
DomainRegistry,
DomainStakingSummary,
Expand Down Expand Up @@ -28,7 +28,7 @@ export interface ConsensusDefaultState {
// domains
domainRegistry: DomainRegistry[]
domainStakingSummary: DomainStakingSummary[]
latestConfirmedDomainBlock: ConfirmedDomainBlock[]
latestConfirmedDomainExecutionReceipt: ConfirmedDomainExecutionReceipt[]
// latestSubmittedER: LatestSubmittedER[]
nominatorCount: NominatorCount[]
operatorIdOwner: OperatorIdOwner[]
Expand All @@ -51,7 +51,9 @@ interface ConsensusState extends ConsensusDefaultState {
setSystem: (params: { chain: string; name: string }) => void
setDomainRegistry: (domainRegistry: DomainRegistry[]) => void
setDomainStakingSummary: (domainStakingSummary: DomainStakingSummary[]) => void
setLatestConfirmedDomainBlock: (latestConfirmedDomainBlock: ConfirmedDomainBlock[]) => void
setLatestConfirmedDomainExecutionReceipt: (
latestConfirmedDomainExecutionReceipt: ConfirmedDomainExecutionReceipt[],
) => void
setNominatorCount: (nominatorCount: NominatorCount[]) => void
setOperatorIdOwner: (operatorIdOwner: OperatorIdOwner[]) => void
setOperators: (operators: Operators[]) => void
Expand All @@ -77,7 +79,7 @@ const initialState: ConsensusDefaultState = {
// domains
domainRegistry: [],
domainStakingSummary: [],
latestConfirmedDomainBlock: [],
latestConfirmedDomainExecutionReceipt: [],
// latestSubmittedER: [],
nominatorCount: [],
operatorIdOwner: [],
Expand All @@ -104,8 +106,8 @@ export const useConsensusStates = create<ConsensusState>()(
setSystem: (params) => set(() => ({ chain: params.chain, name: params.name })),
setDomainRegistry: (domainRegistry) => set(() => ({ domainRegistry })),
setDomainStakingSummary: (domainStakingSummary) => set(() => ({ domainStakingSummary })),
setLatestConfirmedDomainBlock: (latestConfirmedDomainBlock) =>
set(() => ({ latestConfirmedDomainBlock })),
setLatestConfirmedDomainExecutionReceipt: (latestConfirmedDomainExecutionReceipt) =>
set(() => ({ latestConfirmedDomainExecutionReceipt })),
setNominatorCount: (nominatorCount) => set(() => ({ nominatorCount })),
setOperatorIdOwner: (operatorIdOwner) => set(() => ({ operatorIdOwner })),
setOperators: (operators) => set(() => ({ operators })),
Expand Down
8 changes: 2 additions & 6 deletions explorer/src/types/consensus.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,13 +56,9 @@ export type DomainStakingSummary = {
}
}

export type ConfirmedDomainBlock = {
export type ConfirmedDomainExecutionReceipt = {
id: number
blockNumber: number
blockHash: string
parentBlockReceiptHash: string
stateRoot: string
extrinsicsRoot: string
domainBlockNumber: number
}

export type NominatorCount = {
Expand Down
2 changes: 1 addition & 1 deletion explorer/src/utils/auth/providers/nova.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export const Nova = () => {

const verifyParams: VerifyParams = {
signature,
domain: 'subspace.network',
domain: 'autonomys.xyz',
nonce: await getCsrfToken({ req }),
}

Expand Down
2 changes: 1 addition & 1 deletion indexers/staking-squid/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Staking squid

Our Staking Indexer using [Squid](https://subsquid.io).
It is in use at [Astral - Staking](https://explorer.subspace.network/gemini-3h/staking) Autonomus Explorer, Staking section.
It is in use at [Astral - Staking](https://explorer.autonomys.xyz/gemini-3h/staking) Autonomys Explorer, Staking section.

## Summary

Expand Down
Loading

0 comments on commit 9ea961d

Please sign in to comment.