Close this tab to return to the site
Smart Contract StatementFor month of MayFor smart contract: 0x713b73c3994442b533e6a083ec968e40606810ec
Statement created with EthSlurp v.0.9.0 on 5/15/2016 10:47:04am |
How was this accomplished?
To build this webpage we made the following changes to the config.dat file, created the template file (see below), and ran this command:
ethslurp -f:custom 0x713b73c3994442b533e6a083ec968e40606810ec
The changes we made to the config.dat file were to add the following lines under the [DISPLAY_STR] group:
[DISPLAY_STR]
...
fieldList=timeStamp|from|gas|value
fmt_custom_file=statement.template
fmt_custom_record=fmt_html_record
fmt_custom_field=fmt_html_field
In other words, we told it the name of a template file (see below) and to pick up its other display strings from the 'html' format.
Notice that the 'custom' part of the command line above can take on any value. For example, 'custom_1' or 'custom_2'. This would allow you to call two different formats for the same smart contract. For example, perhaps you want to separate incoming from outgoing transacations, or separate transactions by date. Note that we also customized the list of fields to include.
The template file (statement.template) looked like this:
<!DOCTYPE html> <html> <head> <link rel="stylesheet" href="stylesheets/statement.css"> <link rel="stylesheet" href="stylesheets/github-dark.css"> <title>EthSlurp - Drink the Blockchain</title> </head> <body> <header> <div class="container"> <h1>EthSlurp</h1> <h2>Drink the blockchain</h2> </div> </header> <div class="container"> <table width=60%><tr><td> <h1>Smart Contract Statement</h1><br> <h2>For month of [{CUR_MONTH}]</h2><br> <h3>For smart contract: [{ADDR}]</h3><p> <table width=75%> <tr>[{HEADER}]</tr> [{RECORDS}] </table> Statement created: [{NOW}] </td></tr></table> <div> </body> </html>
The orange values are special tokens replaced by EthSlurp when it runs.