Tesra

command module
v0.0.0-...-6a5524b Latest Latest
Warning

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

Go to latest
Published: Dec 31, 2019 License: LGPL-3.0 Imports: 42 Imported by: 0

README

Tesranode

Version 0.0.1b

GoDoc Go Report Card Travis

English | 中文

Welcome to the official Go implementation of the Tesranode blockchain!

Tesranode is a high-performance public blockchain project and distributed trust collaboration platform. It is highly customizable and suitable for all kinds of business requirements. The Tesranode MainNet[for testing] was launched on December 31th, 2019.

As a public blockchain project, Tesranode is currently maintained by both the Tesranode core tech team and community members who can all support you in development. There are many available tools for use for development - SDKs, the SmartX IDE, Tesranode blockchain explorer and more.

New features are still being rapidly developed, therefore the master branch may be unstable. Stable versions can be found in the releases section.

Features

  • Scalable lightweight universal smart contracts
  • Scalable WASM contract support
  • Cross-chain interactive protocol
  • Multiple encryption algorithms supported
  • Highly optimized transaction processing speed
  • P2P link layer encryption (optional module)
  • Multiple consensus algorithms supported (VBFT/DBFT/RBFT/SBFT/PoW)
  • Quick block generation time (1-30 seconds)

Build Development Environment

The requirements to build Tesranode are:

  • Golang version 1.11 or later

Download Tesranode

Download Release

You can download a stable compiled version of the Tesranode node software by either:

Build from Source Code

Alternatively, you can build the Tesranode application directly from the source code. Note that the code in the master branch may not be stable.

  1. Clone the Tesranode repository into a appropriate directory but $GOPATH:
$ git clone https://github.com/TesraSupernet/Tesra.git
  1. Build the source code with make:
$ cd Tesra && make all

or

$ cd Tesra && go build -o tesranode main.go

After building the source code successfully, you should see one executable program:

  • tesranode: The primary Tesranode node application and CLI.

Run Tesranode

The Tesranode CLI can run nodes for the MainNet, TestNet and local PrivateNet. Check out the Tesranode CLI user guide for a full list of commands.

MainNet Sync Node

You can run an Tesranode MainNet node built from the source code with:

./tesranode

To run it with a macOS release build:

./tesranode-darwin-amd64

To run it with a Windows release build:

start tesranode-windows-amd64.exe

TestNet Sync Node

You can run an Tesranode TestNet node built from the source code with:

./tesranode --networkid 2

To run it with a macOS release build:

./tesranode-darwin-amd64 --networkid 2

To run it with a Windows release build:

start tesranode-windows-amd64.exe --networkid 2

Local PrivateNet

The Tesranode CLI allows you to run a local PrivateNet on your computer. Before you can run the PrivateNet you will need to create a wallet file. A wallet file named twallet.dat can be generated by running

./tesranode account add -d

To start the PrivateNet built from the source code with:

./tesranode --testmode

Here's an example of the directory structure

$ tree
└── tesranode
    ├── tesranode
    └── twallet.dat

To run it with a macOS release build:

./tesranode-darwin-amd64 --testmode

To run it with a Windows release build:

start tesranode-windows-amd64.exe --testmode

Examples

TST transfer sample

-- from: transfer from; -- to: transfer to; -- amount: TST amount;

 ./tesranode asset transfer  --from=ARVVxBPGySL56CvSSWfjRVVyZYpNZ7zp48 --to=AaCe8nVkMRABnp5YgEjYZ9E5KYCxks2uce --amount=10

If the asset transfer is successful, the result will display as follows:

Transfer TST
  From:ARVVxBPGySL56CvSSWfjRVVyZYpNZ7zp48
  To:AaCe8nVkMRABnp5YgEjYZ9E5KYCxks2uce
  Amount:10
  TxHash:437bff5dee9a1894ad421d55b8c70a2b7f34c574de0225046531e32faa1f94ce

TxHash is the transfer transaction hash, and we can query a transfer result by the TxHash. Due to block time, the transfer transaction will not be executed before the block is generated and added.

If you want to transfer TSG, just add --asset=tsg flag.

Note that TST is an integer and has no decimals, whereas TSG has 9 decimals.

./tesranode asset transfer --from=ARVVxBPGySL56CvSSWfjRVVyZYpNZ7zp48 --to=ARVVxBPGySL56CvSSWfjRVVyZYpNZ7zp48 --amount=95.479777254 --asset=tsg

If transfer of the asset succeeds, the result will display as follows:

Transfer TSG
  From:ARVVxBPGySL56CvSSWfjRVVyZYpNZ7zp48
  To:AaCe8nVkMRABnp5YgEjYZ9E5KYCxks2uce
  Amount:95.479777254
  TxHash:e4245d83607e6644c360b6007045017b5c5d89d9f0f5a9c3b37801018f789cc3

Please note, when you use the address of an account, you can use the index or label of the account instead. Index is the sequence number of a particular account in the wallet. The index starts from 1, and the label is the unique alias of an account in the wallet.

./tesranode asset transfer --from=1 --to=2 --amount=10

Query transfer status sample

./tesranode info status <TxHash>

For Example:

./tesranode info status 10dede8b57ce0b272b4d51ab282aaf0988a4005e980d25bd49685005cc76ba7f

Result:

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

