Getting Started

This page describes how to drive ADC.
Please run it on Ubuntu or Docker.

Ubuntu

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

$ wget http://developer.aladdinchain.io/download/adc_testnet.tar
$ tar -xvf adc_testnet.tar
$ cd adc_testnet
$ ./adc_testnet &
------------------------------------------------------

            STARTING SIGMAENGINE NETWORK

------------------------------------------------------
root public key: ADC5icoK2tPfK4JjXF6fWYuCPPg6awJd8jQvea6ExPZVAyLN4nyM1
chain id: 6220ab76142634aa0a2e54ede36c75d35900c35d30c8989196bef90673443a0a
blockchain version: 0.1.0
s/w version: 0.1.0
------------------------------------------------------

Docker

If it's not Ubuntu, run it with Docker. You can run it after receiving an image from the Docker Hub. The p2p port is set to 6001 and the rpc port is set to 6002.

$ docker run --name adc_testnet -p 7002:7002 -p 7001:7001 aladdinchain/adc_testnet:lastest /adc_testnet/adcd_testnet --data-dir=/adc_testnet/node_data_dir/
------------------------------------------------------

            STARTING SIGMAENGINE NETWORK

------------------------------------------------------
root public key: ADC5icoK2tPfK4JjXF6fWYuCPPg6awJd8jQvea6ExPZVAyLN4nyM1
chain id: 6220ab76142634aa0a2e54ede36c75d35900c35d30c8989196bef90673443a0a
blockchain version: 0.1.0
s/w version: 0.1.0
------------------------------------------------------
199216ms th_a       main.cpp:172                  main                 ] parsing options
199216ms th_a       main.cpp:174                  main                 ] initializing node
199216ms th_a       main.cpp:176                  main                 ] initializing plugins
199216ms th_a       application.cpp:1160          initialize_plugins   ] Initializing plugin account_by_key
199216ms th_a       account_by_key_plugin.cpp:193 plugin_initialize    ] Initializing account_by_key plugin
199216ms th_a       application.cpp:1160          initialize_plugins   ] Initializing plugin account_history
199216ms th_a       application.cpp:1160          initialize_plugins   ] Initializing plugin bobserver
199216ms th_a       application.cpp:1160          initialize_plugins   ] Initializing plugin dapp
199216ms th_a       dapp_plugin.cpp:216           plugin_initialize    ] Intializing dapp plugin
199216ms th_a       application.cpp:1160          initialize_plugins   ] Initializing plugin dapp_history
199216ms th_a       dapp_history_plugin.cpp:114   plugin_initialize    ] Intializing dapp history plugin
199216ms th_a       application.cpp:1160          initialize_plugins   ] Initializing plugin token
199216ms th_a       token_plugin.cpp:137          plugin_initialize    ] Intializing token plugin
199216ms th_a       main.cpp:179                  main                 ] starting node
199216ms th_a       application.cpp:259           startup              ] Backtrace on segfault is enabled
199216ms th_a       application.cpp:263           startup              ] shared_file_size is 57982058496 bytes
199216ms th_a       application.hpp:104           register_api_factory ] name: login_api
199216ms th_a       application.hpp:104           register_api_factory ] name: database_api
199216ms th_a       application.hpp:104           register_api_factory ] name: network_node_api
199216ms th_a       application.hpp:104           register_api_factory ] name: network_broadcast_api
199216ms th_a       application.cpp:281           startup              ] Starting SigmaEngine node in write mode.
199216ms th_a       application.cpp:302           startup              ] _options->count(black-list) : 0
199249ms th_a       database.cpp:1553             show_free_memory     ] Free memory is now 53G
199249ms th_a       application.cpp:393           startup              ] API database_api enabled publicly
199249ms th_a       application.cpp:393           startup              ] API login_api enabled publicly
199249ms th_a       application.cpp:393           startup              ] API account_by_key_api enabled publicly
199249ms th_a       application.cpp:393           startup              ] API network_broadcast_api enabled publicly
199249ms th_a       application.cpp:393           startup              ] API dapp_api enabled publicly
199249ms th_a       application.cpp:393           startup              ] API token_api enabled publicly
199249ms th_a       application.cpp:393           startup              ] API dapp_history_api enabled publicly
199260ms th_a       application.cpp:106           reset_p2p_node       ] Adding seed node 3.34.142.46:7001
199261ms th_a       application.cpp:137           reset_p2p_node       ] Configured p2p node to listen on 0.0.0.0:7001
199261ms th_a       application.cpp:145           reset_p2p_node       ] head_block_id: 0000000000000000000000000000000000000000
199261ms th_a       application.cpp:187           reset_websocket_serv ] Configured websocket rpc to listen on 0.0.0.0:7002
199261ms th_a       main.cpp:181                  main                 ] starting plugins
199261ms th_a       application.hpp:104           register_api_factory ] name: account_by_key_api
199261ms th_a       account_history_plugin.cpp:329 plugin_startup       ] account_history plugin: plugin_startup() begin
199261ms th_a       account_history_plugin.cpp:331 plugin_startup       ] account_history plugin: plugin_startup() end
199261ms th_a       bobserver_plugin.cpp:390      plugin_startup       ] bobserver plugin:  plugin_startup() begin
199261ms th_a       bobserver_plugin.cpp:408      plugin_startup       ] No bobservers configured! Please add bobserver names and private keys to configuration.
199261ms th_a       bobserver_plugin.cpp:410      plugin_startup       ] bobserver plugin:  plugin_startup() end
199261ms th_a       application.hpp:104           register_api_factory ] name: dapp_api
199261ms th_a       application.hpp:104           register_api_factory ] name: dapp_history_api
199261ms th_a       application.hpp:104           register_api_factory ] name: token_api
199261ms th_a       main.cpp:198                  operator()           ] Started bobserver node on a chain with 0 blocks.
199567ms th_a       database.cpp:2252             apply_hardfork       ] HARDFORK 1 at block 1
202008ms th_a       application.cpp:500           handle_block         ] Syncing Blockchain --- Got block: #10000 time: 2021-09-29T15:27:24
Copy

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 = 3.34.142.46:7001
seed-node = 3.35.172.164:7001

