stroj test network construction

Precondition

  • centos7
  • Go 1.14+
  • C tooling
  • Postgres
  • Redis

Install or upgrade go

It is recommended to use 1.15.7other versions of compilation problems

Download and unzip

yum remove golang
rm -rf  /usr/local/go
wget https://golang.org/dl/go1.15.7.linux-amd64.tar.gz
tar -C /usr/local -xf go1.15.7.linux-amd64.tar.gz
rm -f go1.15.7.linux-amd64.tar.gz
ln -s /usr/local/go/bin/go /usr/bin/go

Configure GOROOT, GOPATH environment variables

vi ~/.bash_profile
export PATH=$PATH:/usr/local/go/bin
export GOROOT=/usr/local/go
export GOPATH=/root/gopath
export PATH=$PATH:$GOROOT/bin:$GOPATH/bin

Make environment variables take effect

source ~/.bash_profile

Check installation

go version

c tooling

yum install make automake gcc gcc-c++ kernel-devel

pg

mkdir -p /data/storj-test/postgresql
docker run -d --name storj-postgres -v /data/storj-test/postgresql:/var/lib/postgresql/data -e POSTGRES_HOST_AUTH_METHOD=trust -p 5432:5432  postgres
docker exec -it  storj-postgres createdb -U postgres teststorj

repeat

Create data directory

mkdir -p /data/storj-test/redis/data
docker rm -f stroj-redis

docker run -d --name stroj-redis\
-v /data/storj-test/redis/data:/data   \
-p 6379:6379 \
redis:5.0.4 

Installation and configuration

Build storj

git clone https://github.com/storj/storj.git 
cd storj
git checkout main
git pull
make install-sim

Build satellite web console

cd web/satellite
npm install
npm run build 

GOOS=js GOARCH=wasm go build -o access.wasm storj.io/storj/satellite/console/wasm
mv access.wasm static/wasm/
cp "$(go env GOROOT)/misc/wasm/wasm_exec.js"  static/wasm/
cd ..

Build storagenode web console

cd web/storagenode
npm install
npm run build 

Build configuration

storj-sim network setup --host 0.0.0.0 --postgres=postgres://postgres@localhost:5432/teststorj?sslmode=disable --satellites 2  --storage-nodes 10 --redis 127.0.0.1:6379 --config-dir  /data/storj-test/config

run

storj-sim network run  --config-dir  /data/storj-test/config   --redis 127.0.0.1:6379  --satellites 2  --storage-nodes 10

Generate port format: "1PXXE", P is the peer category, XX is the instance index, E is the endpoint.

  • Gateways start from port 11000
  • Version control is at port 12000
  • Bootstrap server is at port 13000
  • Satellites start from port 10000
  • Satellite Console starts on port 10002
  • Storage Nodes public ports start from port 14000
  • Storage Nodes private ports start from port 14001

gateway

  • server.address: 0.0.0.0:11000 (minio web console)
  • debug.addr: 0.0.0.0:11009

satellite

  • admin.address: 0.0.0.0:10005
  • console.address: 0.0.0.0:10002
  • server.address: 0.0.0.0:10000
  • server.private-address: 0.0.0.0:10001
  • debug.addr: 0.0.0.0:10009

storagenode

  • console.address: 0.0.0.0:13002
  • server.address: 0.0.0.0:13000
  • server.private-address: 0.0.0.0:13001
  • debug.addr: 0.0.0.0:13009

versioncontrol

  • debug.addr: 0.0.0.0:12009
  • address: 0.0.0.0:12000

Check the web console, replace 127.0.0.1 with your ip

  • Gateway web console: 127.0.0.1:11000 or 127.0.0.1:11001
    requires a key, which can be obtained by viewing the configuration file /data/storj-test/config/gateway/XX/config.yaml. XX currently represents 0 or 1. Only two satellites are generated, and each satellite corresponds to a gateway
  • Satellite web console:127.0.0.1:10002 or 127.0.0.1:10012
    need to be registered first, you can log in to
    storagenode web console:127.0.0.1:13002 until 127.0.0.1:13092 without activation

There are also bugs. After startup, it is found that postgres is not used at all, and the data is stored in sqllite

Clear test network data & rebuild database

storj-sim network destroy --config-dir /data/storj-test/config

docker exec -it  storj-postgres psql -U postgres
postgres=#drop database teststorj;
postgres=#create database teststorj; 

Guess you like

Origin blog.csdn.net/kk3909/article/details/115354042