File tree 10 files changed +695
-63
lines changed
10 files changed +695
-63
lines changed Original file line number Diff line number Diff line change
1
+ import Data.ProtoLens.Setup
2
+
3
+ main = defaultMainGeneratingProtos " proto"
Original file line number Diff line number Diff line change 12
12
license : Apache-2.0
13
13
license-files : LICENSE
14
14
NOTICE
15
- build-type : Simple
15
+ build-type : Custom
16
16
extra-doc-files : ChangeLog.md
17
+ extra-source-files : proto/*.proto
18
+
19
+ custom-setup
20
+ setup-depends :
21
+ base
22
+ , Cabal
23
+ , proto-lens-setup
17
24
18
25
Flag unexpected_thunks
19
26
Description : Turn on unexpected thunks checks
@@ -88,6 +95,10 @@ library
88
95
Cardano.Node.Protocol.Shelley
89
96
Cardano.Node.Protocol.Types
90
97
Cardano.Node.Queries
98
+ Cardano.Node.Rpc.Client
99
+ Cardano.Node.Rpc.Proto.Api.Node
100
+ Cardano.Node.Rpc.Proto.Api.NodeMetadata
101
+ Cardano.Node.Rpc.Server
91
102
Cardano.Node.Run
92
103
Cardano.Node.Startup
93
104
Cardano.Node.STM
@@ -174,6 +185,8 @@ library
174
185
, ekg-core
175
186
, filepath
176
187
, formatting
188
+ , grapesy
189
+ , grpc-spec
177
190
, generic-data
178
191
, hashable
179
192
, hostname
@@ -200,6 +213,9 @@ library
200
213
, ouroboros-network-protocols ^>= 0.14
201
214
, prettyprinter
202
215
, prettyprinter-ansi-terminal
216
+ , proto-lens-protobuf-types
217
+ , proto-lens-runtime
218
+ , proto-lens
203
219
, psqueues
204
220
, random
205
221
, resource-registry
@@ -225,6 +241,8 @@ library
225
241
, typed-protocols-stateful >= 0.3
226
242
, yaml
227
243
244
+ build-tool-depends : proto-lens-protoc :proto-lens-protoc
245
+
228
246
executable cardano-node
229
247
import : project-config
230
248
hs-source-dirs : app
Original file line number Diff line number Diff line change
1
+
2
+ syntax = "proto3" ;
3
+
4
+ import "google/protobuf/empty.proto" ;
5
+
6
+ service Node {
7
+
8
+ rpc GetEra (google .protobuf .Empty ) returns (CurrentEra ) {}
9
+
10
+ }
11
+
12
+ enum Era {
13
+ byron = 0 ;
14
+ shelley = 1 ;
15
+ allegra = 2 ;
16
+ mary = 3 ;
17
+ alonzo = 4 ;
18
+ babbage = 5 ;
19
+ conway = 6 ;
20
+ }
21
+
22
+
23
+ message CurrentEra {
24
+ Era era = 1 ;
25
+ }
Original file line number Diff line number Diff line change
1
+ {-# LANGUAGE DataKinds #-}
2
+ {-# LANGUAGE TypeApplications #-}
3
+
4
+ module Cardano.Node.Rpc.Client
5
+ ( exampleCurrentEra
6
+
7
+ )
8
+ where
9
+ import qualified Cardano.Node.Rpc.Proto.Api.Node as ProtoGen
10
+ import Data.ProtoLens (defMessage )
11
+ import Data.ProtoLens.Field (field )
12
+ import Lens.Micro
13
+
14
+ exampleCurrentEra :: ProtoGen. CurrentEra
15
+ exampleCurrentEra = defMessage & field @ " era" .~ ProtoGen. Byron
You can’t perform that action at this time.
0 commit comments