Skip to content

Commit

Permalink
Merge pull request #13 from CudoVentures/12-gaiad-support
Browse files Browse the repository at this point in the history
12 gaiad support
  • Loading branch information
admcudo authored Nov 26, 2022
2 parents 76116c2 + 76bcf40 commit acc1b6f
Show file tree
Hide file tree
Showing 30 changed files with 799 additions and 254 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
/SRPMS/
/BUILD/
/buildtmp/
4 changes: 2 additions & 2 deletions SOURCES/[email protected]
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ Description=Cosmovisor Daemon for chain %i
After=network-online.target

[Service]
EnvironmentFile=-/etc/default/cosmovisor
EnvironmentFile=-/etc/default/cosmovisor@%i
User=%i
PermissionsStartOnly=true
ExecStart=/usr/bin/cosmovisor start --home /var/lib/%i/.%id --log_level ${DAEMON_LOGLEVEL}
ExecStart=/usr/bin/cosmovisor start --home ${DAEMON_HOME} --log_level ${DAEMON_LOGLEVEL}
Restart=always
RestartSec=3
LimitNOFILE=infinity
Expand Down
Binary file added SOURCES/cudos-noded-0.8.0.tar.gz
Binary file not shown.
9 changes: 9 additions & 0 deletions SOURCES/etc_default_cosmovisor-gaia
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
DAEMON_NAME=gaiad
DAEMON_HOME=/var/lib/gaia/.gaia
DAEMON_RESTART_AFTER_UPGRADE="true"
DAEMON_ALLOW_DOWNLOAD_BINARIES="false"
DAEMON_LOG_BUFFER_SIZE="512"
UNSAFE_SKIP_BACKUP="true"

DAEMON_LOGLEVEL=info

3 changes: 3 additions & 0 deletions SPECS/cosmovisor.spec
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@ cp ${RPM_SOURCE_DIR}/etc_profiled_cosmovisor.sh ${RPM_BUILD_ROOT}/etc/profile.d/
# Install systemd service files
cp ${RPM_SOURCE_DIR}/[email protected] ${RPM_BUILD_ROOT}/usr/lib/systemd/system/

%clean
rm -rf $RPM_BUILD_ROOT

%files
%defattr(-,root,root,-)
/etc/profile.d/cosmovisor.sh
Expand Down
2 changes: 1 addition & 1 deletion SPECS/cudos-network-mainnet.spec
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ ln -s /var/lib/cudos/cudos-data/cosmovisor/upgrades/v1.0 genesis
cd -

%clean
# rm -rf $RPM_BUILD_ROOT
rm -rf $RPM_BUILD_ROOT

%post
if [ $1 = "1" ]
Expand Down
2 changes: 1 addition & 1 deletion SPECS/cudos-network-private-testnet.spec
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ ln -s /var/lib/cudos/cudos-data/cosmovisor/upgrades/v0.8 genesis
cd -

%clean
# rm -rf $RPM_BUILD_ROOT
rm -rf $RPM_BUILD_ROOT

%post
if [ $1 = "1" ]
Expand Down
2 changes: 1 addition & 1 deletion SPECS/cudos-network-public-testnet.spec
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ ln -s /var/lib/cudos/cudos-data/cosmovisor/upgrades/v0.9 genesis
cd -

%clean
# rm -rf $RPM_BUILD_ROOT
rm -rf $RPM_BUILD_ROOT

%post
if [ $1 = "1" ]
Expand Down
80 changes: 57 additions & 23 deletions SPECS/cudos-noded-v0.8.0.spec
Original file line number Diff line number Diff line change
Expand Up @@ -15,61 +15,95 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# Runs the Cudos Node Daemon
#

Name: cudos-noded-v0.8.0
%global project_title Cudos
%global parent_url https://github.com/CudoVentures
%global project_name cudos-node

%global daemon_name cudos-noded
%global daemon_version v0.8.0
%global upgrade_name v0.8
%global obsoletes cudos-noded-v0.3

%global username cudos
%global data_directory cudos-data

#####################################################################
# Do not edit below this line

Name: %{daemon_name}-%{daemon_version}
Version: %{_versiontag}
Release: %{_releasetag}%{?dist}
Summary: Cudos Node v0.8.0 Binary Pack for System version %{version}
Summary: %{project_title} Node %{daemon_version} Binary Pack for System version %{version}

License: GPL3
URL: https://github.com/CudoVentures/cudos-node
Source0: cudos-noded-0.8.0.tar.gz
URL: %{parent_url}/%{project_name}

Requires: cudos-noded
Requires: %{daemon_name}
Requires: cosmovisor

Provides: libwasmvm.so()(64bit)

Obsoletes: %{obsoletes}

%description
Cudos Node binary and library
Installed into the Cosmovisor directories
System Version: %{_versiontag}

project_title: %{project_title}
parent_url: %{parent_url}
project_name: %{project_name}

