Skip to content

Commit 1fea149

Browse files
authored
Merge pull request #35 from oracleNetworkProtocol/sc
add cosmovisor
2 parents 4782ded + 81a7bd5 commit 1fea149

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+5083
-95
lines changed

Dockerfile

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,32 @@
11
# docker build -t plugchain .
2-
# Server:
32

43
#从 golang:alpine 映像开始构建镜像。
54
FROM golang:alpine AS build-env
65

6+
#指定维护者信息
7+
# MAINTAINER
8+
79
# 安装最低限度的必要依赖项
8-
ENV PACKAGES curl make git libc-dev bash gcc linux-headers eudev-dev
10+
ENV PACKAGES curl make git libc-dev bash gcc linux-headers eudev-dev jq
911
RUN sed -i 's/https/http/' /etc/apk/repositories \
1012
&& apk add --no-cache $PACKAGES
13+
RUN mkdir /lib64 && ln -s /lib/libc.musl-x86_64.so.1 /lib64/ld-linux-x86-64.so.2
1114

1215
#设置工作目录
13-
WORKDIR /code
16+
WORKDIR /plugchain
1417

1518
#将 . 项目中的当前目录复制到 . 镜像中的工作目录。
1619
COPY . .
1720

18-
RUN GOPROXY=https://goproxy.io make install
21+
#设置代理
22+
ENV GOPROXY=https://proxy.golang.com.cn,direct
23+
24+
#编译程序
25+
RUN make install
26+
27+
RUN cd cosmovisor && make install && cd -
28+
29+
#暴露端口
30+
# EXPOSE 26656
1931

2032
# CMD ["plugchaind"]

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/make -f
22

3-
AppVersion ?= $(shell echo $(shell git describe --tags `git rev-list --tags="v*" --max-count=1`) | sed 's/^v//')
3+
AppVersion ?= $(shell echo $(shell git describe --tags) | sed 's/^v//')
44
COMMIT := $(shell git log -1 --format='%H')
55
TMVERSION := $(shell go list -m github.com/tendermint/tendermint | sed 's:.* ::')
66
LEDGER_ENABLED ?= true

