-
Notifications
You must be signed in to change notification settings - Fork 0
/
openchain.yaml
executable file
·317 lines (256 loc) · 10.8 KB
/
openchain.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
---
###############################################################################
#
# CLI section
#
###############################################################################
cli:
# The address that the cli process will use for callbacks from chaincodes
address: 0.0.0.0:30304
###############################################################################
#
# REST section
#
###############################################################################
rest:
# Enable/disable setting for the REST service.
enabled: true
# The address that the REST service will listen on for incoming requests.
address: 0.0.0.0:5000
###############################################################################
#
# Peer section
#
###############################################################################
peer:
# Peer Version following version semantics as described here http://semver.org/
# The Peer supplies this version in communications with other Peers
version: 0.1.0
# The Peer id is used for identifying this Peer instance.
id: jdoe
# The privateKey to be used by this peer
privateKey: 794ef087680e2494fa4918fd8fb80fb284b50b57d321a31423fe42b9ccf6216047cea0b66fe8365a8e3f2a8140c6866cc45852e63124668bee1daa9c97da0c2a
# The networkId allows for logical seperation of networks
# networkId: dev
# networkId: test
networkId: dev
Dockerfile: |
from golang:1.5.1
ENV GO15VENDOREXPERIMENT=1
# Install RocksDB
RUN cd /opt && git clone --branch v4.1 --single-branch --depth 1 https://github.com/facebook/rocksdb.git && cd rocksdb
WORKDIR /opt/rocksdb
RUN make shared_lib
ENV LD_LIBRARY_PATH=/opt/rocksdb:$LD_LIBRARY_PATH
RUN apt-get update && apt-get install -y libsnappy-dev zlib1g-dev libbz2-dev
# Copy GOPATH src and install Peer
COPY src $GOPATH/src
RUN mkdir -p /var/openchain/db
WORKDIR $GOPATH/src/github.com/openblockchain/obc-peer/
RUN CGO_CFLAGS="-I/opt/rocksdb/include" CGO_LDFLAGS="-L/opt/rocksdb -lrocksdb -lstdc++ -lm -lz -lbz2 -lsnappy" go install && cp $GOPATH/src/github.com/openblockchain/obc-peer/openchain.yaml $GOPATH/bin
# The Address this Peer will listen on
listenAddress: 0.0.0.0:30303
# The Address this Peer will bind to for providing services
address: 0.0.0.0:30303
# Whether the Peer should programmatically determine the address to bind to. This case is useful for docker containers.
addressAutoDetect: false
# Logging settings
logging:
# Logging level, can be one of [error|warning|info|debug]
# One of: CRITICAL | ERROR | WARNING | NOTICE | INFO | DEBUG
level: DEBUG
# Peer port to accept connections on
port: 30303
# Peer's setting for GOMAXPROCS
gomaxprocs: 2
workers: 2
# Sync related configuration
sync:
blocks:
# Channel size for readonly SyncBlocks messages channel for receiving blocks from oppositie Peer Endpoints.
# NOTE: currently messages are not stored and forwarded, but rather lost if the channel write blocks.
channelSize: 1
state:
snapshot:
# Channel size for readonly syncStateSnapshot messages channel for receiving state deltas for snapshot from oppositie Peer Endpoints.
# NOTE: currently messages are not stored and forwarded, but rather lost if the channel write blocks.
channelSize: 50
# Validator defines whether this peer is a validating peer or not, and if
# it is enabled, what consensus plugin to load
validator:
enabled: true
# Consensus plugin to use. The value is the name of the plugin, e.g. obcpbft, noops
consensus: noops
# List of validating peers.
replicas:
# For MVP, assume list is static.
ips: 172.17.0.2:30303 172.17.0.3:30303 172.17.0.4:30303 172.17.0.5:30303
# Base64-encoded values.
hashes: a, b, c, d
events:
# The address that the Event service will be enabled on the validator
address: 0.0.0.0:31315
# total number of events that could be buffered without blocking the validator sends
buffersize: 100
# milliseconds timeout for producer to send an event.
# if < 0, if buffer full, unblocks immediately and not send
# if 0, if buffer full, will block and guarantee the event will be sent out
# if > 0, if buffer full, blocks till timeout
timeout: 10
# TLS Settings for p2p communications
tls:
enabled: false
cert:
file: testdata/server1.pem
key:
file: testdata/server1.key
# The server name use to verify the hostname returned by TLS handshake
server-host-override:
# PKI member services properties
pki:
eca:
paddr: localhost:50051
tca:
paddr: localhost:50551
tlsca:
paddr: localhost:50951
# Peer discovery settings. Controls how this peer discovers other peers
discovery:
# The root nodes are used for bootstrapping purposes, and generally supplied through ENV variables
rootnode:
# The duration of time between attempts to asks peers for their connected peers
period: 5s
## leaving this in for example of sub map entry
# testNodes:
# - node : 1
# ip : 127.0.0.1
# port : 30303
# - node : 2
# ip : 127.0.0.1
# port : 30303
# Should the discovered nodes and their reputations
# be stored in DB and persisted between restarts
persist: true
# if peer discovery is off
# the peer window will show
# only what retrieved by active
# peer [true/false]
enabled: true
# number of workers that
# tastes the peers for being
# online [1..10]
workers: 8
# the period in seconds with which the discovery
# tries to reconnect to successful nodes
# 0 means the nodes are not reconnected
touchPeriod: 600
# the maximum nuber of nodes to reconnect to
# -1 for unlimited
touchMaxNodes: 100
# Path on the file system where peer will store data
fileSystemPath: /var/openchain/production
### NOTE: The validator section below is not needed and will be removed - BN
###############################################################################
#
# Validator section
#
###############################################################################
validator:
enabled: false
address: 0.0.0.0:30304
# TLS Settings for p2p communications
tls:
enabled: false
cert:
file: testdata/server1.pem
key:
file: testdata/server1.key
# The server name use to verify the hostname returned by TLS handshake
server-host-override:
# Peer discovery settings. Controls how this peer discovers other peers
discovery:
# The root nodes are used for bootstrapping purposes, and generally supplied through ENV variables
rootnode:
###############################################################################
#
# VM section
#
###############################################################################
vm:
# Endpoint of the vm management system. For docker can be one of the following in general
# unix:///var/run/docker.sock
# http://localhost:4243
endpoint: unix:///var/run/docker.sock
###############################################################################
#
# Chaincode section
#
###############################################################################
chaincode:
# The id is used by the Chaincode stub to register the executing Chaincode ID with the Peerand is generally supplied through ENV variables
# the Path form of ID is provided when deploying the chaincode. The name is used for all other requests. The name is really a hashcode
# returned by the system in response to the deploy transaction. In development mode where user runs the chaincode, the name can be
# any string
id:
path:
name:
golang:
# This is the basis for the Golang Dockerfile. Additional commands will be appended depedendent upon the chaincode specification.
Dockerfile: |
from golang:1.5.1
ENV GO15VENDOREXPERIMENT=1
COPY src $GOPATH/src
WORKDIR $GOPATH
#timeout in millisecs for starting up a container and waiting for Register to come through. 1sec should be plenty for chaincode unit tests
startuptimeout: 1000
#timeout in millisecs for deploying chaincode from a remote repository.
deploytimeout: 30000
#mode - options are "dev", "net"
#dev - in dev mode, user runs the chaincode after starting validator from command line on local machine
#net - in net mode validator will run chaincode in a docker container
mode: net
installpath: /go/bin/
###############################################################################
#
# Ledger section - ledger configuration encompases both the blockchain
# and the state
#
###############################################################################
ledger:
blockchain:
# Define the genesis block
genesisBlock:
# Deploy chaincodes into the genesis block
# chaincode:
# path: github.com/openblockchain/obc-peer/openchain/example/chaincode/chaincode_example01
# type: GOLANG
# constructor:
# func: init
# args:
# - alice
# - "4"
# - bob
# - "10"
state:
# Control the number state deltas that are maintained. This takes additional
# disk space, but allow the state to be rolled backwards and forwards
# without the need to replay transactions.
deltaHistorySize: 500
# The data structure in which the state will be stored. Different data
# structures may offer different performance characteristics. Options are
# 'buckettree' and 'trie'. If not set, the default data structure is the
# 'buckettree'. This CANNOT be changed after the DB has been created.
dataStructure: buckettree
###############################################################################
#
# Security section -
#
###############################################################################
security:
enabled: false
# To enroll NVP or VP with Member Services PKI. These parameters are for
# 1 time use. They will not be valid the subsequent times without un-enroll
enrollID: nepumuk
enrollSecret: 9gvZQRwhUq9q
# To enable privacy and confidentiality of transactions (requires security to be enabled)
privacy: false