SDK Node Configuration

When service merchants start up SDK node, they are supposed to configure node in template file.

Yaml Configuration Example

stage: test
dbInit: false
depositAddress: ""
vsysNetType: "M"
vsysNodeAddress: "https://wallet.v.systems/api"
serverPrivateKey: ""
serverPublicKey: ""
tokenId: ""
kubeConfigPath: ""
vsysTokenExchangeRate: 2.0

middleware:
  authenticationEnable: true
  providerAllowEnable: true

mongodb:
  endpoint: "mongodb+srv://testdb:xxxxxxxxxxxxxxxxxx.pgyad.mongodb.net/market-cli-test?retryWrites=true&w=majority"
  endpointTest: "mongodb://localhost:27017"
  timeout: 10
  collectionPrefix: "vcloud_test"
  indexCreation: true

casbin:
  enable: true
  debug: true
  model: "config/model.conf"
  autoload: true
  autoloadInterval: 10

luaPlugin:
  httpSharedKeyPrefix: "vsys-market"

platformConf:
  tempDir: "/templates"
  host: "127.0.0.1"
  port: "3002"
  uploadUri: "/api/v1/service/template/add"

yaml configuration overview

The configuration file contains 6 parts: basic configuration for node, middleware, mongodb database, casbin permission, lua script plugin and service template configuration.

Node Basic Configuration

Attribute Type Required Description
stage string True Marks node running status and define database to be connected. Database is market-cli-+stage .
dbInit string False Depreciated
depositAddress string False (TODO)If providers want to request resource from each other, they have to top up wallet configured in node.
vsysNetType string True Network of VSYS chain used in node:Mainnet is "M", testnet is"T".
vsysNodeAddress string True VSYS node address.
serverPrivateKey string True Provider's VSYS wallet private key.
sererPublicKey string True Provider's VSYS wallet public key.
tokenId string True Token used to refund or pay for orders.
kubeConfigPath string True File path of configuration file which control remote K8S cluster.
vsysTokenExchangeRate float True Exchange rate between VSYS coin and token in order refund requested by users.
middleware object False Configuration of middlewares in node.
mongodb object True Mongodb configuration in the node.
casbin object True Casbin RBAC configuration of node.
luaPlugin object False Lua script configuration.
platformConf object True Information of platform node which register service.

middleware Configuration

Attribute Type Required Description
authenticationEnable bool True Enable URL request authentication. Requests should contain VSYS wallet address and signature.
providerAllowEnable bool True Only requests from service provider are allowed .

mongodb Configuration

Attribute Type Required Description
endpoint string True Production environment mongodb endpoint
endpointTest string False Test environment mongodb endpoint
timeout int True Mongodb timeout setting
collectionPrefix string True Prefix of mongodb collection name.
indexCreation bool True Create index in collection or not

casbin Configuration

Attribute Type Required Description
enable bool True Enable casbin or not.
debug bool True Enable debug information log or not.
model string True Casbin model config file path; casbin model (opens new window)
autoload bool True Enable auto load or not.
autoloadInterval int True Auto load interval.

luaPlugin Configuration

Attribute Type Required Description
httpSharedKeyPrefix string True Secret key used for Lua script http request body content encryption.

platformConf Configuration

Attribute Type Required Description
tempDir string True The directory of folder store templates(To-be-depreciated).
host string True Vcloud platform domain name or IP.
port string False Listening port.
uploadUri string True Api route.
Last Updated: 2/27/2023, 8:08:10 AM