eos icon indicating copy to clipboard operation
eos copied to clipboard

minimalistic mongodb to query tx | config.ini

Open murray1337 opened this issue 8 years ago • 1 comments

I setup a non-producing node and an API to let an app query user transactions. API is similar to the CryptoLions/EOS-mongo-history-API

What is the most minimalistic and effective approach to decrease sync time and storage? So far I use the following. Problem now is that when I query a tx, its returned 3 times from the mongodb, so I guess I can remove 2 of 3 mongodb-store-... options

agent-name = apibackend

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

blocks-dir = "/mnt/xfs/mainnet/blocks" 

bnet-endpoint = 0.0.0.0:4321
bnet-follow-irreversible = 0
bnet-no-trx = false
read-mode = read-only
validation-mode = light
mongodb-uri = mongodb://127.0.0.1:27017/EOS
mongodb-queue-size = 2048
mongodb-abi-cache-size = 2048
mongodb-block-start = 1
mongodb-store-transactions = 1
mongodb-store-transaction-traces = 1           <------ needed?
mongodb-store-action-traces = 1                <------ needed?
mongodb-filter-on = *
mongodb-filter-out = eosio:onblock:
mongodb-filter-out = gu2tembqgage::
mongodb-filter-out = blocktwitter::

wasm-runtime = wabt
p2p-max-nodes-per-host = 1
http-validate-host = false
https-client-validate-peers = 1
abi-serializer-max-time-ms = 5000
chain-state-db-size-mb = 32000
reversible-blocks-db-size-mb = 340
contracts-console = false
allowed-connection = any
max-clients = 100
network-version-match = 0
sync-fetch-span = 500
connection-cleanup-period = 30
max-implicit-request = 1500
access-control-allow-origin = *
access-control-allow-headers = *
access-control-allow-credentials = false
verbose-http-errors = true

plugin = eosio::chain_plugin
plugin = eosio::chain_api_plugin              <------ needed?
plugin = eosio::bnet_plugin
plugin = eosio::mongo_db_plugin
plugin = eosio::http_plugin                   <------ needed?

Will --mongodb-filter-on=* interfere with mongodb-store-transactions = 1 or is it even obsolete ? Download all actions from anyone VS download all tx from anyone. Not sure if this works but it could be a solution: --mongodb-filter-on=*:transfer: -->

Track actions which match receiver:action:actor. Actor may be blank to include all. Receiver and Action may not be blank. Default is * include everything.

murray1337 avatar Oct 15 '18 13:10 murray1337

  • abi-serializer-max-time-ms = 5000 needs to be larger or you will have problems with action data not being serialized and remaining in hex.
  • What you store depends on what kind of queries you want to support.
# Enables storing blocks in mongodb. (eosio::mongo_db_plugin)
mongodb-store-blocks = 1

# Enables storing block state in mongodb. (eosio::mongo_db_plugin)
mongodb-store-block-states = 1

# Enables storing transactions in mongodb. (eosio::mongo_db_plugin)
mongodb-store-transactions = 1

# Enables storing transaction traces in mongodb. (eosio::mongo_db_plugin)
mongodb-store-transaction-traces = 1

# Enables storing action traces in mongodb. (eosio::mongo_db_plugin)
mongodb-store-action-traces = 1

The default on all the -store- options is true (1), so you have to explilcitly disable if not interested in storing a particular collection.

  • mongodb-store-blocks -- Stores complete signed blocks -- No filtering is applied
  • mongodb-store-block-states -- Stores the block states which is some meta data about the block -- No filtering is applied
  • mongodb-store-transactions -- Stores incoming transactions -- Filtering is applied as of 1.4 release
  • mongodb-store-transaction-traces -- Stores the transaction trace (result) including all the action traces -- Filtering is applied
  • mongodb-store-action-traces -- Stores the action trace (result) of the transaction trace seperately -- Filtering is applied

heifner avatar Oct 16 '18 13:10 heifner