https://github.com/upper/cockroachdb-example
https://github.com/upper/cockroachdb-example
Last synced: 9 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/upper/cockroachdb-example
- Owner: upper
- Archived: true
- Created: 2020-08-25T14:14:09.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2020-08-25T14:59:54.000Z (over 5 years ago)
- Last Synced: 2025-02-17T02:16:41.888Z (11 months ago)
- Language: Go
- Size: 1.95 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# upper/db + CockroachDB example
## Run the insecure node example
Create and run an insecure node:
```
make insecure-node
```
Open a second terminal and create the bank database:
```
make bank-database-insecure
```
Run the `main.go` example:
```
go run main.go
```
## Run the secure node example
Create and run a secure node:
```
make secure-node
```
Open a second terminal and create the bank database:
```
make bank-database-secure
```
Edit the `main.go` file and add options for secure connection:
```go
var settings = cockroachdb.ConnectionURL{
Host: "localhost",
Database: "bank",
User: "maxroach",
Options: map[string]string{
// Insecure node.
// "sslmode": "disable",
// Secure node.
"sslrootcert": "certs/ca.crt",
"sslkey": "certs/client.maxroach.key",
"sslcert": "certs/client.maxroach.crt",
},
}
```
Run the `main.go` example:
```
go run main.go
```