wget https://storage.googleapis.com/golang/go1.7.linux-armv6l.tar.gz
tar -C /usr/local -xzf go1.7.linux-armv6l.tar.gz
export PATH=$PATH:/usr/local/go/bin
Some significant changes that impact the swap implementation are the restructuring of protocols found in swarm/network/protocol.go So far I have added back swap specific properties to the Bzz Struct and Peer Struct.
Right now, everything compiles and runs - but when I connect two swarm peers there is not any swap accounting happening. This is to be expected because I haven't yet implemented the swap instances on the Bzz or Peer Structs. I am planning to begin implementing this here
Would you mind taking a quick look at what's been done so far and help me understand if I'm headed the right direction, or if I'm way off in my approach thus far. And
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Peer should implement a send method. (as a p2p/Protocol msg Type) | |
| Swap should be a protocol (p2p/Protocol) that the peer implements. | |
| Swap protocol should have 2 messages (payment request, and payment) | |
| Eliminate the 'proto' interface e.g. `self.proto.Pay(-self.balance, promise)` | |
| This next section basically is to say, don't let the cheqbook deployment and interface logic get in the way of the developement of implementing Swap. | |
| Leave cheque book deployment alone. | |
| Could draft how to simplify the cheqbook. | |
| A simplified version of the cheqbook will be deployed. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| pragma solidity ^0.4.21; | |
| /** | |
| * @title SafeMath | |
| * @dev Math operations with safety checks that throw on error | |
| */ | |
| library SafeMath { | |
| /** |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| admin.addPeer("enode://0f740f471e876020566c2ce331c81b4128b9a18f636b1d4757c4eaea7f077f4b15597a743f163280293b0a7e35092064be11c4ec199b9905541852a36be9004b@206.221.178.149:30303"); | |
| admin.addPeer("enode://16d92fc94f4ec4386aca44d255853c27cbe97a4274c0df98d2b642b0cc4b2f2330e99b00b46db8a031da1a631c85e2b4742d52f5eaeca46612cd28db41fb1d7f@91.223.175.173:30303"); | |
| admin.addPeer("enode://1d70e87a2ee28a2762f1b2cd56f1b9134824a84264030539bba297f67a5bc9ec7ae3016b5f900dc59b1c27b4e258a63fc282a37b2dd6e25a8377473530513394@208.88.169.151:30303"); | |
| admin.addPeer("enode://561014f4725f2793a3ec18ae48c3524517004518454052327cfa4bb78216b774271a17db61121f6a23a51420626aacecdd177be3990e0bec34627dbf8434d806@108.232.148.241:30303"); | |
| admin.addPeer("enode://9ba1bdeed84efec70f4caa6d94be303e6d659eebbe9ba293d38a3c2242aa3f59ba6e436f83971a241c23149c0f2eab963b21b65c29ff1f9407082233204004f9@104.192.88.96:30303"); | |
| admin.addPeer("enode://cd626999588e7dba545258872c3e42f1278b9f51b70706286380558f9da93247d5b25b9d2ca0668c76e23f78a499690ab26092bb6ef56c6145fe29b1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Add this function to the bottom of swarm/storage/filestore.go | |
| func (f *FileStore) Append(addr Address, data io.Reader, toEncrypt bool) (newAddr Address, wait func(), err error) { | |
| putter := NewHasherStore(f.ChunkStore, f.hashFunc, toEncrypt) | |
| return PyramidAppend(addr, data, putter, putter) | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var lastPercentage = 0;var lastBlocksToGo = 0;var timeInterval = 10000; | |
| setInterval(function(){ | |
| var percentage = eth.syncing.currentBlock/eth.syncing.highestBlock*100; | |
| var percentagePerTime = percentage - lastPercentage; | |
| var blocksToGo = eth.syncing.highestBlock - eth.syncing.currentBlock; | |
| var bps = (lastBlocksToGo - blocksToGo) / (timeInterval / 1000) | |
| var etas = 100 / percentagePerTime * (timeInterval / 1000) | |
| var etaM = parseInt(etas/60,10); | |
| console.log(parseInt(percentage,10)+'% ETA: '+etaM+' minutes @ '+bps+'bps'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| pragma solidity ^0.4.21; | |
| /** | |
| * @title Ownable | |
| * @dev The Ownable contract has an owner address, and provides basic authorization control | |
| * functions, this simplifies the implementation of "user permissions". | |
| */ | |
| contract Ownable { | |
| address public owner; |
OlderNewer