Categorygithub.com/Decentr-net/vulcan
module
1.5.2
Repository: https://github.com/decentr-net/vulcan.git
Documentation: pkg.go.dev

# README

Vulcan

img img img

Vulcan provides Decentr off-chain functionality. The Vulcan uses decentrcli home for sending messages to blockchain.
You should provide decentrcli home directory to this service. The Vulcan will use it for transactions signing.

Run

Docker

Local image

make image
docker run -it --rm -e "HTTP_HOST=0.0.0.0" -e "HTTP_PORT=7070" -e "LOG_LEVEL=debug" -p "7080:7070" vulcan-local

From source

go run cmd/vulcan/main.go \
    --http.host=0.0.0.0 \
    --http.port=8080 \
    --http.request-timeout 10s \
    --log.level=debug \
    --postgres="host=localhost port=5432 user=postgres password=root sslmode=disable" \
    --postgres.migrations="scripts/migrations/postgres" \
    --mandrill.api_key="MANDRILL_SUCCESS" \
    --mandrill.email_verification_subject="Email confirmation" \
    --mandrill.email_verification_template_name="confirmation" \
    --mandrill.email_welcome_subject="Welcome" \
    --mandrill.email_welcome_template_name="welcome" \
    --mandrill.from_name="decentr noreply" \
    --mandrill.from_email="[email protected]" \
    --blockchain.node="zeus.testnet.decentr.xyz:26656" \
    --blockchain.from="zeus" \
    --blockchain.tx_memo="you're beautiful" \
    --blockchain.initial_stake=1000000

Parameters

vulcand

CLI paramEnvironment varDefaultRequiredDescription
http.hostHTTP_HOST0.0.0.0truehost to bind server
http.portHTTP_PORT8080trueport to listen
http.request-timeoutHTTP_REQUEST_TIMEOUT45sfalserequest processing timeout
http.recaptcha_secretHTTP_RECAPTCHA_SECRETtruerecaptcha secret
postgresPOSTGREShost=localhost port=5432 user=postgres password=root sslmode=disabletruepostgres dsn
postgres.max_open_connectionsPOSTGRES_MAX_OPEN_CONNECTIONS0truepostgres maximal open connections count, 0 means unlimited
postgres.max_idle_connectionsPOSTGRES_MAX_IDLE_CONNECTIONS5truepostgres maximal idle connections count
postgres.migrationsPOSTGRES_MIGRATIONS/migrations/postgrestruepostgres migrations directory
mandrill.api_keyMANDRILL_API_KEYtruemandrillapp.com api key
mandrill.verification_email_subjectMANDRILL_VERIFICATION_EMAIL_SUBJECTdecentr.xyz - Verificationfalsesubject for verification emails
mandrill.verification_email_template_nameMANDRILL_VERIFICATION_EMAIL_TEMPLATE_NAMEtruemandrill's verification template to be sent
mandrill.welcome_email_subjectMANDRILL_WELCOME_EMAIL_SUBJECTdecentr.xyz - Verificationfalsesubject for welcome emails
mandrill.welcome_email_template_nameMANDRILL_WELCOME_EMAIL_TEMPLATE_NAMEtruemandrill's welcome template to be sent
mandrill.from_nameMANDRILL_FROM_NAMEdecentr.xyzfalsename for emails sender
mandrill.from_emailMANDRILL_FROM_NAME[email protected]trueemail for emails sender
blockchain.nodeBLOCKCHAIN_NODEhttp://zeus.mainnet.decentr.xyz:26657truedecentr node address
blockchain.fromBLOCKCHAIN_FROMtruedecentr account name to send stakes
blockchain.tx_memoBLOCKCHAIN_TX_MEMOfalsedecentr tx's memo
blockchain.chain_idBLOCKCHAIN_CHAIN_IDtestnettruedecentr chain id
blockchain.client_homeBLOCKCHAIN_CLIENT_HOME~/.decentrclitruedecentrcli home directory
blockchain.keyring_backendBLOCKCHAIN_KEYRING_BACKENDtesttruedecentrcli keyring backend
blockchain.keyring_prompt_inputBLOCKCHAIN_KEYRING_PROMPT_INPUTfalsedecentrcli keyring prompt input
blockchain.gasBLOCKCHAIN_GAS10falsegas amount
blockchain.feeBLOCKCHAIN_FEE1udecfalsetransaction fee
blockchain.initial_stakeBLOCKCHAIN_INITIAL_STAKE1000000truestakes count to be sent, 1DEC = 1000000 uDEC
referral.threshold_pdvREFERRAL_THRESHOLD_PDV100truehow many uPDV a user should obtain to get a referral reward
referral.threshold_daysREFERRAL_THRESHOLD_DAYS30truehow many days a user should wait to get a referral reward
supply.native_nodeSUPPLY_NATIVE_NODEhttps://zeus.testnet.decentr.xyztruenative rest node address
supply.erc20_nodeSUPPLY_ERC20_NODEtrueerc20 node address
log.levelLOG_LEVELinfofalselevel of logger (debug,info,warn,error)
sentry.dsnSENTRY_DSNsentry dsn
slack.hook-urlSLACK_HOOK_URLfalseslack hook url
slack.channelSLACK_CHANNELalerts-dloanfalseslack channel

