Skip to content

v4.0.0

Compare
Choose a tag to compare
@chappjc chappjc released this 27 Mar 13:47
· 654 commits to master since this release

IMPORTANT NOTES

  1. This version of dcrdata requires a build of dcrd running JSON RPC server version 5.1.x, such as the dcrd v1.4.0 release.
  2. When upgrading from dcrdata v3.x, the PostgreSQL database does NOT need to be rebuilt from scratch. However, if upgrading from v2.x.y, a complete DB rebuild is needed.

Summary (work in progress!)

This is the release of dcrdata v4.0.0. Since the last published non-patch release (v3.1.0), the following changes were made:

Explorer pages

  • Complete redesign with new page styles, more information, and better organization.
  • Politeia Proposal(s) pages.
  • Listing aggregate block information on time intervals (week, month, etc.) on Block page.
  • Charts may use log or linear y axis scaling.
  • Exchange rate monitoring for Decred-to-fiat conversions.
  • lots...

HTTP APIs

  • Added /block/.../raw and /block/.../header/raw endpoints. These return the hexadecimal encoded serialized bytes of the block or block header.
  • Added /agendas and /agenda/{agendaid} endpoints.
  • "hex" JSON field added to several "raw" endpoints (TODO: list endpoints here)
  • "network_name" added to API Status response
  • Compression is optional. Use --compress-api to enable compression in dcrdata's response handlers.
  • more...

Nuts and Bolts

The following changes are of most interest to site operators and developers:

  • The dcrdata module is now v4.
  • New build process. Webpack via npm. See README.md and dev/build.sh to learn more.
  • Support for go 1.11.5 and 1.12.1.
  • Support for dcrd v1.4.0 (JSON-RPC v5.1.0).
  • New config settings (see --help for details):
    • API: insight-limit-rps, max-api-addrs, compress-api
    • DB: purge-n-blocks, fast-sqlite-purge, pgtimeout, hidepgconfig, addr-cache-cap
    • Politeia: proposalsdbfile, politeiaurl
    • Exchange bot: exchange-monitor, disable-exchange, exchange-currency, ratemaster, ratecert
    • Site config: mainnet-link, testnet-link
  • Removed config settings: mempool (it is required), dumpallmptix (was a debug tool)
  • Updated CONTRIBUTING.md, and moved it to the docs folder.
  • Information from dcrd's new getblockchaininfo RPC is used in many places.
  • dcrd's notification sequence for chain reorganization events has changed with RPC v5.0.0, and dcrdata was changed to work with the new sequence. JSON-RPC server versions older than v5.0.0 are not compatible. Use the current dcrd release.
  • New "gov" packages (gov/agendas and gov/politeia), and the /proposals page.
  • New pubsub package, including related packages (pubsub/psclient and pubsub/types) and a demo client app (pubsub/democlient). pubsub's main types are PubSubHub and WebsocketHub. PubSubHub manages the collection and distribution of block chain and mempool data. WebsocketHub and its event loop manage all websocket client connections. psclient defines a Client type that can help writing apps that connect to a dcrdata pub-sub server.
  • mempool package has expanded functionality as a central hub for mempool data. explorer and pubsub now get their mempool updates from the mempool package's MempoolMonitor type. explorerUI and PubSubHub implement the MempoolDataSaver interface.
  • New exchanges package that implements an exchange rate data collection bot.
  • New dcrrates package and rateserver app for running a remote exchange data bot with one ore more dcrdata instances as clients.
  • New testutil/apiload package for load testing the dcrdata APIs.
  • New db/cache package for caching address data. Presently used in dcrpg.
  • The chainMonitor in the blockdata package replaced BlockConnectedSync with ConnectBlock. It is no longer necessary to run the BlockConnectedHandler goroutine.
  • Added the ability to purge N blocks on startup to assist in recovery.
  • dcrpg (dcrdata's PostgreSQL interface) changes:
    • dcrpg table versions are now 3.10.0 (dcrdata v3.1 had tables at version 3.5.5).
    • ChainDB queries have a query timeout now, and a cancelable context.Context.
    • Multiple caches added for address (db/cache) and ticket pool data.
    • When the log level is debug or verbose, the PostgreSQL server (postgres) settings are displayed in a table on dcrdata startup to assist in debugging configuration issues.
    • Time in PostgreSQL tables is now stored as TIMESTAMPTZ instead of INT64. Time fields of Go structs in api/types are changed to the new TimeDef type. Tables: addresses, vins, blocks, transactions.
    • chainwork column (TEXT) ADDED to the blocks table.
    • extra_data, merkle_root, stake_root, and final_state columns are REMOVED from the blocks table.
    • The agendas table scheme is completely new. The old table is dropped and recreated from scratch.
    • New agenda_votes table.
    • block_time column (TIMESTAMPTZ) ADDED to the votes table.
    • New testing table.
    • dcrdata sets the timezone to UTC at the beginning of each PostgreSQL session.
    • dcrpg now uses dcrjson/v2 and rpcclient/v2 modules.
  • dcrsqlite changes:
    • Now exports the main SQLite interface type, WiredDB.
    • New block data cache.
    • WiredDB will request a shutdown with a provided function if the "database is locked" error is encountered on a table write operation.
    • UnconfirmedTxnsForAddress is moved from dcrsqlite to rpcutils.
    • Side chains are now tracked: hash is the new primary key. The is_mainchain and is_valid columns are added. Ability to import side chain data from dcrd also added.
    • explorer.New now takes a config struct, ExplorerConfig.
  • Dependency changes:
    • Updated direct deps: asdine/storm, caarlos0/env, all dcrd modules, dcrwallet/wallet, dgraph-io/badger, didip/tollbooth, go-chi/chi, google/gops, googolleego-socket.io, mattn/go-sqlite3, rs/cors, sirupsen/logrus, golang.org/x/net,
    • Added deps: politeia, golang/protobuf, google.golang.org/grpc, jessevdk/go-flags
    • Removed deps: btcsuite/go-flags, oleide/lane

Contributors

Summarized by number of commits:

     3  Ademu Enyo Anthony
    76  buck54321
    23  David Hill
     1  Jamie Holdstock
   160  Jonathan Chappelow
     2  Macaulay Davies
    28  Migwi Ndung'u
     2  Wisdom Arerosuoghene
     23 ZeroASIC
     1  degeri
    25  gozart1
     1  jujuhar

394 changed files with 47,963 additions and 19,205 deletions (yes, that is enormous!):
v3.1.0...v4.0.0