terra-worker

module
v0.7.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 21, 2021 License: Apache-2.0

README

TERRA WORKER

This repository contains a worker part dedicated for terra transactions.

Compatibility

Works with bombay testnet and columbus-5 chain. For compatibility with old manager, use columbus-5/legacy-manager.

For columbus-3 and columbus-4, use the branch columbus-3-and-4 for compatibility with legacy manager, otherwise columbus-3-and-4/new-manager.

Worker

Stateless worker is responsible for connecting with the chain, getting information, converting it to a common format and sending it back to manager. Worker can be connected with multiple managers but should always answer only to the one that sent request.

API

Implementation of bare requests for network.

Client

Worker's business logic wiring of messages to client's functions.

Installation

This system can be put together in many different ways. This readme will describe only the simplest one worker, one manager with embedded scheduler approach.

Compile

To compile sources you need to have go 1.14.1+ installed.

    make build
Running

Worker also need some basic config:

    MANAGERS=0.0.0.0:8085
    TERRA_RPC_ADDR=https://terra-4.address
    DATAHUB_KEY=1QAZXSW23EDCvfr45TGB
    CHAIN_ID=columbus-4

Where - TERRA_RPC_ADDR is a http address to node's RPC endpoint - MANAGERS a comma-separated list of manager ip:port addresses that worker will connect to. In this case only one

After running both binaries worker should successfully register itself to the manager.

If you wanna connect with manager running on docker instance add HOSTNAME=host.docker.internal (this is for OSX and Windows). For linux add your docker gateway address taken from ifconfig (it probably be the one from interface called docker0).

Developing Locally

First, you will need to set up a few dependencies:

  1. Install Go
  2. A running indexer-manager instance
  3. A running datastore API instance (configured with STORE_HTTP_ENDPOINTS).

Then, run the worker with some environment config:

CHAIN_ID=bombay-0008 \
STORE_HTTP_ENDPOINTS=http://127.0.0.1:8986/input/jsonrpc \
TERRA_GRPC_ADDR=127.0.0.1:9090 \
go run ./cmd/terra-worker

Transaction Types

List of currently supporter transaction types in terra-worker are (listed by modules):

  • bank: multisend , send
  • crisis: verify_invariant
  • distribution: withdraw_validator_commission , set_withdraw_address , withdraw_delegator_reward , fund_community_pool
  • evidence: submit_evidence
  • gov: deposit , vote , submit_proposal
  • market: swap , swapsend
  • oracle: delegatefeeder , aggregateexchangerateprevote , aggregateexchangeratevote
  • slashing: unjail
  • staking: begin_unbonding , edit_validator , create_validator , delegate , begin_redelegate
  • wasm: execute_contract, store_code, update_contract_admin , instantiate_contract , migrate_contract, migrate_code, clear_contract_admin
  • internal: error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL