-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
25: OP-1964: Adding network_configs to change download location source for protocol versions. r=sacherjj a=sacherjj Using network_configs folder in debian for allowing multiple network names and source URLs. This will allow others to submit PRs to allow using the launcher package to pull configs and binaries from other networks. Also updated config_from_example.sh to allow a second argument to specify IP for NAT installs or when external auto-detection fails. Added check that these are run as `casper` user to eliminate permissions issues when this is not done. Small fix from clippy update. Co-authored-by: Joe Sacher <[email protected]>
- Loading branch information
Showing
7 changed files
with
217 additions
and
51 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
[package] | ||
name = "casper-node-launcher" | ||
version = "0.3.2" | ||
authors = ["Fraser Hutchison <[email protected]>"] | ||
version = "0.3.3" | ||
authors = ["Fraser Hutchison <[email protected]>", "Joe Sacher <[email protected]>"] | ||
edition = "2018" | ||
description = "A binary which runs and upgrades the casper-node of the Casper network" | ||
readme = "README.md" | ||
|
@@ -36,6 +36,7 @@ assets = [ | |
["./resources/BIN_README.md", "/var/lib/casper/bin/README.md", "755"], | ||
["./resources/maintainer_scripts/logrotate.d/casper-node", "/etc/logrotate.d/casper-node", "644"], | ||
["./resources/maintainer_scripts/pull_casper_node_version.sh", "/etc/casper/pull_casper_node_version.sh", "755"], | ||
["./resources/maintainer_scripts/network_configs/*", "/etc/casper/network_configs/", "644"], | ||
["./resources/maintainer_scripts/delete_local_db.sh", "/etc/casper/delete_local_db.sh", "755"], | ||
["./resources/maintainer_scripts/config_from_example.sh", "/etc/casper/config_from_example.sh", "755"], | ||
["./resources/DEB_README.md", "/etc/casper/README.md", "644"], | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
# Network Configurations | ||
|
||
Network configurations should be of the format: | ||
``` | ||
SOURCE_URL=<url for packages> | ||
NETWORK_NAME=<name of network> | ||
``` | ||
It is recommended that network_name used is the same as the <network_name>.conf. This will be executed as | ||
`source "$DIR/network_configs/<config_file>.conf` to load these variables. | ||
|
||
## Usage | ||
|
||
These configurations will be sent to `pull_casper_node_version.sh` as an argument. | ||
|
||
The target URL is expected to serve HTTP access to `<url>/<network_name>/<protocol_version>/[bin.tar.gz|config.tar.gz]` | ||
|
||
Example: | ||
`sudo -u casper pull_casper_node_version.sh casper.conf 1_0_0` | ||
|
||
With `casper.conf` of: | ||
``` | ||
SOURCE_URL=genesis.casperlabs.io | ||
NETWORK_NAME=casper | ||
``` | ||
|
||
Will perform: | ||
``` | ||
curl -JLO genesis.casperlabs.io/casper/1_0_0/bin.tar.gz | ||
curl -JLO genesis.casperlabs.io/casper/1_0_0/config.tar.gz | ||
``` | ||
|
||
`config.tar.gz` is decompressed into `/etc/casper/<protocol_version>`. | ||
`bin.tar.gz` is decompressed into `/var/lib/casper/<protocol_version>`. | ||
|
||
The script will error if protocol versions already exist. | ||
|
||
## Packaging | ||
|
||
With merges to `master`, `release-*` and `dev` branches in the `casper-node` repo, the artifacts are created in | ||
`genesis.casperlabs.io/drone/<git_hash>/<protocol version>/[bin.tar.gz|config.tar.gz]`. | ||
|
||
You may also pull down the artifacts for a given network and modify to stage a new network. | ||
If you want to launch a network with the same software version of `casper`, you could pull down the `bin.tar.gz` and | ||
use as is. However, your `config.tar.gz` would need modified. | ||
|
||
``` | ||
mkdir config | ||
curl -JLO genesis.casperlabs.io/casper/1_0_0/bin.tar.gz | ||
curl -JLO genesis.casperlabs.io/casper/1_0_0/config.tar.gz | ||
mv config.tar.gz config_old.tar.gz | ||
cd config | ||
tar -xzvf ../config_old.tar.gz | ||
``` | ||
|
||
You would need to customize `chainspec.toml` with a new network name and activation_point timestamp. | ||
You would need to customize `config-example.toml` with new known_addresses. | ||
|
||
Once all the configuration changes are done. Create a new config.tar.gz from within the config directory. | ||
|
||
``` | ||
tar -czvf ../config.tar.gz . | ||
``` | ||
|
||
Now upload `bin.tar.gz` and `config.tar.gz` to your `<url>/<network>/<protocol_version>` location. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
SOURCE_URL=genesis.casperlabs.io | ||
NETWORK_NAME=casper |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters