I hereby claim:
- I am kylemccollom on github.
- I am kylemccollom (https://keybase.io/kylemccollom) on keybase.
- I have a public key ASDYNZO9UUJtHJc_ehLtcwWypRWhFkP_8r5pmxQNW-664go
To claim this, I am signing this object:
Verifying my Blockstack ID is secured with the address 16iFLMrLpdoz8uLt7FNJPkfv7dq4dJ8RXC https://explorer.blockstack.org/address/16iFLMrLpdoz8uLt7FNJPkfv7dq4dJ8RXC |
I hereby claim:
To claim this, I am signing this object:
val channel = system.actorOf(Props(classOf[Channel], primaryAccount, TestNetwork, 24)) | |
(1 to 2000) foreach { _ => | |
channel ! Pay(recipient, Amount.lumens(1)) | |
} | |
channel ! Close |
function getClosestCheckpointSequence(sequence) { | |
return Math.floor(sequence / 64) * 64 + 63 | |
} | |
function getArchiveFilePaths(sequence) { | |
//convert sequence number to hex representation | |
const hex = sequence.toString(16).padStart(8, '0'), | |
//split hex representation to build a path | |
dirPath = `/${hex.substr(0, 2)}/${hex.substr(2, 2)}/${hex.substr(4, 2)}/, | |
//use SDF testnet archive location as root |
val channel = system.actorOf(Props(classOf[Channel], primaryAccount, TestNetwork, 24)) | |
(1 to 2000) foreach { _ => | |
channel ! Pay(recipient, Amount.lumens(1)) | |
} | |
channel ! Close |
/** | |
*Responsible for creating channel accounts and coordinating the channel operations. | |
*/ | |
class Channel(signer: KeyPair, width: Int = 10) extends Actor { | |
override def preStart = { | |
val accounts = Vector.fill(width)(KeyPair.random) | |
val createOps = accounts.map(CreateAccountOperation(_, Amount.lumens(2))) | |
for { | |
signerAccount ← network.account(signer).map(_.toAccount) |
... | |
routees = accounts.map { accn => | |
val channelAccount = context.actorOf(Props(classOf[ChannelAccount], signer, accn)) | |
ActorRefRoutee(channelAccount) | |
} | |
} yield Router(RoundRobinRoutingLogic(), routees) |
case paymentRequest: Pay => router.route(paymentRequest, self) |
case Pay(recipient, amount) => | |
val payment = PaymentOperation(recipient, amount, sourceAccount = Some(signerKey)) |
batch match { | |
// this is the first of the batch | |
case Nil => | |
// add this payment to the batch | |
context.become(ready(accnKey, accn, replyTo, Seq(payment))) | |
// remind myself in 1 second from now to flush the batch | |
context.system.scheduler.scheduleOnce(1.second, self, Flush) | |
// this is the last that can fit inside the batch | |
case _ if batch.size == MaxTxnLength - 1 => |