mirror of https://github.com/BTCPrivate/copay.git
merge
This commit is contained in:
commit
a2be737bad
|
@ -40,4 +40,4 @@ lib/*
|
||||||
!lib/socket.io.js
|
!lib/socket.io.js
|
||||||
|
|
||||||
js/copayBundle.js
|
js/copayBundle.js
|
||||||
js/config.js
|
config.js
|
||||||
|
|
28
README.md
28
README.md
|
@ -1 +1,29 @@
|
||||||
Copay
|
Copay
|
||||||
|
=====
|
||||||
|
|
||||||
|
Installation:
|
||||||
|
|
||||||
|
Copy config.template.js to config.js and edit to suit your needs. (Defaults to
|
||||||
|
public PeerJS and Insight servers)
|
||||||
|
|
||||||
|
Then execute these commands:
|
||||||
|
```
|
||||||
|
npm install
|
||||||
|
bower install
|
||||||
|
grunt --target=dev shell
|
||||||
|
node app.js
|
||||||
|
```
|
||||||
|
|
||||||
|
To run on a different port:
|
||||||
|
```
|
||||||
|
PORT=3001 node app.js
|
||||||
|
```
|
||||||
|
|
||||||
|
To open up five different instances to test 3-of-5 multisig with yourself, then run this in 5 different terminals:
|
||||||
|
```
|
||||||
|
PORT=3001 node app.js
|
||||||
|
PORT=3002 node app.js
|
||||||
|
PORT=3003 node app.js
|
||||||
|
PORT=3004 node app.js
|
||||||
|
PORT=3005 node app.js
|
||||||
|
```
|
||||||
|
|
|
@ -0,0 +1,12 @@
|
||||||
|
var express=require("express");
|
||||||
|
var http=require("http");
|
||||||
|
|
||||||
|
var app=express();
|
||||||
|
|
||||||
|
var port = process.env.PORT || 3000;
|
||||||
|
app.set("port", port);
|
||||||
|
app.use(express.static(__dirname));
|
||||||
|
|
||||||
|
app.listen(port, function(){
|
||||||
|
console.log("Listening at: http://localhost:" + port);
|
||||||
|
});
|
|
@ -3,12 +3,12 @@
|
||||||
var config = {
|
var config = {
|
||||||
networkName: 'testnet',
|
networkName: 'testnet',
|
||||||
network: {
|
network: {
|
||||||
// key: 'lwjd5qra8257b9',
|
key: 'lwjd5qra8257b9', //Copay API key for public PeerJS server
|
||||||
// This is for running local peerJs with params: ./peerjs -p 10009 -k 'sdfjhwefh'
|
// This is for running local peerJs with params: ./peerjs -p 10009 -k 'sdfjhwefh'
|
||||||
key: 'sdfjhwefh',
|
//key: 'sdfjhwefh',
|
||||||
host: 'localhost',
|
//host: 'localhost',
|
||||||
port: 10009,
|
//port: 10009,
|
||||||
path: '/',
|
//path: '/',
|
||||||
maxPeers: 3,
|
maxPeers: 3,
|
||||||
debug: 3,
|
debug: 3,
|
||||||
},
|
},
|
11
index.html
11
index.html
|
@ -17,7 +17,7 @@
|
||||||
<img src="./img/logo-negative.svg" alt="" width="130">
|
<img src="./img/logo-negative.svg" alt="" width="130">
|
||||||
</figure>
|
</figure>
|
||||||
<div class="text-right" ng-show="$root.wallet">
|
<div class="text-right" ng-show="$root.wallet">
|
||||||
<h5 ng-show="$root.wallet.id">Wallet ID:{{$root.wallet.id}}</h5>
|
<h5 ng-show="$root.wallet.id">Wallet ID: {{$root.wallet.id}}</h5>
|
||||||
<p ng-show="totalBalance">{{totalBalance}} BTC</p>
|
<p ng-show="totalBalance">{{totalBalance}} BTC</p>
|
||||||
<p ng-show="!totalBalance">0 BTC</p>
|
<p ng-show="!totalBalance">0 BTC</p>
|
||||||
</div>
|
</div>
|
||||||
|
@ -271,7 +271,7 @@ missing
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<p class="large-5 columns"> Address 1 <small class="right"> 1231 BTC </small></p>
|
<p class="large-5 columns"> Address 1 <small class="right"> 1231 BTC </small></p>
|
||||||
<i class="large-1 columns fi-arrow-left size-16 text-center"></i>
|
<i class="large-1 columns fi-arrow-left size-16 text-center"></i>
|
||||||
<p class="large-5 columns"> Adress 2 <small class="right"> 1231 BTC </small></p>
|
<p class="large-5 columns"> Address 2 <small class="right"> 1231 BTC </small></p>
|
||||||
<span class="panel-res panel-sign">
|
<span class="panel-res panel-sign">
|
||||||
<i class="fi-check size-16"></i>
|
<i class="fi-check size-16"></i>
|
||||||
</span>
|
</span>
|
||||||
|
@ -281,7 +281,7 @@ missing
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<p class="large-5 columns"> Address 1 <small class="right"> 1231 BTC </small></p>
|
<p class="large-5 columns"> Address 1 <small class="right"> 1231 BTC </small></p>
|
||||||
<i class="large-1 columns fi-arrow-left size-16 text-center"></i>
|
<i class="large-1 columns fi-arrow-left size-16 text-center"></i>
|
||||||
<p class="large-5 columns"> Adress 2 <small class="right"> 1231 BTC </small></p>
|
<p class="large-5 columns"> Address 2 <small class="right"> 1231 BTC </small></p>
|
||||||
<span class="panel-res panel-sign">
|
<span class="panel-res panel-sign">
|
||||||
<i class="fi-check size-16"></i>
|
<i class="fi-check size-16"></i>
|
||||||
</span>
|
</span>
|
||||||
|
@ -291,7 +291,7 @@ missing
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<p class="large-5 columns"> Address 1 <small class="right"> 1231 BTC </small></p>
|
<p class="large-5 columns"> Address 1 <small class="right"> 1231 BTC </small></p>
|
||||||
<i class="large-1 columns fi-arrow-left size-16 text-center"></i>
|
<i class="large-1 columns fi-arrow-left size-16 text-center"></i>
|
||||||
<p class="large-5 columns"> Adress 2 <small class="right"> 1231 BTC </small></p>
|
<p class="large-5 columns"> Address 2 <small class="right"> 1231 BTC </small></p>
|
||||||
<span class="panel-res panel-ignore">
|
<span class="panel-res panel-ignore">
|
||||||
<i class="fi-x size-16"></i>
|
<i class="fi-x size-16"></i>
|
||||||
</span>
|
</span>
|
||||||
|
@ -392,6 +392,8 @@ missing
|
||||||
<p class="text-center"><a href="#/">go back...</a></p>
|
<p class="text-center"><a href="#/">go back...</a></p>
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
<script src="config.js"></script>
|
||||||
|
|
||||||
<script src="lib/angular/angular.min.js"></script>
|
<script src="lib/angular/angular.min.js"></script>
|
||||||
<script src="lib/qrcode-generator/js/qrcode.js"></script>
|
<script src="lib/qrcode-generator/js/qrcode.js"></script>
|
||||||
<script src="lib/angular-qrcode/qrcode.js"></script>
|
<script src="lib/angular-qrcode/qrcode.js"></script>
|
||||||
|
@ -406,7 +408,6 @@ missing
|
||||||
<script src="js/copayBundle.js"></script>
|
<script src="js/copayBundle.js"></script>
|
||||||
|
|
||||||
<script src="js/app.js"></script>
|
<script src="js/app.js"></script>
|
||||||
<script src="js/config.js"></script>
|
|
||||||
<script src="js/routes.js"></script>
|
<script src="js/routes.js"></script>
|
||||||
<script src="js/directives.js"></script>
|
<script src="js/directives.js"></script>
|
||||||
<script src="js/filters.js"></script>
|
<script src="js/filters.js"></script>
|
||||||
|
|
|
@ -16,7 +16,6 @@ angular.module('copay.signin').controller('SigninController',
|
||||||
console.log('[signin.js.23:walletId:]',walletId); //TODO
|
console.log('[signin.js.23:walletId:]',walletId); //TODO
|
||||||
var w = walletFactory.open(walletId, opts);
|
var w = walletFactory.open(walletId, opts);
|
||||||
controllerUtils.setupUxHandlers(w);
|
controllerUtils.setupUxHandlers(w);
|
||||||
w.netStart();
|
|
||||||
};
|
};
|
||||||
|
|
||||||
$scope.join = function(secret) {
|
$scope.join = function(secret) {
|
||||||
|
@ -29,7 +28,6 @@ console.log('[signin.js.23:walletId:]',walletId); //TODO
|
||||||
walletFactory.joinCreateSession(secret, function(w) {
|
walletFactory.joinCreateSession(secret, function(w) {
|
||||||
console.log('[signin.js.33] joinCreateSession RETURN', w); //TODO
|
console.log('[signin.js.33] joinCreateSession RETURN', w); //TODO
|
||||||
controllerUtils.setupUxHandlers(w);
|
controllerUtils.setupUxHandlers(w);
|
||||||
w.setupNetHandlers();
|
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
|
@ -32,6 +32,8 @@ PrivateKey.fromObj = function(obj) {
|
||||||
};
|
};
|
||||||
|
|
||||||
PrivateKey.prototype.toObj = function() {
|
PrivateKey.prototype.toObj = function() {
|
||||||
|
|
||||||
|
console.log('[PrivateKey.js.35] TODO TODO: PRIV: ', this.getExtendedPrivateKeyString()); //TODO
|
||||||
return {
|
return {
|
||||||
extendedPrivateKeyString: this.getExtendedPrivateKeyString(),
|
extendedPrivateKeyString: this.getExtendedPrivateKeyString(),
|
||||||
networkName: this.network.name,
|
networkName: this.network.name,
|
||||||
|
|
|
@ -106,9 +106,11 @@ Wallet.prototype._handleData = function(senderId, data, isInbound) {
|
||||||
}
|
}
|
||||||
this.log('[Wallet.js.98]' , data.type); //TODO
|
this.log('[Wallet.js.98]' , data.type); //TODO
|
||||||
switch(data.type) {
|
switch(data.type) {
|
||||||
|
// This handler is repeaded on WalletFactory (#join). TODO
|
||||||
|
case 'walletId':
|
||||||
|
this.sendWalletReady(senderId);
|
||||||
|
break;
|
||||||
case 'walletReady':
|
case 'walletReady':
|
||||||
|
|
||||||
console.log('[Wallet.js.109] RECV WALLETREADY'); //TODO
|
|
||||||
this.sendPublicKeyRing(senderId);
|
this.sendPublicKeyRing(senderId);
|
||||||
this.sendTxProposals(senderId);
|
this.sendTxProposals(senderId);
|
||||||
break;
|
break;
|
||||||
|
@ -189,6 +191,7 @@ console.log('[Wallet.js.177] NET START: emit CREATED'); //TODO
|
||||||
if (otherPeerId !== myPeerId) {
|
if (otherPeerId !== myPeerId) {
|
||||||
net.connectTo(otherPeerId);
|
net.connectTo(otherPeerId);
|
||||||
}
|
}
|
||||||
|
self.emit('refresh');
|
||||||
}
|
}
|
||||||
}, startOpts);
|
}, startOpts);
|
||||||
};
|
};
|
||||||
|
|
|
@ -33,7 +33,6 @@ console.log('[controllerUtils.js.30:created:] RECV '); //TODO
|
||||||
|
|
||||||
$rootScope.wallet.getBalance(function(balance) {
|
$rootScope.wallet.getBalance(function(balance) {
|
||||||
$rootScope.totalBalance = balance;
|
$rootScope.totalBalance = balance;
|
||||||
$rootScope.$digest();
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
w.on('refresh', function() {
|
w.on('refresh', function() {
|
||||||
|
@ -42,6 +41,8 @@ console.log('[controllerUtils.js.30:created:] RECV '); //TODO
|
||||||
});
|
});
|
||||||
w.on('openError', root.onErrorDigest);
|
w.on('openError', root.onErrorDigest);
|
||||||
w.on('close', root.onErrorDigest);
|
w.on('close', root.onErrorDigest);
|
||||||
|
|
||||||
|
console.log('[controllerUtils.js.45] CALLING NETSTART FROM setupUxHandlers'); //TODO
|
||||||
w.netStart();
|
w.netStart();
|
||||||
console.log('[controllerUtils.js.45] setupUxHandlers END'); //TODO
|
console.log('[controllerUtils.js.45] setupUxHandlers END'); //TODO
|
||||||
};
|
};
|
||||||
|
|
|
@ -19,6 +19,7 @@
|
||||||
},
|
},
|
||||||
"homepage": "https://github.com/bitpay/copay",
|
"homepage": "https://github.com/bitpay/copay",
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
"express": "4.0.0",
|
||||||
"grunt-contrib-watch": "~0.5.3",
|
"grunt-contrib-watch": "~0.5.3",
|
||||||
"grunt-mocha-test": "~0.8.2",
|
"grunt-mocha-test": "~0.8.2",
|
||||||
"grunt-shell": "~0.6.4",
|
"grunt-shell": "~0.6.4",
|
||||||
|
|
Loading…
Reference in New Issue