@@ -84,7 +84,7 @@ transaction:
84
84
}
85
85
],
86
86
"metadata" : {
87
- 674 : {
87
+ " 674" : {
88
88
"msg" : [
89
89
" Test message"
90
90
]
@@ -101,10 +101,11 @@ using Uber's `Zap` logging library.
101
101
102
102
## Configuration
103
103
104
- Adder supports multiple configuration methods for versatility: commandline arguments, YAML config file,
105
- and environment variables (in that order).
104
+ Adder supports multiple configuration methods for versatility: commandline
105
+ arguments, YAML config file, and environment variables (in that order).
106
106
107
- You can get a list of all available commandline arguments by using the ` -h ` /` -help ` flag.
107
+ You can get a list of all available commandline arguments by using the
108
+ ` -h ` /` -help ` flag.
108
109
109
110
``` bash
110
111
$ ./adder -h
@@ -122,9 +123,10 @@ Usage of adder:
122
123
specifies the log level to use (default " info" )
123
124
```
124
125
125
- Each commandline argument (other than ` -config ` ) has a corresponding environment variable. For example,
126
- the ` -input ` option has the ` INPUT ` environment variable, the ` -input-chainsync-address ` option has the
127
- ` INPUT_CHAINSYNC_ADDRESS ` environment variable, and ` -output ` has ` OUTPUT ` .
126
+ Each commandline argument (other than ` -config ` ) has a corresponding environment
127
+ variable. For example, the ` -input ` option has the ` INPUT ` environment variable,
128
+ the ` -input-chainsync-address ` option has the ` INPUT_CHAINSYNC_ADDRESS `
129
+ environment variable, and ` -output ` has ` OUTPUT ` .
128
130
129
131
You can also specify each option in the config file.
130
132
@@ -134,7 +136,8 @@ input: chainsync
134
136
output : log
135
137
` ` `
136
138
137
- Plugin arguments can be specified under a special top-level key in the config file.
139
+ Plugin arguments can be specified under a special top-level key in the config
140
+ file.
138
141
139
142
` ` ` yaml
140
143
plugins :
@@ -149,11 +152,14 @@ plugins:
149
152
150
153
## Filtering
151
154
152
- Adder supports filtering events before they are output using multiple criteria. An event must match all configured filters to be emitted.
153
- Each filter supports specifying multiple possible values separated by commas. When specifying multiple values for a filter, only one of
154
- the values specified must match an event.
155
+ Adder supports filtering events before they are output using multiple criteria.
156
+ An event must match all configured filters to be emitted. Each filter supports
157
+ specifying multiple possible values separated by commas. When specifying
158
+ multiple values for a filter, only one of the values specified must match an
159
+ event.
155
160
156
- You can get a list of all available filter options by using the ` -h`/`-help` flag.
161
+ You can get a list of all available filter options by using the ` -h`/`-help`
162
+ flag.
157
163
158
164
` ` ` bash
159
165
$ ./adder -h
@@ -170,7 +176,8 @@ Usage of adder:
170
176
...
171
177
` ` `
172
178
173
- Multiple filter options can be used together, and only events matching all filters will be output.
179
+ Multiple filter options can be used together, and only events matching all
180
+ filters will be output.
174
181
175
182
# # Example usage
176
183
@@ -207,59 +214,73 @@ docker run --rm -ti \
207
214
Only output `chainsync.transaction` event types
208
215
209
216
` ` ` bash
210
- $ adder -filter-type chainsync.transaction
217
+ adder -filter-type chainsync.transaction
211
218
` ` `
212
219
213
220
Only output `chainsync.rollback` and `chainsync.block` event types
214
221
215
222
` ` ` bash
216
- $ adder -filter-type chainsync.transaction,chainsync.block
223
+ adder -filter-type chainsync.transaction,chainsync.block
217
224
` ` `
218
225
219
226
# ### Filtering on asset policy
220
227
221
228
Only output transactions involving an asset with a particular policy ID
222
229
223
230
` ` ` bash
224
- $ adder -filter-type chainsync.transaction -filter-policy 13aa2accf2e1561723aa26871e071fdf32c867cff7e7d50ad470d62f
231
+ adder -filter-type chainsync.transaction \
232
+ -filter-policy 13aa2accf2e1561723aa26871e071fdf32c867cff7e7d50ad470d62f
225
233
` ` `
226
234
227
235
# ### Filtering on asset fingerprint
228
236
229
237
Only output transactions involving a particular asset
230
238
231
239
` ` ` bash
232
- $ adder -filter-type chainsync.transaction -filter-asset asset108xu02ckwrfc8qs9d97mgyh4kn8gdu9w8f5sxk
240
+ adder -filter-type chainsync.transaction \
241
+ -filter-asset asset108xu02ckwrfc8qs9d97mgyh4kn8gdu9w8f5sxk
233
242
` ` `
234
243
235
244
# ### Filtering on a policy ID and asset fingerprint
236
245
237
- Only output transactions involving both a particular policy ID and a particular asset (which do not need to be related)
246
+ Only output transactions involving both a particular policy ID and a particular
247
+ asset (which do not need to be related)
238
248
239
249
` ` ` bash
240
- $ adder -filter-type chainsync.transaction -filter-asset asset108xu02ckwrfc8qs9d97mgyh4kn8gdu9w8f5sxk -filter-policy 13aa2accf2e1561723aa26871e071fdf32c867cff7e7d50ad470d62f
250
+ adder -filter-type chainsync.transaction \
251
+ -filter-asset asset108xu02ckwrfc8qs9d97mgyh4kn8gdu9w8f5sxk \
252
+ -filter-policy 13aa2accf2e1561723aa26871e071fdf32c867cff7e7d50ad470d62f
241
253
` ` `
242
254
243
255
# ### Filtering on an address
244
256
245
257
Only output transactions with outputs matching a particular address
246
258
247
259
` ` ` bash
248
- $ adder -filter-type chainsync.transaction -filter-address addr1qyht4ja0zcn45qvyx477qlyp6j5ftu5ng0prt9608dxp6l2j2c79gy9l76sdg0xwhd7r0c0kna0tycz4y5s6mlenh8pq4jxtdy
260
+ adder -filter-type chainsync.transaction \
261
+ -filter-address addr1qyht4ja0zcn45qvyx477qlyp6j5ftu5ng0prt9608dxp6l2j2c79gy9l76sdg0xwhd7r0c0kna0tycz4y5s6mlenh8pq4jxtdy
249
262
` ` `
250
263
251
264
# ### Filtering on a stake address
252
265
253
266
Only output transactions with outputs matching a particular stake address
254
267
255
268
` ` ` bash
256
- $ adder -filter-type chainsync.transaction -filter-address stake1u9f9v0z5zzlldgx58n8tklphu8mf7h4jvp2j2gddluemnssjfnkzz
269
+ adder -filter-type chainsync.transaction \
270
+ -filter-address stake1u9f9v0z5zzlldgx58n8tklphu8mf7h4jvp2j2gddluemnssjfnkzz
257
271
` ` `
258
272
259
273
# ## Push notifications
260
274
261
- The example shows how push notification output can be used with filtering options. In this example, push notifications will be sent to the block events. Push notifications will be sent to the specified project_id in the serviceAccount.json file. Please refer to https://github.com/blinklabs-io/adder-mobile for more details on how to send push notifications to adder-mobile.
275
+ The example shows how push notification output can be used with filtering
276
+ options. In this example, push notifications will be sent for the block events.
277
+ Push notifications will be sent to the FCM `project_id` specified in the
278
+ ` serviceAccount.json` file. Please refer to the
279
+ [adder-mobile README](https://github.com/blinklabs-io/adder-mobile) for more
280
+ details on how to send push notifications to mobile.
262
281
263
282
` ` ` bash
264
- $ adder -filter-type chainsync.block -output push -output-push-serviceAccountFilePath /path/to/serviceAccount.json
283
+ adder -filter-type chainsync.block \
284
+ -output push \
285
+ -output-push-serviceAccountFilePath /path/to/serviceAccount.json
265
286
` ` `
0 commit comments