Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
709 commits
Select commit Hold shift + click to select a range
5cb4ca1
fix metrics and foundation tests
chris124567 Dec 4, 2024
5aebb69
fix satisfied policy check
chris124567 Dec 4, 2024
22efb34
fix lint
chris124567 Dec 4, 2024
518fdb7
add final renter and host outputs
chris124567 Dec 4, 2024
4415340
panic on index error
chris124567 Dec 5, 2024
c56345e
use logger's panic function
chris124567 Dec 5, 2024
f0baecb
Merge pull request #147 from SiaFoundation/christopher/panic-on-index…
n8maninger Dec 5, 2024
9307437
Bump go.sia.tech/core in the all-dependencies group
dependabot[bot] Dec 9, 2024
9705b81
add total / remining storage to HostMetrics
chris124567 Dec 12, 2024
7378ccc
Merge pull request #150 from SiaFoundation/christopher/add-remainings…
chris124567 Dec 15, 2024
f182e2b
Bump the all-dependencies group with 2 updates
dependabot[bot] Dec 16, 2024
5ca4544
minor test changes due to coreutils changes
chris124567 Dec 16, 2024
02eaac2
fix host scanning
chris124567 Dec 21, 2024
5c71c93
simplify scanning code
chris124567 Jan 3, 2025
38b4818
use WaitGroup on explorer
chris124567 Jan 3, 2025
996d8af
Bump the all-dependencies group with 2 updates
dependabot[bot] Dec 23, 2024
bff0bfd
Merge branch 'master' into christopher/fix-host-scanning
chris124567 Jan 3, 2025
827504e
Merge pull request #153 from SiaFoundation/christopher/fix-host-scanning
n8maninger Jan 3, 2025
06d8e99
add host query function
chris124567 Dec 17, 2024
dea9fb4
add host query test and use different fields for v2 hosts
chris124567 Dec 17, 2024
72ea677
use known_since instead of last_announcement for date created filter
chris124567 Dec 17, 2024
dd00457
add api endpoint
chris124567 Dec 17, 2024
491b537
fix docstrings
chris124567 Dec 17, 2024
332fb34
standardize limits
chris124567 Dec 18, 2024
e3ab683
don't panic if we get invalid sort column
chris124567 Dec 18, 2024
0f9b7b5
rename hosts route
chris124567 Dec 18, 2024
f13615b
use url.Values for /host query parameters
chris124567 Dec 18, 2024
5bff09e
add TestQueryHosts
chris124567 Dec 19, 2024
3f65c28
fix used storage sorting
chris124567 Dec 19, 2024
d6f16f1
unify host methods, make specifying v1/v2 optional
chris124567 Dec 20, 2024
c32e219
use types similar to those in coreutils/wallet but with explorer enha…
chris124567 Dec 16, 2024
e141e67
remove SpentSiacoinElements/SpentSiafundElements because the explorer…
chris124567 Dec 19, 2024
781e9c9
reduce code duplication for v2 events
chris124567 Dec 19, 2024
4ba8ec5
remove log
chris124567 Jan 6, 2025
cc39f5c
add unconfirmed events
chris124567 Jan 9, 2025
0edac67
standardize relevant addresses
chris124567 Jan 9, 2025
5fbf239
fix lint
chris124567 Jan 9, 2025
fbee1da
fill in more transaction fields in ananotate function
chris124567 Jan 11, 2025
40f78cb
fix events marshalling
chris124567 Jan 11, 2025
de870ee
add tests
chris124567 Jan 12, 2025
c201c45
fix typo
chris124567 Jan 12, 2025
f981c39
Bump go.sia.tech/coreutils in the all-dependencies group
dependabot[bot] Jan 13, 2025
24f1507
Merge branch 'master' into christopher/add-pending-events
chris124567 Jan 13, 2025
e9b8e07
remove unnecessary loop in /events/:id handler because we treat all e…
chris124567 Jan 13, 2025
18cf3fe
return confirmations and add event marshalling test
chris124567 Jan 13, 2025
5fc6ad6
fix typo
chris124567 Jan 13, 2025
4764fb2
use reflect.DeepEqual in TestEventMarshalling
chris124567 Jan 14, 2025
3f0a126
Merge pull request #156 from SiaFoundation/christopher/add-pending-ev…
chris124567 Jan 14, 2025
dcff892
add exponential backoff
chris124567 Jan 17, 2025
1f30cae
consider hosts announced in the past year for scanning
chris124567 Jan 17, 2025
89a5185
use MaxLastScan as backoff interval
chris124567 Jan 17, 2025
316268e
change HostsForScanning to use next_scan instead of last_scan when fi…
chris124567 Jan 17, 2025
1181c30
Bump the all-dependencies group with 2 updates
dependabot[bot] Jan 20, 2025
f8443c7
Merge pull request #162 from SiaFoundation/dependabot/go_modules/all-…
n8maninger Jan 21, 2025
fde4aa6
Add exchange rates (#158)
chris124567 Jan 21, 2025
c7815f4
don't pass current time to HostsForScanning
chris124567 Jan 22, 2025
26bd698
give more time to scan after readding
chris124567 Jan 22, 2025
6fd03e6
Merge branch 'master' into christopher/scanning-exponential-backoff
chris124567 Jan 22, 2025
ede9ef8
inline addHostScans
chris124567 Jan 22, 2025
9ab3c45
Rationalize search API HTTP error codes and add hosts and v2 contract…
chris124567 Jan 22, 2025
c9feca0
Merge branch 'master' into christopher/scanning-exponential-backoff
chris124567 Jan 22, 2025
2203dac
store FailedInteractionsStreak on hosts to be scanned and remove inte…
chris124567 Jan 23, 2025
183f432
have HostsForScanning return a simplified type
chris124567 Jan 23, 2025
04df7ba
Merge pull request #160 from SiaFoundation/christopher/scanning-expon…
chris124567 Jan 23, 2025
61e21cb
use standard exchange rate route
chris124567 Jan 23, 2025
5ec30ee
Merge pull request #163 from SiaFoundation/christopher/change-exchang…
n8maninger Jan 23, 2025
15eb617
add optional CoinGecko pro support
chris124567 Feb 4, 2025
b58c733
Merge pull request #167 from SiaFoundation/christopher/support-coinge…
n8maninger Feb 4, 2025
a6b56a5
add JSON camelCase tags to HostQuery
chris124567 Feb 7, 2025
7b2b244
use nil pointer as zero value for min/max prices, uptime, duration in…
chris124567 Feb 7, 2025
5123493
use omitempty on HostQuery fields
chris124567 Feb 10, 2025
eb514ab
use helper to get uint64 pointers in test
chris124567 Feb 10, 2025
aa05d97
Bump the all-dependencies group with 2 updates
dependabot[bot] Feb 10, 2025
baffc39
changes for consensus diffs
chris124567 Feb 10, 2025
37ed567
update core
chris124567 Feb 10, 2025
5866a7a
update coreutils
chris124567 Feb 11, 2025
5030a9f
use helper to create file contract element for revision
chris124567 Feb 11, 2025
ba23258
disable forced index in query for address events
chris124567 Feb 13, 2025
3a02302
other query changes from walletd
chris124567 Feb 14, 2025
5a75e41
fix lint
chris124567 Feb 14, 2025
28219be
Merge pull request #170 from SiaFoundation/christopher/improve-events…
chris124567 Feb 15, 2025
4d25c5a
use maxmind instead of ip2location, include latitude/longitude
chris124567 Feb 18, 2025
4adb7e5
include geolite2 database
chris124567 Feb 18, 2025
79644e9
reorder Location struct fields
chris124567 Feb 18, 2025
b118cd4
Merge pull request #171 from SiaFoundation/christopher/add-lat-lon
n8maninger Feb 18, 2025
c016bc9
fix setting proof output sources, retrieve all siacoin element fields…
chris124567 Feb 21, 2025
173f434
Bump github.com/google/go-cmp in the all-dependencies group
dependabot[bot] Feb 24, 2025
9946e1e
Merge branch 'master' into christopher/fix-event-output-source
chris124567 Feb 24, 2025
4bede20
Merge pull request #172 from SiaFoundation/christopher/fix-event-outp…
chris124567 Feb 24, 2025
1565f01
update core
ChrisSchinnerl Feb 25, 2025
a0f5115
Merge pull request #174 from SiaFoundation/chris/update-core
n8maninger Feb 25, 2025
75eba2c
use median values instead of mean
chris124567 Feb 27, 2025
f617c71
fix bug where zero values were added to arrays used to calculate median
chris124567 Feb 28, 2025
d79165a
Bump the all-dependencies group with 2 updates
dependabot[bot] Mar 3, 2025
67ebed8
Merge branch 'master' into christopher/remove-outliers-host-metrics
chris124567 Mar 3, 2025
b280667
Merge pull request #175 from SiaFoundation/christopher/remove-outlier…
chris124567 Mar 3, 2025
d1af93d
include NextScan in hosts response
chris124567 Feb 28, 2025
4f90681
add check for NextScan
chris124567 Mar 5, 2025
c231c19
scan hosts every hour instead of every 3 hours by default
chris124567 Mar 6, 2025
a819fbb
update core and coreutils
chris124567 Mar 6, 2025
2e64ef2
bump coreutils
chris124567 Mar 6, 2025
da5cacd
Merge pull request #180 from SiaFoundation/christopher/change-scan-in…
n8maninger Mar 6, 2025
fa8b203
add rhp4 fields to host metrics
chris124567 Mar 4, 2025
9e23c96
fix bool decoding from database
chris124567 Mar 4, 2025
cd518ea
rename rhp4 -> v2
chris124567 Mar 5, 2025
0e8be44
add metrics test
chris124567 Mar 5, 2025
bbdd33b
fix rebase issues
chris124567 Mar 6, 2025
d928698
add v2 numbers to total and remaining storage
chris124567 Mar 9, 2025
6882b79
add search by net address
chris124567 Mar 7, 2025
403fc57
add API test
chris124567 Mar 7, 2025
812613a
Merge branch 'master' into christopher/fix-v2-storage-total
chris124567 Mar 10, 2025
1479def
fix cases where timeouts were ignored scanning with rhp 2/3
chris124567 Mar 11, 2025
15fd6f0
simplify deadline handling in rhpv2/3 scanning code
chris124567 Mar 11, 2025
6f12d3a
wrap error value in rhpv2Settings
chris124567 Mar 11, 2025
1e52e31
treat v2 total and remaining storage as number of sectors instead of …
chris124567 Mar 11, 2025
542f63b
update scan test to check total and remaining storage
chris124567 Mar 11, 2025
a8d8971
reduce code duplication in deriving deadline
chris124567 Mar 11, 2025
e129e69
increase default timeout
chris124567 Mar 11, 2025
2fd2cb0
Revert "reduce code duplication in deriving deadline"
chris124567 Mar 11, 2025
be4974c
Merge pull request #184 from SiaFoundation/christopher/fix-timeout-v1…
n8maninger Mar 11, 2025
41ea624
fix JSON tag in host metrics
chris124567 Mar 11, 2025
95238de
Merge pull request #183 from SiaFoundation/christopher/fix-metrics-js…
chris124567 Mar 12, 2025
53d10bf
nitpick
chris124567 Mar 12, 2025
51860d7
Merge branch 'master' into christopher/fix-v2-storage-total
chris124567 Mar 12, 2025
e82a9f6
test improvements, use mock local host
chris124567 Mar 13, 2025
18eaafc
fix lint
chris124567 Mar 13, 2025
0949797
fix lint
chris124567 Mar 13, 2025
c73eb3f
nits and add test for offline v2 host
chris124567 Mar 14, 2025
2e41f95
Bump the all-dependencies group with 2 updates
dependabot[bot] Mar 17, 2025
7dcc543
Bump golang.org/x/net from 0.34.0 to 0.36.0 in the go_modules group
dependabot[bot] Mar 17, 2025
dd5f544
Merge branch 'master' into christopher/fix-v2-storage-total
chris124567 Mar 17, 2025
6cfdb33
lower timeouts and add more checks for second scan of hosts
chris124567 Mar 17, 2025
3138eb6
check v2 output source field in tests
chris124567 Mar 18, 2025
01941c9
set sources for v2 siacoin outputs
chris124567 Mar 18, 2025
c08f8b9
make delay configurable
chris124567 Mar 18, 2025
bf299a5
Merge pull request #188 from SiaFoundation/christopher/fix-v2-output-…
chris124567 Mar 19, 2025
bec6623
Merge branch 'master' into christopher/fix-v2-storage-total
chris124567 Mar 19, 2025
1bffeab
update core
n8mgr Mar 21, 2025
086609d
Merge pull request #191 from SiaFoundation/nate/update-core
n8maninger Mar 21, 2025
7181a21
Merge branch 'master' into christopher/fix-v2-storage-total
chris124567 Mar 21, 2025
472aa68
Merge pull request #181 from SiaFoundation/christopher/fix-v2-storage…
chris124567 Mar 21, 2025
bac214d
rename scanner config fields
chris124567 Mar 20, 2025
1496a02
reduce timeout for checking if we are synced
chris124567 Mar 20, 2025
979850a
use debug level for shutdown message in the scanning goroutine
chris124567 Mar 20, 2025
ba95bb1
reduce waiting in test
chris124567 Mar 20, 2025
4374873
reduce timeout further
chris124567 Mar 24, 2025
5e58cae
update schema
chris124567 Mar 26, 2025
88b5af2
simplify v2 resolution type
chris124567 Mar 27, 2025
45a03c9
update scanV2FileContract and tests
chris124567 Mar 27, 2025
5ee1c4d
check for invalid resolution type when retrieving from DB
chris124567 Mar 27, 2025
f31de85
update schema comments
chris124567 Mar 27, 2025
60f5daf
use V2ResolutionType function to simplify getting V2Resolution type f…
chris124567 Mar 27, 2025
77205b1
404 if block doesn't exist instead of 500
chris124567 Mar 27, 2025
e4bc026
check that resolution fields on contract are nil when we haven't reso…
chris124567 Mar 28, 2025
e5fd778
add test for invalid block id
chris124567 Mar 28, 2025
0ce0d57
Merge pull request #193 from SiaFoundation/christopher/404-no-block
chris124567 Mar 31, 2025
b5f8cb0
Merge branch 'master' into christopher/add-v2-resolution-type
chris124567 Mar 31, 2025
118f4d4
Merge pull request #192 from SiaFoundation/christopher/add-v2-resolut…
chris124567 Mar 31, 2025
ae713f4
add function to manually scan host
chris124567 Mar 18, 2025
76f81bd
add API endpoint
chris124567 Mar 18, 2025
18b2b86
don't use exponential backoff for manual scans
chris124567 Mar 18, 2025
2cfa553
make manual scanning configurable
chris124567 Mar 18, 2025
9eb65f4
fix lint
chris124567 Mar 18, 2025
a18ff61
store last scan error
chris124567 Mar 22, 2025
817bd42
add docstring for EnableManualScan
chris124567 Mar 24, 2025
f81232e
rebase fix
chris124567 Mar 25, 2025
1ff92cd
add basic auth for manual scan and add test for manual scan
chris124567 Mar 25, 2025
c03aff1
refactor test
chris124567 Mar 25, 2025
52f088f
retrieve last scan error and check for it in test
chris124567 Mar 25, 2025
c8c8ed7
fix basic auth
chris124567 Mar 26, 2025
49df298
return scan error if we got one
chris124567 Mar 26, 2025
00a7035
remove unused config field
chris124567 Mar 26, 2025
2964b3d
simplify error handling in TriggerHostScan
chris124567 Mar 26, 2025
2c5bf7d
rename routes /pubkey/:key/host -> /hosts/:key
chris124567 Mar 26, 2025
3029626
nits
chris124567 Mar 26, 2025
4122397
make AddHostScans variadic
chris124567 Mar 26, 2025
87ff3e7
return HostScans of the scanned hosts from ScanHosts
chris124567 Mar 26, 2025
b5688f3
fix lint
chris124567 Mar 26, 2025
a317e08
check auth for peer connect endpoint too
chris124567 Mar 26, 2025
08b234d
use pointer to string instead of string for LastScanError
chris124567 Mar 26, 2025
2f4e68d
add config field for pssword
chris124567 Mar 26, 2025
f2b5c05
fix typo
chris124567 Mar 26, 2025
88a2a76
fix typo
chris124567 Mar 26, 2025
2bb3e8b
add API tests with auth/no auth
chris124567 Mar 27, 2025
7528730
add test for syncer endpoint auth
chris124567 Mar 28, 2025
d92b3e8
check auth error message
chris124567 Mar 31, 2025
93879b5
change error message for invalid credentials
chris124567 Apr 1, 2025
6676eb8
rebase and only return ErrNoTip from BestHeight if height we haven't …
chris124567 Apr 1, 2025
2e3ce91
prevent busy waiting in waitForTip
chris124567 Apr 1, 2025
e41e9df
nit
chris124567 Apr 2, 2025
cec4c9b
add genesis block in NewExplorer
chris124567 Apr 2, 2025
95bda6d
camel case SearchTypeV2Contract
chris124567 Apr 3, 2025
d12d301
add renewed to ID for v2
chris124567 Apr 7, 2025
396d91e
add fields for v2 renewed from ID
chris124567 Apr 7, 2025
1f2a4e1
set v2 renewed from
chris124567 Apr 7, 2025
decaf51
fix typo, add test cases
chris124567 Apr 7, 2025
ead50ae
Bump the all-dependencies group with 2 updates
dependabot[bot] Apr 7, 2025
4fca1b6
ignore new unexported fields of StateElement
chris124567 Apr 7, 2025
18c39dd
add renewed from / renewed to test
chris124567 Apr 7, 2025
14693eb
Merge branch 'master' into christopher/add-renewed-from-renewed-to-co…
chris124567 Apr 7, 2025
e50e7da
rename renewedFromID -> renewedFrom, renewedToID -> renewedTo
chris124567 Apr 8, 2025
1c41d75
add merkle proof endpoint
chris124567 Apr 7, 2025
9816b73
Revert "add merkle proof endpoint"
chris124567 Apr 8, 2025
720b7a5
retrieve merkle proof for outputs, v2 contracts
chris124567 Apr 8, 2025
c17fee5
Merge branch 'master' into christopher/add-renewed-from-renewed-to-co…
chris124567 Apr 9, 2025
194037f
fix lint
chris124567 Apr 9, 2025
3dc566b
Merge pull request #198 from SiaFoundation/christopher/add-renewed-fr…
chris124567 Apr 12, 2025
99c3ebc
fix hanging on start (again)
chris124567 Apr 15, 2025
a11b50c
Merge pull request #202 from SiaFoundation/christopher/fix-hanging-on…
chris124567 Apr 16, 2025
1a62ff3
Bump golang.org/x/net from 0.37.0 to 0.38.0 in the go_modules group
dependabot[bot] Apr 16, 2025
e7f0ffa
Bump github.com/mattn/go-sqlite3 in the all-dependencies group
dependabot[bot] Apr 21, 2025
fe2887e
Merge pull request #205 from SiaFoundation/dependabot/go_modules/all-…
n8maninger Apr 21, 2025
395ac48
Bump the all-dependencies group with 2 updates
dependabot[bot] Apr 24, 2025
c49eb06
fix build
ChrisSchinnerl Apr 24, 2025
9a07676
fix bug where if the first block a transaction was in contained the s…
chris124567 Apr 23, 2025
318d577
nits, use transaction check helper in tests
chris124567 Apr 23, 2025
b236c4a
remove sfDBIDs parameter in addEvents
chris124567 Apr 23, 2025
70aa137
update jape dependency
ChrisSchinnerl Apr 24, 2025
e3dd42c
add tests from #204
chris124567 Apr 23, 2025
fc6f69f
refactor
chris124567 Apr 23, 2025
9de5fd9
pass nil chain migration logger
chris124567 Apr 24, 2025
b179bea
nits
chris124567 Apr 25, 2025
282104a
use variable to remove occurences of ugly n.genesis().Transactions[0]…
chris124567 Apr 25, 2025
9cdb5a9
rebase
chris124567 Apr 24, 2025
2751576
add revert.go
chris124567 Apr 24, 2025
4030cf6
simplify test
chris124567 Apr 24, 2025
d15817b
simplify test
chris124567 Apr 24, 2025
800e970
add refactored TestTransactionChainIndices and remove unrefactored tr…
chris124567 Apr 29, 2025
b131d4b
Bump the all-dependencies group across 1 directory with 3 updates
dependabot[bot] Apr 28, 2025
017163e
check errors in syncer methods
chris124567 Apr 28, 2025
66bdeda
Merge branch 'master' into christopher/fix-orphan-transactions-bug
chris124567 Apr 29, 2025
463bcfb
Merge pull request #207 from SiaFoundation/christopher/fix-orphan-tra…
chris124567 Apr 29, 2025
bb0c633
add siafund versions of TestSiacoinOutput and TestEphemeralSiacoinOutput
chris124567 Apr 30, 2025
2f8eca3
add balance tests, remove TestSiafundBalance
chris124567 Apr 30, 2025
332a8cd
reenable jape analyzer
chris124567 Apr 30, 2025
86a069d
fix syntax
chris124567 Apr 30, 2025
6f8b55c
replace TestTip/TestRevertTip, TestMissingBlock with refactored equiv…
chris124567 Apr 30, 2025
2c85aa6
add ResetChainState and call when we do chain migration
chris124567 Apr 24, 2025
d5b12f3
add test
chris124567 Apr 24, 2025
df56533
remove a little boilerplate from test
chris124567 Apr 24, 2025
a554e40
fix lint
chris124567 Apr 24, 2025
c056198
fix potential deadlock
chris124567 Apr 25, 2025
97522f0
drop all tables and init again in ResetChainState
chris124567 Apr 26, 2025
2c97a0e
check genesis transactions after reindex
chris124567 Apr 29, 2025
724f1cb
close rows on error
chris124567 Apr 29, 2025
814aba1
defer rows.Close
chris124567 Apr 29, 2025
e1daab1
drop tables in correct order
chris124567 Apr 29, 2025
b6b86e8
use EXCLUDED where possible
chris124567 May 1, 2025
0a06a93
avoid using maps of internal IDs where possible when retrieving v1 tr…
chris124567 May 2, 2025
63b2f81
Merge branch 'add-events' into christopher/refactor-database
Sia-Developments Sep 2, 2026
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
24 changes: 0 additions & 24 deletions .github/actions/test/action.yml

This file was deleted.

4 changes: 4 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,7 @@ updates:
directory: "/" # Location of package manifests
schedule:
interval: "weekly"
groups:
all-dependencies:
patterns:
- "*"
31 changes: 13 additions & 18 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,30 +1,25 @@
name: Main
name: Lint & Test
on:
workflow_dispatch:
pull_request:
push:
branches:
- master

env:
CGO_ENABLED: 1

jobs:
test:
runs-on: ${{ matrix.os }}
permissions:
contents: read
strategy:
matrix:
os: [ ubuntu-latest , macos-latest, windows-latest ]
go-version: [ '1.21', '1.22' ]
uses: SiaFoundation/workflows/.github/workflows/go-test.yml@master
analyze:
runs-on: ubuntu-latest
steps:
- name: Configure git
run: git config --global core.autocrlf false # required on Windows
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
- name: Checkout
uses: actions/checkout@v4
- name: Jape Analyzer
uses: SiaFoundation/action-golang-analysis@HEAD
with:
go-version: ${{ matrix.go-version }}
- name: Test
uses: ./.github/actions/test
- name: Build
run: go build -o bin/ ./cmd/explored
analyzers: |
go.sia.tech/jape.Analyzer@master
directories: |
api
25 changes: 25 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Publish

# Controls when the action will run.
on:
push:
branches:
- master
tags:
- "v[0-9]+.[0-9]+.[0-9]+"
- "v[0-9]+.[0-9]+.[0-9]+-**"

concurrency:
group: ${{ github.workflow }}
cancel-in-progress: false

jobs:
publish:
uses: SiaFoundation/workflows/.github/workflows/go-publish.yml@d0721ade42a1811c199a3f5707c6980f1d8a2ad8
secrets: inherit
with:
linux-build-args: -tags=timetzdata -trimpath -a -ldflags '-s -w -linkmode external -extldflags "-static"'
windows-build-args: -tags=timetzdata -trimpath -a -ldflags '-s -w -linkmode external -extldflags "-static"'
macos-build-args: -tags=timetzdata -trimpath -a -ldflags '-s -w'
cgo-enabled: 1
project: explored
73 changes: 29 additions & 44 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,28 +17,8 @@ run:
# 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

Expand All @@ -50,7 +30,6 @@ linters-settings:
## Enabled linters:
govet:
# report about shadowed variables
check-shadowing: false
disable-all: false

tagliatelle:
Expand All @@ -65,23 +44,31 @@ linters-settings:
# 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
enabled-tags:
- diagnostic
- style
disabled-checks:
# diagnostic
- appendAssign
- commentedOutCode
- uncheckedInlineErr
# style
- httpNoBody
- exitAfterDefer
- ifElseChain
- importShadow
- initClause
- nestingReduce
- octalLiteral
- paramTypeCombine
- ptrToRefParam
- stringsCompare
- tooManyResultsChecker
- typeDefFirst
- typeUnparen
- unlabelStmt
- unnamedResult
- whyNoLint
revive:
ignore-generated-header: true
rules:
Expand All @@ -90,7 +77,7 @@ linters-settings:
- name: bool-literal-in-expr
disabled: false
- name: confusing-naming
disabled: true
disabled: false
- name: confusing-results
disabled: false
- name: constant-logical-expr
Expand All @@ -108,7 +95,7 @@ linters-settings:
- name: increment-decrement
disabled: false
- name: modifies-value-receiver
disabled: false
disabled: true
- name: optimize-operands-order
disabled: false
- name: range-val-in-closure
Expand Down Expand Up @@ -154,12 +141,10 @@ issues:
# 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:
- "ifElseChain:.*"
- "exitAfterDefer:.*"
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
exclude-use-default: false
40 changes: 40 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
FROM docker.io/library/golang:1.23 AS builder

WORKDIR /explored

# Install dependencies
COPY go.mod go.sum ./
RUN go mod download

# Copy source
COPY . .

# Enable CGO for sqlite3 support
ENV CGO_ENABLED=1

RUN go generate ./...
RUN go build -o bin/ -tags='netgo timetzdata' -trimpath -a -ldflags '-s -w -linkmode external -extldflags "-static"' ./cmd/explored

FROM docker.io/library/alpine:3
LABEL maintainer="The Sia Foundation <info@sia.tech>" \
org.opencontainers.image.description.vendor="The Sia Foundation" \
org.opencontainers.image.description="An explored container - indexes the state of the Sia blockchain" \
org.opencontainers.image.source="https://github.com/SiaFoundation/explored" \
org.opencontainers.image.licenses=MIT

ENV PUID=0
ENV PGID=0

# copy binary and prepare data dir.
COPY --from=builder /explored/bin/* /usr/bin/
VOLUME [ "/data" ]

# API port
EXPOSE 9980/tcp
# RPC port
EXPOSE 9981/tcp

USER ${PUID}:${PGID}

ENV EXPLORED_CONFIG_FILE=/data/explored.yml
ENTRYPOINT [ "explored", "--dir", "/data" ]
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
[![GoDoc](https://godoc.org/go.sia.tech/explored?status.svg)](https://godoc.org/go.sia.tech/explored)

`explored` is an explorer for Sia.

## Required Disclosure

This product includes GeoLite2 data created by MaxMind, available at https://www.maxmind.com. It is provided under a [Creative Commons Corporation Attribution-ShareAlike 4.0 International License](https://www.maxmind.com/en/geolite2/eula).
17 changes: 10 additions & 7 deletions api/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,18 @@ import (
"time"

"go.sia.tech/core/types"
"go.sia.tech/explored/explorer"
)

// A StateResponse returns information about the current state of the explored
// daemon.
type StateResponse struct {
Version string `json:"version"`
Commit string `json:"commit"`
OS string `json:"os"`
BuildTime time.Time `json:"buildTime"`
StartTime time.Time `json:"startTime"`
}

// A GatewayPeer is a currently-connected peer.
type GatewayPeer struct {
Addr string `json:"addr"`
Expand All @@ -31,12 +40,6 @@ type TxpoolTransactionsResponse struct {
V2Transactions []types.V2Transaction `json:"v2transactions"`
}

// AddressUTXOsResponse is the response for /addresses/:address/utxos.
type AddressUTXOsResponse struct {
UnspentSiacoinOutputs []explorer.SiacoinOutput `json:"unspentSiacoinOutputs"`
UnspentSiafundOutputs []explorer.SiafundOutput `json:"unspentSiafundOutputs"`
}

// AddressBalanceResponse is the response for /addresses/:address/balance.
type AddressBalanceResponse struct {
UnspentSiacoins types.Currency `json:"unspentSiacoins"`
Expand Down
Loading
Loading