Skip to content

Commit

Permalink
update sdk version and readme
Browse files Browse the repository at this point in the history
  • Loading branch information
AstaFrode committed Jul 31, 2024
1 parent f0c449f commit c6638d0
Show file tree
Hide file tree
Showing 6 changed files with 57 additions and 53 deletions.
82 changes: 40 additions & 42 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# <h1 align="center">CESS-BUCKET </br> [![GitHub license](https://img.shields.io/badge/license-Apache2-blue)](#LICENSE) <a href=""><img src="https://img.shields.io/badge/golang-%3E%3D1.20-blue.svg" /></a> [![Go Reference](https://pkg.go.dev/badge/github.com/CESSProject/cess-miner/edit/main/README.md.svg)](https://pkg.go.dev/github.com/CESSProject/cess-miner/edit/main/README.md) [![build](https://github.com/CESSProject/cess-miner/actions/workflows/build.yml/badge.svg)](https://github.com/CESSProject/cess-miner/actions/workflows/build.yml) [![Go Report Card](https://goreportcard.com/badge/github.com/CESSProject/cess-bucket)](https://goreportcard.com/report/github.com/CESSProject/cess-bucket)</h1>
# <h1 align="center">CESS-BUCKET </br> [![GitHub license](https://img.shields.io/badge/license-Apache2-blue)](#LICENSE) <a href=""><img src="https://img.shields.io/badge/golang-%3E%3D1.20-blue.svg" /></a> [![Go Reference](https://pkg.go.dev/badge/github.com/CESSProject/cess-miner/edit/main/README.md.svg)](https://pkg.go.dev/github.com/CESSProject/cess-miner/edit/main/README.md) [![build](https://github.com/CESSProject/cess-miner/actions/workflows/build.yml/badge.svg)](https://github.com/CESSProject/cess-miner/actions/workflows/build.yml) [![Go Report Card](https://goreportcard.com/badge/github.com/CESSProject/cess-miner)](https://goreportcard.com/report/github.com/CESSProject/cess-miner)</h1>

CESS-Bucket is a mining program provided by cess platform for storage miners.

Expand All @@ -8,18 +8,16 @@ If you find any system errors or you have better suggestions, please submit an i
## 📢 Announcement
**CESS test network rpc endpoints**
```
wss://testnet-rpc0.cess.cloud/ws/
wss://testnet-rpc1.cess.cloud/ws/
wss://testnet-rpc2.cess.cloud/ws/
wss://testnet-rpc.cess.cloud/ws/
```
**CESS test network bootstrap node**
```
_dnsaddr.boot-bucket-testnet.cess.cloud
_dnsaddr.boot-miner-testnet.cess.cloud
```

## 🚰 CESS test network faucet
```
https://testnet-faucet.cess.cloud/
https://cess.cloud/faucet.html
```

## ⚠ Attention
Expand All @@ -44,7 +42,7 @@ yum install git curl wget vim util-linux -y
```

### Firewall configuration
By default, cess-bucket uses port `4001` to listen for incoming connections, if your platform blocks these two ports by default, you may need to enable access to these port.
By default, cess-miner uses port `4001` to listen for incoming connections, if your platform blocks these two ports by default, you may need to enable access to these port.

#### ufw
For hosts with ufw enabled (Debian, Ubuntu, etc.), you can use the ufw command to allow traffic to flow to specific ports. Use the following command to allow access to a port:
Expand Down Expand Up @@ -106,13 +104,13 @@ If you are using the test network, Please join the [CESS discord](https://discor
### Method one
Download the latest release of the binary application directly at:
```
wget https://github.com/CESSProject/cess-miner/releases/download/v0.7.10/bucket0.7.10.linux-amd64.tar.gz
wget https://github.com/CESSProject/cess-miner/releases/download/v0.7.11/bucket0.7.11.linux-amd64.tar.gz
```
### Method two
Compile the binary program from the storage node source code and follow the process as follows:

**1) install go**
CESS-Bucket requires [Go 1.20](https://golang.org/dl/), See the [official Golang installation instructions](https://golang.org/doc/install).
CESS-Bucket requires [Go 1.21](https://golang.org/dl/), See the [official Golang installation instructions](https://golang.org/doc/install).

Open gomod mode:
```
Expand All @@ -127,32 +125,32 @@ go env -w GOPROXY="https://goproxy.cn,direct"
**2) clone code**

