Skip to content

Commit 29a09f2

Browse files
committed
improvements
Signed-off-by: Andrey Kononykhin <andkononykhin@gmail.com>
1 parent 13ec953 commit 29a09f2

File tree

2 files changed

+34
-9
lines changed

2 files changed

+34
-9
lines changed

deployment/scripts/update_peers

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
#!/bin/bash
2+
# Copyright 2020 DSR Corporation
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
16+
set -eu
17+
set -o pipefail
18+
19+
CONFIG_FILE="$HOME/.dcld/config/config.toml"
20+
PERSISTENT_PEERS_FILE="${1:-./persistent_peers.txt}"
21+
PERSISTENT_PEERS="$(cat $PERSISTENT_PEERS_FILE | head -n1)"
22+
23+
sed -i -r "s~^persistent_peers = .*~persistent_peers = \"$PERSISTENT_PEERS\"~" "$CONFIG_FILE"
24+
25+
echo "Updated"

docs/running-node.md

+9-9
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ $ sudo rm -f "$(which dcld)" "$(which dclcli)"
7272
* Get setup scripts either from [release page](https://github.com/zigbee-alliance/distributed-compliance-ledger/releases) or
7373
from [repository](../deployment/scripts) if you need latest development version.
7474
* (for validator and observer) Get the running DCLedegr network data:
75-
* `genesis.json` can be found in a `<chain-id>` sub-directory of the [persistent_chains](../deployment/persistent_chains) folder and `persistent_peers.txt`
75+
7676
* `persistent_peers.txt`: that file may be published there as well or can be requested from the DCLedger network administrators otherwise
7777

7878
<details>
@@ -81,15 +81,15 @@ $ sudo rm -f "$(which dcld)" "$(which dclcli)"
8181

8282
```bash
8383
# release artifacts
84-
curl -O https://github.com/zigbee-alliance/distributed-compliance-ledger/releases/download/<release>/dclcli
85-
curl -O https://github.com/zigbee-alliance/distributed-compliance-ledger/releases/download/<release>/dcld
86-
curl -O https://github.com/zigbee-alliance/distributed-compliance-ledger/releases/download/<release>/dcld.service
87-
curl -O https://github.com/zigbee-alliance/distributed-compliance-ledger/releases/download/<release>/run_dcl_node
84+
curl -L -O https://github.com/zigbee-alliance/distributed-compliance-ledger/releases/download/<release>/dclcli
85+
curl -L -O https://github.com/zigbee-alliance/distributed-compliance-ledger/releases/download/<release>/dcld
86+
curl -L -O https://github.com/zigbee-alliance/distributed-compliance-ledger/releases/download/<release>/dcld.service
87+
curl -L -O https://github.com/zigbee-alliance/distributed-compliance-ledger/releases/download/<release>/run_dcl_node
8888

8989
# OR latest dev version in case of some not yet released improvements
90-
curl -O https://raw.githubusercontent.com/zigbee-alliance/distributed-compliance-ledger/master/deployment/scripts/run_dcl_node
90+
curl -L -O https://raw.githubusercontent.com/zigbee-alliance/distributed-compliance-ledger/master/deployment/scripts/run_dcl_node
9191

92-
curl -O https://raw.githubusercontent.com/zigbee-alliance/distributed-compliance-ledger/master/deployment/persistent_chains/<chain-id>/genesis.json
92+
curl -L -O https://raw.githubusercontent.com/zigbee-alliance/distributed-compliance-ledger/master/deployment/persistent_chains/<chain-id>/genesis.json
9393
```
9494

9595
</p>
@@ -105,9 +105,9 @@ curl -O https://raw.githubusercontent.com/zigbee-alliance/distributed-compliance
105105
<p>
106106

107107
```bash
108-
$ sudo cp ./dclcli ./dcld -t /usr/bin
109-
$ sudo chmod u+x /usr/bin/dclcli /usr/bin/dcld
108+
$ sudo cp -f ./dclcli ./dcld -t /usr/bin
110109
$ sudo chown ubuntu /usr/bin/dclcli /usr/bin/dcld
110+
$ sudo chmod u+x /usr/bin/dclcli /usr/bin/dcld
111111
```
112112

113113
</p>

0 commit comments

Comments
 (0)