Skip to content

Instantly share code, notes, and snippets.

/**
*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)
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

Keybase proof

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