Merge pull request #487 from torkelrogstad/2019-05-31-publish-website

Publish website
This commit is contained in:
Torkel Rogstad 2019-06-03 10:29:19 +02:00 committed by GitHub
commit 87a655e7f8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 83 additions and 60 deletions

View file

@ -51,15 +51,15 @@ stages:
- name: release
if: ((branch = master AND type = push) OR (tag IS present)) AND NOT fork
script: sbt ++$TRAVIS_SCALA_VERSION coverage test &&
sbt ++$TRAVIS_SCALA_VERSION core/coverageReport &&
sbt ++$TRAVIS_SCALA_VERSION coverageAggregate &&
sbt ++$TRAVIS_SCALA_VERSION coveralls
jobs:
include:
- env: TEST="bitcoin-s test suite"
script:
sbt ++$TRAVIS_SCALA_VERSION coverage test &&
sbt ++$TRAVIS_SCALA_VERSION core/coverageReport &&
sbt ++$TRAVIS_SCALA_VERSION coverageAggregate &&
sbt ++$TRAVIS_SCALA_VERSION coveralls
# run ci-release only if previous stages passed
- stage: release
script: sbt ci-release
# run website push only if previous stages passed
- script: sbt docs/docusaurusPublishGhpages

View file

@ -284,7 +284,8 @@ lazy val docs = project
mdocExtraArguments := List("--no-link-hygiene"),
name := "bitcoin-s-docs",
mdocVariables := Map(
"VERSION" -> version.value
"STABLE_VERSION" -> previousStableVersion.value.get,
"UNSTABLE_VERSION" -> version.value
),
publishWebsite := Def
.sequential(

View file

@ -53,7 +53,7 @@ In a separate shell:
```bash
$ sbt
> doc/mdoc --watch
> docs/mdoc --watch
```
The above commands compiles our Mdoc Markdown files every time you change

View file

@ -12,15 +12,18 @@ downloads and installs [Coursier](https://get-coursier.io/) and uses it to
fetch the [Ammonite](https://ammonite.io) REPL and the latest version of
Bitcoin-S. It then drops you into immediately into a REPL session.
```
% curl -s https://raw.githubusercontent.com/bitcoin-s/bitcoin-s-core/master/try-bitcoin-s.sh | bash
```bash
$ curl -s https://raw.githubusercontent.com/bitcoin-s/bitcoin-s/master/try-bitcoin-s.sh | bash
Loading...
Welcome to the Ammonite Repl 1.0.3
(Scala 2.12.4 Java 1.8.0_152)
If you like Ammonite, please support our development at www.patreon.com/lihaoyi
@ 23 :: "foo" :: true :: HNil
res0: Int :: String :: Boolean :: HNil = 23 :: "foo" :: true :: HNil
%
Welcome the Bitcoin-S REPL, powered by Ammonite
Check out our documentation and examples at
https://bitcoin-s.org/docs/getting-started
@ val priv = ECPrivateKey()
@ val pub = priv.publicKey
@ val spk = P2WPKHWitnessSPKV0(pub)
@ val address = Bech32Address(spk, MainNet)
@ address.value # Tada! You've just made a Bech32 address
res4: String = "bc1q7ynsz7tamtnvlmts4snrl7e98jc9d8gqwsjsr5"
```
## Build tools
@ -33,17 +36,39 @@ instructions for your build tool
Add this to your `build.sbt`:
```scala
libraryDependencies +="org.bitcoins" % "bitcoin-s-secp256k1jni" % "@VERSION@"
libraryDependencies +="org.bitcoin-s" % "bitcoin-s-secp256k1jni" % "@STABLE_VERSION@"
libraryDependencies += "org.bitcoins" %% "bitcoin-s-core" % "@VERSION@" withSources() withJavadoc()
libraryDependencies += "org.bitcoin-s" %% "bitcoin-s-core" % "@STABLE_VERSION@"
libraryDependencies += "org.bitcoins" %% "bitcoin-s-bitcoind-rpc" % "@VERSION@" withSources() withJavadoc()
libraryDependencies += "org.bitcoin-s" %% "bitcoin-s-bitcoind-rpc" % "@STABLE_VERSION@"
libraryDependencies += "org.bitcoins" %% "bitcoin-s-eclair-rpc" % "@VERSION@" withSources() withJavadoc()
libraryDependencies += "org.bitcoin-s" %% "bitcoin-s-eclair-rpc" % "@STABLE_VERSION@"
libraryDependencies += "org.bitcoins" %% "bitcoin-s-testkit" % "@VERSION@" withSources() withJavadoc()
libraryDependencies += "org.bitcoin-s" %% "bitcoin-s-testkit" % "@STABLE_VERSION@"
libraryDependencies += "org.bitcoin-s" %% "bitcoin-s-zmq" % "@STABLE_VERSION@"
```
```scala mdoc:passthrough
val isUnstable = "@UNSTABLE_VERSION" != "@STABLE_VERSION@"
if (isUnstable) {
println(s"""
### Nightly builds
You can also run on the bleeding edge of Bitcoin-S, by
adding a snapshot build to your `build.sbt`. The most
recent snapshot published is `@UNSTABLE_VERSION@`.
To fetch snapshot, you will need to add the correct
resolver in your `build.sbt`:
```sbt
resolvers += Resolver.sonatypeRepo("snapshots")
${List.fill(3)("`").mkString /* Hacky solution to get around nesting backticks */ }
""")
}
libraryDependencies += "org.bitcoins" %% "bitcoin-s-zmq" % "@VERSION@" withSources() withJavadoc()
```
### Mill

View file

@ -10,6 +10,8 @@ version lines. It can be set up to work with both local and remote Bitcoin Core
## Connecting to a local `bitcoind` instance
### Getting started quickly, with default options:
```scala mdoc:compile-only
import scala.concurrent._
import akka.actor.ActorSystem
@ -17,22 +19,14 @@ import akka.actor.ActorSystem
import org.bitcoins.{rpc, core}
import core.currency.Bitcoins
import rpc.client.common._
import rpc.config.BitcoindInstance
implicit val actorSystem: ActorSystem = ActorSystem.create()
implicit val ec: ExecutionContext = actorSystem.dispatcher
implicit val system = ActorSystem.create()
implicit val ec: ExecutionContext = system.dispatcher
// data directory defaults to ~/.bitcoin on Linux and
// ~/Library/Application Support/Bitcoin on macOS
val bitcoindInstance = BitcoindInstance.fromDatadir()
// alternative:
import java.io.File
val dataDir = new File("/my/bitcoin/data/dir")
val otherInstance = BitcoindInstance.fromDatadir(dataDir)
val client = new BitcoindRpcClient(bitcoindInstance)
// this reads authentication credentials and
// connection details from the default data
// directory on your platform
val client = BitcoindRpcClient.fromDatadir()
val balance: Future[Bitcoins] = for {
_ <- client.start()
@ -67,20 +61,17 @@ import org.bitcoins.rpc.client.common._
val username = "FILL_ME_IN" //this username comes from 'rpcuser' in your bitcoin.conf file
val password = "FILL_ME_IN" //this password comes from your 'rpcpassword' in your bitcoin.conf file
val rpcPort = 8332 //this is default port for mainnet, 18332 for testnet/regtest
val authCredentials = BitcoindAuthCredentials(
val authCredentials = BitcoindAuthCredentials.PasswordBased(
username = username,
password = password,
rpcPort = rpcPort
password = password
)
val bitcoindInstance = {
BitcoindInstance (
network = MainNet,
uri = new URI(s"http://localhost:${authCredentials.rpcPort + 1}"),
rpcUri = new URI(s"http://localhost:${authCredentials.rpcPort}"),
uri = new URI(s"http://localhost:${MainNet.port}"),
rpcUri = new URI(s"http://localhost:${MainNet.rpcPort}"),
authCredentials = authCredentials
)
}

View file

@ -11,9 +11,15 @@ test -e ~/.coursier/coursier || \
(mkdir -p ~/.coursier && curl -L -s --output ~/.coursier/coursier $COURSIER_URL && chmod +x ~/.coursier/coursier)
MSG="Welcome the Bitcoin-S REPL, powered by Ammonite
Check out our documentation at https://bitcoin-s.org"
Check out our documentation and examples at
https://bitcoin-s.org/docs/getting-started"
IMPORT_STATEMENT="import org.bitcoins.core._; import currency._, \
protocol.blockchain._, number._, crypto._, hd._, protocol.script._, \
protocol.ln, wallet.builder._, protocol.transaction._, \
script._, config._, protocol._ "
# launch Ammonite with bitcoin-s on the classpath
~/.coursier/coursier launch -q -P \
com.lihaoyi:ammonite_2.12.4:latest.release \
org.bitcoin-s:core.12:latest.release \
-- --predef-code 'import org.bitcoins.core._' --banner $MSG < /dev/tty
com.lihaoyi:ammonite_2.12.8:1.6.0 \
org.bitcoin-s:bitcoin-s-core_2.12:latest.release \
-M ammonite.Main -- --banner "$MSG" \
--predef-code "$IMPORT_STATEMENT" < /dev/tty

View file

@ -11,30 +11,30 @@
/**
* For github.io type URLs, you would set the url and baseUrl like:
* const url = 'https://your-github-user-name.github.io'
* const baseUrl = "/bitcoin-s-core/"
*
* This would place the site under
* https://your-user-name.github.io/bitcoin-s-core.
* const baseUrl = "/bitcoin-s/"
*
* This would place the site under
* https://your-user-name.github.io/bitcoin-s.
* If publishing under a custom domain with no path
* after the domain, you'd set const baseUrl = "/"
* and const url = "https://your-domain.org".
*/
*/
const url = "https://bitcoin-s.org"
const url = "https://bitcoin-s.org";
const baseUrl = "/";
const scaladocUrl = baseUrl + "api/org/bitcoins";
/**
* This should be the username/organization that owns the repo
* you're publishing the website for.
* you're publishing the website for.
*/
const organizationName = "bitcoin-s",
const organizationName = "bitcoin-s";
/**
* This should be the name of the repo you're publishing the
* This should be the name of the repo you're publishing the
* website for
*/
const projectName = "bitcoin-s-core"
const projectName = "bitcoin-s";
// List of projects/orgs using your project for the users page.
const users = [
@ -71,12 +71,12 @@ const users = [
const siteConfig = {
title: "bitcoin-s", // Title for your website.
tagline: "Bitcoin implementation in Scala",
url,
url,
baseUrl,
// URL for editing docs, has to be present for the
// "Edit this Doc" button to appear
editUrl: "https://github.com/bitcoin-s/bitcoin-s-core/docs",
editUrl: "https://github.com/bitcoin-s/bitcoin-s/docs",
// Used for publishing and more
projectName,
@ -152,7 +152,7 @@ const siteConfig = {
////////////////////
// custom keys begin
repoUrl: "https://github.com/bitcoin-s/bitcoin-s-core",
repoUrl: "https://github.com/bitcoin-s/bitcoin-s",
suredbitsSlack:
"https://join.slack.com/t/suredbits/shared_invite/enQtNDEyMjY3MTg1MTg3LTYyYjkwOGUzMDQ4NDAwZjE1M2I3MmQyNWNlZjNlYjg4OGRjYTRjNWUwNjRjNjg4Y2NjZjAxYjU1N2JjMTU1YWM",
gitterUrl: "https://gitter.im/bitcoin-s-core/",