Skip to content

Instantly share code, notes, and snippets.

View kushti's full-sized avatar

Alexander Chepurnoy kushti

View GitHub Profile
object MptBench extends App {
val dbPath = Files.createTempDirectory("testdb").toAbsolutePath.toString
val dataSource = LevelDBDataSource(new LevelDbConfig {
override val verifyChecksums: Boolean = false
override val paranoidChecks: Boolean = false
override val createIfMissing: Boolean = true
override val path: String = dbPath
})
try {
@kushti
kushti / ThresholdLoggerFilter.scala
Created August 3, 2015 13:15
Threshold + Logger filter for Logback in Scala
package smartcontract.utils
import ch.qos.logback.classic.Level
import ch.qos.logback.classic.spi.ILoggingEvent
import ch.qos.logback.core.filter.Filter
import ch.qos.logback.core.spi.FilterReply
/**
* Code rewritten from Java source
package sigmastate
import scorex.crypto.hash.Sha256
object LotteryWinner extends App {
val participantsRaw =
"""_jonwel_
504_Saints
a_atapin
sbt "runMain org.ergoplatform.ErgoApp /home/kushti/ergo/ergo/src/main/resources/my-application.conf"
object ConcreteCollection extends App {
import scala.reflect.runtime.universe.{typeTag, TypeTag}
def restoreElement[S <: SType](body: Array[Byte], idx: Int): (Value[_ <: SType], TypeTag[_ <: SType]) = {
if (body(idx) == 10) (IntConstant(body(idx + 1)), typeTag[SInt.type])
else if (body(idx) == 11) BooleanConstant.fromBoolean(body(idx + 1) != 0) -> typeTag[SBoolean.type] else ???
}
def normalize[S <: SType](elems: (Value[_ <: SType], TypeTag[_ <: SType])*)(t: TypeTag[S]): IndexedSeq[Value[S]] = {
package sigmastate.utxo.examples
import java.math.BigInteger
import org.ergoplatform.ErgoBox.{R4, R5, R6}
import org.ergoplatform._
import scorex.crypto.hash.{Blake2b256, Digest32}
import scorex.utils.Random
import sigmastate.Values.{ByteArrayConstant, ByteConstant, GroupElementConstant, IntConstant, SigmaPropConstant}
import sigmastate._
@kushti
kushti / gist:6e5afdb21a5c4d20bc49bca8b9eaf23f
Created January 25, 2019 14:27
exception in MixExample
key not found: 1
java.util.NoSuchElementException: key not found: 1
at scala.collection.MapLike.default(MapLike.scala:235)
at scala.collection.MapLike.default$(MapLike.scala:234)
at scala.collection.AbstractMap.default(Map.scala:63)
at scala.collection.mutable.HashMap.apply(HashMap.scala:69)
at sigmastate.serialization.ValDefTypeStore.apply(ValDefTypeStore.scala:13)
at sigmastate.serialization.ValUseSerializer.parseBody(ValUseSerializer.scala:18)
at sigmastate.serialization.ValUseSerializer.parseBody(ValUseSerializer.scala:8)
at sigmastate.serialization.ValueSerializer$.deserialize(ValueSerializer.scala:175)
# Spending mining reward
This text is to help miners to withdraw funds mined.
A lot of folks launched a node and also a miner, with "pubkeyHex" from the miner embedded in the node config. Now
information on how to recognize the coins mined and withdraw them to another address.
# On keys.
package org.ergoplatform
import scorex.util.encode.Base58
import sigmastate.basics.DLogProtocol.ProveDlog
import sigmastate.eval.CSigmaProp
object Tester extends App {
implicit val ergoAddressEncoder: ErgoAddressEncoder = new ErgoAddressEncoder(ErgoAddressEncoder.MainnetNetworkPrefix)
val miningKey = "mPdcmWTSJ6EGpC5WrQJKs5x6G8aEEgsKnrZLPbFqbUthiMXjsU5ivv4rNwoXfgd2FDRycwajErTNwHH9"

After-Launch Thoughts and Ergo Roadmap

Firstly, we would like to thank many enthusiasts, developers, miners, other folks, and our families for measureless help with Ergo development and launching. The launch finishes a few years period of initial research and development by the Team, and also starts a new epoch, where the core technology is mostly set in stone and gradual improvements in protocol implementations and infrastructure projects become the main focus.

The current core Ergo Core Team remains fully committed to the project (at least, while the Foundation Treasury enables that). With that in mind, let me give the light on current status of the project and future plans.