File tree Expand file tree Collapse file tree 1 file changed +16
-1
lines changed Expand file tree Collapse file tree 1 file changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -15,10 +15,11 @@ use node::{
15
15
SyncStatsQuery ,
16
16
} ,
17
17
stats:: sync:: SyncKind ,
18
+ BuildEnv ,
18
19
} ;
19
20
use o1_utils:: field_helpers:: FieldHelpersError ;
20
21
use openmina_core:: {
21
- block:: AppliedBlock , consensus:: ConsensusConstants , constants:: constraint_constants,
22
+ block:: AppliedBlock , consensus:: ConsensusConstants , constants:: constraint_constants, NetworkConfig
22
23
} ;
23
24
use openmina_node_common:: rpc:: RpcSender ;
24
25
use snark:: GraphQLPendingSnarkWork ;
@@ -27,6 +28,7 @@ use transaction::GraphQLTransactionStatus;
27
28
use warp:: { Filter , Rejection , Reply } ;
28
29
use zkapp:: GraphQLZkapp ;
29
30
31
+
30
32
pub mod account;
31
33
pub mod block;
32
34
pub mod constants;
@@ -433,6 +435,19 @@ impl Query {
433
435
. map ( GraphQLPendingSnarkWork :: try_from)
434
436
. collect :: < Result < Vec < _ > , _ > > ( ) ?)
435
437
}
438
+
439
+ /// The chain-agnostic identifier of the network
440
+ #[ graphql( name = "networkID" ) ]
441
+ async fn network_id ( _context : & Context ) -> juniper:: FieldResult < String > {
442
+ let res = format ! ( "mina:{}" , NetworkConfig :: global( ) . name) ;
443
+ Ok ( res)
444
+ }
445
+
446
+ /// The version of the node (git commit hash)
447
+ async fn version ( _context : & Context ) -> juniper:: FieldResult < String > {
448
+ let res = BuildEnv :: get ( ) . git . commit_hash ;
449
+ Ok ( res)
450
+ }
436
451
}
437
452
438
453
async fn inject_tx < R > (
You can’t perform that action at this time.
0 commit comments