-
Notifications
You must be signed in to change notification settings - Fork 1
Using local db
Jonathan Xu edited this page May 11, 2020
·
3 revisions
Sapphire accesses and stores miner info on a relational database. To use it in staging and testing, you can interface with the database on the docker container.
- Install dbeaver.
- When prompted to connect to a databse, select PostgreSQl.
- On the connection settings panel, click on the main tab.
- Under the Server group, enter
localhost
for Host,5432
for port andpostgres
for Database. You can find the ports for all the gems that Myriade uses, in thedevtools/local/config.yml
in the devtools repo. - Under the Authentication group, select
Database Native
for Authentication, and enterpostgres
for Username, andmyriade
for Password. - Click OK.
In the Database Navigator tab on the left side of the window, you can navigate through the database you have connected to in the previous step.
Database Schemas can be accessed in the Database Navigator as such: PostgreSQL - myriade -> myriade -> Schemas
Example Here an example showing how to edit table contents for miners.
- Navigate to the database schemas as shown above.
- Navigate to Diamond -> Tables. Double click on
Miners
to show the miners table on the right pane of the window. - In the right pane, table properties can be set under the
Properties
tab. Click on that tab, then theColumns
tab. Notice that some the checkbox forNot Null
has been checked for some columns. - Table data can be changed under the
Data
tab. Click on theData
tab. - At the bottom of the pane, click on the icon: to add a new row. Make sure that the columns that have been marked as
Not Null
have values. - You can change specific info for exisitng rows by double clicking on the cell.
There is an endpoint in the Emerald directory to do manually add data to the Miners database. <emeraldURL>/v1/internal/forceData
receives POST requests of the form:
{
"minerId":<String>,
"share":<Integer>,
"difficulty":<Integer>,
"blockHeight":<Integer>
}