hillstreetlabs / parr Goto Github PK
View Code? Open in Web Editor NEWElastify the Ethereum blockchain
Home Page: https://parr.io
License: MIT License
Elastify the Ethereum blockchain
Home Page: https://parr.io
License: MIT License
Example:
[
{
"constant": true,
"inputs": [],
"name": "rate",
"outputs": [
{
"name": "",
"type": "uint256"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "weiRaised",
"outputs": [
{
"name": "",
"type": "uint256"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "wallet",
"outputs": [
{
"name": "",
"type": "address"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "token",
"outputs": [
{
"name": "",
"type": "address"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"name": "_rate",
"type": "uint256"
},
{
"name": "_wallet",
"type": "address"
},
{
"name": "_token",
"type": "address"
}
],
"payable": false,
"stateMutability": "nonpayable",
"type": "constructor"
}]
Example output:
Failed to download transaction 0x752924da840fbe610484c3d510de165bc42c0ddc4cd35971727f65e3b9d97b4f TypeError: Cannot read property 'to' of null
at /Users/pfh/Projects/ferrari/src/lib/TransactionDownloader.js:77:50
at Generator.next (<anonymous>)
at step (/Users/pfh/Projects/ferrari/dist/lib/TransactionDownloader.js:20:191)
at /Users/pfh/Projects/ferrari/dist/lib/TransactionDownloader.js:20:361
at <anonymous>
at process._tickCallback (internal/process/next_tick.js:118:7)
Update Importer
to only download a block and persist the block and its included transactions to postgres. It should not call getTransactionReceipt
for the transactions.
Should include:
Includes:
Included:
Index 1: Blocks and transactions
type
field that can be either block
or transaction
from
, to
, logs
and internal_transactions
all embeddedIndex 2: Addresses
join
fieldtype
field that can be address
, fromTransaction
and toTransaction
Should include:
Not sure if this is intended. But seems to make bunch of transactions fail
Includes:
/blocks
, /transactions
, and /accounts
routesThe goal of this issue is to list out all use-cases for parr, so that we build only useful things. This is meant to serve as a living document of interesting use-cases.
Not sure what to call this, but it should take an arbitrary, un-imported transaction from postgres, call getTransactionReceipt
, get internal transactions, decode logs, and write all the data back to postgres for indexing.
Included items:
blocks
, transactions
, internal_transactions
and logs
tablesstatus
fields (or another name) to indicate parsing status (i.e. downloaded transaction but not transaction receipt or added block ID but not block data)Allow people to save and share queries.
POST /queries
:{ query: "[THE QUERY]", hash: "[hash]" }
GET /queries/[hash]
{ query: "[THE QUERY]", hash: "[hash]" }
Data should include:
All of this is in the Crowdsale
ABI:
{
"contractName": "Crowdsale",
"abi": [
{
"constant": true,
"inputs": [],
"name": "rate",
"outputs": [
{
"name": "",
"type": "uint256"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "endTime",
"outputs": [
{
"name": "",
"type": "uint256"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "weiRaised",
"outputs": [
{
"name": "",
"type": "uint256"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "wallet",
"outputs": [
{
"name": "",
"type": "address"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "startTime",
"outputs": [
{
"name": "",
"type": "uint256"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "token",
"outputs": [
{
"name": "",
"type": "address"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"name": "purchaser",
"type": "address"
},
{
"indexed": true,
"name": "beneficiary",
"type": "address"
},
{
"indexed": false,
"name": "value",
"type": "uint256"
},
{
"indexed": false,
"name": "amount",
"type": "uint256"
}
],
"name": "TokenPurchase",
"type": "event"
},
{
"constant": false,
"inputs": [
{
"name": "beneficiary",
"type": "address"
}
],
"name": "buyTokens",
"outputs": [],
"payable": true,
"stateMutability": "payable",
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "hasEnded",
"outputs": [
{
"name": "",
"type": "bool"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
}
]
}
Includes:
/query
or /search
POST methodTODO:
The simplest version of this website will be just a textarea and a submit button. A user can input an ES json query into the textarea and send to /search
by submitting the form.
Because encodeSignature
requires its argument to have both a name
and a type
, just checking that all inputs have those works for now. However, it might make sense to tell the user that their ABI is invalid, if they pass an ABI with an entry that is of type function
but lacks a name. It seems only constructor
and fallback
types are allowed to miss name
.
Also, possible add a stats CLI command
When adding a new ABI to check every address against, we shouldn't have to re-download transactions. We should have a separate script for re-checking bytecode against ABIs and updating the implements
jsonb column.
ES errors just cause a timeout right now ๐
We should update Indexer
to index blocks, transactions, logs, internal transactions, and addresses from postgres. The script should watch postgres and index fully imported rows once the importers update them.
The parr_blocks_transactions
index embeds addresses inside transactions (i.e. {type: "transaction", from: {address: "...", is_contract: false}}
). When the embedded address changes, each transaction should be re-indexed.
The parr_addresses
index embeds addresses as well, even though it also has a parent/child relationship between transactions and addresses.
When addresses are being indexed, it fetches all the transactions available and indexes those. If new transactions that involve already indexed addresses gets added, that should trigger a re-index.
We currently only index blocks, transactions and logs.
We should import and index internal transactions as well.
Includes:
We need a way for community members to submit contract ABIs and specify their addresses
Not sure what the best setup will be, but we should start working on this
A JSON route that a user can hit that gives stats about the import/download/index status of the whole system.
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.