mirror of
https://seed.radicle.dev/rad:z4V1sjrXqjvFdnCUbxPFqd5p4DtH5.git
synced 2026-11-21 14:20:42 +08:00
Update heartwood and schemas
This commit is contained in:
@@ -76,6 +76,7 @@ export type Node = z.infer<typeof nodeSchema>;
|
||||
|
||||
const nodeSchema = object({
|
||||
id: string(),
|
||||
version: string(),
|
||||
config: object({
|
||||
alias: string(),
|
||||
peers: union([
|
||||
@@ -91,6 +92,8 @@ const nodeSchema = object({
|
||||
routingMaxSize: number(),
|
||||
routingMaxAge: number(),
|
||||
fetchConcurrency: number(),
|
||||
gossipMaxAge: number(),
|
||||
maxOpenFiles: number(),
|
||||
rate: object({
|
||||
inbound: object({
|
||||
fillRate: number(),
|
||||
@@ -114,7 +117,7 @@ const nodeInfoSchema = object({
|
||||
message: string(),
|
||||
service: string(),
|
||||
version: string(),
|
||||
node: nodeSchema.pick({ id: true }),
|
||||
nid: string(),
|
||||
path: string(),
|
||||
links: array(
|
||||
object({
|
||||
|
||||
@@ -11,7 +11,6 @@ export async function authenticate(
|
||||
"http://localhost:3001",
|
||||
"--no-open",
|
||||
"--connect",
|
||||
"--listen",
|
||||
`${peer.httpdBaseUrl.hostname}:${peer.httpdBaseUrl.port}`,
|
||||
]);
|
||||
const match = stdout.match(/Visit (http:\/\/\S+) to connect/);
|
||||
|
||||
@@ -94,8 +94,7 @@ export async function loadNodeRoute(
|
||||
const api = new HttpdClient(params.baseUrl);
|
||||
try {
|
||||
const projectPageIndex = 0;
|
||||
const [nodeInfo, node, { projects, total }] = await Promise.all([
|
||||
api.getNodeInfo(),
|
||||
const [node, { projects, total }] = await Promise.all([
|
||||
api.getNode(),
|
||||
loadProjects(projectPageIndex, params.baseUrl),
|
||||
]);
|
||||
@@ -104,9 +103,9 @@ export async function loadNodeRoute(
|
||||
params: {
|
||||
projectPageIndex: projectPageIndex + 1,
|
||||
baseUrl: params.baseUrl,
|
||||
nid: nodeInfo.node.id,
|
||||
nid: node.id,
|
||||
externalAddresses: node.config?.externalAddresses ?? [],
|
||||
version: nodeInfo.version,
|
||||
version: node.version,
|
||||
projects: projects,
|
||||
projectCount: total,
|
||||
},
|
||||
|
||||
@@ -152,7 +152,6 @@ export const test = base.extend<{
|
||||
"http://localhost:3001",
|
||||
"--no-open",
|
||||
"--connect",
|
||||
"--listen",
|
||||
`${peer.httpdBaseUrl.hostname}:${peer.httpdBaseUrl.port}`,
|
||||
]);
|
||||
const match = stdout.match(/Visit (http:\/\/\S+) to connect/);
|
||||
|
||||
@@ -1 +1 @@
|
||||
6bc7d297a5e7e3feecec3f61327a9adbdf532f61
|
||||
5dbd9bb2a32dca6aafbd2b4a50dd73d237ca025d
|
||||
@@ -136,6 +136,7 @@ export const NodeConfigSchema = object({
|
||||
routingMaxAge: number(),
|
||||
fetchConcurrency: number(),
|
||||
gossipMaxAge: number(),
|
||||
maxOpenFiles: number(),
|
||||
rate: object({
|
||||
inbound: object({ fillRate: number(), capacity: number() }),
|
||||
outbound: object({ fillRate: number(), capacity: number() }),
|
||||
@@ -307,6 +308,7 @@ export class RadiclePeer {
|
||||
routingMaxAge: 604800,
|
||||
fetchConcurrency: 1,
|
||||
gossipMaxAge: 1209600,
|
||||
maxOpenFiles: 4096,
|
||||
rate: {
|
||||
inbound: { fillRate: 0.2, capacity: 32 },
|
||||
outbound: { fillRate: 1.0, capacity: 64 },
|
||||
|
||||
Reference in New Issue
Block a user