```shell
git clone https://github.com/CESSProject/cess-bucket.git
git clone https://github.com/CESSProject/cess-miner.git
```

**3) compile code**

```shell
cd cess-bucket/
go build -o bucket cmd/main.go
cd cess-miner/
go build -o miner cmd/main.go
```

**4) Grant execute permission**

```shell
chmod +x bucket
chmod +x miner
```

**5) View bucket features (optional)**
**5) View miner features (optional)**

The `bucket` has many functions, you can use `./bucket -h` or `./bucket --help` to view, as follows:
The `miner` has many functions, you can use `./miner -h` or `./miner --help` to view, as follows:

- Flags

| Flag | Description |
| ----------- | -------------------------------------------------- |
| -c,--config | custom configuration file (default "conf.yaml") |
| -h,--help | help for bucket |
| -h,--help | help for cess-miner |
| --earnings | earnings account |
| --port | listening port |
| --rpc | rpc endpoint list |
Expand All @@ -176,38 +174,38 @@ The `bucket` has many functions, you can use `./bucket -h` or `./bucket --help`
| claim | | Claim reward |

## 🟢 Start mining
The bucket program has two running modes: foreground and background.
The miner program has two running modes: foreground and background.

> :warning: If you are not running the bucket program with root privileges, make sure that the user you are currently logged in to has all permissions for the workspace directory you have configured. If you are logged in as `user`, the configured directory is `/cess`, and your signature account is `cXfyomKDABfehLkvARFE854wgDJFMbsxwAJEHezRb6mfcAi2y`, execute the following command to grant permissions:
> :warning: If you are not running the `miner` program with root privileges, make sure that the user you are currently logged in to has all permissions for the workspace directory you have configured. If you are logged in as `user`, the configured directory is `/cess`, and your signature account is `cXfyomKDABfehLkvARFE854wgDJFMbsxwAJEHezRb6mfcAi2y`, execute the following command to grant permissions:
```
chown -R user:user /cess/cXfyomKDABfehLkvARFE854wgDJFMbsxwAJEHezRb6mfcAi2y/
```

### Foreground operation mode

The foreground operation mode requires the terminal window to be kept all the time, and the window cannot be closed. You can use the screen command to create a window for the bucket and ensure that the window always exists.
Create and enter the bucket window command:
The foreground operation mode requires the terminal window to be kept all the time, and the window cannot be closed. You can use the screen command to create a window for the miner and ensure that the window always exists.
Create and enter the miner window command:
```
screen -S bucket
screen -S miner
```
Press `ctrl + A + D` to exit the bucket window without closing it.
Press `ctrl + A + D` to exit the miner window without closing it.

View window list command:
```
screen -ls
```
Re-enter the bucket window command:
Re-enter the miner window command:
```
screen -r bucket
screen -r miner
```


**method one**

Enter the `bucket run` command to run directly, and enter the information according to the prompt to complete the startup:
Enter the `miner run` command to run directly, and enter the information according to the prompt to complete the startup:

