supernode
is a server application that handles walletnode
requests. The app does most of the work of registering and searching artworks.
-
Build SuperNode app:
-
Install libtensorflow
-
For Linux:
- For new CPUs which supports avx/avx2 instructions
wget https://storage.googleapis.com/tensorflow/libtensorflow/libtensorflow-cpu-linux-x86_64-2.4.0.tar.gz sudo tar -C /usr/local -xzf ./libtensorflow-cpu-linux-x86_64-2.4.0.tar.gz sudo /sbin/ldconfig -v
- For older CPU, have to build libtensorflow by yourself:
# Install bazel wget https://github.com/bazelbuild/bazel/releases/download/3.1.0/bazel-3.1.0-installer-linux-x86_64.sh chmod u+x bazel-3.1.0-installer-linux-x86_64.sh sudo ./bazel-3.1.0-installer-linux-x86_64.sh # Build libtensorflow wget https://github.com/tensorflow/tensorflow/archive/refs/tags/v2.4.0.tar.gz tar xvf ./v2.4.0.tar.gz cd tensorflow-2.4.0 ./configure #set options you want bazel build --config opt //tensorflow/tools/lib_package:libtensorflow sudo tar -C /usr/local -xzf bazel-bin/tensorflow/tools/lib_package/libtensorflow.tar.gz
- For new CPUs which supports avx/avx2 instructions
-
For Window/Mac (TBD):
-
-
Build:
cd ./supernode go build ./
-
-
Start supernode - there're some options:
- Without any parameters,
supernode
tries to find and read all settings from the config filesupernode.yml
in the default dir:
./supernode
- Specified config files:
./supernode --pastel-config-file ./examples/configs/pastel.conf --config-file ./examples/configs/mainnet.yml
- The following set of parameters is suitable for debugging the process:
SUPERNODE_DEBUG=1 \ ./supernode --log-level debug
- Without any parameters,
supernode
supports the following CLI parameters:
Specifies supernode
config file in yaml format. By default default_dir/supernode.yml
Specifies pastel.conf
config file in env format. By default default_dir/pastel.conf
Sets the directory for storing temp data. The default path is determined automatically and depends on the OS. On Unix systems, it returns $TMPDIR
if non-empty, else /tmp
. On Windows, it returns the first non-empty value from %TMP%
, %TEMP%
, %USERPROFILE%
, or the Windows directory. Use the --help
flag to see the default path.
Sets the directory for storing working data, such as tensorflow models. The default path is default_dir/supernode
Sets the log level. Can be set to debug
, info
, warning
, fatal
, e.g. --log-level debug
. By default info
.
Sets the path to log file to write to. Disabled by default.
Disallows log output to stdout. By default false
.
Used for integration testing and testing at the developer stage.
SUPERNODE_DEBUG
displays advanced log messages and stack of the errors. Can be set to0
,1
, e.g.SUPERNODE_DEBUG=1
. By default0
.LOAD_TFMODELS
sets the number of tensorflow models to load; it can be used to reduce the number of loaded models; a value of0
means not to load any models at all, e.g.LOAD_TFMODELS=0
. By default, it is set to the maximum number of7
.
The path depends on the OS:
- MacOS
~/Library/Application Support/Pastel
- Linux
~/.pastel
- Windows (>= Vista)
C:\Users\Username\AppData\Roaming\Pastel
- Windows (< Vista)
C:\Documents and Settings\Username\Application Data\Pastel
This means that supernode
did not find tensforflow models; the path where it tries to load them is work-dir/tfmodels
. By default default_dir/supernode/tfmodels
We do not commit mock files, this is only needed for development and their lack, does not affect to build the package. But if you need to run unit tests or go mod tidy
, you probably get an error. To fix this issue you need to generate mock files.
if you run unit tests for the first time, you must generate the mock files:
- Install mockery
go get github.com/vektra/mockery/v2/.../
- In the root directory, running
./gonode
will generate mock files for all modules
for d in ./*/ ; do (cd "$d" && [[ -f go.mod ]] && go mod tidy && go generate ./...); done
To run unit tests:
go test -v -race -timeout 45m -short ./...