referrald

CLI paramEnvironment varDefaultRequiredDescription
postgresPOSTGREShost=localhost port=5432 user=postgres password=root sslmode=disabletruepostgres dsn
postgres.max_open_connectionsPOSTGRES_MAX_OPEN_CONNECTIONS0truepostgres maximal open connections count, 0 means unlimited
postgres.max_idle_connectionsPOSTGRES_MAX_IDLE_CONNECTIONS5truepostgres maximal idle connections count
postgres.migrationsPOSTGRES_MIGRATIONS/migrations/postgrestruepostgres migrations directory
blockchain.nodeBLOCKCHAIN_NODEhttp://zeus.mainnet.decentr.xyz:26657truedecentr node address
blockchain.fromBLOCKCHAIN_FROMtruedecentr account name to send stakes
blockchain.tx_memoBLOCKCHAIN_TX_MEMOfalsedecentr tx's memo
blockchain.chain_idBLOCKCHAIN_CHAIN_IDtestnettruedecentr chain id
blockchain.client_homeBLOCKCHAIN_CLIENT_HOME~/.decentrclitruedecentrcli home directory
blockchain.keyring_backendBLOCKCHAIN_KEYRING_BACKENDtesttruedecentrcli keyring backend
blockchain.keyring_prompt_inputBLOCKCHAIN_KEYRING_PROMPT_INPUTfalsedecentrcli keyring prompt input
blockchain.gasBLOCKCHAIN_GAS10falsegas amount
blockchain.feeBLOCKCHAIN_FEE1udecfalsetransaction fee
blockchain.grpc_node_urlBLOCKCHAIN_GRPC_NODE_URLhera.mainnet.decentr.xyz:9090falseGRPC endpoint url
referral.threshold_pdvREFERRAL_THRESHOLD_PDV0.000100truehow many uPDV a user should obtain to get a referral reward
referral.threshold_daysREFERRAL_THRESHOLD_DAYS30truehow many days a user should wait to get a referral reward
log.levelLOG_LEVELinfofalselevel of logger (debug,info,warn,error)
sentry.dsnSENTRY_DSNsentry dsn

Development

Makefile

Update vendors

Use make vendor

Install required for development tools

You can check all tools existence with make check-all or force installing them with make install-all

golangci-lint 1.29.0

Use make install-linter

swagger v0.25.0

Use make install-swagger

gomock v1.4.3

Use make install-mockgen

Build docker image

Use make image to build local docker image named vulcan-local

Build binary

Use make build to build for your OS or use make linux to build for linux(used in make image)

Run tests

Use make test to run tests. Also you can run tests with integration tag with make fulltest

# Packages

No description provided by the author
No description provided by the author