```
# ./bucket run
# ./miner run
>> Please enter the rpc address of the chain, multiple addresses are separated by spaces:
wss://testnet-rpc0.cess.cloud/ws/ wss://testnet-rpc1.cess.cloud/ws/ wss://testnet-rpc2.cess.cloud/ws/
>> Please enter the workspace, press enter to use / by default workspace:
Expand All @@ -225,7 +223,7 @@ cXfyomKDABfehLkvARFE854wgDJFMbsxwAJEHezRb6mfcAi2y
**method two**

```
# ./bucket run --rpc wss://testnet-rpc0.cess.cloud/ws/ wss://testnet-rpc1.cess.cloud/ws/ wss://testnet-rpc2.cess.cloud/ws/ --ws / --earnings cXfyomKDABfehLkvARFE854wgDJFMbsxwAJEHezRb6mfcAi2y --port 4001 --space 2000
# ./miner run --rpc wss://testnet-rpc0.cess.cloud/ws/ wss://testnet-rpc1.cess.cloud/ws/ wss://testnet-rpc2.cess.cloud/ws/ --ws / --earnings cXfyomKDABfehLkvARFE854wgDJFMbsxwAJEHezRb6mfcAi2y --port 4001 --space 2000
>> Please enter the mnemonic of the staking account:
*******************************************************************************
```
Expand All @@ -234,23 +232,23 @@ cXfyomKDABfehLkvARFE854wgDJFMbsxwAJEHezRb6mfcAi2y

Generate configuration file:
```
./bucket config
OK /root/bucket/conf.yaml
./miner config
OK /root/miner/conf.yaml
```
Edit the configuration file and fill in the correct information, then run:
```
nohup ./bucket run -c /root/bucket/conf.yaml &
nohup ./miner run -c /root/miner/conf.yaml &
```
If the configuration file is named conf.yaml and is located in the same directory as the bucket program, you can specify without -c:
If the configuration file is named conf.yaml and is located in the same directory as the miner program, you can specify without -c:
```
nohup ./bucket run &
nohup ./miner run &
```

## 💡 Other commands

- stat
```shell
./bucket stat --rpc wss://testnet-rpc0.cess.cloud/ws/ wss://testnet-rpc1.cess.cloud/ws/ wss://testnet-rpc2.cess.cloud/ws/
./miner stat --rpc wss://testnet-rpc.cess.cloud/ws/
>> Please enter the mnemonic of the staking account:
*******************************************************************************
+-------------------+------------------------------------------------------+
Expand All @@ -272,61 +270,61 @@ nohup ./bucket run &

- increase staking
```shell
./bucket increase staking 1000 --rpc wss://testnet-rpc0.cess.cloud/ws/ wss://testnet-rpc1.cess.cloud/ws/ wss://testnet-rpc2.cess.cloud/ws/
./miner increase staking 1000000000000000000000 --rpc wss://testnet-rpc.cess.cloud/ws/
>> Please enter the mnemonic of the staking account:
*******************************************************************************
OK 0xe098179a4a668690f28947d20083014e5a510b8907aac918e7b96efe1845e053
```

- increase space
```shell
./bucket increase space 10 --rpc wss://testnet-rpc0.cess.cloud/ws/ wss://testnet-rpc1.cess.cloud/ws/ wss://testnet-rpc2.cess.cloud/ws/
./miner increase space 10 --rpc wss://testnet-rpc.cess.cloud/ws/
>> Please enter the mnemonic of the staking account:
*******************************************************************************
OK 0xe098179a4a668690f28947d20083014e5a510b8907aac918e7b96efe1845e053
```

- update earnings
```shell
./bucket update earnings cXgDBpxj2vHhR9qP8wTkZ5ZST9YMu6WznFsEAZi3SZPD4b4qw --rpc wss://testnet-rpc0.cess.cloud/ws/ wss://testnet-rpc1.cess.cloud/ws/ wss://testnet-rpc2.cess.cloud/ws/
./miner update earnings cXgDBpxj2vHhR9qP8wTkZ5ZST9YMu6WznFsEAZi3SZPD4b4qw --rpc wss://testnet-rpc.cess.cloud/ws/
>> Please enter the mnemonic of the staking account:
*******************************************************************************
OK 0x0fa67b89d9f8ff134b45e4e507ccda00c0923d43c3b8166a2d75d3f42e5a269a
```

- version
```shell
./bucket version
bucket v0.7.8
./miner version
miner v0.7.11
```

- exit
```shell
./bucket exit --rpc wss://testnet-rpc0.cess.cloud/ws/ wss://testnet-rpc1.cess.cloud/ws/ wss://testnet-rpc2.cess.cloud/ws/
./miner exit --rpc wss://testnet-rpc.cess.cloud/ws/
>> Please enter the mnemonic of the staking account:
*******************************************************************************
OK 0xf6e9573ba53a90c4bbd8c3784ef97bbf74bdb1cf8c01df697310a64c2a7d4513
```

- withdraw
```shell
./bucket withdraw --rpc wss://testnet-rpc0.cess.cloud/ws/ wss://testnet-rpc1.cess.cloud/ws/ wss://testnet-rpc2.cess.cloud/ws/
./miner withdraw --rpc wss://testnet-rpc.cess.cloud/ws/
>> Please enter the mnemonic of the staking account:
*******************************************************************************
OK 0xfbcc77c072f88668a83f2dd3ea00f3ba2e5806aae8265cfba1582346d6ada3f1
```

