Meter Docs
Search…
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:8667
Warringstakes tesnet: http://warringstakes.meter.io:8667
1
$ sudo apt install npm
2
$ npm install meterify
3
$ git clone https://github.com/meterio/hackathon-demo
Copied!

Create Account Example

1
$ node createAccount.js
Copied!
Please 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
1
2
$ node createAccount.js
3
4
$ node sendTransaction.js
5
Copied!
Source Files

Deploy a Contract Example

Run
1
2
$ node createAccount.js
3
4
$ node sendTransaction.js
5
6
$ node deployContract.js
Copied!
Source Files

Call a Contract CLI Example

Run
1
$ node createAccount.js
2
3
$ node sendTransaction.js
4
5
$ node deployContract.js
6
7
$ node callContract.js
Copied!
Source Files

Meterify + Simple React Wallet

Install
1
$ git clone https://github.com/meterio/hackathon-demo-react.git
2
3
$ cd hackathon-demo-react.git
4
5
$ npm install
Copied!
Run
1
$ npm start
Copied!
Last modified 11mo ago