-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #270 from UnUniFi/develop
merge Develop
- Loading branch information
Showing
30 changed files
with
851 additions
and
70 deletions.
There are no files selected for viewing
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,49 @@ | ||
FROM ubuntu:20.04 | ||
|
||
RUN apt update -y && apt upgrade -y && \ | ||
apt install -y sudo curl git jq wget vim make build-essential | ||
|
||
|
||
ENV GO_VERSION 1.20 | ||
RUN wget -O go.tgz https://golang.org/dl/go${GO_VERSION}.linux-amd64.tar.gz && \ | ||
tar -C /usr/local -xzf go.tgz && \ | ||
rm go.tgz | ||
ENV PATH $PATH:/usr/local/go/bin | ||
|
||
RUN echo 'PATH=$PATH:/usr/local/go/bin' >> $HOME/.bashrc && \ | ||
echo 'PATH=$PATH:~/go/bin' >> $HOME/.bashrc | ||
|
||
# RUN curl -fsSL https://deb.nodesource.com/setup_16.x | sudo -E bash - && sudo apt-get install -y nodejs | ||
|
||
RUN useradd -m docker && echo "docker:docker" | chpasswd && adduser docker sudo | ||
|
||
WORKDIR $HOME | ||
|
||
ENV CHAIN_REPO https://github.com/UnUniFi/chain | ||
ENV CHAIN_REPO_BRANCHE=v3.2.0 | ||
ENV TARGET=ununifid | ||
ENV TARGET_HOME=.ununifi | ||
ENV CHAIN_ID=test | ||
|
||
ENV DAEMON_NAME=$TARGET | ||
ENV DAEMON_HOME=/root/$TARGET_HOME | ||
ENV DAEMON_ALLOW_DOWNLOAD_BINARIES=true | ||
ENV DAEMON_LOG_BUFFER_SIZE=512 | ||
ENV DAEMON_RESTART_AFTER_UPGRADE=true | ||
ENV UNSAFE_SKIP_BACKUP=true | ||
|
||
|
||
|
||
RUN git clone $CHAIN_REPO chain_repo && \ | ||
cd chain_repo && \ | ||
git checkout $CHAIN_REPO_BRANCHE && \ | ||
make install | ||
|
||
RUN go install github.com/cosmos/cosmos-sdk/cosmovisor/cmd/cosmovisor@v1.0.0 | ||
RUN mkdir -p $DAEMON_HOME/cosmovisor && \ | ||
mkdir -p $DAEMON_HOME/cosmovisor/genesis && \ | ||
mkdir -p $DAEMON_HOME/cosmovisor/genesis/bin && \ | ||
mkdir -p $DAEMON_HOME/cosmovisor/upgrades && \ | ||
cp ~/go/bin/$DAEMON_NAME $DAEMON_HOME/cosmovisor/genesis/bin | ||
|
||
CMD ["bash"] |
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,49 @@ | ||
FROM ubuntu:20.04 | ||
|
||
RUN apt update -y && apt upgrade -y && \ | ||
apt install -y sudo curl git jq wget vim make build-essential | ||
|
||
|
||
ENV GO_VERSION 1.20 | ||
RUN wget -O go.tgz https://golang.org/dl/go${GO_VERSION}.linux-amd64.tar.gz && \ | ||
tar -C /usr/local -xzf go.tgz && \ | ||
rm go.tgz | ||
ENV PATH $PATH:/usr/local/go/bin | ||
|
||
RUN echo 'PATH=$PATH:/usr/local/go/bin' >> $HOME/.bashrc && \ | ||
echo 'PATH=$PATH:~/go/bin' >> $HOME/.bashrc | ||
|
||
# RUN curl -fsSL https://deb.nodesource.com/setup_16.x | sudo -E bash - && sudo apt-get install -y nodejs | ||
|
||
RUN useradd -m docker && echo "docker:docker" | chpasswd && adduser docker sudo | ||
|
||
WORKDIR $HOME | ||
|
||
ENV CHAIN_REPO https://github.com/UnUniFi/chain | ||
ENV CHAIN_REPO_BRANCHE=v3.2.1 | ||
ENV TARGET=ununifid | ||
ENV TARGET_HOME=.ununifi | ||
ENV CHAIN_ID=test | ||
|
||
ENV DAEMON_NAME=$TARGET | ||
ENV DAEMON_HOME=/root/$TARGET_HOME | ||
ENV DAEMON_ALLOW_DOWNLOAD_BINARIES=true | ||
ENV DAEMON_LOG_BUFFER_SIZE=512 | ||
ENV DAEMON_RESTART_AFTER_UPGRADE=true | ||
ENV UNSAFE_SKIP_BACKUP=true | ||
|
||
|
||
|
||
RUN git clone $CHAIN_REPO chain_repo && \ | ||
cd chain_repo && \ | ||
git checkout $CHAIN_REPO_BRANCHE && \ | ||
make install | ||
|
||
RUN go install github.com/cosmos/cosmos-sdk/cosmovisor/cmd/cosmovisor@v1.0.0 | ||
RUN mkdir -p $DAEMON_HOME/cosmovisor && \ | ||
mkdir -p $DAEMON_HOME/cosmovisor/genesis && \ | ||
mkdir -p $DAEMON_HOME/cosmovisor/genesis/bin && \ | ||
mkdir -p $DAEMON_HOME/cosmovisor/upgrades && \ | ||
cp ~/go/bin/$DAEMON_NAME $DAEMON_HOME/cosmovisor/genesis/bin | ||
|
||
CMD ["bash"] |
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,49 @@ | ||
FROM ubuntu:20.04 | ||
|
||
RUN apt update -y && apt upgrade -y && \ | ||
apt install -y sudo curl git jq wget vim make build-essential | ||
|
||
|
||
ENV GO_VERSION 1.20 | ||
RUN wget -O go.tgz https://golang.org/dl/go${GO_VERSION}.linux-amd64.tar.gz && \ | ||
tar -C /usr/local -xzf go.tgz && \ | ||
rm go.tgz | ||
ENV PATH $PATH:/usr/local/go/bin | ||
|
||
RUN echo 'PATH=$PATH:/usr/local/go/bin' >> $HOME/.bashrc && \ | ||
echo 'PATH=$PATH:~/go/bin' >> $HOME/.bashrc | ||
|
||
# RUN curl -fsSL https://deb.nodesource.com/setup_16.x | sudo -E bash - && sudo apt-get install -y nodejs | ||
|
||
RUN useradd -m docker && echo "docker:docker" | chpasswd && adduser docker sudo | ||
|
||
WORKDIR $HOME | ||
|
||
ENV CHAIN_REPO https://github.com/UnUniFi/chain | ||
ENV CHAIN_REPO_BRANCHE=v3.2.2-query | ||
ENV TARGET=ununifid | ||
ENV TARGET_HOME=.ununifi | ||
ENV CHAIN_ID=test | ||
|
||
ENV DAEMON_NAME=$TARGET | ||
ENV DAEMON_HOME=/root/$TARGET_HOME | ||
ENV DAEMON_ALLOW_DOWNLOAD_BINARIES=true | ||
ENV DAEMON_LOG_BUFFER_SIZE=512 | ||
ENV DAEMON_RESTART_AFTER_UPGRADE=true | ||
ENV UNSAFE_SKIP_BACKUP=true | ||
|
||
|
||
|
||
RUN git clone $CHAIN_REPO chain_repo && \ | ||
cd chain_repo && \ | ||
git checkout $CHAIN_REPO_BRANCHE && \ | ||
make install | ||
|
||
RUN go install github.com/cosmos/cosmos-sdk/cosmovisor/cmd/cosmovisor@v1.0.0 | ||
RUN mkdir -p $DAEMON_HOME/cosmovisor && \ | ||
mkdir -p $DAEMON_HOME/cosmovisor/genesis && \ | ||
mkdir -p $DAEMON_HOME/cosmovisor/genesis/bin && \ | ||
mkdir -p $DAEMON_HOME/cosmovisor/upgrades && \ | ||
cp ~/go/bin/$DAEMON_NAME $DAEMON_HOME/cosmovisor/genesis/bin | ||
|
||
CMD ["bash"] |
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,49 @@ | ||
FROM ubuntu:20.04 | ||
|
||
RUN apt update -y && apt upgrade -y && \ | ||
apt install -y sudo curl git jq wget vim make build-essential | ||
|
||
|
||
ENV GO_VERSION 1.20 | ||
RUN wget -O go.tgz https://golang.org/dl/go${GO_VERSION}.linux-amd64.tar.gz && \ | ||
tar -C /usr/local -xzf go.tgz && \ | ||
rm go.tgz | ||
ENV PATH $PATH:/usr/local/go/bin | ||
|
||
RUN echo 'PATH=$PATH:/usr/local/go/bin' >> $HOME/.bashrc && \ | ||
echo 'PATH=$PATH:~/go/bin' >> $HOME/.bashrc | ||
|
||
# RUN curl -fsSL https://deb.nodesource.com/setup_16.x | sudo -E bash - && sudo apt-get install -y nodejs | ||
|
||
RUN useradd -m docker && echo "docker:docker" | chpasswd && adduser docker sudo | ||
|
||
WORKDIR $HOME | ||
|
||
ENV CHAIN_REPO https://github.com/UnUniFi/chain | ||
ENV CHAIN_REPO_BRANCHE=v4.0.0 | ||
ENV TARGET=ununifid | ||
ENV TARGET_HOME=.ununifi | ||
ENV CHAIN_ID=test | ||
|
||
ENV DAEMON_NAME=$TARGET | ||
ENV DAEMON_HOME=/root/$TARGET_HOME | ||
ENV DAEMON_ALLOW_DOWNLOAD_BINARIES=true | ||
ENV DAEMON_LOG_BUFFER_SIZE=512 | ||
ENV DAEMON_RESTART_AFTER_UPGRADE=true | ||
ENV UNSAFE_SKIP_BACKUP=true | ||
|
||
|
||
|
||
RUN git clone $CHAIN_REPO chain_repo && \ | ||
cd chain_repo && \ | ||
git checkout $CHAIN_REPO_BRANCHE && \ | ||
make install | ||
|
||
RUN go install github.com/cosmos/cosmos-sdk/cosmovisor/cmd/cosmovisor@v1.0.0 | ||
RUN mkdir -p $DAEMON_HOME/cosmovisor && \ | ||
mkdir -p $DAEMON_HOME/cosmovisor/genesis && \ | ||
mkdir -p $DAEMON_HOME/cosmovisor/genesis/bin && \ | ||
mkdir -p $DAEMON_HOME/cosmovisor/upgrades && \ | ||
cp ~/go/bin/$DAEMON_NAME $DAEMON_HOME/cosmovisor/genesis/bin | ||
|
||
CMD ["bash"] |
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,49 @@ | ||
FROM ubuntu:20.04 | ||
|
||
RUN apt update -y && apt upgrade -y && \ | ||
apt install -y sudo curl git jq wget vim make build-essential | ||
|
||
|
||
ENV GO_VERSION 1.20 | ||
RUN wget -O go.tgz https://golang.org/dl/go${GO_VERSION}.linux-amd64.tar.gz && \ | ||
tar -C /usr/local -xzf go.tgz && \ | ||
rm go.tgz | ||
ENV PATH $PATH:/usr/local/go/bin | ||
|
||
RUN echo 'PATH=$PATH:/usr/local/go/bin' >> $HOME/.bashrc && \ | ||
echo 'PATH=$PATH:~/go/bin' >> $HOME/.bashrc | ||
|
||
# RUN curl -fsSL https://deb.nodesource.com/setup_16.x | sudo -E bash - && sudo apt-get install -y nodejs | ||
|
||
RUN useradd -m docker && echo "docker:docker" | chpasswd && adduser docker sudo | ||
|
||
WORKDIR $HOME | ||
|
||
ENV CHAIN_REPO https://github.com/UnUniFi/chain | ||
ENV CHAIN_REPO_BRANCHE=v4.0.1 | ||
ENV TARGET=ununifid | ||
ENV TARGET_HOME=.ununifi | ||
ENV CHAIN_ID=test | ||
|
||
ENV DAEMON_NAME=$TARGET | ||
ENV DAEMON_HOME=/root/$TARGET_HOME | ||
ENV DAEMON_ALLOW_DOWNLOAD_BINARIES=true | ||
ENV DAEMON_LOG_BUFFER_SIZE=512 | ||
ENV DAEMON_RESTART_AFTER_UPGRADE=true | ||
ENV UNSAFE_SKIP_BACKUP=true | ||
|
||
|
||
|
||
RUN git clone $CHAIN_REPO chain_repo && \ | ||
cd chain_repo && \ | ||
git checkout $CHAIN_REPO_BRANCHE && \ | ||
make install | ||
|
||
RUN go install github.com/cosmos/cosmos-sdk/cosmovisor/cmd/cosmovisor@v1.0.0 | ||
RUN mkdir -p $DAEMON_HOME/cosmovisor && \ | ||
mkdir -p $DAEMON_HOME/cosmovisor/genesis && \ | ||
mkdir -p $DAEMON_HOME/cosmovisor/genesis/bin && \ | ||
mkdir -p $DAEMON_HOME/cosmovisor/upgrades && \ | ||
cp ~/go/bin/$DAEMON_NAME $DAEMON_HOME/cosmovisor/genesis/bin | ||
|
||
CMD ["bash"] |
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,98 @@ | ||
# Faucet for UnUniFi v3.2.2 | ||
|
||
## Docker | ||
|
||
Edit .ununifi home directory | ||
|
||
```dockerfile | ||
# - ~/.ununifi:/root/.ununifi | ||
- ~/.ununifi:/mnt/blockstorage/.ununifi | ||
``` | ||
|
||
Edit faucet command | ||
|
||
- denom | ||
- port | ||
- credit-amount | ||
- max-credit | ||
|
||
Set Faucet account | ||
|
||
```bash | ||
ununifid keys add faucet --recover --keyring-backend test | ||
# enter the mnemonic | ||
``` | ||
|
||
Launch | ||
|
||
```bash | ||
docker-compose build | ||
docker-compose up -d | ||
``` | ||
|
||
## nohup (NOT recommend) | ||
|
||
Download Faucet | ||
|
||
```bash | ||
wget https://github.com/tendermint/faucet/releases/download/v0.0.3/faucet_0.0.3_linux_amd64.tar.gz | ||
tar -xvf ./faucet_0.0.3_linux_amd64.tar.gz | ||
``` | ||
|
||
Add nginx config | ||
|
||
```nginx | ||
server { | ||
listen 8000; | ||
listen [::]:8000; | ||
server_name localhost; | ||
charset UTF-8; | ||
location / { | ||
proxy_http_version 1.1; | ||
proxy_pass http://localhost:7000; | ||
if ($request_method = 'OPTIONS') { | ||
add_header Access-Control-Allow-Origin '*'; | ||
add_header Access-Control-Allow-Methods 'GET, POST, PUT, DELETE'; | ||
add_header Access-Control-Allow-Headers 'Origin, Authorization, Accept, Content-Type'; | ||
# add_header Access-Control-Max-Age 3600; | ||
add_header Content-Type 'text/plain charset=UTF-8'; | ||
add_header Content-Length 0; | ||
return 204; | ||
} | ||
} | ||
} | ||
server { | ||
listen 8002; | ||
listen [::]:8002; | ||
server_name localhost; | ||
charset UTF-8; | ||
location / { | ||
proxy_http_version 1.1; | ||
proxy_pass http://localhost:7002; | ||
if ($request_method = 'OPTIONS') { | ||
add_header Access-Control-Allow-Origin '*'; | ||
add_header Access-Control-Allow-Methods 'GET, POST, PUT, DELETE'; | ||
add_header Access-Control-Allow-Headers 'Origin, Authorization, Accept, Content-Type'; | ||
# add_header Access-Control-Max-Age 3600; | ||
add_header Content-Type 'text/plain charset=UTF-8'; | ||
add_header Content-Length 0; | ||
return 204; | ||
} | ||
} | ||
} | ||
``` | ||
|
||
Run via nohup | ||
./run_bk.sh | ||
|
||
```bash | ||
#!/bin/bash | ||
SCRIPT_DIR=$(cd $(dirname $0); pwd) | ||
nohup $SCRIPT_DIR/faucet --cli-name ununifid --denoms ubtc --keyring-backend test --account-name faucet --port 7000 --credit-amount=100000 --max-credit=2000000 --home=/root/.ununifi > $SCRIPT_DIR/fauet1.log 2>&1 & | ||
nohup $SCRIPT_DIR/faucet --cli-name ununifid --denoms uguu,uusdc --keyring-backend test --account-name faucet --port 7002 --credit-amount=20000000 --max-credit=2000000000 --home=/root/.ununifi > $SCRIPT_DIR/fauet2.log 2>&1 & | ||
``` |
Oops, something went wrong.