input-output-hk / scorex Goto Github PK
View Code? Open in Web Editor NEWModular blockchain framework. Public domain
License: Creative Commons Zero v1.0 Universal
Modular blockchain framework. Public domain
License: Creative Commons Zero v1.0 Universal
I get the following error. Tried a fix with sbt recompile && sbt startLocal1
and deleting all tmp folders, but didn't work for me.
tmp data gets stored in e.g. /tmp/wallet1
. I suggest a folder such as /tmp/scorex/wallet1 (so one can rm -r /tmp/scorex).
[main] >> [ERROR] scorex.Server$ >> 12:35:45.527 STARTUP ERROR:
org.mapdb.DBException$DataCorruption: wrong header in file: /tmp/wallet1/wallet.s.dat
at org.mapdb.StoreDirect.initOpen(StoreDirect.java:178) ~[scorex.jar:1.1.0-SNAPSHOT]
at org.mapdb.StoreWAL.initOpenPost(StoreWAL.java:227) ~[scorex.jar:1.1.0-SNAPSHOT]
...
Caused by: java.io.IOException: Parent folder does not exist: /tmp/data1/signatures
at org.mapdb.Volume$FileChannelVol.checkFolder(Volume.java:1790)
at org.mapdb.Volume$MappedFileVol.<init>(Volume.java:1158)
... 24 more
Create Jenkins task that make release:
I found that Scorex doesn't have own version.
ScorexApiRoute located in Lagonaki and returns scorex version from Constants defined in Lagonaki project.
What do think about to have two verions in future - for Scorex itself and Lagonaki app ?
Make modular API design to get modules-specific routing wired in an application
At the moment a key / a signature / a digest is just Array[Byte], with some runtime checks made with the help require()/ensuring(). Describe those entities with sized arrays(presented in Shapeless) to get compile-time guarantees.
Implement disk-based persistence for peers whitelist/blacklist in PeerDatabaseImpl (instead of in-heap Buffer). Probably by using MapDb.
Since there is no issues in this project, nobody can help you with development. If there'll be some issues, open source comunity can increasy development speed
HTTP backend is already in place. Should be quite easy to add HTML/JS frontend. Would be interesting for e.g. visualizing transactions and consensus.
Hi,
I tried running with start.sh, but a change is needed: with changing the script to the following it worked (scorex.Start does not exist):
#!/bin/sh
rm -rf data/
sbt clean
sbt compile
sbt start-script
cp settings.json target
sh -c 'target/start settings.json'
Somewhat like blocks/seq/{from}/{to}
For now, a transaction just have sender, recipient and an amount. Add optional binary data attachment also contains height until which the data should be stored in a state.
Finish peer blacklisting. For now, Blacklist signal to be sent in case of bad behavior. Further steps:
Add a new API method to paginate across accouns
Some API calls (payment/stop/???) should not be available for unauthorized users
Current EC framework isn't thread-safe (vRallev/ECC-25519#4), so switching to Curve25519 is needed even before merging the pull request with a constructor getting a seed as an argument ( signalapp/curve25519-java#7 ).
For now genesis block's timestamp calculates every time in Block class (genesis method) but for some consensus alogs it is important to have fixed value.
It will be great to be able have to change this behavior somehow.
Thanks!
Network layer is part of the top-level application now. The should be split to modular design as well, and core logic should be in the scorex-basics module.
It would be great to return block height in /blocks/seq/{from}/{to} and /transactions/info api method
Split logs by date
I mean this one
https://github.com/input-output-hk/Scorex/tree/master/scorex-basics/src/main/resources/swagger-ui
Is there any reason to keep it inside main project repo?
As workaround i could suggest git submodules https://git-scm.com/docs/git-submodule
It is a good idea to rename api_key header field to api-key.
Because HTTP standard suppose use '-' as name delimiter and some http servers check it. Eg. nginx will cut off api_key from request.
Add setting to allow/block cross-origin requests for API
I've found that after upgrade to akka-http (Scorex v.1.2.5) Swagger UI started use 0.0.0.0 as host in all http request. For instance, http://0.0.0.0:9085/addresses and so on.
Is there a solution to config swagger ui for correct host? Each node has it's own public IP address.
We should add ability to add random delays to network messages, that emulates network latency.
At now miner(s) could include previously a tx already put into a blockchain, and that's not effectively detectable. Add always-increasing nonce to tx and state with checks(like Ethereum does)
Hi all!
I have tried to get transactions for particular address.
The request
http://23.94.190.226:9081/transactions/address/kVVAu6F21Ax2Ugddms4p5uXz4kdZfAp8g
returns:
Ooops! The server was not able to produce a timely response to your request. Please try again in a short while!
Is it right that this method must return txs for any address ?
Hi guys!
I'm thinking about json fields naming style in your project. Now you use '-' as separator. For instance: 'consensus-algo'. But in JavaScript it will be problem because we can't use '-' in variable's name.
There is workaround for JS: data["consenus-algo"] or data["some long name"].
But may be it will be more comfortable use something like '_' or camelCase? What do you think ?
I have just found Google Style : https://google.github.io/styleguide/jsoncstyleguide.xml
it's up to you, just want know your decision/opinion
{play-json, json4s, akka-http-spray-json} -> akka-http-spray-json
{mapdb, mvstore} -> mapdb
etc
When invalid block is received from any peer we should
Hi guys!
Sorry for a stupid question,but is it possible to get particular transaction info by http api?
I didn't find any method at swagger definition :(
Current puz calculation (puz = hash(lastBlockId)) is vulnerable to cheap iterations. s value is costly to replay so it is the only value should be used.
If i send tx from A to A /transactions/address/{address} will return such tx twice.
ps. you can see this result for this tx if click on Sender address
blocks/at/{height} API call should return a sequence of blocks at specified height if node is working against a blocktree
I want suggest small improvement.
/blocks/seq rest method returns now transactions as array in array.
For instance:
.... "transactions": [ [ { "type": 1, .....
I think it will be always only one element in parent array. Shall we fix response structure?
Use Swagger ( http://swagger.io ) to describe API, to have UI/doc generation for free then.
I've found that when we need represent *PaymentTransaction * as bytes array we use tx type as 1-byte array proof
override lazy val bytes: Array[Byte] = {
val typeBytes = Array(TypeId.toByte)
......
But when we calculate singnature data we represent Tx type as 4-byte array proof:
private def signatureData(sender: PublicKeyAccount, recipient: Account,
amount: Long, fee: Long, timestamp: Long): Array[Byte] = {
val typeBytes = Ints.toByteArray(TransactionType.PaymentTransaction.id)
......
Shall we use similar solution in both cases ?
what does TT stand for? looks like PI.
isValid[TT]
Would be nice to have docker container. If accepted i can do it.
Throughout the code there are few logging solutions being used, Logback / JUL, sometimes println even. Consider the only solution & use it everywhere
Investigate how it's possible to exctract consensus-related part of the project into a dedicated submodule
If we provide incorrect wallet file path to Wallet.scala we will have empty wallet seed and stuck in infinity loop:
in Wallet.scala
def readSeed(): Array[Byte] = Base58.decode(scala.io.StdIn.readLine()).getOrElse {
println("Wallet seed should be correct Base58 encoded string.")
readSeed()
}
readSeed()
Example:
val walletFile = new java.io.File(s"/asdfasdfasdfasdftmp/wallet${Random.nextLong()}.dat")
val w = new Wallet(Some(walletFile), "", None)
Sometimes an attempt to stop running app causes hanging - Controller.stopAll() put into shutdown hook stucks.
Run tests over each pull request, static code analyzers etc.
Tried to run test from console:
sbt test
got
[info] Run completed in 819 milliseconds.
[info] Total number of tests run: 10
[info] Suites: completed 7, aborted 0
[info] Tests: succeeded 10, failed 0, canceled 0, ignored 0, pending 0
[info] All tests passed.
[error] ../Scorex-Lagonaki/src/test/scala/scorex/ScorexTestSuite.scala:15: not found: type CryptoTestSuite
[error] ,new CryptoTestSuite
[error] ^
[error] one error found
[error] (scorex/test:compileIncremental) Compilation failed
[error] Total time: 9 s, completed Sep 23, 2015 4:21:24 AM
Some time after start we have NullPointerException in the logs.
Short investigation shows that it happens due to null as appVersion argument during Handshake construction
[ERROR] [05/18/2016 09:44:31.374] [lagonaki-akka.actor.default-dispatcher-18] [akka://lagonaki/user/networkController/$x] null
java.lang.NullPointerException
at scorex.network.Handshake.bytes$lzycompute(Handshake.scala:21)
at scorex.network.Handshake.bytes(Handshake.scala:20)
at scorex.network.PeerConnectionHandler$$anonfun$handshake$1.applyOrElse(PeerConnectionHandler.scala:80)
at scala.PartialFunction$OrElse.applyOrElse(PartialFunction.scala:170)
at akka.actor.Actor$class.aroundReceive(Actor.scala:482)
at scorex.network.PeerConnectionHandler.aroundReceive(PeerConnectionHandler.scala:31)
at akka.actor.ActorCell.receiveMessage(ActorCell.scala:526)
at akka.actor.ActorCell.invoke(ActorCell.scala:495)
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 scala.concurrent.forkjoin.ForkJoinTask.doExec(ForkJoinTask.java:260)
at scala.concurrent.forkjoin.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1339)
at scala.concurrent.forkjoin.ForkJoinPool.runWorker(ForkJoinPool.java:1979)
at scala.concurrent.forkjoin.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:107)
How about adding back logback.xml? Not sure if this is scala-idiomatic, but logback offers a lot of functionality, such as filtering etc.
see:
https://github.com/typesafehub/scala-logging
older commit:
6d86cba
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.