- Dnode - Dfinance Blockchain node.
- PegZone - PegZone smart contracts.
- OracleApp - oracle node, which fetches price feeds from exchanges.
There are two ways to install and try DVM - with Docker or with Rust-toolchain.
You can use this schema for your docker-compose to run everything at once:
version: '3.7'
services:
dvm-server:
container_name: dvm-server
image: dfinance/dvm
restart: always
network_mode: host
command: ./dvm "http://0.0.0.0:50051" "http://127.0.0.1:50052"Or you can pull container from docker hub and run it by yourself:
# pull the latest containers
docker pull dfinance/dvmThat is how you do it:
# run virtual machine & compilation server
docker run -d --rm --network host --name dvm -p 50051:50051 registry.wings.toys/dfinance/dvm:master ./dvm "http://0.0.0.0:50051" "http://127.0.0.1:50052"# stop the server
docker stop dvmCheck out Usage part for more info.
To install using cargo run the following commands:
git clone https://github.com/dfinance/dvm.git && cd dvm
# for all binaries:
cargo install --path ./cli --bins
# or for dvm only:
# cargo install --path ./cli --bin dvmAs result you will get the following executables into your .cargo/bin directory:
dvm- virtual machine & compilation servermovec- standalone compilerstdlib-builder- standard library builder (useful for genesis creation)status-table- table of status/error-codes exporter tool
Uninstallation: cargo uninstall dvm.
Note: Following instructions are for standalone binary executables. If you want to use
cargoto build & run, just addcargo run --binat the start of the mentioned command.
dvm is a Move/Mvir virtual machine gRPC server.
API described in protobuf schemas.
To launch the DVM server use this command:
# format: <which host:port to listen> <data-source address>
dvm "http://[::1]:50051" "http://[::1]:50052"DVM has built-in Move compilation gRPC server. API described in protobuf schemas.
stdlib-builder is a standard library builder.
To build standard library run:
# format: <source directory> [-o output-file] [--verbose] [-p] [--help]`
# print output to stdout:
stdlib-builder stdlib/modules -p
# or write output to the file:
stdlib-builder stdlib/modules -po ./stdlib.jsonTo build your stdlib run:
stdlib-builder /path-to-your/stdlib -po ./stdlib.jsonDVM require positional argument described as <data-source address>.
This is URI of a data source server, typically Dnode, local or external.
This argument can be ommited because we'll read the DVM_DATA_SOURCE environment variable as fallback.
All of this URIs are supports following schemes:
httpipc(using UDS), e.g.:ipc://tmp/dir/file(absolute path)ipc://./dir/file(relative path with.and..)ipc://~/dir/file(relative to$HOME)
Positional arguments have higher priority than environment variables, and override them when specified.
For example:
# using env var:
DVM_DATA_SOURCE="http://[::1]:50052" dvm "http://[::1]:50051"
# or using positional arg:
dvm "http://[::1]:50051" "http://[::1]:50052"
# both is sameBut env vars used just as fallback, so args are higher prioritised.
DVM_DATA_SOURCE="http://[::1]:42" dvm "http://[::1]:50051" "http://[::1]:50052"
# There DVM will listen port 50051
# and connect to data source on 50052 port
# ignoring env variable.DVM_DATA_SOURCE- Data-source address. Used if relevant positional argument isn't specified.DVM_LOG- Log filters. The same as standardRUST_LOGenvironment variable. Possible values in verbosity ordering:error,warn,info,debugandtrace. For complex filters see documentationDVM_LOG_STYLE- Log colors. The same as standardRUST_LOG_STYLE. Possible values in verbosity ordering:auto,always,never.DVM_SENTRY_DSN- Optional key-uri, enables crash logging service integration. If value ommited, crash logging service will not be initialized. E.g.:DVM_SENTRY_DSN=https://your-dsn@uri dvm "http://[::1]:50051"DVM_SENTRY_ENVIRONMENT- Sets the environment code to separate events from testnet and production. Optional. Works with Sentry integration. E.g.:DVM_SENTRY_ENVIRONMENT="testnet"
Optional arguments have higher priority than environment variables, and override them when specified.
--log- same asDVM_LOG--log-color- same asDVM_LOG_STYLE--sentry-dsn- same asDVM_SENTRY_DSN--sentry-env- same asDVM_SENTRY_ENVIRONMENT
For more info run dvm with --help.
Just clone this repo and hack some:
# clone the repository
git clone https://github.com/dfinance/dvm.git
cd dvm
# build and run vm
cargo run --bin dvm -- --helpCheck out online documentation built on CI for latest release.
To launch tests run:
cargo test --allList of contributors is here.
To help project you always can open issue or fork, modify code in your own fork and open pull request.
Useful precommit-hook to check changes locally:
ln -s `git rev-parse --show-toplevel`/check_project.sh `git rev-parse --absolute-git-dir`/hooks/pre-commitCopyright © 2020 Wings Stiftung
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.