|
4 months ago | |
---|---|---|
R | 4 months ago | |
data | 2 years ago | |
data-raw | 2 years ago | |
inst/shiny-app | 4 months ago | |
man | 4 months ago | |
.gitignore | 2 years ago | |
DESCRIPTION | 4 months ago | |
LICENSE | 2 years ago | |
NAMESPACE | 4 months ago | |
README.md | 2 years ago |
An R-package for interacting with the Townforge blockchain
Read more about Townforge at: www.townforge.net
Townforge is a blockchain based game forked originally from the Monero project (https://github.com/monero-project). This is a package written for the R statistical software language, for curl'ing the Townforge RPC commands and interacting with the daemon. TownforgeR parses the input JSON according to the web app, and the returned JSON into R-compatible lists and data frames.
It comes with an R Shiny interface, i.e. a graphical web browser, in addition to the base R functionality.
Launching daemon (in testnet):
townforged --testnet
Launching wallet rpc (in testnet):
townforge-wallet-rpc --rpc-bind-port 63079 --wallet-file "myWalletFile" --password "myWalletPassword" --testnet --daemon-port 28881 --disable-rpc-login
Installing TownforgeR from GitHub and testing a basic daemon RPC call:
# devtools::install_github("Syksy/TownforgeR")
library(TownforgeR)
# Curl the RPC with the method "get_block_count", assuming URL to be 127.0.0.1:18881
# Note that testnet daemon port by default is 28881
TownforgeR::tf_rpc_curl(method="get_block_count")
Launching (testnet) R Shiny interface:
TownforgeR::shinyTF("http://127.0.0.1:28881/json_rpc")
(In part based on https://stackoverflow.com/questions/37830819/developing-shiny-app-as-a-package-and-deploying-it-to-shiny-server#49623819 )
Install Shiny Server. Guide for installing on a Virtual Private Server (VPS): https://deanattali.com/2015/05/09/setup-rstudio-shiny-server-digital-ocean/
Install the TownforgeR package for all users:
sudo su - -c "R -e \"devtools::install_github('Syksy/TownforgeR')\""
Then create a file at /srv/shiny-server/TownforgeR/app.R
containing the following:
shiny::shinyOptions(start.townforged = TRUE)
TownforgeR::shinyTF("http://127.0.0.1:28881/json_rpc")