daemon_name: %{daemon_name}
daemon_version: %{daemon_version}
upgrade_name: %{upgrade_name}
obsoletes: %{obsoletes}

username: %{username}
data_directory: %{data_directory}

This package contains the files common
to all versions of the %{project_name}
node software

NB This package does not contain any
genesis or node configuration information

%pre
getent group cudos >/dev/null || echo " Create Group cudos" || groupadd -r cudos || :
getent passwd cudos >/dev/null || echo " Create User cudos" || useradd -c "Cudos User" -g cudos -s /bin/bash -r -m -d /var/lib/cudos cudos 2> /dev/null || :
getent group %{username} >/dev/null || echo " Create Group %{username}" || groupadd -r %{username} || :
getent passwd %{username} >/dev/null || echo " Create User %{username}" || useradd -c "%{project_title} User" -g %{username} -s /bin/bash -r -m -d /var/lib/%{username} %{username} 2> /dev/null || :

%prep
echo -e "\n\n=== prep section ===\n\n"
# Unpack tarball
rm -rf CudosNode CudosBuilders CudosGravityBridge
tar xzf %{SOURCE0}
rm -rf %{project_name}
git clone -b %{daemon_version} %{parent_url}/%{project_name}

%build
echo -e "\n\n=== build section ===\n\n"
export GOPATH="${RPM_BUILD_DIR}/go"
cd CudosNode
make
cd %{project_name}
echo -e "\n\n***** Build %{project_title} Daemon *****\n\n"
make install
echo -e "\n\n***** Run %{project_title} Daemon Self Test *****\n\n"
make test || true

%install
echo -e "\n\n=== install section ===\n\n"

# Make the fixed directory structure
mkdir -p ${RPM_BUILD_ROOT}/var/lib/cudos/cudos-data/cosmovisor/upgrades/v0.8/bin/
mkdir -p ${RPM_BUILD_ROOT}/var/lib/cudos/cudos-data/cosmovisor/upgrades/v0.8/lib/
mkdir -p ${RPM_BUILD_ROOT}/var/lib/%{username}/%{data_directory}/cosmovisor/upgrades/%{upgrade_name}/bin/
mkdir -p ${RPM_BUILD_ROOT}/var/lib/%{username}/%{data_directory}/cosmovisor/upgrades/%{upgrade_name}/lib/