# 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 = true

# 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
2021-11-19T08:08:30 th_a:invoke handle_block         handle_block ] Got 0 transactions on block 1469580 by adctestnetbp18 -- latency: 24 ms                     application.cpp:523
2021-11-19T08:08:33 th_a:invoke handle_block         handle_block ] Got 0 transactions on block 1469581 by adctestnetbp21 -- latency: 25 ms                     application.cpp:523
2021-11-19T08:08:36 th_a:invoke handle_block         handle_block ] Got 0 transactions on block 1469582 by adctestnetbp09 -- latency: 29 ms                     application.cpp:523
2021-11-19T08:08:39 th_a:invoke handle_block         handle_block ] Got 0 transactions on block 1469583 by adctestnetbp10 -- latency: 24 ms                     application.cpp:523
2021-11-19T08:08:42 th_a:invoke handle_block         handle_block ] Got 0 transactions on block 1469584 by adctestnetbp12 -- latency: 24 ms                     application.cpp:523
2021-11-19T08:08:45 th_a:invoke handle_block         handle_block ] Got 0 transactions on block 1469585 by adctestnetbp20 -- latency: 25 ms                     application.cpp:523
2021-11-19T08:08:48 th_a:invoke handle_block         handle_block ] Got 0 transactions on block 1469586 by adctestnetbp08 -- latency: 26 ms                     application.cpp:523
2021-11-19T08:08:51 th_a:invoke handle_block         handle_block ] Got 0 transactions on block 1469587 by adctestnetbp17 -- latency: 26 ms                     application.cpp:523
2021-11-19T08:08:54 th_a:invoke handle_block         handle_block ] Got 0 transactions on block 1469588 by adctestnetbp16 -- latency: 25 ms                     application.cpp:523
2021-11-19T08:08:57 th_a:invoke handle_block         handle_block ] Got 0 transactions on block 1469589 by adctestnetbp03 -- latency: 25 ms                     application.cpp:523
2021-11-19T08:09:00 th_a:invoke handle_block         handle_block ] Got 0 transactions on block 1469590 by adctestnetbp14 -- latency: 26 ms                     application.cpp:523
Copy

©2021 ADC. All rights reserved.

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.