-
Notifications
You must be signed in to change notification settings - Fork 0
CasperApi Constructor
Vsevolod Trofimov edited this page Jul 3, 2018
·
3 revisions
Let's assume you have imported casperapi like
const CasperApi = require('casperapi')Now you can do
const casper = new CasperApi(web3)Let's see what more can be done here
CasperApi(blockchainProvider [, options])-
Object— Blockchain provider, for ethereum this would beweb3orweb3-eth(:hammer: neo coming soon).
-
Object— Options object.
Which blockchain to use, currently only eth is supported.
type: String
default: 'eth'
'development'mode runs on the test nodes in casper test network. This works a bit faster and we could pull up some logs if you'll need it.
'production' mode will make request to production smart contract and store data on real provider nodes. (this will be happen on testnet before alpha version is launched)
type: String
default: 'development'
Casper instance.
You can call .save, .getFile, .getLink, .delete
const casper = new CasperApi(web3, { mode: 'production' })If you have any issues / questions / feedback feel free to reach to us via email alyona@casperproject.io.