Reorganized extrafiles to prepare for non-rpmbuild build.

This commit is contained in:
Greg Szabo
2017-06-20 13:07:01 +00:00
parent 2efdd069c6
commit e280cbdead
19 changed files with 27 additions and 173 deletions
@@ -4,6 +4,7 @@ Priority: optional
Maintainer: Greg Szabo <greg@philosobear.com>
Build-Depends: debhelper (>=9)
Depends: tendermint (>=0.10.0)
Breaks: ethermint
Standards-Version: 3.9.6
Homepage: https://tendermint.com
Package: basecoin
@@ -20,30 +20,11 @@ set -e
case "$1" in
configure)
chown basecoin.basecoin /etc/basecoin
chown basecoin.basecoin /etc/basecoin/genesis.json
chown basecoin.basecoin /etc/basecoin/tendermint
chown basecoin.basecoin /etc/basecoin/tendermint/config.toml
test ! -f /etc/basecoin/priv_validator.json && tendermint gen_validator > /etc/basecoin/priv_validator.json && chmod 0400 /etc/basecoin/priv_validator.json && chown basecoin.basecoin /etc/basecoin/priv_validator.json
test ! -f /etc/basecoin/tendermint/priv_validator.json && tendermint gen_validator > /etc/basecoin/tendermint/priv_validator.json && chmod 0400 /etc/basecoin/tendermint/priv_validator.json && chown basecoin.basecoin /etc/basecoin/tendermint/priv_validator.json
tendermint_pubkey="`tendermint show_validator --home /etc/basecoin/tendermint --log_level error`"
chown basecoin.basecoin /etc/basecoin/tendermint/data
test ! -f /etc/basecoin/tendermint/genesis.json && cat << EOF > /etc/basecoin/tendermint/genesis.json
{
"genesis_time": "2017-06-10T03:37:03Z",
"chain_id": "my_chain_id",
"validators":
[
{
"pub_key": $tendermint_pubkey,
"amount":10,
"name":"my_testchain_node"
}
],
"app_hash": "",
"app_options": {}
}
EOF
chown basecoin.basecoin /etc/basecoin/tendermint/genesis.json
sudo -Hu basecoin basecoin init --home /etc/basecoin
#The above command generates a genesis.json file that contains validators. This is wrong, the validator part should be empty. https://github.com/tendermint/basecoin/issues/124
sudo -Hu basecoin tendermint init --home /etc/basecoin/tendermint
#The above command might need some kind of additional option in the future. https://github.com/tendermint/tendermint/issues/542
systemctl daemon-reload
systemctl enable basecoin
;;
@@ -28,7 +28,6 @@ case "$1" in
purge|remove|abort-install|disappear)
systemctl daemon-reload
# userdel basecoin
;;
*)
@@ -4,6 +4,7 @@ Priority: optional
Maintainer: Greg Szabo <greg@philosobear.com>
Build-Depends: debhelper (>=9)
Depends: tendermint (>=0.10.0)
Breaks: basecoin
Standards-Version: 3.9.6
Homepage: https://tendermint.com
Package: ethermint
@@ -22,37 +22,14 @@ case "$1" in
chown ethermint.ethermint /etc/ethermint
chown ethermint.ethermint /etc/ethermint/genesis.json
chown ethermint.ethermint /etc/ethermint/tendermint
chown ethermint.ethermint /etc/ethermint/tendermint/config.toml
chown ethermint.ethermint /etc/ethermint/keystore
chown ethermint.ethermint /etc/ethermint/keystore/UTC--2016-10-21T22-30-03.071787745Z--7eff122b94897ea5b0e2a9abf47b86337fafebdc
/usr/bin/ethermint --datadir /etc/ethermint init /etc/ethermint/genesis.json
chown -R ethermint.ethermint /etc/ethermint/ethermint
test ! -f /etc/ethermint/tendermint/priv_validator.json && tendermint gen_validator > /etc/ethermint/tendermint/priv_validator.json && chmod 0400 /etc/ethermint/tendermint/priv_validator.json && chown ethermint.ethermint /etc/ethermint/tendermint/priv_validator.json
tendermint_pubkey="`tendermint show_validator --home /etc/ethermint/tendermint --log_level error`"
chown ethermint.ethermint /etc/ethermint/tendermint/data
test ! -f /etc/ethermint/tendermint/genesis.json && cat << EOF > /etc/ethermint/tendermint/genesis.json
{
"genesis_time": "2017-06-10T03:37:03Z",
"chain_id": "my_chain_id",
"validators":
[
{
"pub_key": $tendermint_pubkey,
"amount":10,
"name":"my_testchain_node"
}
],
"app_hash": "",
"app_options": {}
}
EOF
chown ethermint.ethermint /etc/ethermint/tendermint/genesis.json
sudo -Hu ethermint /usr/bin/ethermint --datadir /etc/ethermint init /etc/ethermint/genesis.json
sudo -Hu ethermint tendermint init --home /etc/ethermint/tendermint
systemctl daemon-reload
systemctl enable ethermint
if [ -d /etc/ethermint/tendermint/data ]; then
service ethermint start
fi
;;
abort-upgrade|abort-remove|abort-deconfigure)
@@ -1,23 +0,0 @@
{
"genesis_time": "2017-06-10T03:37:03Z",
"chain_id": "my_chain_id",
"validators": [],
"app_hash": "",
"app_options": {
"accounts": [{
"name": "dev_money",
"address": "1B1BE55F969F54064628A63B9559E7C21C925165",
"pub_key": {
"type": "ed25519",
"data": "619D3678599971ED29C7529DDD4DA537B97129893598A17C82E3AC9A8BA95279"
},
"coins": [
{
"denom": "mycoin",
"amount": 9007199254740992
}
]
}]
}
}
@@ -1,16 +0,0 @@
# This is a TOML config file.
# For more information, see https://github.com/toml-lang/toml
proxy_app = "tcp://127.0.0.1:46658"
moniker = ""
fast_sync = true
db_backend = "leveldb"
log_level = "debug"
[rpc]
laddr = "tcp://0.0.0.0:46657"
[p2p]
laddr = "tcp://0.0.0.0:46656"
seeds = ""
@@ -1,16 +0,0 @@
# This is a TOML config file.
# For more information, see https://github.com/toml-lang/toml
proxy_app = "tcp://127.0.0.1:46658"
moniker = ""
fast_sync = true
db_backend = "leveldb"
log_level = "debug"
[rpc]
laddr = "tcp://0.0.0.0:46657"
[p2p]
laddr = "tcp://0.0.0.0:46656"
seeds = ""