Meterify Code Examples
Setup Test Environment
We already have the example code in Github, which require node.js as the runtime environment. The following commands setup node.js, install meterify package and check out the example code in Github.
Please change the end point in meterifiedWeb3.js to your own node or the official mainnet/testnet end points, which are:
mainnet: https://mainnet.meter.io
Warringstakes tesnet: http://testnet.meter.io
$ sudo apt install npm
$ npm install meterify
$ git clone https://github.com/meterio/hackathon-demoCreate Account Example
$ node createAccount.jsPlease be aware the above script creates the private/public key pair on the RPC end point. You should always run your own local node and connect to the local RPC end point for creating account due to security reasons.
Source Files
Send Transaction CLI Example
Run
$ node createAccount.js
$ node sendTransaction.js
Source Files
Deploy a Contract Example
Run
$ node createAccount.js
$ node sendTransaction.js
$ node deployContract.jsSource Files
Call a Contract CLI Example
Run
$ node createAccount.js
$ node sendTransaction.js
$ node deployContract.js
$ node callContract.jsSource Files
Meterify + Simple React Wallet
Install
$ git clone https://github.com/meterio/hackathon-demo-react.git
$ cd hackathon-demo-react.git
$ npm installRun
$ npm startLast updated
Was this helpful?