- git subtree usage
git remote add someorigin https://github.com/someproject # add remote
git subtree add --prefix=foldername someorigin master # add folder MonadJ as subtree code directory
git subtree push --prefix=foldername someorigin master # push subtree local change to remote
git subtree pull --prefix=foldername someorigin master # pull from remote
- spring data jpa usage
https://docs.spring.io/spring-data/jpa/docs/current/reference/html/
- lombok usage
https://jingyan.baidu.com/article/0a52e3f4e53ca1bf63ed725c.html
- configurations override
-Dspring.config.location=classpath:\application.yml,some-path\custom-config.yml
- web assembly text format compiler
https://github.com/WebAssembly/wabt/releases
- smart contract development
- install rust toolchain https://www.rust-lang.org/tools/install
- install rust wasm build target
rustup target add wasm32-unknown-unknown
- build to wasm
cargo build
- RLP Encoding/Decoding see https://github.com/TrustedDataFramework/java-rlp
Benchmark compare to EthereumJ:
decoding list 10000000 times:
ethereumJ: 3698ms our: 2515ms
-
github package
- set GITHUB_USERNAME environment as your github login name
- generate a token for github package: https://github.com/settings/tokens
- set GITHUB_TOKEN environment as the token generated above.
-
vscode debug config example
{
"configurations": [
{
"type": "java",
"name": "sunflower-core",
"request": "launch",
"mainClass": "org.tdf.sunflower.Start",
"projectName": "sunflower-core-sunflower-core",
"vmArgs": "-Dspring.config.location=sunflower-core/local/local-0.yml"
}
]
}
- start application: (Windows)
.\gradlew sunflower-core:bootRun
- clear builds (Windows)
.\gradlew clean
- build and run fat jar (Windows)
.\gradlew sunflowe-core:bootJar
# override default spring config with your custom config
java -jar sunflower-core\build\libs\sunflower*.jar -Dspring.config.location=classpath:\application.yml,some-path\custom-config.yml
# you can also load your config by environment
set SPRING_CONFIG_LOCATION=classpath:\application.yml,some-path\custom-config.yml
java -jar consortium\build\libs\consortium-0.0.1-SNAPSHOT.jar
- build docker and push
bash sunflower-core/docker/build.sh -i your_name_space/your_repository_name:tag --push
- rest apis
- /rpc/account/{address} display account
- /rpc/config display application configuration