๐ท I enjoy being useful
pragmaxim / ergo-uexplorer Goto Github PK
View Code? Open in Web Editor NEWSupplementary ergo chain explorer/analyzer with Scala/ZIO
License: MIT License
Supplementary ergo chain explorer/analyzer with Scala/ZIO
License: MIT License
๐ท I enjoy being useful
get /info/
{
version: number,
mode: "full" | "light",
height: number, // indexed height
additionalIndexes: { // only return this if mode == "light"
contracts: string[],
contractTemplates: string[],
tokenIds: string[]
} | null
}
GET /blocks/
GET /blocks/{headerId:HexString}/
GET /blocks/at/{height:int}/
skip: int
take: int
GET /boxes/{spent|unspent|all}/{boxId:HexString}/
GET /boxes/{spent|unspent|all}/tokens/{tokenId:HexString}/
GET /boxes/{spent|unspent|all}/addresses/{address:string}/
GET /boxes/{spent|unspent|all}/contracts/{contract:HexString}/
GET /boxes/{spent|unspent|all}/contracts/templates/{template:HexString}/
skip: int
take: int
tokenId: HexString | "empty"
R4: HexString | "empty"
R5: HexString | "empty"
R6: HexString | "empty"
R7: HexString | "empty"
R8: HexString | "empty"
R9: HexString | "empty"
confirmed: boolean
confirmed
is omitted or equal to null
, then confirmed and unconfirmed boxes must be merged. Which means that new unconfirmed boxes must be added to returning array and confirmed boxes that are being spent in the mempool must be removed from the returning array.take
and skip
, I suggest using creationHeight
and boxId
, as creationHeight
solely is not unique.dApp constantly need to query for multiple contracts/addresses/templates/tokens, to potentially reduce the amount of roundtrips, I propose a custom query endpoint as described below.
POST /boxes/query/
{
spent: boolean | null,
addresses: string[] | null,
contracts: HexString[] | null,
templates: HexString[] | null,
contractHashes: HexString[] | null,
templateHashes: HexString[] | null,
tokens: HexString[] | null,
registers: {
R4: HexString | "empty" | null,
R5: HexString | "empty" | null,
R6: HexString | "empty" | null,
R7: HexString | "empty" | null,
R8: HexString | "empty" | null,
R9: HexString | "empty" | null
} | null,
skip: number | null,
take: number | null
}
addresses
, contracts
, templates
, contractHashes
, and templateHashes
are exclusive.addresses
, contracts
, templates
, contractHashes
, templateHashes
, or tokens
needs to be defined for the query to be considered valid.Array<{
boxId: HexString,
transactionId: HexString,
index: number,
ergoTree: HexString,
creationHeight: number,
value: string,
assets: { tokenId: HexString, amount: string }[]
additionalRegisters: {
R4?: HexString,
R5?: HexString,
R6?: HexString,
R7?: HexString,
R8?: HexString,
R9?: HexString,
},
state: {
confirmed: boolean,
spent: boolean,
}
}>
box.value
and box.assets.amounts
must be typed as string
, for improved compatibility.GET /tokens/{tokenId}/ // parsed token metadata
GET /tokens/{tokenId}/minting-box/
The following endpoint will serve as proxy endpoint for the node behind running uexplorer instance.
GET /node/headers/last/{count:int}/ // --> node's GET /blocks/lastHeaders/{count}/ endpoint
GET /node/info/ // --> node's GET /info/ endpoint
POST /node/transaction/ // --> node's POST /transactions/ endpoint
POST /node/transaction/check/ // --> node's POST /transactions/check/ endpoint
Finding out if any box related data have been spent or not in query time puts huge pressure on DB
=> let's do that at indexing time so that queries are real-time !
headerIdsByHeight: Map[Height, Set[HeaderId]] // more than one in case of a fork-in-progress
blockByHeaderId: Map[HeaderId, Block] // arbitrary block data (depends on performance)
utxosByAddress: Map[Address, Map[BoxId, Value]] // this would be a clone of Node's utxo state
addressByUtxo: Map[BoxId, Address] // non-empty address by utxo
allBoxesByCustomAddress: Map[Address, Set[BoxId]] // all boxes for a configured address by a dApp developer
There can be many of these indexes, please provide your suggestions and use-cases!
Facts to consider :
addresses
Eventually the Http API will allow for retrieving anything that can be put together from these persistent Maps.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.