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

Add SQLite store #44

Merged
merged 24 commits into from
Feb 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
4895bc7
deps: update go version, add sqlite
n8maninger Jan 2, 2024
46db8cc
wallet: add manager
n8maninger Jan 9, 2024
591f38e
api, cmd: use sqlite3 store
n8maninger Jan 9, 2024
1bec403
internal: remove ephemeral and JSON wallet store
n8maninger Jan 9, 2024
ffed07b
cmd: create data directory if it doesn't exist
n8maninger Jan 10, 2024
fb4466f
sqlite: fix tip encoding
n8maninger Jan 10, 2024
6c45c1f
cmd: gracefully close stores on shutdown
n8maninger Jan 10, 2024
f780171
ci: fix lint errors
n8maninger Jan 10, 2024
e6f1717
ci: disable jape analyzer
n8maninger Jan 10, 2024
7a3f173
sqlite: fix siacoin element arg order
n8maninger Jan 10, 2024
77ec061
ci: enable cgo, bump go versions for test
n8maninger Jan 10, 2024
9863471
sqlite: use NewBufDecoder
n8maninger Jan 11, 2024
37c4daa
api: fix client docstring
n8maninger Jan 11, 2024
ef65830
api,cmd,sqlite,syncer: remove ephemeral store, add sqlite peer store
n8maninger Jan 11, 2024
0dcc110
sqlite: add peer tests
n8maninger Jan 11, 2024
ac351b5
sqlite: better update proof logic
n8maninger Jan 11, 2024
d470946
sqlite: fix ownsAddress
n8maninger Jan 11, 2024
d066588
sqlite: better encoding
n8maninger Jan 12, 2024
db19456
sqlite: fix tests
n8maninger Jan 23, 2024
21dd514
sqlite: remove txn interface
n8maninger Jan 24, 2024
44e471d
sqlite: fix address balance tracking
n8maninger Jan 26, 2024
b7ef754
api,sqlite,wallet: support immature siacoin balance
n8maninger Jan 26, 2024
75812b1
remove duplicate api startup
n8maninger Feb 1, 2024
0df580e
sqlite: fix currency encoding
n8maninger Feb 1, 2024
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
8 changes: 4 additions & 4 deletions .github/actions/test/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ runs:
- name: Configure git # required for golangci-lint on Windows
shell: bash
run: git config --global core.autocrlf false
# - name: Lint
# uses: golangci/golangci-lint-action@v3
# with:
# skip-cache: true
- name: Lint
uses: golangci/golangci-lint-action@v3
with:
skip-cache: true
# - name: Analyze
# uses: SiaFoundation/action-golang-analysis@HEAD
# with:
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ on:
branches:
- master

env:
CGO_ENABLED: 1

jobs:
test:
runs-on: ${{ matrix.os }}
Expand All @@ -14,7 +17,7 @@ jobs:
strategy:
matrix:
os: [ ubuntu-latest , macos-latest, windows-latest ]
go-version: [ '1.19', '1.20' ]
go-version: [ '1.20', '1.21' ]
steps:
- name: Configure git
run: git config --global core.autocrlf false # required on Windows
Expand Down
159 changes: 159 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,159 @@
# Based off of the example file at https://github.com/golangci/golangci-lint

# options for analysis running
run:
# default concurrency is a available CPU number
concurrency: 4

# timeout for analysis, e.g. 30s, 5m, default is 1m
timeout: 600s

# exit code when at least one issue was found, default is 1
issues-exit-code: 1

# include test files or not, default is true
tests: true

# list of build tags, all linters use it. Default is empty list.
build-tags: []

# which dirs to skip: issues from them won't be reported;
# can use regexp here: generated.*, regexp is applied on full path;
# default value is empty list, but default dirs are skipped independently
# from this option's value (see skip-dirs-use-default).
skip-dirs:
- cover

# default is true. Enables skipping of directories:
# vendor$, third_party$, testdata$, examples$, Godeps$, builtin$
skip-dirs-use-default: true

# which files to skip: they will be analyzed, but issues from them
# won't be reported. Default value is empty list, but there is
# no need to include all autogenerated files, we confidently recognize
# autogenerated files. If it's not please let us know.
skip-files: []

# output configuration options
output:
# colored-line-number|line-number|json|tab|checkstyle|code-climate, default is "colored-line-number"
format: colored-line-number

# print lines of code with issue, default is true
print-issued-lines: true

# print linter name in the end of issue text, default is true
print-linter-name: true

# all available settings of specific linters
linters-settings:
## Enabled linters:
govet:
# report about shadowed variables
check-shadowing: false
disable-all: false

tagliatelle:
case:
rules:
json: goCamel
yaml: goCamel


gocritic:
# Which checks should be enabled; can't be combined with 'disabled-checks';
# See https://go-critic.github.io/overview#checks-overview
# To check which checks are enabled run `GL_DEBUG=gocritic golangci-lint run`
# By default list of stable checks is used.
enabled-checks:
- argOrder # Diagnostic options
- badCond
- caseOrder
- dupArg
- dupBranchBody
- dupCase
- dupSubExpr
- nilValReturn
- offBy1
- weakCond
- boolExprSimplify # Style options here and below.
- builtinShadow
- emptyFallthrough
- hexLiteral
- underef
- equalFold
revive:
ignore-generated-header: true
rules:
- name: blank-imports
disabled: false
- name: bool-literal-in-expr
disabled: false
- name: confusing-results
disabled: false
- name: constant-logical-expr
disabled: false
- name: context-as-argument
disabled: false
- name: exported
disabled: false
- name: errorf
disabled: false
- name: if-return
disabled: false
- name: increment-decrement
disabled: false
- name: modifies-value-receiver
disabled: false
- name: optimize-operands-order
disabled: false
- name: range-val-in-closure
disabled: false
- name: struct-tag
disabled: false
- name: superfluous-else
disabled: false
- name: time-equal
disabled: false
- name: unexported-naming
disabled: false
- name: unexported-return
disabled: false
- name: unnecessary-stmt
disabled: false
- name: unreachable-code
disabled: false
- name: package-comments
disabled: true

linters:
disable-all: true
fast: false
enable:
- tagliatelle
- gocritic
- gofmt
- revive
- govet
- misspell
- typecheck
- whitespace

issues:
# Maximum issues count per one linter. Set to 0 to disable. Default is 50.
max-issues-per-linter: 0

# Maximum count of issues with the same text. Set to 0 to disable. Default is 3.
max-same-issues: 0

# List of regexps of issue texts to exclude, empty list by default.
# But independently from this option we use default exclude patterns,
# it can be disabled by `exclude-use-default: false`. To list all
# excluded by default patterns execute `golangci-lint run --help`
exclude: []

# Independently from option `exclude` we use default exclude patterns,
# it can be disabled by this option. To list all
# excluded by default patterns execute `golangci-lint run --help`.
# Default value for this option is true.
exclude-use-default: false
Loading
Loading