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
| object MiningAddresses extends App { | |
| val address = "9fAuYCJ9pCfL8cNn2nsoUhYqmjkjP78Y2KzSptu769nYHGSXVir" | |
| val enc = new ErgoAddressEncoder(ErgoAddressEncoder.MainnetNetworkPrefix) | |
| val addr = enc.fromString(address).get.asInstanceOf[P2PKAddress] | |
| val script = ErgoScriptPredef.rewardOutputScript(720, addr.pubkey) | |
| println(Pay2SAddress(script)(enc)) | |
| } |
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
| object ValueEncoder extends App { | |
| val pd = ErgoAddressEncoder | |
| .apply(ErgoAddressEncoder.MainnetNetworkPrefix) | |
| .fromString("9gmNsqrqdSppLUBqg2UzREmmivgqh1r3jmNcLAc53hk3YCvAGWE") | |
| .get | |
| .asInstanceOf[P2PKAddress] | |
| .pubkey | |
| val s = SigmaPropConstant(pd) |
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
| import scalaj.http.{Http, HttpOptions} | |
| import scala.util.Try | |
| object Connector extends App { | |
| var prevPoolDatapoint = 0L | |
| (1 to 10000000).foreach {_ => | |
| val t = Try { |
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
| ergo { | |
| node { | |
| stateType = "digest" | |
| blocksToKeep = 2880 | |
| mining = false | |
| } | |
| } | |
| scorex { |
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
| package org.ergoplatform.wallet; | |
| import org.ergoplatform.*; | |
| import org.ergoplatform.wallet.interface4j.crypto.ErgoUnsafeProver; | |
| import org.ergoplatform.wallet.secrets.ExtendedSecretKey; | |
| import scorex.util.Random; | |
| public class CreateTransactionDemo { | |
| /** |
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
| package org.ergoplatform.wallet; | |
| import org.ergoplatform.ErgoAddressEncoder; | |
| import org.ergoplatform.P2PKAddress; | |
| import org.ergoplatform.wallet.mnemonic.Mnemonic; | |
| import org.ergoplatform.wallet.secrets.DerivationPath; | |
| import org.ergoplatform.wallet.secrets.ExtendedPublicKey; | |
| import org.ergoplatform.wallet.secrets.ExtendedSecretKey; | |
| import scala.Option; |
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
| object v2testing extends App { | |
| implicit val ec: scala.concurrent.ExecutionContext = scala.concurrent.ExecutionContext.global | |
| private val ergoSettings: ErgoSettings = ErgoSettings.read(Args(Some("/home/kushti/ergo/mainnet/mainnet.conf"), Some(NetworkType.MainNet))) | |
| val ntp = new NetworkTimeProvider(ergoSettings.scorexSettings.ntp) | |
| val ldc = new LinearDifficultyControl(ergoSettings.chainSettings) | |
| val eh = ErgoHistory.readOrGenerate(ergoSettings, ntp) |
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
| property("testvectors from WP") { | |
| val msg = Base16.decode("82dbfccc40aa9919d21dd2bad90935ec44db013738592466e5dad1fa051cb4ff").get | |
| val nonce = Base16.decode("E8F2800001A12388").get | |
| val height = 5090 | |
| val h = Ints.toByteArray(height) | |
| val pow = new AutolykosPowScheme(32, 26) |
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
| ergo { | |
| networkType = "testnet" | |
| node { | |
| mining = true | |
| } | |
| } | |
| scorex { |
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
| emission.minersRewardAtHeight(525000) shouldBe 67500000000L | |
| emission.minersRewardAtHeight(525600) shouldBe 67500000000L | |
| emission.minersRewardAtHeight(590400) shouldBe 67500000000L | |
| emission.minersRewardAtHeight(655200) shouldBe 66000000000L | |
| emission.minersRewardAtHeight(720000) shouldBe 63000000000L | |
| emission.minersRewardAtHeight(784800) shouldBe 60000000000L | |
| emission.minersRewardAtHeight(849600) shouldBe 57000000000L | |
| emission.minersRewardAtHeight(914400) shouldBe 54000000000L | |
| emission.minersRewardAtHeight(979200) shouldBe 51000000000L |