Sign inSign up

someguy123/jussi

By someguy123

•Updated over 6 years ago

Image
0

307

someguy123/jussi repository overview

This is a pre-built binary Docker image for Jussi. It's built from the Hive fork of steemit/jussi, but should work with Steem and any other Steem-based RPC node.

The Jussi source code can be found here: https://gitlab.syncad.com/hive/jussi/-/tree/autoclave⁠

At the time of writing, the latest tag is built from the autoclave branch of hive/jussi.

Quickstart Jussi for usage with hive-docker/steem-docker

The below quickstart commands downloads the basic.conf example config from Privex⁠'s CDN, creates a Jussi container (should auto-install this image too) with /jussi/config.json mounted as a volume within the container, exposes Jussi to port 8080 to the internet, and starts the container in the background.

basic.conf is a simple Jussi configuration which sends appbase and steemd endpoints to http://seed:8091, with sensible default TTLs and Timeout's.

If your Hive/Steem container isn't set to the default of seed - you'll need to adjust config.json and replace http://seed with http://YOUR_CONTAINER_NAME, and change the docker run command --link seed to --link YOUR_CONTAINER_NAME

sudo su -

# Create /jussi folder and download basic config file into /jussi/config.json
mkdir /jussi
wget -O /jussi/config.json https://cdn.privex.io/extras/configs/jussi/basic.conf

# Run someguy123/jussi as the container name 'jussi', with config.json mounted into the container
# and expose port 8080 to the internet. If you don't want to expose Jussi to the internet, 
# change '8080:8080' to '127.0.0.1:8080:8080' to limit it to localhost.
docker run -itd --link seed --name jussi -h jussi -v "/jussi/config.json:/app/DEV_config.json" -p 8080:8080 someguy123/jussi

Convert a hive-docker seed/witness into a fully functional RPC node

You can easily convert any existing hive-docker Hive seed / witness node into a basic RPC node with nginx + jussi by using Privex's mkrpc script.

The mkrpc script uses a Jussi config which only forwards endpoints to your node that a low memory mode node with no major plugins can handle. Full node / account history etc. will be forwarded to https://hived.privex.io⁠ by default, allowing your server to function like a full RPC node, despite being a low memory seed/witness node.

The mkrpc script will:

  • Adjust your hive-docker config.ini to have the plugins witness condenser_api network_broadcast_api rc_api account_by_key database_api block_api
  • Restart your Hive node
  • Download https://cdn.privex.io/extras/rpc/jussiconfig.json⁠ into /jussi/config.json
  • Creates a jussi container using this image, exposing port 8080
  • Installs nginx if it isn't already installed
  • Deletes the default nginx site to prevent conflicts!
  • Configures nginx to connect to Jussi, using the domain MYDOM from the environment
  • Restarts nginx

Once the script is finished, you should be able to send RPC queries via standard HTTP to the domain you pointed at the server :)

NOTE: I recommend reviewing the source code of the script, so that you understand the changes it will make to your system: https://cdn.privex.io/extras/rpc/mkrpc.sh⁠

# !!!!! WARNING !!!!!
# PLEASE BE CAREFUL IF YOU HAVE AN EXISTING NGINX SETUP! It will delete the nginx default / default.conf site.
# mkrpc.sh will delete /etc/nginx/sites-enabled/default and/or default.conf if they are present.
# It will also set the RPC site 'seed.conf' as 'default_server'
# !!!!! WARNING !!!!!

# Become root. Don't do 'sudo bash' because it will lose your exported variables
sudo su -
# Set MYDOM to the domain you'll be pointing at your server for the RPC node
export MYDOM="seed.mydomain.com"

# Set SIAB to point to your someguy123/hive-docker installation.
# SIAB defaults to /hive if you don't set it.
export SIAB="/root/steem-docker"

# Download and run the mkrpc script
curl -fsSL https://cdn.privex.io/extras/rpc/mkrpc.sh | bash

# Test that your RPC is working
curl -v -fsSL --data '{"jsonrpc": "2.0", "method": "call", "params": ["database_api", "get_dynamic_global_properties", []], "id": 1}' http://127.0.0.1

If you are setting up a full RPC node, Privex also has these two example configs available, which are designed for the Privex Dual RPC Node Setup⁠:

Basic Jussi Config

{
    "limits": {
        "blacklist_accounts":["non-steemit"]
    },
    "upstreams":[
        {
            "name":"steemd",
            "translate_to_appbase":true,
            "urls":[
                ["steemd","http://seed:8091"]
            ],
            "ttls":[
                ["steemd",3],
                ["steemd.login_api",-1],
                ["steemd.network_broadcast_api",-1],
                ["steemd.follow_api",10],
                ["steemd.market_history_api",1],
                ["steemd.database_api",3],
                ["steemd.database_api.get_block",-2],
                ["steemd.database_api.get_block_header",-2],
                ["steemd.database_api.get_content",1],
                ["steemd.database_api.get_state",1],
                ["steemd.database_api.get_state.params=['/trending']",30],
                ["steemd.database_api.get_state.params=['trending']",30],
                ["steemd.database_api.get_state.params=['/hot']",30],
                ["steemd.database_api.get_state.params=['/welcome']",30],
                ["steemd.database_api.get_state.params=['/promoted']",30],
                ["steemd.database_api.get_state.params=['/created']",10],
                ["steemd.database_api.get_dynamic_global_properties",1]
            ],
            "timeouts":[
                ["steemd",5],
                ["steemd.network_broadcast_api",0]
            ]
        },
        {
            "name":"appbase",
            "translate_to_appbase": false,
            "urls":[
                ["appbase","http://seed:8091"]
            ],
            "ttls":[
                ["appbase", 3],
                ["appbase.login_api",-1],
                ["appbase.network_broadcast_api", -1],
                ["appbase.follow_api", 10],
                ["appbase.market_history_api", 1],
                ["appbase.condenser_api", 3],
                ["appbase.condenser_api.get_block", -2],
                ["appbase.condenser_api.get_block_header", -2],
                ["appbase.condenser_api.get_content", 1],
                ["appbase.condenser_api.get_state", 1],
                ["appbase.condenser_api.get_state.params=['/trending']", 30],
                ["appbase.condenser_api.get_state.params=['trending']", 30],
                ["appbase.condenser_api.get_state.params=['/hot']", 30],
                ["appbase.condenser_api.get_state.params=['/welcome']", 30],
                ["appbase.condenser_api.get_state.params=['/promoted']", 30],
                ["appbase.condenser_api.get_state.params=['/created']", 10],
                ["appbase.condenser_api.get_dynamic_global_properties", 3]
            ],
            "timeouts":[
                ["appbase", 3],
                ["appbase.network_broadcast_api",0],
                ["appbase.chain_api.push_block", 0],
                ["appbase.chain_api.push_transaction", 0],
                ["appbase.condenser_api.broadcast_block", 0],
                ["appbase.condenser_api.broadcast_transaction", 0],
                ["appbase.condenser_api.broadcast_transaction_synchronous", 0],
                ["appbase.condenser_api.get_account_history", 20],
                ["appbase.condenser_api.get_account_votes", 20],
                ["appbase.condenser_api.get_ops_in_block.params=[2889020,false]", 20],
                ["appbase.account_history_api.get_ops_in_block.params={\"block_num\":2889020,\"only_virtual\":false}", 20]
            ]
        }
    ]
}

Tag summary

Content type

Image

Digest

Size

1.1 GB

Last updated

over 6 years ago

docker pull someguy123/jussi