mirror of
https://github.com/hanzoai/bootnode.git
synced 2026-10-25 02:31:30 +00:00
Merge remote-tracking branch 'origin/main' into consolidate-bootnode
This commit is contained in:
+8
-2
@@ -1,5 +1,7 @@
|
||||
# syntax=docker/dockerfile:1.7
|
||||
FROM golang:1.26-alpine AS build
|
||||
RUN apk add --no-cache ca-certificates tzdata
|
||||
RUN addgroup -g 65532 -S nonroot && adduser -u 65532 -S nonroot -G nonroot
|
||||
WORKDIR /src
|
||||
COPY go.mod go.sum ./
|
||||
RUN go mod download
|
||||
@@ -10,8 +12,12 @@ RUN CGO_ENABLED=0 GOOS=linux \
|
||||
-ldflags "-s -w -X main.version=${VERSION}" \
|
||||
-o /out/bootnode ./cmd/bootnode
|
||||
|
||||
FROM gcr.io/distroless/static-debian12:nonroot
|
||||
FROM scratch
|
||||
COPY --from=build /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt
|
||||
COPY --from=build /usr/share/zoneinfo /usr/share/zoneinfo
|
||||
COPY --from=build /etc/passwd /etc/passwd
|
||||
COPY --from=build /etc/group /etc/group
|
||||
COPY --from=build /out/bootnode /usr/local/bin/bootnode
|
||||
EXPOSE 8000
|
||||
USER nonroot:nonroot
|
||||
USER 65532:65532
|
||||
ENTRYPOINT ["/usr/local/bin/bootnode"]
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
module github.com/hanzoai/bootnode
|
||||
|
||||
go 1.26.3
|
||||
go 1.26.4
|
||||
|
||||
require (
|
||||
github.com/go-chi/chi/v5 v5.1.0
|
||||
|
||||
@@ -96,8 +96,7 @@ func chainsList(deps Deps) http.HandlerFunc {
|
||||
"chains": []map[string]any{
|
||||
{"id": "ethereum", "chainId": 1, "name": "Ethereum"},
|
||||
{"id": "lux-c", "chainId": 96369, "name": "Lux C-Chain"},
|
||||
{"id": "liquid", "chainId": 8675309, "name": "Liquid EVM"},
|
||||
{"id": "pars", "chainId": 8675311, "name": "Pars"},
|
||||
{"id": "pars", "chainId": 7070, "name": "Pars"},
|
||||
{"id": "zoo", "chainId": 200200, "name": "Zoo"},
|
||||
{"id": "hanzo", "chainId": 36963, "name": "Hanzo"},
|
||||
},
|
||||
|
||||
+4
-4
@@ -60,10 +60,10 @@ values like `/12` or `/37`.
|
||||
| macOS window-chrome dot trio | red/yellow/green @ 60% | OS affordance reproduction |
|
||||
| External brand logos | brand's official hex | Recognizing third-party identity |
|
||||
|
||||
For brands with a saturated primary (Zoo, Pars, Liquidity, Osage, Zen, MIGA,
|
||||
Cyrus), prefer the brand's own palette over the generic Tailwind red/green
|
||||
above where the brand maps cleanly (e.g. Osage red `#b8312f` for errors,
|
||||
Zoo green `#00A652` for success).
|
||||
For brands with a saturated primary (Zoo, Pars, Osage, Zen, MIGA, Cyrus),
|
||||
prefer the brand's own palette over the generic Tailwind red/green above
|
||||
where the brand maps cleanly (e.g. Osage red `#b8312f` for errors, Zoo
|
||||
green `#00A652` for success).
|
||||
|
||||
---
|
||||
|
||||
|
||||
@@ -4185,6 +4185,6 @@
|
||||
}
|
||||
}
|
||||
],
|
||||
"cChainGenesis": "{\n \"alloc\": {\n \"0200000000000000000000000000000000000005\": {\n \"balance\": \"0x0\",\n \"code\": \"0x01\",\n \"nonce\": \"0x1\"\n },\n \"0x35D64Ff3f618f7a17DF34DCb21be375A4686a8de\": {\n \"balance\": \"0x193e5939a08ce9dbd480000000\"\n },\n \"0x5a299B0010BAc9c0339B6EF600B1f2943131b1e7\": {\n \"balance\": \"0x3635c9adc5dea00000\"\n },\n \"0xFf9bc69A6554a511E92236C019a58e5aB5f0e486\": {\n \"balance\": \"0x3635c9adc5dea00000\"\n },\n \"0x9Fa1E0E5A524C7120c9e95538D2682d30BB01d98\": {\n \"balance\": \"0x3635c9adc5dea00000\"\n },\n \"0x8E704638D25950E77D9B4fB207Bdf03329101ca9\": {\n \"balance\": \"0x3635c9adc5dea00000\"\n },\n \"0xA7a0600258652bB10ffeA97b6D10C8f0E8fD40e8\": {\n \"balance\": \"0x3635c9adc5dea00000\"\n },\n \"0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266\": {\n \"balance\": \"0x3635c9adc5dea00000\"\n },\n \"0x70997970C51812dc3A010C7d01b50e0d17dc79C8\": {\n \"balance\": \"0x3635c9adc5dea00000\"\n },\n \"0x3C44CdDdB6a900fa2b585dd299e03d12FA4293BC\": {\n \"balance\": \"0x3635c9adc5dea00000\"\n }\n },\n \"baseFeePerGas\": \"0x5d21dba00\",\n \"coinbase\": \"0x0000000000000000000000000000000000000000\",\n \"config\": {\n \"arrowGlacierBlock\": 0,\n \"berlinBlock\": 0,\n \"byzantiumBlock\": 0,\n \"cancunTime\": 0,\n \"chainId\": 96370,\n \"constantinopleBlock\": 0,\n \"durangoTimestamp\": 0,\n \"eip150Block\": 0,\n \"eip155Block\": 0,\n \"eip158Block\": 0,\n \"etnaTimestamp\": 0,\n \"blobSchedule\": {\n \"cancun\": {\n \"max\": 6,\n \"target\": 3,\n \"baseFeeUpdateFraction\": 3338477\n }\n },\n \"feeConfig\": {\n \"baseFeeChangeDenominator\": 36,\n \"blockGasCostStep\": 200000,\n \"gasLimit\": 12000000,\n \"maxBlockGasCost\": 1000000,\n \"minBaseFee\": 1000000000,\n \"minBlockGasCost\": 0,\n \"targetBlockRate\": 2,\n \"targetGas\": 60000000\n },\n \"fortunaTimestamp\": 0,\n \"graniteTimestamp\": 0,\n \"grayGlacierBlock\": 0,\n \"homesteadBlock\": 0,\n \"istanbulBlock\": 0,\n \"londonBlock\": 0,\n \"mergeNetsplitBlock\": 0,\n \"muirGlacierBlock\": 0,\n \"petersburgBlock\": 0,\n \"shanghaiTime\": 0,\n \"subnetEVMTimestamp\": 0,\n \"terminalTotalDifficulty\": 0,\n \"warpConfig\": {\n \"blockTimestamp\": 0,\n \"quorumNumerator\": 67,\n \"requirePrimaryNetworkSigners\": false\n }\n },\n \"difficulty\": \"0x0\",\n \"extraData\": \"0x\",\n \"gasLimit\": \"0xb71b00\",\n \"gasUsed\": \"0x0\",\n \"mixHash\": \"0x0000000000000000000000000000000000000000000000000000000000000000\",\n \"nonce\": \"0x0\",\n \"number\": \"0x0\",\n \"parentHash\": \"0x0000000000000000000000000000000000000000000000000000000000000000\",\n \"timestamp\": \"0x0\"\n}\n",
|
||||
"cChainGenesis": "{\"alloc\":{\"0200000000000000000000000000000000000005\":{\"balance\":\"0x0\",\"code\":\"0x01\",\"nonce\":\"0x1\"},\"0x35D64Ff3f618f7a17DF34DCb21be375A4686a8de\":{\"balance\":\"0x193e5939a08ce9dbd480000000\"},\"0x5a299B0010BAc9c0339B6EF600B1f2943131b1e7\":{\"balance\":\"0x3635c9adc5dea00000\"},\"0xFf9bc69A6554a511E92236C019a58e5aB5f0e486\":{\"balance\":\"0x3635c9adc5dea00000\"},\"0x9Fa1E0E5A524C7120c9e95538D2682d30BB01d98\":{\"balance\":\"0x3635c9adc5dea00000\"},\"0x8E704638D25950E77D9B4fB207Bdf03329101ca9\":{\"balance\":\"0x3635c9adc5dea00000\"},\"0xA7a0600258652bB10ffeA97b6D10C8f0E8fD40e8\":{\"balance\":\"0x3635c9adc5dea00000\"},\"0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266\":{\"balance\":\"0x3635c9adc5dea00000\"},\"0x70997970C51812dc3A010C7d01b50e0d17dc79C8\":{\"balance\":\"0x3635c9adc5dea00000\"},\"0x3C44CdDdB6a900fa2b585dd299e03d12FA4293BC\":{\"balance\":\"0x3635c9adc5dea00000\"}},\"baseFeePerGas\":\"0x5d21dba00\",\"coinbase\":\"0x0000000000000000000000000000000000000000\",\"config\":{\"arrowGlacierBlock\":0,\"berlinBlock\":0,\"byzantiumBlock\":0,\"cancunTime\":0,\"chainId\":96370,\"constantinopleBlock\":0,\"durangoTimestamp\":0,\"eip150Block\":0,\"eip155Block\":0,\"eip158Block\":0,\"blobSchedule\":{\"cancun\":{\"max\":6,\"target\":3,\"baseFeeUpdateFraction\":3338477}},\"feeConfig\":{\"baseFeeChangeDenominator\":36,\"blockGasCostStep\":200000,\"gasLimit\":12000000,\"maxBlockGasCost\":1000000,\"minBaseFee\":1000000000,\"minBlockGasCost\":0,\"targetBlockRate\":2,\"targetGas\":60000000},\"fortunaTimestamp\":0,\"graniteTimestamp\":0,\"grayGlacierBlock\":0,\"homesteadBlock\":0,\"istanbulBlock\":0,\"londonBlock\":0,\"mergeNetsplitBlock\":0,\"muirGlacierBlock\":0,\"petersburgBlock\":0,\"shanghaiTime\":0,\"subnetEVMTimestamp\":0,\"terminalTotalDifficulty\":0,\"warpConfig\":{\"blockTimestamp\":0,\"quorumNumerator\":67,\"requirePrimaryNetworkSigners\":false}},\"difficulty\":\"0x0\",\"extraData\":\"0x\",\"gasLimit\":\"0xb71b00\",\"gasUsed\":\"0x0\",\"mixHash\":\"0x0000000000000000000000000000000000000000000000000000000000000000\",\"nonce\":\"0x0\",\"number\":\"0x0\",\"parentHash\":\"0x0000000000000000000000000000000000000000000000000000000000000000\",\"timestamp\":\"0x0\"}",
|
||||
"message": "Lux et Libertas"
|
||||
}
|
||||
|
||||
@@ -4186,5 +4186,5 @@
|
||||
}
|
||||
}
|
||||
],
|
||||
"cChainGenesis": "{\n \"config\": {\n \"chainId\": 96369,\n \"homesteadBlock\": 0,\n \"eip150Block\": 0,\n \"eip155Block\": 0,\n \"eip158Block\": 0,\n \"byzantiumBlock\": 0,\n \"constantinopleBlock\": 0,\n \"petersburgBlock\": 0,\n \"istanbulBlock\": 0,\n \"muirGlacierBlock\": 0,\n \"berlinBlock\": 0,\n \"londonBlock\": 0,\n \"arrowGlacierBlock\": 0,\n \"grayGlacierBlock\": 0,\n \"mergeNetsplitBlock\": 0,\n \"shanghaiTime\": 0,\n \"cancunTime\": 253399622400,\n \"terminalTotalDifficulty\": 0,\n \"banffBlockTimestamp\": 253399622400,\n \"cortinaBlockTimestamp\": 253399622400,\n \"durangoBlockTimestamp\": 253399622400,\n \"etnaTimestamp\": 253399622400,\n \"fortunaTimestamp\": 253399622400,\n \"graniteTimestamp\": 253399622400,\n \"blobSchedule\": {\n \"cancun\": {\n \"max\": 6,\n \"target\": 3,\n \"baseFeeUpdateFraction\": 3338477\n }\n },\n \"feeConfig\": {\n \"gasLimit\": 12000000,\n \"targetBlockRate\": 2,\n \"minBaseFee\": 25000000000,\n \"targetGas\": 60000000,\n \"baseFeeChangeDenominator\": 36,\n \"minBlockGasCost\": 0,\n \"maxBlockGasCost\": 1000000,\n \"blockGasCostStep\": 200000\n },\n \"subnetEVMTimestamp\": 0,\n \"warpConfig\": {\n \"blockTimestamp\": 1730446786,\n \"quorumNumerator\": 67,\n \"requirePrimaryNetworkSigners\": false\n }\n },\n \"nonce\": \"0x0\",\n \"timestamp\": \"0x672485c2\",\n \"extraData\": \"0x\",\n \"gasLimit\": \"0xb71b00\",\n \"difficulty\": \"0x0\",\n \"mixHash\": \"0x0000000000000000000000000000000000000000000000000000000000000000\",\n \"coinbase\": \"0x0000000000000000000000000000000000000000\",\n \"alloc\": {\n \"0200000000000000000000000000000000000005\": {\n \"balance\": \"0x0\",\n \"nonce\": \"0x1\",\n \"code\": \"0x01\"\n },\n \"0x9011E888251AB053B7bD1cdB598Db4f9DEd94714\": {\n \"balance\": \"0x193e5939a08ce9dbd480000000\"\n }\n },\n \"stateRoot\": \"0x2d1cedac263020c5c56ef962f6abe0da1f5217bdc6468f8c9258a0ea23699e80\",\n \"number\": \"0x0\",\n \"gasUsed\": \"0x0\",\n \"parentHash\": \"0x0000000000000000000000000000000000000000000000000000000000000000\",\n \"baseFeePerGas\": \"0x5d21dba00\",\n \"skipPostMergeFields\": true,\n \"genesisHash\": \"0x3f4fa2a0b0ce089f52bf0ae9199c75ffdd76ecafc987794050cb0d286f1ec61e\"\n}"
|
||||
}
|
||||
"cChainGenesis": "{\"config\":{\"chainId\":96369,\"homesteadBlock\":0,\"eip150Block\":0,\"eip155Block\":0,\"eip158Block\":0,\"byzantiumBlock\":0,\"constantinopleBlock\":0,\"petersburgBlock\":0,\"istanbulBlock\":0,\"muirGlacierBlock\":0,\"berlinBlock\":0,\"londonBlock\":0,\"arrowGlacierBlock\":0,\"grayGlacierBlock\":0,\"mergeNetsplitBlock\":0,\"shanghaiTime\":0,\"cancunTime\":253399622400,\"terminalTotalDifficulty\":0,\"banffBlockTimestamp\":253399622400,\"cortinaBlockTimestamp\":253399622400,\"durangoBlockTimestamp\":253399622400,\"fortunaTimestamp\":253399622400,\"graniteTimestamp\":253399622400,\"blobSchedule\":{\"cancun\":{\"max\":6,\"target\":3,\"baseFeeUpdateFraction\":3338477}},\"feeConfig\":{\"gasLimit\":12000000,\"targetBlockRate\":2,\"minBaseFee\":25000000000,\"targetGas\":60000000,\"baseFeeChangeDenominator\":36,\"minBlockGasCost\":0,\"maxBlockGasCost\":1000000,\"blockGasCostStep\":200000},\"subnetEVMTimestamp\":0,\"warpConfig\":{\"blockTimestamp\":1730446786,\"quorumNumerator\":67,\"requirePrimaryNetworkSigners\":false}},\"nonce\":\"0x0\",\"timestamp\":\"0x672485c2\",\"extraData\":\"0x\",\"gasLimit\":\"0xb71b00\",\"difficulty\":\"0x0\",\"mixHash\":\"0x0000000000000000000000000000000000000000000000000000000000000000\",\"coinbase\":\"0x0000000000000000000000000000000000000000\",\"alloc\":{\"0200000000000000000000000000000000000005\":{\"balance\":\"0x0\",\"nonce\":\"0x1\",\"code\":\"0x01\"},\"0x9011E888251AB053B7bD1cdB598Db4f9DEd94714\":{\"balance\":\"0x193e5939a08ce9dbd480000000\"}},\"stateRoot\":\"0x2d1cedac263020c5c56ef962f6abe0da1f5217bdc6468f8c9258a0ea23699e80\",\"number\":\"0x0\",\"gasUsed\":\"0x0\",\"parentHash\":\"0x0000000000000000000000000000000000000000000000000000000000000000\",\"baseFeePerGas\":\"0x5d21dba00\",\"skipPostMergeFields\":true,\"genesisHash\":\"0x3f4fa2a0b0ce089f52bf0ae9199c75ffdd76ecafc987794050cb0d286f1ec61e\"}"
|
||||
}
|
||||
|
||||
@@ -4185,6 +4185,6 @@
|
||||
}
|
||||
}
|
||||
],
|
||||
"cChainGenesis": "{\n \"alloc\": {\n \"0200000000000000000000000000000000000005\": {\n \"balance\": \"0x0\",\n \"code\": \"0x01\",\n \"nonce\": \"0x1\"\n },\n \"0x9011E888251AB053B7bD1cdB598Db4f9DEd94714\": {\n \"balance\": \"0x193e5939a08ce9dbd480000000\"\n }\n },\n \"baseFeePerGas\": \"0x5d21dba00\",\n \"coinbase\": \"0x0000000000000000000000000000000000000000\",\n \"config\": {\n \"arrowGlacierBlock\": 0,\n \"berlinBlock\": 0,\n \"byzantiumBlock\": 0,\n \"cancunTime\": 0,\n \"chainId\": 96368,\n \"constantinopleBlock\": 0,\n \"durangoTimestamp\": 0,\n \"eip150Block\": 0,\n \"eip155Block\": 0,\n \"eip158Block\": 0,\n \"etnaTimestamp\": 0,\n \"blobSchedule\": {\n \"cancun\": {\n \"max\": 6,\n \"target\": 3,\n \"baseFeeUpdateFraction\": 3338477\n }\n },\n \"feeConfig\": {\n \"baseFeeChangeDenominator\": 36,\n \"blockGasCostStep\": 200000,\n \"gasLimit\": 12000000,\n \"maxBlockGasCost\": 1000000,\n \"minBaseFee\": 25000000000,\n \"minBlockGasCost\": 0,\n \"targetBlockRate\": 2,\n \"targetGas\": 60000000\n },\n \"fortunaTimestamp\": 0,\n \"graniteTimestamp\": 0,\n \"grayGlacierBlock\": 0,\n \"homesteadBlock\": 0,\n \"istanbulBlock\": 0,\n \"londonBlock\": 0,\n \"mergeNetsplitBlock\": 0,\n \"muirGlacierBlock\": 0,\n \"petersburgBlock\": 0,\n \"shanghaiTime\": 0,\n \"subnetEVMTimestamp\": 0,\n \"terminalTotalDifficulty\": 0,\n \"warpConfig\": {\n \"blockTimestamp\": 0,\n \"quorumNumerator\": 67,\n \"requirePrimaryNetworkSigners\": false\n }\n },\n \"difficulty\": \"0x0\",\n \"extraData\": \"0x\",\n \"gasLimit\": \"0xb71b00\",\n \"gasUsed\": \"0x0\",\n \"mixHash\": \"0x0000000000000000000000000000000000000000000000000000000000000000\",\n \"nonce\": \"0x0\",\n \"number\": \"0x0\",\n \"parentHash\": \"0x0000000000000000000000000000000000000000000000000000000000000000\",\n \"stateRoot\": \"0x2d1cedac263020c5c56ef962f6abe0da1f5217bdc6468f8c9258a0ea23699e80\",\n \"timestamp\": \"0x67259912\"\n}\n",
|
||||
"cChainGenesis": "{\"alloc\":{\"0200000000000000000000000000000000000005\":{\"balance\":\"0x0\",\"code\":\"0x01\",\"nonce\":\"0x1\"},\"0x9011E888251AB053B7bD1cdB598Db4f9DEd94714\":{\"balance\":\"0x193e5939a08ce9dbd480000000\"}},\"baseFeePerGas\":\"0x5d21dba00\",\"coinbase\":\"0x0000000000000000000000000000000000000000\",\"config\":{\"arrowGlacierBlock\":0,\"berlinBlock\":0,\"byzantiumBlock\":0,\"cancunTime\":0,\"chainId\":96368,\"constantinopleBlock\":0,\"durangoTimestamp\":0,\"eip150Block\":0,\"eip155Block\":0,\"eip158Block\":0,\"blobSchedule\":{\"cancun\":{\"max\":6,\"target\":3,\"baseFeeUpdateFraction\":3338477}},\"feeConfig\":{\"baseFeeChangeDenominator\":36,\"blockGasCostStep\":200000,\"gasLimit\":12000000,\"maxBlockGasCost\":1000000,\"minBaseFee\":25000000000,\"minBlockGasCost\":0,\"targetBlockRate\":2,\"targetGas\":60000000},\"fortunaTimestamp\":0,\"graniteTimestamp\":0,\"grayGlacierBlock\":0,\"homesteadBlock\":0,\"istanbulBlock\":0,\"londonBlock\":0,\"mergeNetsplitBlock\":0,\"muirGlacierBlock\":0,\"petersburgBlock\":0,\"shanghaiTime\":0,\"subnetEVMTimestamp\":0,\"terminalTotalDifficulty\":0,\"warpConfig\":{\"blockTimestamp\":0,\"quorumNumerator\":67,\"requirePrimaryNetworkSigners\":false}},\"difficulty\":\"0x0\",\"extraData\":\"0x\",\"gasLimit\":\"0xb71b00\",\"gasUsed\":\"0x0\",\"mixHash\":\"0x0000000000000000000000000000000000000000000000000000000000000000\",\"nonce\":\"0x0\",\"number\":\"0x0\",\"parentHash\":\"0x0000000000000000000000000000000000000000000000000000000000000000\",\"stateRoot\":\"0x2d1cedac263020c5c56ef962f6abe0da1f5217bdc6468f8c9258a0ea23699e80\",\"timestamp\":\"0x67259912\"}",
|
||||
"message": "Lux ex Tenebris"
|
||||
}
|
||||
|
||||
@@ -339,7 +339,6 @@ metadata:
|
||||
annotations:
|
||||
kubernetes.io/ingress.class: "hanzo"
|
||||
cert-manager.io/cluster-issuer: "letsencrypt-prod"
|
||||
traefik.ingress.kubernetes.io/router.tls: "true"
|
||||
spec:
|
||||
tls:
|
||||
- hosts:
|
||||
|
||||
@@ -536,7 +536,6 @@ spec:
|
||||
className: "hanzo"
|
||||
annotations:
|
||||
cert-manager.io/cluster-issuer: "letsencrypt-prod"
|
||||
traefik.ingress.kubernetes.io/router.tls: "true"
|
||||
hosts:
|
||||
- host: api.bootno.de
|
||||
paths:
|
||||
|
||||
@@ -5,8 +5,6 @@ metadata:
|
||||
namespace: hanzo
|
||||
annotations:
|
||||
cert-manager.io/cluster-issuer: letsencrypt-prod
|
||||
traefik.ingress.kubernetes.io/router.tls: "true"
|
||||
traefik.ingress.kubernetes.io/buffering.maxrequestbodybytes: "52428800"
|
||||
spec:
|
||||
ingressClassName: hanzo
|
||||
rules:
|
||||
|
||||
@@ -11,7 +11,6 @@ metadata:
|
||||
annotations:
|
||||
kubernetes.io/ingress.class: hanzo
|
||||
cert-manager.io/cluster-issuer: letsencrypt-prod
|
||||
traefik.ingress.kubernetes.io/router.tls: "true"
|
||||
spec:
|
||||
ingressClassName: hanzo
|
||||
tls:
|
||||
@@ -49,7 +48,6 @@ metadata:
|
||||
annotations:
|
||||
kubernetes.io/ingress.class: hanzo
|
||||
cert-manager.io/cluster-issuer: letsencrypt-prod
|
||||
traefik.ingress.kubernetes.io/router.tls: "true"
|
||||
spec:
|
||||
ingressClassName: hanzo
|
||||
tls:
|
||||
@@ -77,7 +75,6 @@ metadata:
|
||||
annotations:
|
||||
kubernetes.io/ingress.class: hanzo
|
||||
cert-manager.io/cluster-issuer: letsencrypt-prod
|
||||
traefik.ingress.kubernetes.io/router.tls: "true"
|
||||
spec:
|
||||
ingressClassName: hanzo
|
||||
tls:
|
||||
@@ -115,7 +112,6 @@ metadata:
|
||||
annotations:
|
||||
kubernetes.io/ingress.class: hanzo
|
||||
cert-manager.io/cluster-issuer: letsencrypt-prod
|
||||
traefik.ingress.kubernetes.io/router.tls: "true"
|
||||
spec:
|
||||
ingressClassName: hanzo
|
||||
tls:
|
||||
@@ -143,7 +139,6 @@ metadata:
|
||||
annotations:
|
||||
kubernetes.io/ingress.class: hanzo
|
||||
cert-manager.io/cluster-issuer: letsencrypt-prod
|
||||
traefik.ingress.kubernetes.io/router.tls: "true"
|
||||
spec:
|
||||
ingressClassName: hanzo
|
||||
tls:
|
||||
@@ -203,7 +198,6 @@ metadata:
|
||||
annotations:
|
||||
kubernetes.io/ingress.class: hanzo
|
||||
cert-manager.io/cluster-issuer: letsencrypt-prod
|
||||
traefik.ingress.kubernetes.io/router.tls: "true"
|
||||
spec:
|
||||
ingressClassName: hanzo
|
||||
tls:
|
||||
@@ -231,7 +225,6 @@ metadata:
|
||||
annotations:
|
||||
kubernetes.io/ingress.class: hanzo
|
||||
cert-manager.io/cluster-issuer: letsencrypt-prod
|
||||
traefik.ingress.kubernetes.io/router.tls: "true"
|
||||
spec:
|
||||
ingressClassName: hanzo
|
||||
tls:
|
||||
@@ -269,7 +262,6 @@ metadata:
|
||||
annotations:
|
||||
kubernetes.io/ingress.class: hanzo
|
||||
cert-manager.io/cluster-issuer: letsencrypt-prod
|
||||
traefik.ingress.kubernetes.io/router.tls: "true"
|
||||
spec:
|
||||
ingressClassName: hanzo
|
||||
tls:
|
||||
@@ -297,7 +289,6 @@ metadata:
|
||||
annotations:
|
||||
kubernetes.io/ingress.class: hanzo
|
||||
cert-manager.io/cluster-issuer: letsencrypt-prod
|
||||
traefik.ingress.kubernetes.io/router.tls: "true"
|
||||
spec:
|
||||
ingressClassName: hanzo
|
||||
tls:
|
||||
@@ -335,7 +326,6 @@ metadata:
|
||||
annotations:
|
||||
kubernetes.io/ingress.class: hanzo
|
||||
cert-manager.io/cluster-issuer: letsencrypt-prod
|
||||
traefik.ingress.kubernetes.io/router.tls: "true"
|
||||
spec:
|
||||
ingressClassName: hanzo
|
||||
tls:
|
||||
@@ -363,7 +353,6 @@ metadata:
|
||||
annotations:
|
||||
kubernetes.io/ingress.class: hanzo
|
||||
cert-manager.io/cluster-issuer: letsencrypt-prod
|
||||
traefik.ingress.kubernetes.io/router.tls: "true"
|
||||
spec:
|
||||
ingressClassName: hanzo
|
||||
tls:
|
||||
@@ -391,7 +380,6 @@ metadata:
|
||||
annotations:
|
||||
kubernetes.io/ingress.class: hanzo
|
||||
cert-manager.io/cluster-issuer: letsencrypt-prod
|
||||
traefik.ingress.kubernetes.io/router.tls: "true"
|
||||
spec:
|
||||
ingressClassName: hanzo
|
||||
tls:
|
||||
@@ -430,7 +418,6 @@ metadata:
|
||||
annotations:
|
||||
kubernetes.io/ingress.class: hanzo
|
||||
cert-manager.io/cluster-issuer: letsencrypt-prod
|
||||
traefik.ingress.kubernetes.io/router.tls: "true"
|
||||
spec:
|
||||
ingressClassName: hanzo
|
||||
tls:
|
||||
|
||||
@@ -6,7 +6,6 @@ import { Button } from "@/components/ui/button"
|
||||
import { Badge } from "@/components/ui/badge"
|
||||
import { Input } from "@/components/ui/input"
|
||||
import { Image, Search, ExternalLink, Loader2 } from "lucide-react"
|
||||
import { getApiUrl, getAuthHeaders } from "@/lib/api"
|
||||
|
||||
interface NFT {
|
||||
contract: string
|
||||
@@ -23,6 +22,15 @@ export default function NFTsPage() {
|
||||
const [loading, setLoading] = useState(false)
|
||||
const [searched, setSearched] = useState(false)
|
||||
|
||||
function getAuthHeaders(): Record<string, string> {
|
||||
if (typeof window === "undefined") return {}
|
||||
const token = localStorage.getItem("bootnode_token")
|
||||
const apiKey = localStorage.getItem("bootnode_api_key")
|
||||
if (token) return { "Authorization": `Bearer ${token}` }
|
||||
if (apiKey) return { "X-API-Key": apiKey }
|
||||
return {}
|
||||
}
|
||||
|
||||
async function searchNFTs() {
|
||||
if (!address.trim()) return
|
||||
setLoading(true)
|
||||
@@ -30,7 +38,7 @@ export default function NFTsPage() {
|
||||
|
||||
try {
|
||||
const res = await fetch(
|
||||
`${getApiUrl()}/v1/nfts/${chain}/owned/${address}`,
|
||||
`${process.env.NEXT_PUBLIC_API_URL || "http://localhost:8000"}/v1/nfts/${chain}/owned/${address}`,
|
||||
{ headers: getAuthHeaders() }
|
||||
)
|
||||
if (res.ok) {
|
||||
|
||||
@@ -10,7 +10,6 @@ import {
|
||||
Server, ArrowLeft, Play, Square, Trash2, RefreshCcw, Copy, Check,
|
||||
Activity, HardDrive, Cpu, MemoryStick, Network, Loader2, Terminal
|
||||
} from "lucide-react"
|
||||
import { getApiUrl, getAuthHeaders } from "@/lib/api"
|
||||
|
||||
interface NodeDetails {
|
||||
id: string
|
||||
@@ -57,10 +56,19 @@ export default function NodeDetailPage() {
|
||||
const [rpcResult, setRpcResult] = useState<string | null>(null)
|
||||
const [rpcLoading, setRpcLoading] = useState(false)
|
||||
|
||||
function getAuthHeaders(): Record<string, string> {
|
||||
if (typeof window === "undefined") return {}
|
||||
const token = localStorage.getItem("bootnode_token")
|
||||
const apiKey = localStorage.getItem("bootnode_api_key")
|
||||
if (token) return { "Authorization": `Bearer ${token}` }
|
||||
if (apiKey) return { "X-API-Key": apiKey }
|
||||
return {}
|
||||
}
|
||||
|
||||
async function fetchNode() {
|
||||
try {
|
||||
const res = await fetch(
|
||||
`${getApiUrl()}/v1/nodes/${nodeId}`,
|
||||
`${process.env.NEXT_PUBLIC_API_URL || "http://localhost:8000"}/v1/nodes/${nodeId}`,
|
||||
{ headers: getAuthHeaders() }
|
||||
)
|
||||
if (!res.ok) throw new Error(`Failed to fetch: ${res.status}`)
|
||||
@@ -80,17 +88,17 @@ export default function NodeDetailPage() {
|
||||
}, [nodeId])
|
||||
|
||||
async function handleAction(action: "start" | "stop" | "delete") {
|
||||
const apiBase = getApiUrl()
|
||||
const apiUrl = process.env.NEXT_PUBLIC_API_URL || "http://localhost:8000"
|
||||
try {
|
||||
if (action === "delete") {
|
||||
if (!confirm("Are you sure you want to delete this node?")) return
|
||||
await fetch(`${apiBase}/v1/nodes/${nodeId}`, {
|
||||
await fetch(`${apiUrl}/v1/nodes/${nodeId}`, {
|
||||
method: "DELETE",
|
||||
headers: getAuthHeaders()
|
||||
})
|
||||
router.push("/dashboard/infrastructure/nodes")
|
||||
} else {
|
||||
const res = await fetch(`${apiBase}/v1/nodes/${nodeId}/${action}`, {
|
||||
const res = await fetch(`${apiUrl}/v1/nodes/${nodeId}/${action}`, {
|
||||
method: "POST",
|
||||
headers: getAuthHeaders()
|
||||
})
|
||||
|
||||
@@ -10,7 +10,6 @@ import {
|
||||
Loader2, Filter, ChevronRight, Zap, Shield, Globe, Star, Lock
|
||||
} from "lucide-react"
|
||||
import Link from "next/link"
|
||||
import { getApiUrl, getAuthHeaders } from "@/lib/api"
|
||||
|
||||
interface StakingData {
|
||||
apy: number
|
||||
@@ -66,10 +65,19 @@ export default function MarketsPage() {
|
||||
const [filter, setFilter] = useState<"all" | "high_yield" | "top_mcap" | "supported">("all")
|
||||
const [sortBy, setSortBy] = useState<"score" | "apy" | "tvl" | "market_cap">("score")
|
||||
|
||||
function getAuthHeaders(): Record<string, string> {
|
||||
if (typeof window === "undefined") return {}
|
||||
const token = localStorage.getItem("bootnode_token")
|
||||
const apiKey = localStorage.getItem("bootnode_api_key")
|
||||
if (token) return { "Authorization": `Bearer ${token}` }
|
||||
if (apiKey) return { "X-API-Key": apiKey }
|
||||
return {}
|
||||
}
|
||||
|
||||
async function fetchMarketData() {
|
||||
try {
|
||||
const res = await fetch(
|
||||
`${getApiUrl()}/v1/nodes/staking`,
|
||||
`${process.env.NEXT_PUBLIC_API_URL || "http://localhost:8000"}/v1/nodes/staking`,
|
||||
{ headers: getAuthHeaders() }
|
||||
)
|
||||
if (res.ok) {
|
||||
|
||||
@@ -39,7 +39,7 @@ export default function SettingsPage() {
|
||||
setProjectName(localStorage.getItem("bootnode_project_name") || "")
|
||||
setProjectDescription(localStorage.getItem("bootnode_project_description") || "")
|
||||
setApiKey(localStorage.getItem("bootnode_api_key") || "")
|
||||
setApiUrl(getApiUrl())
|
||||
setApiUrl(process.env.NEXT_PUBLIC_API_URL || "http://localhost:8000")
|
||||
}, [])
|
||||
|
||||
function handleSaveProject() {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
"use client"
|
||||
|
||||
import { useState, useEffect, useCallback } from "react"
|
||||
import { useState, useEffect } from "react"
|
||||
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@/components/ui/card"
|
||||
import { Button } from "@/components/ui/button"
|
||||
import { Badge } from "@/components/ui/badge"
|
||||
@@ -10,33 +10,6 @@ import {
|
||||
Loader2, ChevronRight, Zap, AlertTriangle, Check, Copy, RefreshCcw
|
||||
} from "lucide-react"
|
||||
import Link from "next/link"
|
||||
import { getApiUrl, getAuthHeaders, api } from "@/lib/api"
|
||||
|
||||
interface NodeResponse {
|
||||
id: string
|
||||
name: string
|
||||
chain: string
|
||||
network: string
|
||||
status: string
|
||||
region: string
|
||||
node_type: string
|
||||
uptime_seconds: number | null
|
||||
block_height: number | null
|
||||
sync_progress: number | null
|
||||
peer_count: number | null
|
||||
rpc_endpoint: string | null
|
||||
created_at: string
|
||||
}
|
||||
|
||||
interface StakingAsset {
|
||||
chain: string
|
||||
name: string
|
||||
symbol: string
|
||||
apy: number
|
||||
price: number
|
||||
staking_ratio: number
|
||||
tvl: number
|
||||
}
|
||||
|
||||
interface Validator {
|
||||
id: string
|
||||
@@ -47,9 +20,6 @@ interface Validator {
|
||||
status: "active" | "pending" | "inactive"
|
||||
uptime: number
|
||||
commission: number
|
||||
apy: number
|
||||
name: string
|
||||
region: string
|
||||
}
|
||||
|
||||
interface WalletState {
|
||||
@@ -58,7 +28,6 @@ interface WalletState {
|
||||
chain: string | null
|
||||
balance: number
|
||||
kmsConfigured: boolean
|
||||
mpcAddress: string | null
|
||||
}
|
||||
|
||||
export default function StakingPage() {
|
||||
@@ -68,76 +37,21 @@ export default function StakingPage() {
|
||||
chain: null,
|
||||
balance: 0,
|
||||
kmsConfigured: false,
|
||||
mpcAddress: null,
|
||||
})
|
||||
const [validators, setValidators] = useState<Validator[]>([])
|
||||
const [stakingData, setStakingData] = useState<StakingAsset[]>([])
|
||||
const [loading, setLoading] = useState(false)
|
||||
const [validatorsLoading, setValidatorsLoading] = useState(true)
|
||||
const [staking, setStaking] = useState(false)
|
||||
const [stakeAmount, setStakeAmount] = useState("")
|
||||
const [copied, setCopied] = useState(false)
|
||||
|
||||
// Fetch validators (nodes with node_type=validator) on mount
|
||||
const fetchValidators = useCallback(async () => {
|
||||
setValidatorsLoading(true)
|
||||
try {
|
||||
const [nodesRes, stakingRes] = await Promise.allSettled([
|
||||
api<NodeResponse[]>("/nodes?node_type=validator"),
|
||||
api<{ staking: StakingAsset[] }>("/nodes/staking"),
|
||||
])
|
||||
function getAuthHeaders(): Record<string, string> {
|
||||
if (typeof window === "undefined") return {}
|
||||
const token = localStorage.getItem("bootnode_token")
|
||||
const apiKey = localStorage.getItem("bootnode_api_key")
|
||||
if (token) return { "Authorization": `Bearer ${token}` }
|
||||
if (apiKey) return { "X-API-Key": apiKey }
|
||||
return {}
|
||||
}
|
||||
|
||||
// Build APY lookup from staking data
|
||||
const apyMap: Record<string, number> = {}
|
||||
if (stakingRes.status === "fulfilled") {
|
||||
const assets = stakingRes.value.staking || []
|
||||
setStakingData(assets)
|
||||
for (const asset of assets) {
|
||||
apyMap[asset.chain] = asset.apy
|
||||
}
|
||||
}
|
||||
|
||||
// Map nodes to Validator interface
|
||||
if (nodesRes.status === "fulfilled") {
|
||||
const nodes = nodesRes.value
|
||||
const mapped: Validator[] = nodes.map((node) => {
|
||||
const uptimeHours = node.uptime_seconds
|
||||
? Math.floor(node.uptime_seconds / 3600)
|
||||
: 0
|
||||
const uptimePercent = node.uptime_seconds
|
||||
? Math.min(99.9, 95 + (node.uptime_seconds / 86400) * 0.1)
|
||||
: 0
|
||||
|
||||
return {
|
||||
id: node.id,
|
||||
chain: node.chain,
|
||||
name: node.name,
|
||||
address: node.rpc_endpoint || `${node.region}.${node.chain}.bootno.de`,
|
||||
stake: 0, // Populated from on-chain data in production
|
||||
rewards: 0,
|
||||
status: node.status === "running" ? "active"
|
||||
: node.status === "provisioning" || node.status === "syncing" ? "pending"
|
||||
: "inactive",
|
||||
uptime: Math.round(uptimePercent * 10) / 10,
|
||||
commission: 5.0, // Default commission rate
|
||||
apy: apyMap[node.chain] || 0,
|
||||
region: node.region,
|
||||
}
|
||||
})
|
||||
setValidators(mapped)
|
||||
}
|
||||
} catch (e) {
|
||||
console.error("Failed to fetch validators:", e)
|
||||
} finally {
|
||||
setValidatorsLoading(false)
|
||||
}
|
||||
}, [])
|
||||
|
||||
useEffect(() => {
|
||||
fetchValidators()
|
||||
}, [fetchValidators])
|
||||
|
||||
async function connectWallet(type: "metamask" | "ledger" | "kms" | "mpc") {
|
||||
async function connectWallet(type: "metamask" | "ledger" | "kms") {
|
||||
setLoading(true)
|
||||
try {
|
||||
if (type === "metamask") {
|
||||
@@ -160,16 +74,16 @@ export default function StakingPage() {
|
||||
chain: parseInt(chainId, 16) === 1 ? "ethereum" : `chain-${parseInt(chainId, 16)}`,
|
||||
balance: parseInt(balance, 16) / 1e18,
|
||||
kmsConfigured: false,
|
||||
mpcAddress: null,
|
||||
})
|
||||
}
|
||||
}
|
||||
} else if (type === "ledger") {
|
||||
// Ledger connection would use @ledgerhq/hw-transport-webusb
|
||||
alert("Ledger connection requires hardware wallet. Please connect your Ledger device.")
|
||||
} else if (type === "kms") {
|
||||
// Check if KMS (Hanzo KMS) is configured via /v1/keys/status
|
||||
// Check if KMS (Hanzo KSM) is configured
|
||||
const res = await fetch(
|
||||
`${getApiUrl()}/v1/keys/status`,
|
||||
`${process.env.NEXT_PUBLIC_API_URL || "http://localhost:8000"}/v1/keys/status`,
|
||||
{ headers: getAuthHeaders() }
|
||||
)
|
||||
if (res.ok) {
|
||||
@@ -180,58 +94,9 @@ export default function StakingPage() {
|
||||
chain: data.default_chain || "multi-chain",
|
||||
balance: data.total_balance || 0,
|
||||
kmsConfigured: true,
|
||||
mpcAddress: data.default_address || null,
|
||||
})
|
||||
} else {
|
||||
alert("KMS not configured. Please configure Hanzo KMS first.")
|
||||
}
|
||||
} else if (type === "mpc") {
|
||||
// Connect via MPC wallet - check status first, create if needed
|
||||
try {
|
||||
const status = await api<{
|
||||
configured: boolean
|
||||
default_address: string | null
|
||||
default_chain: string | null
|
||||
total_wallets: number
|
||||
total_balance: number
|
||||
}>("/mpc/status")
|
||||
|
||||
if (status.configured && status.default_address) {
|
||||
setWallet({
|
||||
connected: true,
|
||||
address: status.default_address,
|
||||
chain: status.default_chain || "ethereum",
|
||||
balance: status.total_balance || 0,
|
||||
kmsConfigured: true,
|
||||
mpcAddress: status.default_address,
|
||||
})
|
||||
} else {
|
||||
// Create a new MPC wallet
|
||||
const newWallet = await api<{
|
||||
address: string
|
||||
chain: string
|
||||
threshold: number
|
||||
num_shares: number
|
||||
}>("/mpc/create", {
|
||||
method: "POST",
|
||||
body: JSON.stringify({
|
||||
chain: "ethereum",
|
||||
threshold: 2,
|
||||
num_shares: 3,
|
||||
}),
|
||||
})
|
||||
setWallet({
|
||||
connected: true,
|
||||
address: newWallet.address,
|
||||
chain: newWallet.chain,
|
||||
balance: 0,
|
||||
kmsConfigured: true,
|
||||
mpcAddress: newWallet.address,
|
||||
})
|
||||
}
|
||||
} catch (e) {
|
||||
console.error("MPC wallet connection failed:", e)
|
||||
alert("Failed to connect MPC wallet. Check API configuration.")
|
||||
alert("KMS not configured. Please configure Hanzo KSM first.")
|
||||
}
|
||||
}
|
||||
} catch (e) {
|
||||
@@ -248,7 +113,6 @@ export default function StakingPage() {
|
||||
chain: null,
|
||||
balance: 0,
|
||||
kmsConfigured: false,
|
||||
mpcAddress: null,
|
||||
})
|
||||
}
|
||||
|
||||
@@ -260,55 +124,6 @@ export default function StakingPage() {
|
||||
}
|
||||
}
|
||||
|
||||
async function handleQuickStake() {
|
||||
if (!wallet.connected || !wallet.mpcAddress) {
|
||||
alert("Connect an MPC wallet to use Quick Stake.")
|
||||
return
|
||||
}
|
||||
|
||||
const amount = parseFloat(stakeAmount)
|
||||
if (!amount || amount <= 0) {
|
||||
alert("Enter a valid stake amount.")
|
||||
return
|
||||
}
|
||||
|
||||
setStaking(true)
|
||||
try {
|
||||
// Sign a staking transaction via MPC
|
||||
const result = await api<{
|
||||
signature: string
|
||||
signer: string
|
||||
raw_transaction: string | null
|
||||
v: number
|
||||
r: string
|
||||
s: string
|
||||
}>(`/mpc/${wallet.mpcAddress}/sign`, {
|
||||
method: "POST",
|
||||
body: JSON.stringify({
|
||||
shares: [], // Server-side KMS shares used automatically
|
||||
transaction: {
|
||||
to: "0x0000000000000000000000000000000000000001", // Staking contract
|
||||
value: `0x${Math.floor(amount * 1e18).toString(16)}`,
|
||||
data: "0xd0e30db0", // deposit()
|
||||
chainId: 1,
|
||||
gas: 100000,
|
||||
},
|
||||
}),
|
||||
})
|
||||
|
||||
alert(`Staking transaction signed. Signer: ${result.signer}`)
|
||||
setStakeAmount("")
|
||||
|
||||
// Refresh validators
|
||||
fetchValidators()
|
||||
} catch (e: any) {
|
||||
console.error("Staking failed:", e)
|
||||
alert(`Staking failed: ${e.message || "Unknown error"}`)
|
||||
} finally {
|
||||
setStaking(false)
|
||||
}
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="space-y-8">
|
||||
<div className="flex items-center justify-between">
|
||||
@@ -352,9 +167,7 @@ export default function StakingPage() {
|
||||
{wallet.address?.slice(0, 8)}...{wallet.address?.slice(-6)}
|
||||
</p>
|
||||
<p className="text-xs text-muted-foreground">
|
||||
{wallet.chain}
|
||||
{wallet.kmsConfigured && " \u2022 MPC Secured"}
|
||||
{wallet.mpcAddress && " \u2022 Threshold 2-of-3"}
|
||||
{wallet.chain} {wallet.kmsConfigured && "• KMS Secured"}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
@@ -383,14 +196,14 @@ export default function StakingPage() {
|
||||
</div>
|
||||
</div>
|
||||
) : (
|
||||
<div className="grid gap-4 md:grid-cols-4">
|
||||
<div className="grid gap-4 md:grid-cols-3">
|
||||
<Button
|
||||
variant="outline"
|
||||
className="h-24 flex-col gap-2"
|
||||
onClick={() => connectWallet("metamask")}
|
||||
disabled={loading}
|
||||
>
|
||||
{loading ? <Loader2 className="h-8 w-8 animate-spin" /> : <Wallet className="h-8 w-8" />}
|
||||
<Wallet className="h-8 w-8" />
|
||||
<span>MetaMask / Browser</span>
|
||||
</Button>
|
||||
<Button
|
||||
@@ -404,21 +217,12 @@ export default function StakingPage() {
|
||||
</Button>
|
||||
<Button
|
||||
variant="outline"
|
||||
className="h-24 flex-col gap-2"
|
||||
className="h-24 flex-col gap-2 border-primary/50 bg-primary/5"
|
||||
onClick={() => connectWallet("kms")}
|
||||
disabled={loading}
|
||||
>
|
||||
<Key className="h-8 w-8" />
|
||||
<span>Hanzo KMS</span>
|
||||
</Button>
|
||||
<Button
|
||||
variant="outline"
|
||||
className="h-24 flex-col gap-2 border-primary/50 bg-primary/5"
|
||||
onClick={() => connectWallet("mpc")}
|
||||
disabled={loading}
|
||||
>
|
||||
{loading ? <Loader2 className="h-8 w-8 animate-spin" /> : <Lock className="h-8 w-8" />}
|
||||
<span>MPC Wallet</span>
|
||||
<Badge variant="secondary" className="text-xs">Recommended</Badge>
|
||||
</Button>
|
||||
</div>
|
||||
@@ -434,15 +238,14 @@ export default function StakingPage() {
|
||||
<div>
|
||||
<p className="font-medium">Enterprise Key Management</p>
|
||||
<p className="text-sm text-muted-foreground">
|
||||
For production deployments, use MPC wallets with threshold signing (2-of-3).
|
||||
Keys are split using Shamir's Secret Sharing and never stored in full.
|
||||
Supports HSM backing, multi-sig, and role-based access.
|
||||
For production deployments, use Hanzo KMS (Key Management System) with HSM backing.
|
||||
Supports multi-sig, role-based access, and hardware security modules for maximum security.
|
||||
</p>
|
||||
<div className="flex gap-2 mt-2">
|
||||
<Button variant="outline" size="sm" asChild>
|
||||
<Link href="/dashboard/settings/keys">
|
||||
<Key className="mr-2 h-4 w-4" />
|
||||
Configure MPC
|
||||
Configure KMS
|
||||
</Link>
|
||||
</Button>
|
||||
<Button variant="ghost" size="sm" asChild>
|
||||
@@ -464,29 +267,16 @@ export default function StakingPage() {
|
||||
<CardTitle>Your Validators</CardTitle>
|
||||
<CardDescription>Active validators across all chains</CardDescription>
|
||||
</div>
|
||||
<div className="flex gap-2">
|
||||
<Button variant="outline" size="sm" onClick={fetchValidators} disabled={validatorsLoading}>
|
||||
{validatorsLoading
|
||||
? <Loader2 className="mr-2 h-4 w-4 animate-spin" />
|
||||
: <RefreshCcw className="mr-2 h-4 w-4" />}
|
||||
Refresh
|
||||
</Button>
|
||||
<Button asChild>
|
||||
<Link href="/dashboard/infrastructure/nodes">
|
||||
<Server className="mr-2 h-4 w-4" />
|
||||
Deploy Validator
|
||||
</Link>
|
||||
</Button>
|
||||
</div>
|
||||
<Button asChild>
|
||||
<Link href="/dashboard/infrastructure/nodes">
|
||||
<Server className="mr-2 h-4 w-4" />
|
||||
Deploy Validator
|
||||
</Link>
|
||||
</Button>
|
||||
</div>
|
||||
</CardHeader>
|
||||
<CardContent>
|
||||
{validatorsLoading ? (
|
||||
<div className="text-center p-12 text-muted-foreground">
|
||||
<Loader2 className="h-12 w-12 mx-auto mb-4 animate-spin opacity-50" />
|
||||
<p className="font-medium">Loading validators...</p>
|
||||
</div>
|
||||
) : validators.length === 0 ? (
|
||||
{validators.length === 0 ? (
|
||||
<div className="text-center p-12 text-muted-foreground">
|
||||
<Server className="h-12 w-12 mx-auto mb-4 opacity-50" />
|
||||
<p className="font-medium">No validators yet</p>
|
||||
@@ -500,40 +290,22 @@ export default function StakingPage() {
|
||||
) : (
|
||||
<div className="space-y-4">
|
||||
{validators.map((v) => (
|
||||
<div key={v.id} className="flex items-center justify-between p-4 border rounded-lg hover:bg-muted/50 transition-colors">
|
||||
<div key={v.id} className="flex items-center justify-between p-4 border rounded-lg">
|
||||
<div className="flex items-center gap-4">
|
||||
<div className="h-10 w-10 rounded-lg bg-primary/10 flex items-center justify-center">
|
||||
<Server className="h-5 w-5" />
|
||||
</div>
|
||||
<div>
|
||||
<p className="font-medium">{v.name || `${v.chain} Validator`}</p>
|
||||
<p className="font-medium">{v.chain} Validator</p>
|
||||
<p className="text-xs text-muted-foreground font-mono">{v.address}</p>
|
||||
<p className="text-xs text-muted-foreground">{v.region}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div className="flex items-center gap-6">
|
||||
{v.apy > 0 && (
|
||||
<div className="text-right">
|
||||
<p className="text-sm font-medium text-green-500">{v.apy.toFixed(1)}% APY</p>
|
||||
<p className="text-xs text-muted-foreground">{v.commission}% commission</p>
|
||||
</div>
|
||||
)}
|
||||
<div className="text-right">
|
||||
<p className="font-medium">
|
||||
{v.stake > 0 ? `${v.stake} staked` : "No stake"}
|
||||
</p>
|
||||
{v.rewards > 0 && (
|
||||
<p className="text-xs text-green-500">+{v.rewards} earned</p>
|
||||
)}
|
||||
{v.uptime > 0 && (
|
||||
<p className="text-xs text-muted-foreground">{v.uptime}% uptime</p>
|
||||
)}
|
||||
<p className="font-medium">{v.stake} staked</p>
|
||||
<p className="text-xs text-green-500">+{v.rewards} earned</p>
|
||||
</div>
|
||||
<Badge variant={
|
||||
v.status === "active" ? "default"
|
||||
: v.status === "pending" ? "secondary"
|
||||
: "destructive"
|
||||
}>
|
||||
<Badge variant={v.status === "active" ? "default" : "secondary"}>
|
||||
{v.status}
|
||||
</Badge>
|
||||
</div>
|
||||
@@ -555,40 +327,11 @@ export default function StakingPage() {
|
||||
</CardHeader>
|
||||
<CardContent>
|
||||
<p className="text-sm text-muted-foreground mb-4">
|
||||
{wallet.mpcAddress
|
||||
? "Sign a staking transaction with your MPC wallet."
|
||||
: "One-click staking deployment with optimized settings for maximum yield."}
|
||||
One-click staking deployment with optimized settings for maximum yield.
|
||||
</p>
|
||||
{wallet.connected && wallet.mpcAddress ? (
|
||||
<div className="space-y-3">
|
||||
<Input
|
||||
type="number"
|
||||
placeholder="Amount (ETH)"
|
||||
value={stakeAmount}
|
||||
onChange={(e) => setStakeAmount(e.target.value)}
|
||||
min="0"
|
||||
step="0.01"
|
||||
/>
|
||||
<Button
|
||||
className="w-full"
|
||||
onClick={handleQuickStake}
|
||||
disabled={staking || !stakeAmount}
|
||||
>
|
||||
{staking ? (
|
||||
<>
|
||||
<Loader2 className="mr-2 h-4 w-4 animate-spin" />
|
||||
Signing...
|
||||
</>
|
||||
) : (
|
||||
"Stake Now"
|
||||
)}
|
||||
</Button>
|
||||
</div>
|
||||
) : (
|
||||
<Button className="w-full" disabled={!wallet.connected}>
|
||||
{wallet.connected ? "Connect MPC Wallet" : "Connect Wallet First"}
|
||||
</Button>
|
||||
)}
|
||||
<Button className="w-full" disabled={!wallet.connected}>
|
||||
{wallet.connected ? "Stake Now" : "Connect Wallet First"}
|
||||
</Button>
|
||||
</CardContent>
|
||||
</Card>
|
||||
|
||||
@@ -613,7 +356,7 @@ export default function StakingPage() {
|
||||
<CardHeader>
|
||||
<CardTitle className="flex items-center gap-2 text-lg">
|
||||
<Lock className="h-5 w-5 text-purple-500" />
|
||||
Liquid Staking
|
||||
|
||||
</CardTitle>
|
||||
</CardHeader>
|
||||
<CardContent>
|
||||
|
||||
Reference in New Issue
Block a user