Skip to content
This repository has been archived by the owner on Oct 4, 2019. It is now read-only.

Commit

Permalink
Docker run configurations added.
Browse files Browse the repository at this point in the history
  • Loading branch information
nemothenoone committed Feb 19, 2017
1 parent 1af0f6e commit dcf69e4
Show file tree
Hide file tree
Showing 8 changed files with 461 additions and 8 deletions.
109 changes: 109 additions & 0 deletions contrib/config-for-docker.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
# Endpoint for P2P node to listen on
# p2p-endpoint =

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

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

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

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

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

# Block signing key to use for init witnesses, overrides genesis file
# dbg-init-key =

# 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 network_broadcast_api follow_api market_history_api tag_api

# Plugin(s) to enable, may be specified multiple times
enable-plugin = witness account_history tags follow market_history

# JSON list of [nblocks,nseconds] pairs, see doc/bcd-trigger.md
bcd-trigger = [[0,10],[85,300]]

# Defines a range of accounts to track as a json pair ["from","to"] [from,to]
# track-account-range =

# Ignore posting operations, only track transfers and account updates
# filter-posting-ops =

# Database edits to apply on startup (may specify multiple times)
# edit-script =

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

# Set the maximum size of cached feed for an account
follow-max-feed-size = 500

# Track market history by grouping orders into buckets of equal size measured in seconds specified as a JSON array of numbers
bucket-size = [15,60,300,3600,86400]

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

# Defines a range of accounts to private messages to/from as a json pair ["from","to"] [from,to)
# pm-account-range =

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

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

# name of witness controlled by this node (e.g. initwitness )
# witness =

# name of miner and its private key (e.g. ["account","WIF PRIVATE KEY"] )
# miner =

# Number of threads to use for proof of work mining
# mining-threads =

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

# Account creation fee to be voted on upon successful POW - Minimum fee is 100.000 STEEM (written as 100000)
# miner-account-creation-fee =

# Maximum block size (in bytes) to be voted on upon successful POW - Max block size must be between 128 KB and 750 MB
# miner-maximum-block-size =

# SBD interest rate to be vote on upon successful POW - Default interest rate is 10% (written as 1000)
# miner-sbd-interest-rate =

# declare an appender named "stderr" that writes messages to the console
[log.console_appender.stderr]
stream=std_error

# 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

# 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 stderr too
[logger.p2p]
level=info
appenders=stderr
90 changes: 90 additions & 0 deletions contrib/golosd.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
#!/bin/bash

export HOME="/var/lib/golosd"

STEEMD="/usr/local/bin/golosd"

#if [[ "$USE_WAY_TOO_MUCH_RAM" ]]; then
# STEEMD="/usr/local/golosd-full/bin/golosd"
#fi

chown -R golosd:golosd $HOME

# seed nodes come from doc/seednodes which is
# installed by docker into /etc/golosd/seednodes
SEED_NODES="$(cat /etc/golosd/seednodes | awk -F' ' '{print $1}')"

ARGS=""

# if user did not pass in any desired
# seed nodes, use the ones above:
if [[ -z "$STEEMD_SEED_NODES" ]]; then
for NODE in $SEED_NODES ; do
ARGS+=" --seed-node=$NODE"
done
fi

# if user did pass in desired seed nodes, use
# the ones the user specified:
if [[ ! -z "$STEEMD_SEED_NODES" ]]; then
for NODE in $STEEMD_SEED_NODES ; do
ARGS+=" --seed-node=$NODE"
done
fi

if [[ ! -z "$STEEMD_WITNESS_NAME" ]]; then
ARGS+=" --witness=\"$STEEMD_WITNESS_NAME\""
fi

if [[ ! -z "$STEEMD_MINER_NAME" ]]; then
ARGS+=" --miner=[\"$STEEMD_MINER_NAME\",\"$STEEMD_PRIVATE_KEY\"]"
ARGS+=" --mining-threads=$(nproc)"
fi