Query account balance sample

./tesranode asset balance <address|index|label>

For Example:

./tesranode asset balance ARVVxBPGySL56CvSSWfjRVVyZYpNZ7zp48

or

./tesranode asset balance 1

Result:

BalanceOf:ARVVxBPGySL56CvSSWfjRVVyZYpNZ7zp48
  TST:989979697
  TSG:28165900

Contributions

Contributors to Tesranode are very welcome! Before beginning, please take a look at our contributing guidelines. You can open an issue by clicking here.

If you have any issues getting setup, open an issue or reach out in the Tesranode Discord.

Open Source Community

Homepage

Main Chain

Computing Chain

License

The Tesranode source code is available under the LGPL-3.0 license.

Documentation

Overview

* Copyright (C) 2019 The TesraSupernet Authors * This file is part of The TesraSupernet library. * * The TesraSupernet 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 TesraSupernet 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 TesraSupernet. If not, see <http://www.gnu.org/licenses/>.

Directories

Path Synopsis
cmd
* Copyright (C) 2019 The TesraSupernet Authors * This file is part of The TesraSupernet library.
* Copyright (C) 2019 The TesraSupernet Authors * This file is part of The TesraSupernet library.
abi
* Copyright (C) 2019 The TesraSupernet Authors * This file is part of The TesraSupernet library.
* Copyright (C) 2019 The TesraSupernet Authors * This file is part of The TesraSupernet library.
sigsvr
* Copyright (C) 2019 The TesraSupernet Authors * This file is part of The TesraSupernet library.
* Copyright (C) 2019 The TesraSupernet Authors * This file is part of The TesraSupernet library.
sigsvr/handlers
* Copyright (C) 2019 The TesraSupernet Authors * This file is part of The TesraSupernet library.
* Copyright (C) 2019 The TesraSupernet Authors * This file is part of The TesraSupernet library.
sigsvr/store
* Copyright (C) 2019 The TesraSupernet Authors * This file is part of The TesraSupernet library.
* Copyright (C) 2019 The TesraSupernet Authors * This file is part of The TesraSupernet library.
utils
* Copyright (C) 2019 The TesraSupernet Authors * This file is part of The TesraSupernet library.
* Copyright (C) 2019 The TesraSupernet Authors * This file is part of The TesraSupernet library.
* Copyright (C) 2019 The TesraSupernet Authors * This file is part of The TesraSupernet library.
* Copyright (C) 2019 The TesraSupernet Authors * This file is part of The TesraSupernet library.
log
core
store/ledgerstore
* Copyright (C) 2019 The TesraSupernet Authors * This file is part of The TesraSupernet library.
* Copyright (C) 2019 The TesraSupernet Authors * This file is part of The TesraSupernet library.
store/overlaydb
* Copyright (C) 2019 The TesraSupernet Authors * This file is part of The TesraSupernet library.
* Copyright (C) 2019 The TesraSupernet Authors * This file is part of The TesraSupernet library.
http
base/actor
Package actor privides communication with other actor Package actor privides communication with other 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) 2019 The TesraSupernet Authors * This file is part of The TesraSupernet library.
Package common privides functions for http handler call * Copyright (C) 2019 The TesraSupernet Authors * This file is part of The TesraSupernet 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 provides functions to for rpc server call
Package rpc provides 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) 2019 The TesraSupernet Authors * This file is part of The TesraSupernet library.
* Copyright (C) 2019 The TesraSupernet Authors * This file is part of The TesraSupernet library.
net/protocol
Package p2p provides an network interface
Package p2p provides an network interface
* Copyright (C) 2019 The TesraSupernet Authors * This file is part of The TesraSupernet library.
* Copyright (C) 2019 The TesraSupernet Authors * This file is part of The TesraSupernet library.
service/native/governance
Governance contract: Users can apply for a candidate node to join consensus selection, deposit TST 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 TST to authorize for candidate nodes, quit selection and unAuthorize for candidate nodes through this contract.
service/native/tstid
* Copyright (C) 2019 The TesraSupernet Authors * This file is part of The TesraSupernet library.
* Copyright (C) 2019 The TesraSupernet Authors * This file is part of The TesraSupernet library.
service/native/utils
* Copyright (C) 2019 The TesraSupernet Authors * This file is part of The TesraSupernet library.
* Copyright (C) 2019 The TesraSupernet Authors * This file is part of The TesraSupernet library.
service/neovm
* Copyright (C) 2019 The TesraSupernet Authors * This file is part of The TesraSupernet library.
* Copyright (C) 2019 The TesraSupernet Authors * This file is part of The TesraSupernet library.
service/util
* Copyright (C) 2019 The TesraSupernet Authors * This file is part of The TesraSupernet library.
* Copyright (C) 2019 The TesraSupernet Authors * This file is part of The TesraSupernet library.
service/wasmvm
* Copyright (C) 2019 The TesraSupernet Authors * This file is part of The TesraSupernet library.
* Copyright (C) 2019 The TesraSupernet Authors * This file is part of The TesraSupernet 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
crossvm_codec
* Copyright (C) 2019 The TesraSupernet Authors * This file is part of The TesraSupernet library.
* Copyright (C) 2019 The TesraSupernet Authors * This file is part of The TesraSupernet library.

Jump to

Keyboard shortcuts

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