mirror of
https://github.com/oceanprotocol/status
synced 2024-11-22 09:47:02 +01:00
commit
ee496fa83a
6
package-lock.json
generated
6
package-lock.json
generated
@ -955,9 +955,9 @@
|
|||||||
"integrity": "sha512-6It2EVfGskxZCQhuykrfnALg7oVeiI6KclWSmGDqB0AiInVrTGB9Jp9i4/Ad21u9Jde/voVQz6eFX/eSg/UsPA=="
|
"integrity": "sha512-6It2EVfGskxZCQhuykrfnALg7oVeiI6KclWSmGDqB0AiInVrTGB9Jp9i4/Ad21u9Jde/voVQz6eFX/eSg/UsPA=="
|
||||||
},
|
},
|
||||||
"@ethereum-navigator/atlas": {
|
"@ethereum-navigator/atlas": {
|
||||||
"version": "0.4.0",
|
"version": "0.5.0",
|
||||||
"resolved": "https://registry.npmjs.org/@ethereum-navigator/atlas/-/atlas-0.4.0.tgz",
|
"resolved": "https://registry.npmjs.org/@ethereum-navigator/atlas/-/atlas-0.5.0.tgz",
|
||||||
"integrity": "sha512-NZO5bc7E++Fd8GRkOWpTvfJPQjEGOEPxjcwAsmX7BArdYa3uQn1Ug/ij+QiGQ8xziJLwnU1jQxWb5jqVDObOdw=="
|
"integrity": "sha512-vrr1mN82keDzY5iDwyvG9+9RshmxOdBmEh2LX9vNLXcVrrr2e2hh7KsVQKWKSnubgv2Mo9WY/Y2IHxvRlUREeg=="
|
||||||
},
|
},
|
||||||
"@hapi/address": {
|
"@hapi/address": {
|
||||||
"version": "2.1.1",
|
"version": "2.1.1",
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
"format": "prettier ./src/**/*.{js,scss,json} --write"
|
"format": "prettier ./src/**/*.{js,scss,json} --write"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@ethereum-navigator/atlas": "^0.4.0",
|
"@ethereum-navigator/atlas": "^0.5.0",
|
||||||
"@oceanprotocol/art": "^2.2.0",
|
"@oceanprotocol/art": "^2.2.0",
|
||||||
"@oceanprotocol/typographies": "^0.1.0",
|
"@oceanprotocol/typographies": "^0.1.0",
|
||||||
"axios": "^0.19.0",
|
"axios": "^0.19.0",
|
||||||
|
@ -8,8 +8,8 @@ Network.propTypes = {
|
|||||||
name: PropTypes.string.isRequired,
|
name: PropTypes.string.isRequired,
|
||||||
networkId: PropTypes.string.isRequired,
|
networkId: PropTypes.string.isRequired,
|
||||||
type: PropTypes.string.isRequired,
|
type: PropTypes.string.isRequired,
|
||||||
url: PropTypes.string.isRequired,
|
rpcUrl: PropTypes.string.isRequired,
|
||||||
explorer: PropTypes.string.isRequired
|
explorerUrl: PropTypes.string.isRequired
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -21,7 +21,7 @@ export default function Network({ network }) {
|
|||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
async function getStatusAndBlock() {
|
async function getStatusAndBlock() {
|
||||||
const response = await axiosRpcRequest(network.url, 'eth_blockNumber')
|
const response = await axiosRpcRequest(network.rpcUrl, 'eth_blockNumber')
|
||||||
|
|
||||||
if (!response || response.status !== 200) {
|
if (!response || response.status !== 200) {
|
||||||
setStatus('Offline')
|
setStatus('Offline')
|
||||||
@ -38,7 +38,10 @@ export default function Network({ network }) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async function getClientVersion() {
|
async function getClientVersion() {
|
||||||
const response = await axiosRpcRequest(network.url, 'web3_clientVersion')
|
const response = await axiosRpcRequest(
|
||||||
|
network.rpcUrl,
|
||||||
|
'web3_clientVersion'
|
||||||
|
)
|
||||||
response && response.data && setClientVersion(response.data.result)
|
response && response.data && setClientVersion(response.data.result)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -64,7 +67,7 @@ export default function Network({ network }) {
|
|||||||
<span>{network.type}</span>
|
<span>{network.type}</span>
|
||||||
</h2>
|
</h2>
|
||||||
<p>
|
<p>
|
||||||
<code>{network.url}</code>
|
<code>{network.rpcUrl}</code>
|
||||||
</p>
|
</p>
|
||||||
<p className={styles.status}>
|
<p className={styles.status}>
|
||||||
<span className={isOnline ? styles.success : styles.error}>
|
<span className={isOnline ? styles.success : styles.error}>
|
||||||
@ -78,7 +81,8 @@ export default function Network({ network }) {
|
|||||||
</p>
|
</p>
|
||||||
{block && (
|
{block && (
|
||||||
<p className={styles.block} title="Current block number">
|
<p className={styles.block} title="Current block number">
|
||||||
At block #<a href={`${network.explorer}/blocks/${block}`}>{block}</a>
|
At block #
|
||||||
|
<a href={`${network.explorerUrl}/blocks/${block}`}>{block}</a>
|
||||||
</p>
|
</p>
|
||||||
)}
|
)}
|
||||||
{clientVersion && <p className={styles.clientVersion}>{clientVersion}</p>}
|
{clientVersion && <p className={styles.clientVersion}>{clientVersion}</p>}
|
||||||
|
@ -20,8 +20,8 @@ describe('Network', () => {
|
|||||||
project: 'Ocean Protocol',
|
project: 'Ocean Protocol',
|
||||||
type: 'mainnet',
|
type: 'mainnet',
|
||||||
networkId: '0xCEA11',
|
networkId: '0xCEA11',
|
||||||
url: 'https://pacific.oceanprotocol.com',
|
rpcUrl: 'https://pacific.oceanprotocol.com',
|
||||||
explorer: 'https://submarine.oceanprotocol.com'
|
explorerUrl: 'https://submarine.oceanprotocol.com'
|
||||||
}
|
}
|
||||||
|
|
||||||
it('renders without crashing', async () => {
|
it('renders without crashing', async () => {
|
||||||
|
Loading…
Reference in New Issue
Block a user