if [[ ! -z "$STEEMD_PRIVATE_KEY" ]]; then
ARGS+=" --private-key=$STEEMD_PRIVATE_KEY"
fi

# overwrite local config with image one
cp /etc/golosd/config.ini $HOME/config.ini

chown golosd:golosd $HOME/config.ini

if [[ ! -d $HOME/blockchain ]]; then
if [[ -e /var/cache/golosd/blocks.tbz2 ]]; then
# init with blockchain cached in image
ARGS+=" --replay-blockchain"
mkdir -p $HOME/blockchain/database
cd $HOME/blockchain/database
tar xvjpf /var/cache/golosd/blocks.tbz2
chown -R golosd:golosd $HOME/blockchain
fi
fi

# without --data-dir it uses cwd as datadir(!)
# who knows what else it dumps into current dir
cd $HOME

# slow down restart loop if flapping
sleep 1

if [[ ! -z "$STEEMD_RPC_ENDPOINT" ]]; then
RPC_ENDPOINT=$STEEMD_RPC_ENDPOINT
else
RPC_ENDPOINT="0.0.0.0:8090"
fi

if [[ ! -z "$STEEMD_P2P_ENDPOINT" ]]; then
P2P_ENDPOINT=$STEEMD_P2P_ENDPOINT
else
P2P_ENDPOINT="0.0.0.0:2001"
fi

exec chpst -ugolosd \
$STEEMD \
--rpc-endpoint=${RPC_ENDPOINT} \
--p2p-endpoint=${P2P_ENDPOINT} \
--data-dir=$HOME \
$ARGS \
$STEEMD_EXTRA_OPTS \
2>&1
8 changes: 4 additions & 4 deletions doc/Python-Debug-Node.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Python Debug Node Readme
------------------------

The Python Debug Node is a wrapper class that automates the creation and maintenance
of a running Steem Debug Node. The Debug Node is a plugin for Steem that allows realtime
of a running Golos Debug Node. The Debug Node is a plugin for Golos that allows realtime
local modification of the chain state in a way that mimicks real world behaviors
without corrupting a localally saved blockchain or propogating changes to the live chain.

Expand All @@ -19,7 +19,7 @@ is a higher level language that many amateur and skilled programmers use. There
been community development of Python libraries to make interfacing with a live node easier.
This plugin closes the gap by allowing a node to be launched programmatically in Python
in addition to interfacing with the node. This module utilizes community member Xeroc's
[Python Steem library](https://github.com/xeroc/python-steemlib).
[Python Golos library](https://github.com/xeroc/python-steemlib).

How Do I Use This?
------------------
Expand Down Expand Up @@ -60,7 +60,7 @@ a system standard temp directory through the standard Python TemporaryDirectory
working data directory for the running node. The only work your script needs to do is
specify the steemd binary location and a populated data directory. For most configurations
this will be `programs/steemd/steemd` and `witness_node_data_dir` respectively, from the
git root directory for Steem.
git root directory for Golos.

TODO/ Long Term Goals
---------------------
Expand All @@ -75,4 +75,4 @@ the RPC call. Most, if not all, RPC API calls could be programatically generated
the C++ source. It would also be a good step forward to introduce a simple testing framework
that could be used to start a debug node and then run a series of test cases on a common
starting chain state. This would address much of the integration testing that is sorely
needed for Steem.
needed for Golos.
2 changes: 1 addition & 1 deletion doc/api-notes.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ There are three methods to secure the API:
- Limit access to the API socket to a trusted LAN by firewall configuration
- Limit access to particular API's with username/password authentication

The Steem developers recommend using the first of these methods to secure the API by binding to localhost, as follows:
The Golos developers recommend using the first of these methods to secure the API by binding to localhost, as follows:

rpc-endpoint = 127.0.0.1:8090

Expand Down
Loading

0 comments on commit dcf69e4

Please sign in to comment.