Skip to content

Commit

Permalink
Change GreenlightCredentials
Browse files Browse the repository at this point in the history
  • Loading branch information
dangeross committed Jun 27, 2024
1 parent eae06bf commit 87cf749
Show file tree
Hide file tree
Showing 18 changed files with 40 additions and 40 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
runs-on: ubuntu-latest
outputs:
sdk-ref: ${{ inputs.sdk-ref || 'd658f85c7c349bd7ed96c05c3d008b7b75e6273a' }}
package-version: '0.4.2-rc1'
package-version: '0.4.3-rc1'
steps:
- run: echo "set pre-setup output variables"

Expand Down
6 changes: 3 additions & 3 deletions snippets/csharp/Production.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ public NodeConfig ProductionNodeConfig() {
// ANCHOR: moving-to-production
// Read in your Greenlight credentials from the file
// system, environment variable or build config
var deviceKey = new List<byte>();
var deviceCert = new List<byte>();
var greenlightCredentials = new GreenlightCredentials(deviceKey, deviceCert);
var developerKey = new List<byte>();
var developerCert = new List<byte>();
var greenlightCredentials = new GreenlightCredentials(developerKey, developerCert);

var nodeConfig = new NodeConfig.Greenlight(
new GreenlightNodeConfig(greenlightCredentials, null)
Expand Down
8 changes: 4 additions & 4 deletions snippets/dart_snippets/lib/production.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ NodeConfig productionNodeConfig() {
// ANCHOR: moving-to-production
// Read in your Greenlight credentials from the file
// system, environment variable or build config
Uint8List deviceKey = Uint8List(0);
Uint8List deviceCert = Uint8List(0);
Uint8List developerKey = Uint8List(0);
Uint8List developerCert = Uint8List(0);
GreenlightCredentials greenlightCredentials = GreenlightCredentials(
deviceKey: deviceKey,
deviceCert: deviceCert,
developerKey: developerKey,
developerCert: developerCert,
);

NodeConfig nodeConfig = NodeConfig.greenlight(
Expand Down
2 changes: 1 addition & 1 deletion snippets/dart_snippets/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ packages:
path: "packages/breez-sdk-flutter"
relative: true
source: path
version: "0.4.2-rc1"
version: "0.4.3-rc1"
build:
dependency: transitive
description:
Expand Down
2 changes: 1 addition & 1 deletion snippets/go/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ module main

go 1.19

require github.com/breez/breez-sdk-go v0.4.0-rc5
require github.com/breez/breez-sdk-go v0.4.3-rc1

replace github.com/breez/breez-sdk-go => ./packages/breez-sdk-go
8 changes: 4 additions & 4 deletions snippets/go/production.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ func ProductionNodeConfig() breez_sdk.NodeConfig {
// ANCHOR: moving-to-production
// Read in your Greenlight credentials from the file
// system, environment variable or build config
deviceKey := []uint8{}
deviceCert := []uint8{}
developerKey := []uint8{}
developerCert := []uint8{}
greenlightCredentials := breez_sdk.GreenlightCredentials{
DeviceKey: deviceKey,
DeviceCert: deviceCert,
developerKey: developerKey,
developerCert: developerCert,
}

nodeConfig := breez_sdk.NodeConfigGreenlight{
Expand Down
2 changes: 1 addition & 1 deletion snippets/kotlin_mpp_lib/shared/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ kotlin {
}
val commonMain by getting {
dependencies {
implementation("technology.breez:breez-sdk-kmp:0.4.2-rc1")
implementation("technology.breez:breez-sdk-kmp:0.4.3-rc1")
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ class Production {
// ANCHOR: moving-to-production
// Read in your Greenlight credentials from the file
// system, environment variable or build config
val deviceKey = emptyList<UByte>()
val deviceCert = emptyList<UByte>()
val greenlightCredentials = GreenlightCredentials(deviceKey, deviceCert)
val developerKey = emptyList<UByte>()
val developerCert = emptyList<UByte>()
val greenlightCredentials = GreenlightCredentials(developerKey, developerCert)

val nodeConfig = NodeConfig.Greenlight(GreenlightNodeConfig(greenlightCredentials, null))
// ANCHOR_END: moving-to-production
Expand Down
6 changes: 3 additions & 3 deletions snippets/python/src/production.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ def production_node_config():
# ANCHOR: moving-to-production
# Read in your Greenlight credentials from the file
# system, environment variable or build config
deviceKey = []
deviceCert = []
greenlightCredentials = breez_sdk.GreenlightCredentials(deviceKey, deviceCert)
developerKey = []
developerCert = []
greenlightCredentials = breez_sdk.GreenlightCredentials(developerKey, developerCert)

node_config = breez_sdk.NodeConfig.GREENLIGHT(
breez_sdk.GreenlightNodeConfig(greenlightCredentials, None))
Expand Down
8 changes: 4 additions & 4 deletions snippets/react-native/production.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ const productionNodeConfig = (): NodeConfig => {
// ANCHOR: moving-to-production
// Read in your Greenlight credentials from the file
// system, environment variable or build config
const deviceKey: number[] = []
const deviceCert: number[] = []
const developerKey: number[] = []
const developerCert: number[] = []
const greenlightCredentials: GreenlightCredentials = {
deviceKey,
deviceCert
developerKey,
developerCert
}

const nodeConfig: NodeConfig = {
Expand Down
4 changes: 2 additions & 2 deletions snippets/rust/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion snippets/rust/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ edition = "2021"
[dependencies]
anyhow = "1"
bip39 = { version = "2", features = ["rand"] }
breez-sdk-core = { git = "https://github.com/breez/breez-sdk", rev = "76cd730e298d330ad4922fccc5296ab020201f36" }
breez-sdk-core = { git = "https://github.com/breez/breez-sdk", rev = "a9d208a0b8aa074cd6ab0bc490ecd074c704197a" }
log = "0.4"
tokio = "1.29"
8 changes: 4 additions & 4 deletions snippets/rust/src/production.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ fn production_node_config() -> Result<NodeConfig> {
// ANCHOR: moving-to-production
// Read in your Greenlight credentials from the file
// system, environment variable or build config
let device_key: Vec<u8> = vec![];
let device_cert: Vec<u8> = vec![];
let developer_key: Vec<u8> = vec![];
let developer_cert: Vec<u8> = vec![];
let greenlight_credentials = GreenlightCredentials {
device_key,
device_cert,
developer_key,
developer_cert,
};

let node_config = NodeConfig::Greenlight {
Expand Down
4 changes: 2 additions & 2 deletions snippets/swift/BreezSDKExamples/Package.resolved
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/breez/breez-sdk-swift",
"state" : {
"revision" : "5f233fc7bd38395461849a1fb5d999f0667039e8",
"version" : "0.4.2-rc1"
"revision" : "f77009b19955f5d5a819aa2decf0e54042ed687f",
"version" : "0.4.3-rc1"
}
},
{
Expand Down
2 changes: 1 addition & 1 deletion snippets/swift/BreezSDKExamples/Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ let package = Package(
platforms: [.macOS(.v13)],
dependencies: [
.package(url: "https://github.com/apple/swift-argument-parser", from: "1.2.3"),
.package(url: "https://github.com/breez/breez-sdk-swift", from: "0.4.2-rc1")
.package(url: "https://github.com/breez/breez-sdk-swift", from: "0.4.3-rc1")
],
targets: [
// Targets are the basic building blocks of a package, defining a module or a test suite.
Expand Down
6 changes: 3 additions & 3 deletions snippets/swift/BreezSDKExamples/Sources/Production.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ func productionNodeConfig() -> NodeConfig {
// ANCHOR: moving-to-production
// Read in your Greenlight credentials from the file
// system, environment variable or build config
let deviceKey = [UInt8]()
let deviceCert = [UInt8]()
let greenlightCredentials = GreenlightCredentials(deviceKey: deviceKey, deviceCert: deviceCert)
let developerKey = [UInt8]()
let developerCert = [UInt8]()
let greenlightCredentials = GreenlightCredentials(developerKey: developerKey, developerCert: developerCert)

let nodeConfig = NodeConfig.greenlight(
config: GreenlightNodeConfig(partnerCredentials: greenlightCredentials, inviteCode: nil))
Expand Down
2 changes: 1 addition & 1 deletion src/guide/install.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ Check https://github.com/breez/breez-sdk/releases for the latest version.

```toml
[dependencies]
breez-sdk-core = { git = "https://github.com/breez/breez-sdk", tag = "0.4.2-rc1" }
breez-sdk-core = { git = "https://github.com/breez/breez-sdk", tag = "0.4.3-rc1" }
```

## Flutter/Dart
Expand Down
2 changes: 1 addition & 1 deletion src/guide/production.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ To obtain a certificate for a production environment, please register [here](htt

## Applying certificates

The certificates received from Blockstream should be contained with a zip file. Within the zip file should be a `.crt` and a `.pem` file, these are the certificate and private key files. To use these files with the Breez SDK each file needs to be read as binary/byte data, inserting the `.crt` data as the device cert and the `.pem` data as the device key.
The certificates received from Blockstream should be contained with a zip file. Within the zip file should be a `.crt` and a `.pem` file, these are the certificate and private key files. To use these files with the Breez SDK each file needs to be read as binary/byte data, inserting the `.crt` data as the developer cert and the `.pem` data as the developer key.
<div class="warning">
<h4>Developer note</h4>
Leave the file contents as is, manipulating the file contents will result in transport errors.
Expand Down

0 comments on commit 87cf749

Please sign in to comment.