Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Postgre transaction methods #74

Merged
merged 2 commits into from
May 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
235 changes: 155 additions & 80 deletions README.md

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions cmd/central/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ import (
"github.com/bartossh/Computantis/configuration"
"github.com/bartossh/Computantis/dataprovider"
"github.com/bartossh/Computantis/logging"
"github.com/bartossh/Computantis/mongorepo"
"github.com/bartossh/Computantis/reactive"
"github.com/bartossh/Computantis/repomongo"
"github.com/bartossh/Computantis/server"
"github.com/bartossh/Computantis/wallet"
)
Expand All @@ -39,7 +39,7 @@ func main() {
cancel()
}()

db, err := mongorepo.Connect(ctx, cfg.Database)
db, err := repomongo.Connect(ctx, cfg.Database)
if err != nil {
fmt.Println(err)
c <- os.Interrupt
Expand Down
4 changes: 2 additions & 2 deletions cmd/validator/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
"github.com/bartossh/Computantis/configuration"
"github.com/bartossh/Computantis/fileoperations"
"github.com/bartossh/Computantis/logging"
"github.com/bartossh/Computantis/mongorepo"
"github.com/bartossh/Computantis/repomongo"
"github.com/bartossh/Computantis/validator"
"github.com/bartossh/Computantis/wallet"
"github.com/bartossh/Computantis/webhooks"
Expand All @@ -30,7 +30,7 @@ func main() {
c := make(chan os.Signal, 1)
signal.Notify(c, os.Interrupt)

db, err := mongorepo.Connect(ctx, cfg.Database)
db, err := repomongo.Connect(ctx, cfg.Database)
if err != nil {
fmt.Println(err)
c <- os.Interrupt
Expand Down
6 changes: 5 additions & 1 deletion docker_postgres_init.sql
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,14 @@ CREATE INDEX transaction_temporary_created_at ON transactionsTemporary USING BTR

CREATE TABLE IF NOT EXISTS transactionsAwaitingReceiver (
id serial PRIMARY KEY,
created_at TIMESTAMP NOT NULL,
hash BYTEA UNIQUE NOT NULL,
issuer_address VARCHAR ( 64 ) NOT NULL,
receiver_address VARCHAR ( 64 ) NOT NULL,
FOREIGN KEY (hash) REFERENCES transactionsTemporary (hash)
subject VARCHAR ( 100 ) NOT NULL,
data BYTEA,
issuer_signature BYTEA NOT NULL,
receiver_signature BYTEA
);

CREATE INDEX transaction_awaiting_issuer_address ON transactionsAwaitingReceiver USING HASH (issuer_address);
Expand Down
Loading