Introduction
Becausetransactions and block data on the mainnet are synchronized to the database in real time, developers can access data flexibly and efficiently by calling our API or by directly accessing our database.
Access Database
At present, developers can access a MySQL database directly to engage with the mainnet data. Other methods are being worked on and will be deployed at a later date.
MySQL Database
Port : 3306
User : community
Password : matrix_community_$2019
Database : new_tom
Note:
- This user only has read-only permissions. This user can access the block table and tx_addres table.
- The database server has permissions. You need to send the node IP address to dev@matrix.io. We will whitelist the IP address, and then you can access the database normally.
Example
Create a new MySQL database connection through Navicat Premium and fill in the relevant information.
View the data in the block information table.
Table field description
block(Block Information Table)
Name | Type | Length | Notes |
---|---|---|---|
id | int | 11 | Block primary key |
number | int | 11 | Block height |
hash | varchar | 128 | Block hash |
parentHash | varchar | 128 | Block parent hash |
nonce | varchar | 32 | Block nonce |
miner | varchar | 42 | Block miner |
leader | varchar | 42 | Block verifier |
leaderStatus | varchar | 1 | Block verifier status:1-Broadcast block, 2-normal, 3-swith |
difficulty | int | 11 | Difficulty |
totalDifficulty | int | 11 | Total difficulty |
size | int | 11 | Block size |
gasLimit | int | 20 | Gas limit |
gasUsed | int | 20 | Gas consumption |
timestamp | bigint | 20 | Block time |
transactions | int | 11 | The number of transactions in block |
signatures | int | 11 | The number of signatures |
tx_address(Transaction Info Table)
Name | Type | Length | Notes |
---|---|---|---|
id | bigint | 20 | Transaction primary key |
hash | varchar | 128 | Transaction hash |
addrTo | varchar | 42 | Transaction recipient address |
value | varchar | 32 | Transaction value |
input | longtext | 0 | Transaction remarks |
addrFrom | varchar | 42 | Transaction sender address |
time | bigint | 20 | Transaction sender address |
block | int | 11 | Transaction block height |
matrixType | int | 3 | Transaction type: 0 - normal Tx, 1 - broadcasting Tx, 2 - miners reward, 3 - revocable Tx, 4 - revert Tx, 5 - authorize, 6 - cancel entrust, 7 - timing Tx, 8 - AI Tx, 9 - create a currency, 10 - Verifier reward, 11 - Interest reward through contract Tx, 12 - Txfee reward, 13 - lottery, 119-super Tx, 120 - super block Tx |
sort | int | 11 | Insertion sequence |
isExtraTo | tinyint | 1 | Whether it is or isn’t a 1-to-many transaction |