Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 3 additions & 8 deletions README.MD
Original file line number Diff line number Diff line change
Expand Up @@ -93,19 +93,14 @@ escKey is used to submit arbitration signature to esc arbiter contract, gas fee(

### 4. run arbiter

run arbiter with go file
```shell
go run app/arbiter/main.go
```

run arbiter with default manifest file
run arbiter
```shell
./arbiter
```

run arbiter with custom manifest file
run arbiter with go file
```shell
./arbiter --gf.gcfg.file=config.yaml
go run app/arbiter/main.go
```

## Automated Deployment
Expand Down
5 changes: 2 additions & 3 deletions app/keystore-generator/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,13 +85,12 @@ func GenerateETHKeystore(privateKeyHex string, password string, outputFile strin
}

if outputFile != "" {
newPath := fmt.Sprintf("%s", outputFile)
err := os.Rename(account.URL.Path, newPath)
err := os.Rename(account.URL.Path, outputFile)
if err != nil {
fmt.Println("Error: Failed to rename keystore file:", err)
os.Exit(1)
}
fmt.Println("Ethereum keystore created successfully at:", newPath)
fmt.Println("Ethereum keystore created successfully at:", outputFile)
} else {
fmt.Println("Ethereum keystore created successfully at:", account.URL.Path)
}
Expand Down
1 change: 0 additions & 1 deletion docker/dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
FROM ubuntu:20.04
RUN apt-get update && apt-get install -y curl
RUN apt-get install wget -y
RUN apt-get install vim -y
RUN cd ~
RUN wget https://download.bel2.org/loan-arbiter/deploy_loan_arbiter.sh
RUN chmod a+x deploy_loan_arbiter.sh
Expand Down
31 changes: 18 additions & 13 deletions docs/deploy_loan_arbiter.sh
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@ check_status()
deploy_arbiter()
{
echo_info $SCRIPT_PATH
if [ $# -ne 3 ]; then
echo "Need to use deploy_loan_arbiter.sh [your_arbiter_esc_address] [hex_encoded_btc_private_key] [hex_encoded_esc_private_key]"
if [ $# -ne 4 ]; then
echo "Need to use deploy_loan_arbiter.sh [your_arbiter_esc_address] [hex_encoded_btc_private_key] [hex_encoded_esc_private_key] [your_keystore_password]"
exit 1
fi

Expand All @@ -81,36 +81,41 @@ deploy_arbiter()
#mv conf/config.yaml .
sed -i "s/0x0262aB0ED65373cC855C34529fDdeAa0e686D913/$1/g" config.yaml

#prepare keystore
# Generate BTC keystore
keystore-generator -c btc -s $2 -p $4 -o btcKey
# Generate ESC keystore
keystore-generator -c eth -s $3 -p $4 -o escKey
mv btcKey escKey keys/

#prepare arbiter
if [ "$(uname -m)" == "armv6l" ] || [ "$(uname -m)" == "armv7l" ] || [ "$(uname -m)" == "aarch64" ]; then
echo "The current system architecture is ARM"
echo_info "Downloading loan arbiter..."
wget -O loan-arbiter-linux-arm64.tgz https://download.bel2.org/loan-arbiter/loan-arbiter-v0.0.1/loan-arbiter-linux-arm64.tgz
tar xf loan-arbiter-linux-arm64.tgz
#prepare keystore
mv loan-arbiter-linux-arm64/keystore-generator .
./keystore-generator -c btc -s $2 -p $4 -o btcKey
./keystore-generator -c eth -s $3 -p $4 -o escKey
mv btcKey escKey keys/
#prepare arbiter
echo_info "Replacing arbiter.."
cp -v loan-arbiter-linux-arm64/arbiter ~/loan_arbiter/
echo_info "Starting arbtier..."
./arbiter --gf.gcfg.file=config.yaml -p $4 > $SCRIPT_PATH/data/logs/arbiter.log 2>&1 &
./arbiter -p $4 > $SCRIPT_PATH/data/logs/arbiter.log 2>&1 &

#rm -f loan-arbiter-linux-arm64.tgz conf.tgz
rm -f loan-arbiter-linux-arm64.tgz conf.tgz
else
echo "The current system architecture is x86"
echo_info "Downloading loan arbiter..."
wget -O loan-arbiter-linux-x86_64.tgz https://download.bel2.org/loan-arbiter/loan-arbiter-v0.0.1/loan-arbiter-linux-x86_64.tgz
tar xf loan-arbiter-linux-x86_64.tgz
#prepare keystore
mv loan-arbiter-linux-x86_64/keystore-generator .
./keystore-generator -c btc -s $2 -p $4 -o btcKey
./keystore-generator -c eth -s $3 -p $4 -o escKey
mv btcKey escKey keys/
#prepare arbiter
echo_info "Replacing arbiter.."
cp -v loan-arbiter-linux-x86_64/arbiter ~/loan_arbiter/
echo_info "Starting arbtier..."
./arbiter --gf.gcfg.file=config.yaml -p $4 > $SCRIPT_PATH/data/logs/arbiter.log 2>&1 &
./arbiter -p $4 > $SCRIPT_PATH/data/logs/arbiter.log 2>&1 &

#rm -f loan-arbiter-linux-x86_64.tgz conf.tgz
rm -f loan-arbiter-linux-x86_64.tgz conf.tgz
fi

check_status
Expand Down
Loading