# Install the newly built binaries
cp -v ${RPM_BUILD_DIR}/go/bin/cudos-noded ${RPM_BUILD_ROOT}/var/lib/cudos/cudos-data/cosmovisor/upgrades/v0.8/bin/
cp -v ${RPM_BUILD_DIR}/go/pkg/mod/github.com/'!cosm!wasm'/wasmvm*/api/libwasmvm*.so ${RPM_BUILD_ROOT}/var/lib/cudos/cudos-data/cosmovisor/upgrades/v0.8/lib/
chmod 644 ${RPM_BUILD_ROOT}/var/lib/cudos/cudos-data/cosmovisor/upgrades/v0.8/lib/*.so
cp -v ${RPM_BUILD_DIR}/go/bin/%{daemon_name} ${RPM_BUILD_ROOT}/var/lib/%{username}/%{data_directory}/cosmovisor/upgrades/%{upgrade_name}/bin/
cp -v ${RPM_BUILD_DIR}/go/pkg/mod/github.com/'!cosm!wasm'/wasmvm*/api/libwasmvm*.so ${RPM_BUILD_ROOT}/var/lib/%{username}/%{data_directory}/cosmovisor/upgrades/%{upgrade_name}/lib/
chmod 644 ${RPM_BUILD_ROOT}/var/lib/%{username}/%{data_directory}/cosmovisor/upgrades/%{upgrade_name}/lib/*.so

%clean
rm -rf $RPM_BUILD_ROOT

%files
%defattr(-,cudos,cudos,-)
/var/lib/cudos/cudos-data/cosmovisor/*
%defattr(-,%{username},%{username},-)
/var/lib/%{username}/%{data_directory}/cosmovisor/*
%doc

%changelog
80 changes: 57 additions & 23 deletions SPECS/cudos-noded-v0.9.0.spec
Original file line number Diff line number Diff line change
Expand Up @@ -15,61 +15,95 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# Runs the Cudos Node Daemon
#

Name: cudos-noded-v0.9.0
%global project_title Cudos
%global parent_url https://github.com/CudoVentures
%global project_name cudos-node

%global daemon_name cudos-noded
%global daemon_version v0.9.0
%global upgrade_name v0.9
%global obsoletes cudos-noded-v0.0.0

%global username cudos
%global data_directory cudos-data

#####################################################################
# Do not edit below this line

Name: %{daemon_name}-%{daemon_version}
Version: %{_versiontag}
Release: %{_releasetag}%{?dist}
Summary: Cudos Node v0.9.0 Binary Pack for System version %{version}
Summary: %{project_title} Node %{daemon_version} Binary Pack for System version %{version}

License: GPL3
URL: https://github.com/CudoVentures/cudos-node
Source0: cudos-noded-0.9.0.tar.gz
URL: %{parent_url}/%{project_name}

Requires: cudos-noded
Requires: %{daemon_name}
Requires: cosmovisor

Provides: libwasmvm.so()(64bit)

Obsoletes: %{obsoletes}

%description
Cudos Node binary and library
Installed into the Cosmovisor directories
System Version: %{_versiontag}

project_title: %{project_title}
parent_url: %{parent_url}
project_name: %{project_name}

daemon_name: %{daemon_name}
daemon_version: %{daemon_version}
upgrade_name: %{upgrade_name}
obsoletes: %{obsoletes}

username: %{username}
data_directory: %{data_directory}

This package contains the files common
to all versions of the %{project_name}
node software

NB This package does not contain any
genesis or node configuration information

%pre
getent group cudos >/dev/null || echo " Create Group cudos" || groupadd -r cudos || :
getent passwd cudos >/dev/null || echo " Create User cudos" || useradd -c "Cudos User" -g cudos -s /bin/bash -r -m -d /var/lib/cudos cudos 2> /dev/null || :
getent group %{username} >/dev/null || echo " Create Group %{username}" || groupadd -r %{username} || :
getent passwd %{username} >/dev/null || echo " Create User %{username}" || useradd -c "%{project_title} User" -g %{username} -s /bin/bash -r -m -d /var/lib/%{username} %{username} 2> /dev/null || :

%prep
echo -e "\n\n=== prep section ===\n\n"
# Unpack tarball
rm -rf CudosNode CudosBuilders CudosGravityBridge
tar xzf %{SOURCE0}
rm -rf %{project_name}
git clone -b %{daemon_version} %{parent_url}/%{project_name}

%build
echo -e "\n\n=== build section ===\n\n"
export GOPATH="${RPM_BUILD_DIR}/go"
cd CudosNode
make
cd %{project_name}
echo -e "\n\n***** Build %{project_title} Daemon *****\n\n"
make install
echo -e "\n\n***** Run %{project_title} Daemon Self Test *****\n\n"
make test || true

%install
echo -e "\n\n=== install section ===\n\n"

# Make the fixed directory structure
mkdir -p ${RPM_BUILD_ROOT}/var/lib/cudos/cudos-data/cosmovisor/upgrades/v0.9/bin/
mkdir -p ${RPM_BUILD_ROOT}/var/lib/cudos/cudos-data/cosmovisor/upgrades/v0.9/lib/
mkdir -p ${RPM_BUILD_ROOT}/var/lib/%{username}/%{data_directory}/cosmovisor/upgrades/%{upgrade_name}/bin/
mkdir -p ${RPM_BUILD_ROOT}/var/lib/%{username}/%{data_directory}/cosmovisor/upgrades/%{upgrade_name}/lib/

# Install the newly built binaries
cp -v ${RPM_BUILD_DIR}/go/bin/cudos-noded ${RPM_BUILD_ROOT}/var/lib/cudos/cudos-data/cosmovisor/upgrades/v0.9/bin/
cp -v ${RPM_BUILD_DIR}/go/pkg/mod/github.com/'!cosm!wasm'/wasmvm*/api/libwasmvm*.so ${RPM_BUILD_ROOT}/var/lib/cudos/cudos-data/cosmovisor/upgrades/v0.9/lib/
chmod 644 ${RPM_BUILD_ROOT}/var/lib/cudos/cudos-data/cosmovisor/upgrades/v0.9/lib/*.so
cp -v ${RPM_BUILD_DIR}/go/bin/%{daemon_name} ${RPM_BUILD_ROOT}/var/lib/%{username}/%{data_directory}/cosmovisor/upgrades/%{upgrade_name}/bin/
cp -v ${RPM_BUILD_DIR}/go/pkg/mod/github.com/'!cosm!wasm'/wasmvm*/api/libwasmvm*.so ${RPM_BUILD_ROOT}/var/lib/%{username}/%{data_directory}/cosmovisor/upgrades/%{upgrade_name}/lib/
chmod 644 ${RPM_BUILD_ROOT}/var/lib/%{username}/%{data_directory}/cosmovisor/upgrades/%{upgrade_name}/lib/*.so

%clean
rm -rf $RPM_BUILD_ROOT

%files
%defattr(-,cudos,cudos,-)
/var/lib/cudos/cudos-data/cosmovisor/*
%defattr(-,%{username},%{username},-)
/var/lib/%{username}/%{data_directory}/cosmovisor/*
%doc

%changelog
75 changes: 0 additions & 75 deletions SPECS/cudos-noded-v1.0.0.spec

This file was deleted.

Loading

0 comments on commit acc1b6f

Please sign in to comment.