Browse Source

change example to new style

patch-2
Manuel Araoz 11 years ago
parent
commit
d35609ff9b
  1. 5
      examples/Address.js
  2. 7
      examples/PeerManager.js
  3. 5
      examples/Rpc.js
  4. 15
      examples/SendTx.js

5
examples/Address.js

@ -2,8 +2,9 @@
var run = function() {
// Replace '..' with 'bitcore' if you plan on using this code elsewhere.
var Address = require('../Address');
// Replace '../bitcore' with 'bitcore' if you use this code elsewhere.
var bitcore = require('../bitcore');
var Address = bitcore.Address;
var addrs = [
'1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa',

7
examples/PeerManager.js

@ -1,9 +1,10 @@
'use strict';
var run = function() {
// Replace '..' with 'bitcore' if you plan on using this code elsewhere.
var networks = require('../networks');
var Peer = require('../Peer');
// Replace '../bitcore' with 'bitcore' if you use this code elsewhere.
var bitcore = require('../bitcore');
var networks = bitcore.networks;
var Peer = bitcore.Peer;
var PeerManager = require('soop').load('../PeerManager', {
network: networks.testnet
});

5
examples/Rpc.js

@ -1,8 +1,9 @@
'use strict';
var run = function() {
// Replace '..' with 'bitcore' if you plan on using this code elsewhere.
var RpcClient = require('../RpcClient');
// Replace '../bitcore' with 'bitcore' if you use this code elsewhere.
var bitcore = require('../bitcore');
var RpcClient = bitcore.RpcClient;
var hash = '0000000000b6288775bbd326bedf324ca8717a15191da58391535408205aada4';
var config = {

15
examples/SendTx.js

@ -1,13 +1,14 @@
'use strict';
var run = function() {
// Replace '..' with 'bitcore' if you plan on using this code elsewhere.
var networks = require('../networks');
var Peer = require('../Peer');
var Transaction = require('../Transaction');
var Address = require('../Address');
var Script = require('../Script');
var coinUtil = require('../util/util');
// Replace '../bitcore' with 'bitcore' if you use this code elsewhere.
var bitcore = require('../bitcore');
var networks = bitcore.networks;
var Peer = bitcore.Peer;
var Transaction = bitcore.Transaction;
var Address = bitcore.Address;
var Script = bitcore.Script;
var coinUtil = bitcore.util;
var PeerManager = require('soop').load('../PeerManager', {
network: networks.testnet
});

Loading…
Cancel
Save