Skip to content

Commit

Permalink
update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
liujuanjuan1984 committed Feb 26, 2024
1 parent 97eefc9 commit d6cbeef
Show file tree
Hide file tree
Showing 5 changed files with 58 additions and 22 deletions.
62 changes: 49 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,23 +112,33 @@ Try [rum-app](https://rumsystem.net/apps), a cross platform RUM GUI application.
Run the [quorum binary](#build_quorum):

```sh
./quorum fullnode --peername peer --listen /ip4/0.0.0.0/tcp/7000 --listen /ip4/0.0.0.0/tcp/9000/ws --apiport 8000 --peer /ip4/94.23.17.189/tcp/10666/p2p/16Uiu2HAmGTcDnhj3KVQUwVx8SGLyKBXQwfAxNayJdEwfsnUYKK4u --configdir rum/peerConfig --datadir rum/peerData --keystoredir rum/keystore --loglevel debug
./quorum fullnode \
--listen=/ip4/0.0.0.0/tcp/7000 \
--listen=/ip4/0.0.0.0/tcp/9000/ws \
--apiport=8000 \
--peer=/ip4/94.23.17.189/tcp/62777/p2p/16Uiu2HAm5waftP3s4oE1EzGF2SyWeK726P5B8BSgFJqSiz6xScGz \
--configdir=rum/config \
--datadir=rum/data \
--keystoredir=rum/keystore \
--keystorepwd=yourpassword \
--loglevel=debug \
--enabledevnetwork=false
```

OPTIONS:

```sh
--peername default:`peer`, used in and same with `configdir` and `datadir`
--listen a multiaddress for the peer service listening
--apihost http api listening host, a domain or a public ip address
--apiport http api listening port
--peer a bootstrap peer multiaddress. Any online peer could be used for bootstrap, you can use the RUM testing bootstrap server for testing.
--configdir a directory for config files. The `peer` of `peerConfig` must same as peername `peer`, eg: if `mypeer2Config`, peername must be `mypeer2`.
--datadir all data storage location. The `peer` of `peerData` must same as peername `peer`, eg: if `mypeer2Data`, peername must be `mypeer2`.
--keystoredir a directory to store private keys. All key files are password protected, and it\'s very important to keep backups of all your keys.
--debug enable logging level to debug or not
--listen required. a multiaddress for the peer service listening
--apihost required. http api listening host, a domain or a public ip address
--peer required. a bootstrap peer multiaddress. Any online peer could be used for bootstrap, you can use the RUM testing bootstrap server for testing.
--configdir optional. a directory for config files. The `peer` of `peerConfig` must same as peername `peer`, eg: if `mypeer2Config`, peername must be `mypeer2`.
--datadir optional. all data storage location. The `peer` of `peerData` must same as peername `peer`, eg: if `mypeer2Data`, peername must be `mypeer2`.
--keystoredir optional. a directory to store private keys. All key files are password protected, and it\'s very important to keep backups of all your keys.
--keystorepwd optional. password for all keystores. Or using the system environment variable `RUM_KSPASSWD`.
```
See more by running ```./quorum help``` and ```./quorum fullnode help```.
*or*
Run RUM inside Docker:
Expand All @@ -148,7 +158,7 @@ docker run --user 1001 \
-p 8000:8000 \
-p 8001:8001 \
-e RUM_KSPASSWD='myverysecretpassword' \
quorum fullnode --listen /ip4/0.0.0.0/tcp/8000 --listen /ip4/0.0.0.0/tcp/8001/ws --apiport 8002 --peer /ip4/94.23.17.189/tcp/10666/p2p/16Uiu2HAmGTcDnhj3KVQUwVx8SGLyKBXQwfAxNayJdEwfsnUYKK4u,/ip4/132.145.109.63/tcp/10666/p2p/16Uiu2HAmTovb8kAJiYK8saskzz7cRQhb45NRK5AsbtdmYsLfD3RM
quorum fullnode --listen /ip4/0.0.0.0/tcp/8000 --listen /ip4/0.0.0.0/tcp/8001/ws --apiport 8002 --peer /ip4/94.23.17.189/tcp/62777/p2p/16Uiu2HAm5waftP3s4oE1EzGF2SyWeK726P5B8BSgFJqSiz6xScGz
```
### Example: a private decentralized forum
Expand Down Expand Up @@ -315,12 +325,38 @@ Add more producers to prevent outages.
1. Build the quorum binary by running the command: `make linux` or `make buildall`. You can find the binary file in the `dist` dir.
2. Add a shell script to run the peer:
Using the system environment variable `RUM_KSPASSWD` or add the param `keystorepwd`.
```sh
export RUM_KSPASSWD=your_very_secret_password
```
```bash
RUM_KSPASSWD=your_very_secret_password ./dist/linux_amd64/quorum fullnode --peername your_peer_name --listen /ip4/0.0.0.0/tcp/7002 --listen /ip4/0.0.0.0/tcp/7100/ws --apiport 8002 --peer /ip4/94.23.17.189/tcp/10666/p2p/16Uiu2HAmGTcDnhj3KVQUwVx8SGLyKBXQwfAxNayJdEwfsnUYKK4u --configdir /var/data/your_peer_nameConfig --datadir /var/data/your_peer_nameData --keystoredir /var/data/keystore --loglevel debug
# run fullnode of quorum
peername=my_first_peer
./quorum fullnode \
--keystorepwd=your_very_secret_password \
--keystoredir=keystore/$peername \
--configdir=config/$peername \
--datadir=data/$peername \
--peer=/ip4/101.42.141.118/tcp/62777/p2p/16Uiu2HAm9uziCEHprbzJoBdG9uktUQSYuFY58eW7o5Dz7rKhRn2j \
--listen=/ip4/0.0.0.0/tcp/60137 \
--listen=/ip4/0.0.0.0/tcp/60135/ws \
--apiport=60136 \
--log-compress=true \
--log-max-age=7 \
--log-max-backups=100 \
--log-max-size=10 \
--logfile=logs/$peername/quorum.log \
--loglevel=debug \
--enabledevnetwork=false
```
[view OPTIONS](#run_a_peer)
3. Run the shell script.
Tips: You can use our public bootstrap peer ```/ip4/94.23.17.189/tcp/10666/p2p/16Uiu2HAmGTcDnhj3KVQUwVx8SGLyKBXQwfAxNayJdEwfsnUYKK4u``` or any other online peers as bootstrap.
Tips: You can use our public bootstrap peer ```/ip4/94.23.17.189/tcp/62777/p2p/16Uiu2HAm5waftP3s4oE1EzGF2SyWeK726P5B8BSgFJqSiz6xScGz``` or any other online peers as bootstrap.
You can also run a bootstrapnode by using the following command: `./quorum bootstrapnode --help`.
12 changes: 6 additions & 6 deletions howtotest.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ check the version and get help:
./quorum bootstrapnode \
--keystoredir=mynodes/bootstrapnode/keystore \
--keystorename=default \
--keystorepass=myboot123 \
--keystorepwd=myboot123 \
--configdir=mynodes/bootstrapnode/config \
--datadir=mynodes/bootstrapnode/data \
--listen=/ip4/0.0.0.0/tcp/50510 \
Expand Down Expand Up @@ -68,7 +68,7 @@ so, your bootstrap peer is `/ip4/127.0.0.1/tcp/50510/p2p/16Uiu2HAkxfXvruFGQUAURi
--peername=peer \
--keystoredir=mynodes/fullnode_owner/keystore \
--keystorename=default \
--keystorepass=myowner456 \
--keystorepwd=myowner456 \
--configdir=mynodes/fullnode_owner/config \
--datadir=mynodes/fullnode_owner/data \
--certdir=mynodes/fullnode_owner/certs \
Expand All @@ -93,7 +93,7 @@ so, your bootstrap peer is `/ip4/127.0.0.1/tcp/50510/p2p/16Uiu2HAkxfXvruFGQUAURi
--peername=peer \
--keystoredir=mynodes/fullnode_user/keystore \
--keystorename=default \
--keystorepass=myuser456 \
--keystorepwd=myuser456 \
--configdir=mynodes/fullnode_user/config \
--datadir=mynodes/fullnode_user/data \
--certdir=mynodes/fullnode_user/certs \
Expand All @@ -118,7 +118,7 @@ so, your bootstrap peer is `/ip4/127.0.0.1/tcp/50510/p2p/16Uiu2HAkxfXvruFGQUAURi
--peername=peer \
--keystoredir=mynodes/producernode1/keystore \
--keystorename=default \
--keystorepass=myproducer111 \
--keystorepwd=myproducer111 \
--configdir=mynodes/producernode1/config \
--datadir=mynodes/producernode1/data \
--certdir=mynodes/producernode1/certs \
Expand All @@ -142,7 +142,7 @@ so, your bootstrap peer is `/ip4/127.0.0.1/tcp/50510/p2p/16Uiu2HAkxfXvruFGQUAURi
--peername=peer \
--keystoredir=mynodes/producernode2/keystore \
--keystorename=default \
--keystorepass=myproducer222 \
--keystorepwd=myproducer222 \
--configdir=mynodes/producernode2/config \
--datadir=mynodes/producernode2/data \
--certdir=mynodes/producernode2/certs \
Expand All @@ -165,7 +165,7 @@ so, your bootstrap peer is `/ip4/127.0.0.1/tcp/50510/p2p/16Uiu2HAkxfXvruFGQUAURi
--peername=peer \
--keystoredir=mynodes/producernode2/keystore \
--keystorename=default \
--keystorepass=myproducer333 \
--keystorepwd=myproducer333 \
--configdir=mynodes/producernode3/config \
--datadir=mynodes/producernode3/data \
--certdir=mynodes/producernode3/certs \
Expand Down
2 changes: 1 addition & 1 deletion pkg/chainapi/api/addpeers_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ func addPeers(api string, payload handlers.AddPeerParam) (*handlers.AddPeerResul
func TestAddPeers(t *testing.T) {
t.Parallel()

payload := handlers.AddPeerParam{"/ip4/94.23.17.189/tcp/10666/p2p/16Uiu2HAmGTcDnhj3KVQUwVx8SGLyKBXQwfAxNayJdEwfsnUYKK4u"}
payload := handlers.AddPeerParam{"/ip4/192.99.101.35/tcp/10666/p2p/16Uiu2HAm8FNWrm1Zqe29Xe4EoHTzKG5UnVD2gCDB7D4b3SM5AvGi"}

if _, err := addPeers(peerapi, payload); err != nil {
t.Errorf("addPeers failed: %s, payload: %+v", err, payload)
Expand Down
2 changes: 1 addition & 1 deletion pkg/chainapi/handlers/addpeers.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
)

// AddPeerParam list of multiaddr
type AddPeerParam []string // Example: ["/ip4/94.23.17.189/tcp/10666/p2p/16Uiu2HAmGTcDnhj3KVQUwVx8SGLyKBXQwfAxNayJdEwfsnUYKK4u", "/ip4/132.145.109.63/tcp/10666/p2p/16Uiu2HAmTovb8kAJiYK8saskzz7cRQhb45NRK5AsbtdmYsLfD3RM"]
type AddPeerParam []string // Example: ["/ip4/94.23.17.189/tcp/62777/p2p/16Uiu2HAm5waftP3s4oE1EzGF2SyWeK726P5B8BSgFJqSiz6xScGz", "/ip4/132.145.109.63/tcp/10666/p2p/16Uiu2HAmTovb8kAJiYK8saskzz7cRQhb45NRK5AsbtdmYsLfD3RM"]

type AddPeerResult struct {
SuccCount int `json:"succ_count" example:"100"`
Expand Down
2 changes: 1 addition & 1 deletion systemd/quorum.service.sample
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ User=rum
Group=rum
RuntimeMaxSec=24h
Environment="RUM_KSPASSWD=YOUR_PASSWORD"
ExecStart=/usr/local/bin/quorum_linux fullnode --peername peer0 --listen /ip4/0.0.0.0/tcp/27002 --listen /ip4/0.0.0.0/tcp/27003/ws --apiport 28002 --apihost 127.0.0.1 --peer /ip4/94.23.17.189/tcp/10666/p2p/16Uiu2HAmGTcDnhj3KVQUwVx8SGLyKBXQwfAxNayJdEwfsnUYKK4u,/ip4/132.145.109.63/tcp/10666/p2p/16Uiu2HAmTovb8kAJiYK8saskzz7cRQhb45NRK5AsbtdmYsLfD3RM --configdir /var/data/peer0data/config --datadir /var/data/peer0data/peerdata --keystoredir /var/data/peer0data/keystore
ExecStart=/usr/local/bin/quorum_linux fullnode --peername peer0 --listen /ip4/0.0.0.0/tcp/27002 --listen /ip4/0.0.0.0/tcp/27003/ws --apiport 28002 --apihost 127.0.0.1 --peer /ip4/94.23.17.189/tcp/62777/p2p/16Uiu2HAm5waftP3s4oE1EzGF2SyWeK726P5B8BSgFJqSiz6xScGz,/ip4/132.145.109.63/tcp/10666/p2p/16Uiu2HAmTovb8kAJiYK8saskzz7cRQhb45NRK5AsbtdmYsLfD3RM --configdir /var/data/peer0data/config --datadir /var/data/peer0data/peerdata --keystoredir /var/data/peer0data/keystore
TimeoutStopSec=10s
LimitNOFILE=1048576
LimitNPROC=512
Expand Down

0 comments on commit d6cbeef

Please sign in to comment.