ontology

command module
v1.0.3-rc Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 31, 2018 License: LGPL-3.0 Imports: 41 Imported by: 0

README

Ontology

Version 1.0

GoDoc Go Report Card Travis Discord

English | 中文

Welcome to Ontology's source code repository!

Ontology is dedicated to creating a modularized, freely configurable, interoperable cross-chain, high-performance, and horizontally scalable blockchain infrastructure system. Ontology makes deploying and invoking decentralized applications easier.

The code is currently alpha quality, but it is in the process of rapid development. The master code may be unstable; stable versions can be downloaded in the release page.

The public test network is described below. We sincerely welcome and hope more developers join Ontology.

Features

  • Scalable lightweight universal smart contract
  • Scalable WASM contract support
  • Crosschain interactive protocol (processing)
  • Multiple encryption algorithm support
  • Highly optimized transaction processing speed
  • P2P link layer encryption (optional module)
  • Multiple consensus algorithm support (VBFT/DBFT/RBFT/SBFT/PoW)
  • Quick block generation time

Contents

Build development environment

The requirements to build Ontology are:

  • Golang version 1.9 or later
  • Glide (a third party package management tool)
  • Properly configured Go language environment
  • Golang supported operating system

Get Ontology

Get from release

  • You can download latest ontology binary file with curl https://dev.ont.io/ontology_install | sh.

  • You can download other version at release page.

Get from source code

Clone the Ontology repository into the appropriate $GOPATH/src/github.com/ontio directory.

$ git clone https://github.com/ontio/ontology.git

or

$ go get github.com/ontio/ontology

Fetch the dependent third party packages with glide.

$ cd $GOPATH/src/github.com/ontio/ontology
$ glide install

Build the source code with make.

$ make all

After building the source code sucessfully, you should see two executable programs:

  • ontology: the node program/command line program for node control
  • tools/sigsvr: (optional)Ontology Signature Server - sigsvr is a rpc server for signing transactions for some special requirement.detail docs can be reference at link

Run ontology

Mainnet sync node

Run ontology straightly

 ./ontology

Then you can connect to ontology mainnet.

Public test network Polaris sync node

Run ontology straightly

 ./ontology --networkid 2

Then you can connect to ontology public test network.

Testmode

Create a directory on the host and store the following files in the directory:

  • Node program + Node control program ontology
  • Wallet filewallet.dat (wallet.dat can be generated by ./ontology account add)

Run command $ ./ontology --testmode can start single-host test net.

Here's a example of single-host configuration:

  • Directory structure

    $ tree
    └── ontology
        ├── ontology
        └── wallet.dat
    

Run in docker

Please ensure there are docker environment in your machine.

  1. make docker image

    • In the root directory of source code,runmake docker, it will make ontology image in docker.
  2. run ontology image

    • Use command docker run ontio/ontologyto run ontology;

    • If you need to allow interactive keyboard input while the image is running, you can use the docker run -ti ontio/ontology command to start the image;

    • If you need to keep the data generated by image at runtime, you can refer to the data persistence function of docker (e.g. valume);

    • If you need to add ontology parameters, you can add them directly after docker run ontio/ontology such as docker run ontio/ontology --networkid 2. The parameters of ontology command line refer to here.

Some example

ONT transfer sample

-- from: transfer from; -- to: transfer to; -- amount: ont amount;

  ./ontology asset transfer  --to=AXkDGfr9thEqWmCKpTtQYaazJRwQzH48eC --amount=10

If transfer asset successd, the result will show as follow:

Transfer ONT
From:TA6edvwgNy3c1nBHgmFj8KrgQ1JCJNhM3o
To:TA4Xe9j8VbU4m3T1zEa1uRiMTauiAT88op
Amount:10
TxHash:10dede8b57ce0b272b4d51ab282aaf0988a4005e980d25bd49685005cc76ba7f

TxHash is the transfer transaction hash, we can query transfer result by txhash. Because of generate block time, the transfer transaction will not execute befer at least generate one block.

Query transfer status sample

--hash:transfer transaction hash

./ontology asset status --hash=10dede8b57ce0b272b4d51ab282aaf0988a4005e980d25bd49685005cc76ba7f

