Code Monkey home page Code Monkey logo

encrycore's Introduction

EncryCore

Build Status

Encry is a distributed digital asset platform supporting smart contracts in non turing-complete Prism language (https://github.com/EncryFoundation/PrismLang) and custom asset issuing.

Related projects

PrismLang - Contract-oriented scripting language designed specially for EncryCore.

Installation

1) Running Latest release

At first, you should download latest release from this page, your target in EncryCore.jar. Make sure that you have a compatible Java Runtime Environment 1.8 or later (64-bit version, you can find official guide here). Once download is complete, you should navigate to the folder where EncryCore.jar is located and execute the following command:

$ java -jar EncryCore.jar

To run this app with additional configurations you should execute the following command:

$ java -jar EncryCore.jar file_with_your_configurations.conf

List of default configs you can find in:

EncryCore/srs/main/resources/configs/

2) Compiling from source

To run EncryCore node you need JRE 1.8 or later (64-bit version, you can find official guide here) and sbt(Simple build tool for scala and java applications, official guide) to be installed. If you running a Windows machine, please make sure, that you have git client installed.

Configuration file is src/main/resources/application.conf.

Linux/MacOS/Windows:

$ git clone https://github.com/EncryFoundation/EncryCore.git

$ cd EncryCore

$ git checkout master

$ sbt run

Using node.

  • After successful installation using any of the described methods above you will have node CLI(command line interface) in opened terminal, description of the valid CLI commands can be found below.
  • Description of node's api can be found here

Interacting with CLI

You can interact with your node using command line interface. Note that generic command structure is:

[GROUP_NAME] [COMMAND] -[ARGUMENT_1]=[VAL_1] -[ARGUMENT_2]=[VAL_2]

If you just have installed node, to check that everything is fine you can run :

wallet createKey

Here is list of the other valid commands:

| Group name |   Command              |   Argument      |  Meaning
|------------|------------------------|-----------------|--------------------------------
| node       |   shutdown             |   None          |  Shutdown the node
| node       |   stopMining           |   None          |  Node stops mining
| node       |   startMining          |   None          |  Node starts mining
| wallet     |   pubKeys              |   None          |  Print available public keys
| wallet     |   privKeys             |   None          |  Print available private keys
| wallet     |   addrs                |   None          |  Print available addresses
| wallet     |   createKey            |   None          |  Add key to storage
| wallet     |   balance              |   None          |  Show balance of current wallet
| wallet     |   transfer             |   addr, amount  |  Transfer `amount` to `addr`ess
| wallet     |   createToken          |   fee, amount   |  Creates new token
| wallet     |   createKey            |   None          |  Creates new account
| wallet     |   fromSeed             |   Seed          |  Creates new account from seed
| peer       |   removeFromBlackList  |   host, port    |  Remove peer from black list
| peer       |   addPeer              |   host, port    |  Add peer to 'knownPeers'
| peer       |   all                  |   None          |  Get all peers in the system
| peer       |   connected            |   None          |  Get all connected peers
| peer       |   banned               |   None          |  Get all banned peers
| peer       |   ban                  |   host, port    |  Ban peer
| app        |   info                 |   None          |  Show info about your node
| app        |   help                 |   None          |  Show all supported commands
| history    |   getTxById            |   Id            |  Get transaction by 'Id'
| history    |   getLastHeaders       |   Number        |  Get last 'Number' headers
| history    |   getLastHeaderIds     |   Number        |  Get header at height 'Number'
| history    |   getHeaderById        |   Id            |  Get header by 'Id'
| history    |   getFullBlock         |   Id            |  Get block by 'Id'
| history    |   getTxById            |   None          |  Get block candidate
| app        |   info                 |   None          |  Show info about your node
| app        |   help                 |   None          |  Show all supported commands

Running tests

$ sbt test

License

All contributions are made under the GNU General Public License v3. See LICENSE.

Acknowledgements

YourKit supports open source projects with its full-featured Java Profiler. YourKit, LLC is the creator of YourKit Java Profiler and YourKit .NET Profiler, innovative and intelligent tools for profiling Java and .NET applications.

encrycore's People

Contributors

bromel777 avatar capdev12 avatar catena2w avatar garmonbozzzia avatar grye avatar gusevtimofey avatar kapinuss avatar koloale avatar liorl00 avatar oskin1 avatar ugulavageorge avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

encrycore's Issues

"Already exists" at transaction application