- claim
```shell
./bucket claim --rpc wss://testnet-rpc0.cess.cloud/ws/ wss://testnet-rpc1.cess.cloud/ws/ wss://testnet-rpc2.cess.cloud/ws/
./miner claim --rpc wss://testnet-rpc.cess.cloud/ws/
>> Please enter the mnemonic of the staking account:
*******************************************************************************
OK 0x59096fd095b66665c838f89ae4f1384ab31255cdc9c80003b05b50124cfdcfee
```

- reward
```shell
./bucket reward --rpc wss://testnet-rpc0.cess.cloud/ws/ wss://testnet-rpc1.cess.cloud/ws/ wss://testnet-rpc2.cess.cloud/ws/
./miner reward --rpc wss://testnet-rpc.cess.cloud/ws/
>> Please enter the mnemonic of the staking account:
*******************************************************************************
+------------------+---------------------------+
Expand Down
8 changes: 4 additions & 4 deletions cmd/console/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -498,7 +498,7 @@ func buildConfigItems(cmd *cobra.Command) (*confile.Confile, error) {
if len(rpc) == 0 {
for {
if !istips {
out.Input(fmt.Sprintf("Enter the rpc address of the chain, multiple addresses are separated by spaces, press Enter to skip\nto use [%s, %s] as default rpc address:", configs.DefaultRpcAddr1, configs.DefaultRpcAddr2))
out.Input(fmt.Sprintf("Enter the rpc address of the chain, multiple addresses are separated by spaces, press Enter to skip\nto use [%s] as default rpc address:", configs.DefaultRpcAddr))
istips = true
}
lines, err = inputReader.ReadString('\n')
Expand All @@ -519,7 +519,7 @@ func buildConfigItems(cmd *cobra.Command) (*confile.Confile, error) {
}
}
if len(rpcValus) == 0 {
rpcValus = []string{configs.DefaultRpcAddr1, configs.DefaultRpcAddr2}
rpcValus = []string{configs.DefaultRpcAddr}
}
cfg.SetRpcAddr(rpcValus)
break
Expand Down Expand Up @@ -852,7 +852,7 @@ func buildAuthenticationConfig(cmd *cobra.Command) (*confile.Confile, error) {
if len(rpc) == 0 {
for {
if !istips {
out.Input(fmt.Sprintf("Enter the rpc address of the chain, multiple addresses are separated by spaces, press Enter to skip\nto use [%s, %s] as default rpc address:", configs.DefaultRpcAddr1, configs.DefaultRpcAddr2))
out.Input(fmt.Sprintf("Enter the rpc address of the chain, multiple addresses are separated by spaces, press Enter to skip\nto use [%s] as default rpc address:", configs.DefaultRpcAddr))
istips = true
}
lines, err = inputReader.ReadString('\n')
Expand All @@ -873,7 +873,7 @@ func buildAuthenticationConfig(cmd *cobra.Command) (*confile.Confile, error) {
}
}
if len(rpcValus) == 0 {
rpcValus = []string{configs.DefaultRpcAddr1, configs.DefaultRpcAddr2}
rpcValus = []string{configs.DefaultRpcAddr}
}
cfg.SetRpcAddr(rpcValus)
break
Expand Down
6 changes: 3 additions & 3 deletions configs/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@ const (
//
DefaultServicePort = 4001
//
DefaultRpcAddr1 = "wss://testnet-rpc0.cess.cloud/ws/"
DefaultRpcAddr2 = "wss://testnet-rpc1.cess.cloud/ws/"
DefaultRpcAddr = "wss://testnet-rpc.cess.cloud/ws/"

//
DefaultBootNodeAddr = "_dnsaddr.boot-miner-testnet.cess.cloud"
//
DefaultDeossAddr = "http://deoss-pub-gateway.cess.cloud/"
DefaultDeossAddr = "https://deoss-pub-gateway.cess.cloud/"

//
MinTagFileSize = 600000
Expand Down
2 changes: 1 addition & 1 deletion configs/system.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ const (
// Name is the name of the program
Name = "miner"
// version
Version = "v0.7.11 pre-release"
Version = "v0.7.11"
// Description is the description of the program
Description = "Storage miner implementation in CESS networks"
// NameSpace is the cached namespace
Expand Down
6 changes: 3 additions & 3 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ go 1.21
toolchain go1.21.12

require (
github.com/CESSProject/cess-go-sdk v0.5.1-0.20240721063943-d679eae43b78
github.com/CESSProject/cess-go-sdk v0.6.0
github.com/CESSProject/cess_pois v0.5.15
github.com/CESSProject/p2p-go v0.3.14
github.com/CESSProject/p2p-go v0.4.0
github.com/btcsuite/btcutil v1.0.3-0.20201208143702-a53e38424cce
github.com/centrifuge/go-substrate-rpc-client/v4 v4.2.1
github.com/gin-contrib/cors v1.7.1
Expand Down Expand Up @@ -186,7 +186,7 @@ require (
golang.org/x/mod v0.15.0 // indirect
golang.org/x/net v0.22.0 // indirect
golang.org/x/sync v0.6.0 // indirect
golang.org/x/sys v0.18.0 // indirect
golang.org/x/sys v0.20.0 // indirect
golang.org/x/term v0.18.0 // indirect
golang.org/x/text v0.14.0 // indirect
golang.org/x/tools v0.18.0 // indirect
Expand Down
6 changes: 6 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,14 @@ github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
github.com/CESSProject/cess-go-sdk v0.5.1-0.20240721063943-d679eae43b78 h1:Klqyh6ByBy1/Gj8B6Me0GgsFzNHQ+umxb4nZJ3FqpqQ=
github.com/CESSProject/cess-go-sdk v0.5.1-0.20240721063943-d679eae43b78/go.mod h1:UH85s5lpxpAf1HCXLmGgOEUAPKyeZZKEdbbWMSMHM8Y=
github.com/CESSProject/cess-go-sdk v0.6.0 h1:QinJuZeDrBRYgkSN34NgR5u30vg5DS8zyfwYiIKl38Y=
github.com/CESSProject/cess-go-sdk v0.6.0/go.mod h1:L5IDeS2ydsdgtdybzhWk9fIdBsDkU2XrQyo5mrWHkdQ=
github.com/CESSProject/cess_pois v0.5.15 h1:oQH8xEtxVzB+SeI+gNS6iSeFgjb/xDAsmgyuoF3al28=
github.com/CESSProject/cess_pois v0.5.15/go.mod h1:rztEZjjG+MbKzVgh5WtQcZc/7ZDkBvDNABc7Em8BKPc=
github.com/CESSProject/p2p-go v0.3.14 h1:t7xLWTC8C+tuELtD6f2k4Ds6Z0zulMA0v83ONTDTthw=
github.com/CESSProject/p2p-go v0.3.14/go.mod h1:NXlRF0kaJs7pUu0dFUnp5K5HpxL//wq4DJ4fcnFNfiI=
github.com/CESSProject/p2p-go v0.4.0 h1:Eh8SJ6aFoLLsl0rr9+bmgs82fi/nHHa8xWF58IcsnLo=
github.com/CESSProject/p2p-go v0.4.0/go.mod h1:BahNU7n8ARLDPyikaJqSRdahOdvPf+z8sO0nS2+MCzE=
github.com/ChainSafe/go-schnorrkel v1.0.0 h1:3aDA67lAykLaG1y3AOjs88dMxC88PgUuHRrLeDnvGIM=
github.com/ChainSafe/go-schnorrkel v1.0.0/go.mod h1:dpzHYVxLZcp8pjlV+O+UR8K0Hp/z7vcchBSbMBEhCw4=
github.com/aead/siphash v1.0.1/go.mod h1:Nywa3cDsYNNK3gaciGTWPwHt0wlpNV15vwmswBAUSII=
Expand Down Expand Up @@ -734,6 +738,8 @@ golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.18.0 h1:DBdB3niSjOA/O0blCZBqDefyWNYveAYMNF1Wum0DYQ4=
golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/sys v0.20.0 h1:Od9JTbYCk261bKm4M/mw7AklTlFYIa0bIp9BgSm1S8Y=
golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
golang.org/x/term v0.18.0 h1:FcHjZXDMxI8mM3nwhX9HlKop4C0YQvCVCdwYl2wOtE8=
Expand Down

0 comments on commit c6638d0

Please sign in to comment.