result:

Transaction:transfer success
From:AXkDGfr9thEqWmCKpTtQYaazJRwQzH48eC
To:AYiToLDT2yZuNs3PZieXcdTpyC5VWQmfaN
Amount:10

Query account balance sample

--address: account address

./ontology asset balance --address=AYiToLDT2yZuNs3PZieXcdTpyC5VWQmfaN

result:

BalanceOf:AYiToLDT2yZuNs3PZieXcdTpyC5VWQmfaN
ONT:10
ONG:0
ONGApprove:0

Further examples you can reference at documentation

Contributions

Please open a pull request with a signed commit. We appreciate your help! You can also send your code as emails to the developer mailing list. You're welcome to join the Ontology mailing list or developer forum.

Please provide detailed submission information when you want to contribute code for this project. The format is as follows:

Header line: explain the commit in one line (use the imperative).

Body of commit message is a few lines of text, explaining things in more detail, possibly giving some background about the issue being fixed, etc.

The body of the commit message can be several paragraphs. Please do proper word-wrap and keep columns shorter than 74 characters or so. That way "git log" will show things nicely even when it is indented.

Make sure you explain your solution and why you are doing what you are doing, as opposed to describing what you are doing. Reviewers and your future self can read the patch, but might not understand why a particular solution was implemented.

Reported-by: whoever-reported-it & Signed-off-by: Your Name youremail@yourhost.com

Open source community

Site

Developer Discord Group

License

The Ontology library is licensed under the GNU Lesser General Public License v3.0, read the LICENSE file in the root directory of the project for details.

Documentation

Overview

* Copyright (C) 2018 The ontology Authors * This file is part of The ontology library. * * The ontology is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * The ontology 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 Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with The ontology. If not, see <http://www.gnu.org/licenses/>.

Directories