app/app.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -577,6 +577,10 @@ func New(
577577

578578
app.SetEndBlocker(app.EndBlocker)
579579

580+
app.RegisterUpgradePlan("v1.2", &store.StoreUpgrades{}, func(ctx sdk.Context, _ upgradetypes.Plan, _ module.VersionMap) (module.VersionMap, error) {
581+
return app.mm.GetVersionMap(), nil
582+
})
583+
580584
if loadLatest {
581585
if err := app.LoadLatestVersion(); err != nil {
582586
tmos.Exit(err.Error())

cosmovisor/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/cosmovisor

cosmovisor/CHANGELOG.md

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
<!--
2+
Guiding Principles:
3+
4+
Changelogs are for humans, not machines.
5+
There should be an entry for every single version.
6+
The same types of changes should be grouped.
7+
Versions and sections should be linkable.
8+
The latest version comes first.
9+
The release date of each version is displayed.
10+
Mention whether you follow Semantic Versioning.
11+
12+
Usage:
13+
14+
Change log entries are to be added to the Unreleased section under the
15+
appropriate stanza (see below). Each entry should ideally include a tag and
16+
the Github issue reference in the following format:
17+
18+
* (<tag>) \#<issue-number> message
19+
20+
The issue numbers will later be link-ified during the release process so you do
21+
not have to worry about including a link manually, but you can if you wish.
22+
23+
Types of changes (Stanzas):
24+
25+
"Features" for new features.
26+
"Improvements" for changes in existing functionality.
27+
"Deprecated" for soon-to-be removed features.
28+
"Bug Fixes" for any bug fixes.
29+
"Client Breaking" for breaking Protobuf, gRPC and REST routes used by end-users.
30+
"CLI Breaking" for breaking CLI commands.
31+
"API Breaking" for breaking exported APIs used by developers building on SDK.
32+
Ref: https://keepachangelog.com/en/1.0.0/
33+
-->
34+
35+
# Changelog
36+
37+
## [Unreleased]
38+
<!-- NOTE: when creating a new release, update cosmovisor/cmd/cosmovisor/cmd/version.go:Version -->
39+
40+
## v1.1.0 2022-10-02
41+
42+
### Features
43+
44+
* [\#10285](https://github.com/cosmos/cosmos-sdk/pull/10316) Added `run` command to run the associated app.
45+
* [\#10533](https://github.com/cosmos/cosmos-sdk/pull/10649) Added environmental variable `DAEMON_BACKUP_DIR` to allow node to set a custom backup directory.
46+
47+
### Features
48+
49+
* [\#10649](https://github.com/cosmos/cosmos-sdk/pull/10649) Customize backup directory. When `DAEMON_BACKUP_DIR` env variable is set, cosmovisor will backup the app data directory in that directory before running the update.
50+
51+
### Deprecated
52+
53+
* [\#10285](https://github.com/cosmos/cosmos-sdk/pull/10316) Running `cosmovisor` without the `run` argument.
54+
55+
### Bug Fixes
56+
57+
* [\#10458](https://github.com/cosmos/cosmos-sdk/pull/10458) Fix version when using 'go install github.com/cosmos/cosmos-sdk/cosmovisor/cmd/[email protected]' to install cosmovisor.
58+
59+
## v1.0.0 2021-09-30
60+
61+
### Features
62+
63+
* [\#8590](https://github.com/cosmos/cosmos-sdk/pull/8590) File watcher for cosmovisor. Instead of parsing logs from stdin and stderr, we watch the `<DAEMON_HOME>/data/upgrade-info.json` file updates using polling mechanism.
64+
* [\#9999](https://github.com/cosmos/cosmos-sdk/pull/10103) Added `version` command that returns the cosmovisor version and the application version.
65+
* [\#9973](https://github.com/cosmos/cosmos-sdk/pull/10056) Added support for pre-upgrade command in Cosmovisor to be called before the binary is upgraded. Added new environmental variable `DAEMON_PREUPGRADE_MAX_RETRIES` that holds the maximum number of times to reattempt pre-upgrade before failing.
66+
* [\#10126](https://github.com/cosmos/cosmos-sdk/pull/10229) Added `help`.
67+
68+
### Improvements
69+
70+
* [\#10018](https://github.com/cosmos/cosmos-sdk/pull/10018) Strict boolean argument parsing: cosmovisor will fail if user will not set correctly a boolean variable. Correct values are: "true", "false", "" (not setting) - all case not sensitive.
71+
* [\#10036](https://github.com/cosmos/cosmos-sdk/pull/10036) Improve logs when downloading the binary.
72+
* [\#10217](https://github.com/cosmos/cosmos-sdk/pull/10217) Replacing logging to use zerolog.
73+
74+
### CLI Breaking
75+
76+
* [\#10128](https://github.com/cosmos/cosmos-sdk/pull/10128) Change default value of `DAEMON_RESTART_AFTER_UPGRADE` to `true`.
77+
78+
## v0.1 2021-08-06
79+
80+
This is the first release and we started this changelog on 2021-07-01. See the [README](https://github.com/cosmos/cosmos-sdk/blob/release/cosmovisor/v0.1.x/cosmovisor/CHANGELOG.md) file for the full list of features.
81+
82+
## Features
83+
84+
* [\#9652](https://github.com/cosmos/cosmos-sdk/pull/9652) Add backup option for cosmovisor.

cosmovisor/Makefile

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#!/usr/bin/make -f
2+
3+
all: install
4+
5+
install:
6+
go build -o $(GOPATH)/bin/ ./cmd/cosmovisor
7+
8+
.PHONY: all install

0 commit comments

Comments
 (0)