📁
shine
  • Introduction to the Shine Blockchain platform
  • Shine overview
  • Shine USP
  • About EOSIO
  • Consensus mechanisms
  • Shine Proof of Authority consensus
  • Data privacy
  • Scalability
  • Business details
    • Why Blockchain
    • Why another Blockchain platform
    • Applications of Shine
      • Assumptions
      • Precious metals traceability
      • Food traceability
        • Spices
        • Perishables
        • Seafood
      • Carbon footprint monitoring
  • Tools, Technologies, and Architecture
    • Docker
    • MongoDB
    • Encryption
    • Server Security
    • Server requirements
    • Architecture
    • Transaction flows
  • Protocol
    • Microservices and APIs
    • Account management
  • Shine Blockchain Setup
    • SHINE Software Installation
    • Create Private/Public key pairs
    • Start the Blockchain node
    • Deploying System Smart Contracts
    • Add Producer/Validator Nodes
    • Node Security Setup
    • Deploying Traceability Smart Contracts
  • Backend Setup
    • Installing Prerequisites
    • Starting The Application
  • Front end Setup
    • User Interface
Powered by GitBook
On this page
  • Edit config file
  • Create log file
  • Edit Genesis file
  • Create systemd
  • Start the node

Was this helpful?

  1. Shine Blockchain Setup

Start the Blockchain node

Now we have everything we require to start the node, we will keep all the config files below ready on server to spin the node.

Edit config file

This is sample config file which can be edit as per business and security requirements:

Replace PRODUCER_NAME, PUBLIC_KEY and PRIVATE_KEY.

cat >etc/config.ini <<'EOT'
producer-name = PRODUCER_NAME
signature-provider=PUBLIC_KEY=KEY:PRIVATE_KEY
enable-stale-production = true

http-server-address = 0.0.0.0:8888
p2p-listen-endpoint = 0.0.0.0:9851

access-control-allow-origin = *
http-validate-host = false
contracts-console = true
verbose-http-errors = true

plugin = eosio::chain_plugin
plugin = eosio::chain_api_plugin
plugin = eosio::producer_plugin
plugin = eosio::producer_api_plugin
plugin = eosio::http_plugin
plugin = eosio::history_api_plugin
plugin = eosio::history_plugin

plugin = eosio::state_history_plugin
plugin = eosio::net_plugin

trace-history = true
chain-state-history = true
trace-history-debug-mode = true
state-history-endpoint = 0.0.0.0:8081

EOT

Change 0.0.0.0 to internal IP for security purposes.

Create log file

cat >etc/logging.json <<'EOT'
{
  "includes": [],
  "appenders": [{
      "name": "consoleout",
      "type": "console",
      "args": {
        "stream": "std_out",
        "level_colors": [{
            "level": "debug",
            "color": "green"
          },{
            "level": "warn",
            "color": "brown"
          },{
            "level": "error",
            "color": "red"
          }
        ]
      },
      "enabled": true
    }
  ],
  "loggers": [{
      "name": "default",
      "level": "warn",
      "enabled": true,
      "additivity": false,
      "appenders": [
        "consoleout"
      ]
    }
  ]
}
EOT

Edit Genesis file

This is sample genesis file, where we need to edit only three things, initial_timestamp, initial_key and initial_chain_id.

cat >etc/genesis.json <<'EOT'
{
  "initial_timestamp": "2020-06-25T00:00:00.000",
  "initial_key": "PUBLIC_KEY",
  "initial_configuration": {
    "max_block_net_usage": 1048576,
    "target_block_net_usage_pct": 1000,
    "max_transaction_net_usage": 524288,
    "base_per_transaction_net_usage": 12,
    "net_usage_leeway": 500,
    "context_free_discount_net_usage_num": 20,
    "context_free_discount_net_usage_den": 100,
    "max_block_cpu_usage": 100000,
    "target_block_cpu_usage_pct": 500,
    "max_transaction_cpu_usage": 50000,
    "min_transaction_cpu_usage": 100,
    "max_transaction_lifetime": 3600,
    "deferred_trx_expiration_window": 600,
    "max_transaction_delay": 3888000,
    "max_inline_action_size": 4096,
    "max_inline_action_depth": 4,
    "max_authority_depth": 6
  },
  "initial_chain_id": "00000000000000000000000000000000000000000000000000005368696e650a"
}
EOT

Create systemd

systemd service manager will take care of on-demand starting of daemons.

cat >etc/shine.service <<'EOT'
[Unit]
Description=Shine
[Service]
Type=simple
ExecStart=/usr/bin/nodeos --genesis-json /home/shine/etc/genesis.json --data-dir /home/shine/data/ --config-dir /home/shine/etc/ --disable-replay-opts
TimeoutStartSec=30s
TimeoutStopSec=300s
Restart=no
User=root
Group=daemon
KillMode=control-group
[Install]
WantedBy=multi-user.target
EOT

Start the node

Finally we are ready to spin the node, on entering below command we should have our new private-net node up and running and producing blocks.

sudo cp etc/shine.service /etc/systemd/system/
sudo systemctl daemon-reload
sudo systemctl enable shine
sudo systemctl restart shine
PreviousCreate Private/Public key pairsNextDeploying System Smart Contracts

Last updated 1 year ago

Was this helpful?