[scorex-akka.actor.default-dispatcher-22] >> [WARN ] encry.view.state.UtxoState >> 16:16:10.274 modification: Insert([B@40564569,[B@891adf3), failure Failure(java.lang.Exception: already exists)
[scorex-akka.actor.default-dispatcher-22] >> [WARN ] encry.local.miner.EncryMiner >> 16:16:10.275 Error when trying to generate candidate:
java.lang.Exception: already exists
at scorex.crypto.authds.avltree.batch.Insert.$anonfun$updateFn$2(Operation.scala:43)

Node fails to apply block with at least one non-coinbase transaction.

Different exceptions arise in AVLIODB:
[encry-akka.actor.default-dispatcher-6] >> [WARN ] s.c.a.a.b.VersionedIODBAVLStorage >> 12:09:15.531 Failed to update tree java.lang.IllegalArgumentException: duplicate key in toUpdate,
java.lang.Exception: Calculated proofHash is not equal to the declared one. at encry.view.state.UtxoState.$anonfun$applyModifier$1(UtxoState.scala:85)

encry.network.EncryDeliveryTracker Unexpected error during node synchronization

[WARN ] encry.network.EncryDeliveryTracker >> 15:11:33.995 Unexpected error
java.util.NoSuchElementException: key not found: (WrappedArray(0, 0, 71, 71, -89, -48, 50, -115, 71, -116, -45, 15, -47, -51, -114, -86, 109, 6, -104, -97, 44, -18, 113, 106, 82, -99, 104, -111, 9, -62, -67, 42),ConnectedPeer(94.130.154.155/94.130.154.155:9001))
at scala.collection.MapLike.default(MapLike.scala:232)
at scala.collection.MapLike.default$(MapLike.scala:231)
at scala.collection.AbstractMap.default(Map.scala:59)
at scala.collection.mutable.HashMap.apply(HashMap.scala:65)
at scorex.core.network.DeliveryTracker.stopExpecting(DeliveryTracker.scala:65)
at scorex.core.network.DeliveryTracker.$anonfun$reexpect$1(DeliveryTracker.scala:54)
at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.java:12

Replace various forms of byte collections by `ByteString` and `Seq`.

Currently, collections of bytes are represented through many different classes, such as ByteStr, ByteString(from Akka), ByteBuffer, Array, WrappedArray. In order to make the code more uniform, we should:

replace these collection types by ByteString (cf. https://doc.akka.io/api/akka/2.0/akka/util/ByteString.html) in places where these collections are created.

replace these collection types by Seq[Byte] in places where these collections are expected (i.e. in contravariant positions; e.g. as arguments of functions).

The point of item 1 is to use a specific byte collection class that is known/believed to be efficient.

The point of item 2 is to make the code as generic and independent of implementation as possible. In particular it will make it possible to easily change from ByteString to some other implementation in the future, if necessary.

java.util.NoSuchElementException: next on empty iterator

[encry-akka.actor.default-dispatcher-23] >> [WARN ] e.v.history.storage.HistoryStorage >> 18:14:32.054 Failed to parse block from db:
java.util.NoSuchElementException: next on empty iterator
at scala.collection.Iterator$$anon$2.next(Iterator.scala:38)
at scala.collection.Iterator$$anon$2.next(Iterator.scala:36)
at scala.collection.IndexedSeqLike$Elements.next(IndexedSeqLike.scala:60)
at scala.collection.IterableLike.head(IterableLike.scala:106)
at scala.collection.IterableLike.head$(IterableLike.scala:105)
at scala.collection.mutable.ArrayOps$ofByte.scala$collection$IndexedSeqOptimized$$super$head(ArrayOps.scala:206)
at scala.collection.IndexedSeqOptimized.head(IndexedSeqOptimized.scala:125)
at scala.collection.IndexedSeqOptimized.head$(IndexedSeqOptimized.scala:125)
at scala.collection.mutable.ArrayOps$ofByte.head(ArrayOps.scala:206)
at encry.modifiers.history.HistoryModifierSerializer$.$anonfun$parseBytes$1(HistoryModifierSerializer.scala:24)
at scala.runtime.java8.JFunction0$mcB$sp.apply(JFunction0$mcB$sp.java:12)
at scala.util.Try$.apply(Try.scala:209)
at encry.modifiers.history.HistoryModifierSerializer$.parseBytes(HistoryModifierSerializer.scala:24)
at encry.view.history.storage.HistoryStorage.$anonfun$modifierById$1(HistoryStorage.scala:17)
at scala.Option.flatMap(Option.scala:171)
at encry.view.history.storage.HistoryStorage.modifierById(HistoryStorage.scala:16)
at encry.view.history.EncryHistoryReader.modifierById(EncryHistoryReader.scala:159)
at encry.view.history.EncryHistoryReader.modifierById$(EncryHistoryReader.scala:158)
at encry.view.history.EncryHistory$$anon$2.modifierById(EncryHistory.scala:197)
at scorex.core.consensus.HistoryReader.contains(HistoryReader.scala:29)
at scorex.core.consensus.HistoryReader.contains$(HistoryReader.scala:29)
at encry.view.history.EncryHistory$$anon$2.contains(EncryHistory.scala:197)
at encry.view.history.processors.DownloadProcessor.$anonfun$modifiersToDownload$4(DownloadProcessor.scala:52)
at encry.view.history.processors.DownloadProcessor.$anonfun$modifiersToDownload$4$adapted(DownloadProcessor.scala:52)
at scala.collection.TraversableLike.$anonfun$filterImpl$1(TraversableLike.scala:248)
at scala.collection.immutable.List.foreach(List.scala:389)
at scala.collection.TraversableLike.filterImpl(TraversableLike.scala:247)
at scala.collection.TraversableLike.filterImpl$(TraversableLike.scala:245)
at scala.collection.AbstractTraversable.filterImpl(Traversable.scala:104)
at scala.collection.TraversableLike.filter(TraversableLike.scala:259)
at scala.collection.TraversableLike.filter$(TraversableLike.scala:259)
at scala.collection.AbstractTraversable.filter(Traversable.scala:104)
at encry.view.history.processors.DownloadProcessor.continuation$1(DownloadProcessor.scala:52)
at encry.view.history.processors.DownloadProcessor.modifiersToDownload(DownloadProcessor.scala:61)
at encry.view.history.processors.DownloadProcessor.modifiersToDownload$(DownloadProcessor.scala:43)
at encry.view.history.EncryHistory$$anon$2.modifiersToDownload(EncryHistory.scala:197)
at encry.network.EncryNodeViewSynchronizer$$anonfun$onCheckModifiersToDownload$1.$anonfun$applyOrElse$2(EncryNodeViewSynchronizer.scala:67)
at encry.network.EncryNodeViewSynchronizer$$anonfun$onCheckModifiersToDownload$1.$anonfun$applyOrElse$2$adapted(EncryNodeViewSynchronizer.scala:65)
at scala.Option.foreach(Option.scala:257)
at encry.network.EncryNodeViewSynchronizer$$anonfun$onCheckModifiersToDownload$1.applyOrElse(EncryNodeViewSynchronizer.scala:65)
at scala.PartialFunction$OrElse.applyOrElse(PartialFunction.scala:171)
at scala.PartialFunction$OrElse.applyOrElse(PartialFunction.scala:172)
at scala.PartialFunction$OrElse.applyOrElse(PartialFunction.scala:172)
at scala.PartialFunction$OrElse.applyOrElse(PartialFunction.scala:172)
at scala.PartialFunction$OrElse.applyOrElse(PartialFunction.scala:172)
at scala.PartialFunction$OrElse.applyOrElse(PartialFunction.scala:172)
at scala.PartialFunction$OrElse.applyOrElse(PartialFunction.scala:172)
at scala.PartialFunction$OrElse.applyOrElse(PartialFunction.scala:172)
at scala.PartialFunction$OrElse.applyOrElse(PartialFunction.scala:172)
at scala.PartialFunction$OrElse.applyOrElse(PartialFunction.scala:172)
at scala.PartialFunction$OrElse.applyOrElse(PartialFunction.scala:172)
at akka.actor.Actor.aroundReceive(Actor.scala:517)
at akka.actor.Actor.aroundReceive$(Actor.scala:515)
at encry.network.NodeViewSynchronizer.aroundReceive(NodeViewSynchronizer.scala:29)
at akka.actor.ActorCell.receiveMessage(ActorCell.scala:590)
at akka.actor.ActorCell.invoke(ActorCell.scala:559)
at akka.dispatch.Mailbox.processMailbox(Mailbox.scala:257)
at akka.dispatch.Mailbox.run(Mailbox.scala:224)
at akka.dispatch.Mailbox.exec(Mailbox.scala:234)
at akka.dispatch.forkjoin.ForkJoinTask.doExec(ForkJoinTask.java:260)
at akka.dispatch.forkjoin.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1339)
at akka.dispatch.forkjoin.ForkJoinPool.runWorker(ForkJoinPool.java:1979)
at akka.dispatch.forkjoin.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:107)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.