Path Synopsis
cmd
* Copyright (C) 2018 The ontology Authors * This file is part of The ontology library.
* Copyright (C) 2018 The ontology Authors * This file is part of The ontology library.
abi
* Copyright (C) 2018 The ontology Authors * This file is part of The ontology library.
* Copyright (C) 2018 The ontology Authors * This file is part of The ontology library.
sigsvr
* Copyright (C) 2018 The ontology Authors * This file is part of The ontology library.
* Copyright (C) 2018 The ontology Authors * This file is part of The ontology library.
sigsvr/handlers
* Copyright (C) 2018 The ontology Authors * This file is part of The ontology library.
* Copyright (C) 2018 The ontology Authors * This file is part of The ontology library.
sigsvr/store
* Copyright (C) 2018 The ontology Authors * This file is part of The ontology library.
* Copyright (C) 2018 The ontology Authors * This file is part of The ontology library.
utils
* Copyright (C) 2018 The ontology Authors * This file is part of The ontology library.
* Copyright (C) 2018 The ontology Authors * This file is part of The ontology library.
* Copyright (C) 2018 The ontology Authors * This file is part of The ontology library.
* Copyright (C) 2018 The ontology Authors * This file is part of The ontology library.
log
core
store/ledgerstore
* Copyright (C) 2018 The ontology Authors * This file is part of The ontology library.
* Copyright (C) 2018 The ontology Authors * This file is part of The ontology library.
http
base/actor
Package actor privides communication with other actor
Package actor privides communication with other actor
base/common
Package common privides functions for http handler call * Copyright (C) 2018 The ontology Authors * This file is part of The ontology library.
Package common privides functions for http handler call * Copyright (C) 2018 The ontology Authors * This file is part of The ontology library.
base/error
Package error privides error code for http
Package error privides error code for http
base/rest
Package rest privides functions to for restful server call
Package rest privides functions to for restful server call
base/rpc
Package rpc privides functions to for rpc server call
Package rpc privides functions to for rpc server call
jsonrpc
Package jsonrpc privides a function to start json rpc server
Package jsonrpc privides a function to start json rpc server
localrpc
Package localrpc privides a function to start local rpc server
Package localrpc privides a function to start local rpc server
nodeinfo
Package nodeinfo privides functions for nodeinfo server
Package nodeinfo privides functions for nodeinfo server
restful
Package restful privides a function to start restful server
Package restful privides a function to start restful server
restful/restful
Package restful privides restful server router and handler
Package restful privides restful server router and handler
websocket
Package websocket privides a function to start websocket server
Package websocket privides a function to start websocket server
websocket/session
Package session privides websocket server manager sessionlist
Package session privides websocket server manager sessionlist
websocket/websocket
Package websocket privides websocket server handler
Package websocket privides websocket server handler
common
* Copyright (C) 2018 The ontology Authors * This file is part of The ontology library.
* Copyright (C) 2018 The ontology Authors * This file is part of The ontology library.
net/protocol
Package p2p provides an network interface
Package p2p provides an network interface
* Copyright (C) 2018 The ontology Authors * This file is part of The ontology library.
* Copyright (C) 2018 The ontology Authors * This file is part of The ontology library.
service/native/governance
Governance contract: Users can apply for a candidate node to join consensus selection, deposit ONT to authorize for candidate nodes, quit selection and unAuthorize for candidate nodes through this contract.
Governance contract: Users can apply for a candidate node to join consensus selection, deposit ONT to authorize for candidate nodes, quit selection and unAuthorize for candidate nodes through this contract.
service/native/ontid
* Copyright (C) 2018 The ontology Authors * This file is part of The ontology library.
* Copyright (C) 2018 The ontology Authors * This file is part of The ontology library.
service/native/utils
* Copyright (C) 2018 The ontology Authors * This file is part of The ontology library.
* Copyright (C) 2018 The ontology Authors * This file is part of The ontology library.
service/neovm
* Copyright (C) 2018 The ontology Authors * This file is part of The ontology library.
* Copyright (C) 2018 The ontology Authors * This file is part of The ontology library.
service/wasmvm
* Copyright (C) 2018 The ontology Authors * This file is part of The ontology library.
* Copyright (C) 2018 The ontology Authors * This file is part of The ontology library.
Package txnpool provides a function to start micro service txPool for external process
Package txnpool provides a function to start micro service txPool for external process
common
Package common provides constants, common types for other packages
Package common provides constants, common types for other packages
proc
Package proc provides functions for handle messages from consensus/ledger/net/http/validators
Package proc provides functions for handle messages from consensus/ledger/net/http/validators
validator
db
vm
neovm
* Copyright (C) 2018 The ontology Authors * This file is part of The ontology library.
* Copyright (C) 2018 The ontology Authors * This file is part of The ontology library.
wasmvm/disasm
Package disasm provides functions for disassembling WebAssembly bytecode.
Package disasm provides functions for disassembling WebAssembly bytecode.
wasmvm/exec
* Copyright (C) 2018 The ontology Authors * This file is part of The ontology library.
* Copyright (C) 2018 The ontology Authors * This file is part of The ontology library.
wasmvm/exec/internal/compile
Package compile is used internally by wagon to convert standard structured WebAssembly bytecode into an unstructured form suitable for execution by it's VM.
Package compile is used internally by wagon to convert standard structured WebAssembly bytecode into an unstructured form suitable for execution by it's VM.
wasmvm/internal/stack
Package stack implements a growable uint64 stack
Package stack implements a growable uint64 stack
wasmvm/validate
package validate provides functions for validating WebAssembly modules.
package validate provides functions for validating WebAssembly modules.
wasmvm/wasm
Package wasm provides functions for reading and parsing WebAssembly modules.
Package wasm provides functions for reading and parsing WebAssembly modules.
wasmvm/wasm/leb128
Package leb128 provides functions for reading integer values encoded in the Little Endian Base 128 (LEB128) format: https://en.wikipedia.org/wiki/LEB128
Package leb128 provides functions for reading integer values encoded in the Little Endian Base 128 (LEB128) format: https://en.wikipedia.org/wiki/LEB128
wasmvm/wasm/operators
Package operators provides all operators used by WebAssembly bytecode, together with their parameter and return type(s).
Package operators provides all operators used by WebAssembly bytecode, together with their parameter and return type(s).

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL