This is currently in pre-alpha state with no error handling, but can get the job done
npm install dune-clientThis is currently in pre-alpha state with no error handling, but can get the job done
``shell script`
npm i -g dune-client
Then set your env variables (todo: better auth for cli):
`shell script`Your session cookie from browser
export SESSION=The client needs one of your queries to use as a workspace
export QUERY_ID=
`shell scripttable mode
$ dune-cli --table 'select block_number, block_time from ethereum.traces limit 5'
submitting: waiting
submitting: done
executing: waiting
executing: done
fetching results
fetched 5 rows
┌─────────┬──────────────┬────────────────────────┐
│ (index) │ block_number │ block_time │
├─────────┼──────────────┼────────────────────────┤
│ 0 │ 46147 │ '2015-08-07T03:30:33Z' │
│ 1 │ 46169 │ '2015-08-07T03:36:53Z' │
│ 2 │ 46170 │ '2015-08-07T03:37:10Z' │
│ 3 │ 46194 │ '2015-08-07T03:43:03Z' │
│ 4 │ 46205 │ '2015-08-07T03:46:15Z' │
└─────────┴──────────────┴────────────────────────┘
Use as a package
`javascript
const DuneClient = require('dune-client')async function main() {
const dune = new DuneClient(session, queryId)
const rows = await dune.query('select * from ethereum.traces limit 10')
console.log(rows)
}
``