TCN blockchain logo

Getting Started

This page describes how to drive TNC.
Please run it on Ubuntu.

Ubuntu

TNC needs ubuntu 16.04. When you download, decompress, and run the file, synchronization with the seed nodes automatically proceed.

$ wget https://testnet.tncdapp.com/download/tnc_testnet.tar
$ tar -xvf tnc_testnet.tar
$ cd tnc_testnet
$ ./tnc_testnet
------------------------------------------------------

            STARTING SIGMAENGINE NETWORK

------------------------------------------------------
root public key: TNC7k2C6MGSWsxrezJ3Tdu8kDCrjMiWcCo7AvRyexXibYZknzuai6
chain id: 92deec447baf67f490c59eacb71f2d951bab2c411b786874f8e5db2d53e1e6b6
blockchain version: 0.1.0
s/w version: 0.1.0
------------------------------------------------------

config.ini

To change the settings, change the [config.ini] in the [node_data_dir] folder and run it again.

  • p2p-endpoint : Set the port to open with p2p
  • rpc-endpoint : Set the port to open with rpc
  • seed-node : seed node information
# Endpoint for P2P node to listen on
p2p-endpoint = 0.0.0.0:7001

# Maxmimum number of incoming connections on P2P endpoint
# p2p-max-connections =

# P2P nodes to connect to on startup (may specify multiple times)
seed-node =

# Pairs of [BLOCK_NUM,BLOCK_ID] that should be enforced as checkpoints.
# checkpoint =

# Location of the shared memory file. Defaults to data_dir/blockchain
# shared-file-dir =

# Size of the shared memory file. Default: 54G
shared-file-size = 54G

# Endpoint for websocket RPC to listen on
rpc-endpoint = 0.0.0.0:7002

# Endpoint for TLS websocket RPC to listen on
# rpc-tls-endpoint =

# Endpoint to forward write API calls to for a read node
# read-forward-rpc =

# The TLS certificate file for this server
# server-pem =

# Password for this certificate
# server-pem-password =

# API user specification, may be specified multiple times
# api-user =

# Set an API to be publicly available, may be specified multiple times
public-api = database_api login_api account_by_key_api network_broadcast_api dapp_api token_api dapp_history_api

# Plugin(s) to enable, may be specified multiple times
enable-plugin = bobserver account_history account_by_key dapp token dapp_history

# Maximum age of head block when broadcasting tx via API
max-block-age = 200

# Flush shared memory file to disk this many blocks
flush = 100000

# Whether to print backtrace on SIGSEGV
backtrace = yes

# Defines a range of accounts to track as a json pair ["from","to"] [from,to] Can be specified multiple times
# track-account-range =

# Defines a list of operations which will be explicitly logged.
# history-whitelist-ops =

# Defines a list of operations which will be explicitly ignored.
# history-blacklist-ops =

# Track blockchain statistics by grouping orders into buckets of equal size measured in seconds specified as a JSON array of numbers
chain-stats-bucket-size = [60,3600,21600,86400,604800,2592000]

# How far back in time to track history for each bucket size, measured in the number of buckets (default: 100)
chain-stats-history-per-bucket = 100

# Enable block production, even if the chain is stale.
enable-stale-production = false

# Percent of bobservers (0-99) that must be participating in order to produce blocks
required-participation = false

# name of bobserver controlled by this node (e.g. initbobserver )
#bobserver =

# WIF PRIVATE KEY to be used by one or more bobservers or miners
#private-key =

# RPC endpoint of a trusted validating node (required)
# trusted-node =

log_config.ini

To change log settings, change log_config.ini in the node_data_dir folder and re-run it.

  • log.console_appender.stderr : Set when running in foreground.
  • log.file_appender.stderr : Set when running in the background. Logs are stored in that path at 1-hour intervals.
  • level : There are three modes in info, debug, warn
# declare an appender named "stderr" that writes messages to the console
#[log.console_appender.stderr]
#stream=std_error

[log.file_appender.stderr]
filename=logs/default/default.log
limit_days=7

# declare an appender named "p2p" that writes messages to p2p.log
[log.file_appender.p2p]
filename=logs/p2p/p2p.log
# filename can be absolute or relative to this config file
limit_days=7

# route any messages logged to the default logger to the "stderr" logger we
# declared above, if they are info level are higher
[logger.default]
level=info
appenders=stderr

# route messages sent to the "p2p" logger to the p2p appender declared above
[logger.p2p]
level=warn
appenders=p2p

log

This is how to check the log when running in the background. (log.file_appender.stderr option in log_config.ini)

  • Log files are stored in the node_data_dir/logs/default/ folder and stored for 7 days.
  • The current log file changes to a different file every 0 minutes, so run it again.
$ tail -f node_data_dir/logs/default/default.log
2020-10-12T03:01:30 th_a:invoke handle_block         handle_block ] Got 0 transactions on block 469580 by tnctestnetbp18 -- latency: 24 ms                     application.cpp:523
2020-10-12T03:01:33 th_a:invoke handle_block         handle_block ] Got 0 transactions on block 469581 by tnctestnetbp21 -- latency: 25 ms                     application.cpp:523
2020-10-12T03:01:36 th_a:invoke handle_block         handle_block ] Got 0 transactions on block 469582 by tnctestnetbp09 -- latency: 29 ms                     application.cpp:523
2020-10-12T03:01:39 th_a:invoke handle_block         handle_block ] Got 0 transactions on block 469583 by tnctestnetbp10 -- latency: 24 ms                     application.cpp:523
2020-10-12T03:01:42 th_a:invoke handle_block         handle_block ] Got 0 transactions on block 469584 by tnctestnetbp12 -- latency: 24 ms                     application.cpp:523
2020-10-12T03:01:45 th_a:invoke handle_block         handle_block ] Got 0 transactions on block 469585 by tnctestnetbp20 -- latency: 25 ms                     application.cpp:523
2020-10-12T03:01:48 th_a:invoke handle_block         handle_block ] Got 0 transactions on block 469586 by tnctestnetbp08 -- latency: 26 ms                     application.cpp:523
2020-10-12T03:01:51 th_a:invoke handle_block         handle_block ] Got 0 transactions on block 469587 by tnctestnetbp17 -- latency: 26 ms                     application.cpp:523
2020-10-12T03:01:54 th_a:invoke handle_block         handle_block ] Got 0 transactions on block 469588 by tnctestnetbp16 -- latency: 25 ms                     application.cpp:523
2020-10-12T03:01:57 th_a:invoke handle_block         handle_block ] Got 0 transactions on block 469589 by tnctestnetbp03 -- latency: 25 ms                     application.cpp:523
2020-10-12T03:02:00 th_a:invoke handle_block         handle_block ] Got 0 transactions on block 469590 by tnctestnetbp14 -- latency: 26 ms                     application.cpp:523
Copy

COPYRIGHT © TNC. ALL RIGHTS RESERVES.

Close

Create Post

Close

Edit Post

Close

Post Password

Please enter the password
you entered when writing the post to edit the post.

Close

Post Password

Please enter the password
you entered when creating the post to delete the post.

Close

Please enter a nickname.

Your post has been completed.