-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add new telemetry fields chain_id and protocol
- Loading branch information
Showing
8 changed files
with
66 additions
and
2 deletions.
There are no files selected for viewing
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"agent":{"build":"1.36.1-533-g1098b24d2","name":"near-rs","version":"trunk"},"chain":{"account_id":"test.near","block_production_tracking_delay":0.1,"is_validator":true,"latest_block_hash":"BauFWYx2gMrntNepXF6GN6j1rhQqQEVeLU39WKp2b4C2","latest_block_height":604,"max_block_production_delay":2.0,"max_block_wait_delay":6.0,"min_block_production_delay":0.6,"node_id":"ed25519:6Hat46Wuxrk1czrhENjJrS3GuYUXYDmMgFtGLFyWGWNq","num_peers":0,"status":"NoSync"},"extra_info":"{\"block_production_tracking_delay\":0.1,\"max_block_production_delay\":2.0,\"max_block_wait_delay\":6.0,\"min_block_production_delay\":0.6}","signature":"ed25519:yMax8NT8ptBu3tGa2LWFVSJRxLLRdXmwuVrE6wPnnXdHFqBDbXQvjP4btNGeraFsu75BzkSGvHV7xaJc3vQzUpQ","system":{"bandwidth_download":0,"bandwidth_upload":0,"boot_time_seconds":1715338798,"cpu_usage":0.0,"memory_usage":68648}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
use sea_orm_migration::prelude::*; | ||
|
||
pub struct Migration; | ||
|
||
impl MigrationName for Migration { | ||
fn name(&self) -> &str { | ||
"m_20240603_000002_add_extra_fields" | ||
} | ||
} | ||
|
||
#[async_trait::async_trait] | ||
impl MigrationTrait for Migration { | ||
async fn up(&self, manager: &SchemaManager) -> Result<(), DbErr> { | ||
manager | ||
.alter_table( | ||
Table::alter() | ||
.table(Node::Table) | ||
.add_column(ColumnDef::new(Node::ChainId).string().null()) | ||
.to_owned(), | ||
) | ||
.await?; | ||
manager | ||
.alter_table( | ||
Table::alter() | ||
.table(Node::Table) | ||
.add_column(ColumnDef::new(Node::ProtocolVersion).integer().null()) | ||
.to_owned(), | ||
) | ||
.await?; | ||
Ok(()) | ||
} | ||
|
||
async fn down(&self, manager: &SchemaManager) -> Result<(), DbErr> { | ||
manager | ||
.alter_table(Table::alter().drop_column(Node::ChainId).to_owned()) | ||
.await?; | ||
manager | ||
.alter_table(Table::alter().drop_column(Node::ProtocolVersion).to_owned()) | ||
.await?; | ||
Ok(()) | ||
} | ||
} | ||
|
||
#[derive(Iden)] | ||
pub enum Node { | ||
Table, | ||
ChainId, | ||
ProtocolVersion, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,16 @@ | ||
use sea_orm_migration::prelude::*; | ||
|
||
mod m20240508_000001_create_tables; | ||
mod m20240603_000002_add_extra_fields; | ||
|
||
pub struct Migrator; | ||
|
||
#[async_trait::async_trait] | ||
impl MigratorTrait for Migrator { | ||
fn migrations() -> Vec<Box<dyn MigrationTrait>> { | ||
vec![Box::new(m20240508_000001_create_tables::Migration)] | ||
vec![ | ||
Box::new(m20240508_000001_create_tables::Migration), | ||
Box::new(m20240603_000002_add_extra_fields::Migration), | ||
] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters