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

Docu/update #562

Merged
merged 5 commits into from
Aug 21, 2024
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
19 changes: 13 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,19 @@ build_release:
build_docker:
docker build . -t test-arc --build-arg="APP_COMMIT=$(APP_COMMIT)" --build-arg="APP_VERSION=$(APP_VERSION)"

.PHONY: run
run:
docker compose -f test/docker-compose.yaml down --remove-orphans
docker compose -f test/docker-compose.yaml up --abort-on-container-exit migrate-blocktx migrate-metamorph
docker compose -f test/docker-compose.yaml up --build arc-blocktx arc-callbacker arc-metamorph arc
docker compose -f test/docker-compose.yaml down

.PHONY: run_e2e_tests
run_e2e_tests:
docker compose -f test/docker-compose.yml down --remove-orphans
docker compose -f test/docker-compose.yml up --abort-on-container-exit migrate-blocktx migrate-metamorph
docker compose -f test/docker-compose.yml up --build --exit-code-from tests tests arc-blocktx arc-callbacker arc-metamorph arc --scale arc-blocktx=4 --scale arc-metamorph=2
docker compose -f test/docker-compose.yml down
docker compose -f test/docker-compose.yaml down --remove-orphans
docker compose -f test/docker-compose.yaml up --abort-on-container-exit migrate-blocktx migrate-metamorph
docker compose -f test/docker-compose.yaml up --build --exit-code-from tests tests arc-blocktx arc-callbacker arc-metamorph arc --scale arc-blocktx=4 --scale arc-metamorph=2
docker compose -f test/docker-compose.yaml down

.PHONY: test
test:
Expand All @@ -40,7 +47,7 @@ install_lint:

.PHONY: lint
lint:
golangci-lint run --config=config/.golangci.yml -v ./...
golangci-lint run --config=config/.golangci.yaml -v ./...
staticcheck ./...

.PHONY: gen_go
Expand Down Expand Up @@ -117,7 +124,7 @@ gh-pages:

.PHONY: api
api:
oapi-codegen -config pkg/api/config.yaml pkg/api/arc.yml > pkg/api/arc.go
oapi-codegen -config pkg/api/config.yaml pkg/api/arc.yaml > pkg/api/arc.go

.PHONY: compare_config
compare_config:
Expand Down
38 changes: 19 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,9 +111,9 @@ Additionally, ARC relies on a message queue to communicate between Metamorph and
docker run -p 4222:4222 nats
```

The [docker-compose file](./deployments/docker-compose.yml) additionally shows how ARC can be run with the message queue and the Postgres database and db migrations. You can run ARC with all components with the following command
You can run ARC with all components using the [docker-compose.yaml](./test/docker-compose.yaml) file by using the following make command
```
docker-compose -f deployments/docker-compose.yml up
make run
```

### Docker
Expand Down Expand Up @@ -166,21 +166,21 @@ go run main.go -metamorph=true
Metamorph keeps track of the lifecycle of a transaction, and assigns it a status, which is returned in the `txStatus` field whenever the transaction is queried.
The following statuses are available:

| Code | Status | Description |
|------|--------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| 0 | `UNKNOWN` | The transaction has been sent to metamorph, but no processing has taken place. This should never be the case, unless something goes wrong. |
| 10 | `QUEUED` | The transaction has been queued for processing. |
| 20 | `RECEIVED` | The transaction has been properly received by the metamorph processor. |
| 30 | `STORED` | The transaction has been stored in the metamorph store. This should ensure the transaction will be processed and retried if not picked up immediately by a mining node. |
| 40 | `ANNOUNCED_TO_NETWORK` | The transaction has been announced (INV message) to the Bitcoin network. |
| 50 | `REQUESTED_BY_NETWORK` | The transaction has been requested from metamorph by a Bitcoin node. |
| 60 | `SENT_TO_NETWORK` | The transaction has been sent to at least 1 Bitcoin node. |
| 70 | `ACCEPTED_BY_NETWORK` | The transaction has been accepted by a connected Bitcoin node on the ZMQ interface. If metamorph is not connected to ZMQ, this status will never by set. |
| 80 | `SEEN_IN_ORPHAN_MEMPOOL` | The transaction has been sent to at least 1 Bitcoin node but parent transaction was not found. |
| 90 | `SEEN_ON_NETWORK` | The transaction has been seen on the Bitcoin network and propagated to other nodes. This status is set when metamorph receives an INV message for the transaction from another node than it was sent to. |
| 100 | `DOUBLE_SPEND_ATTEMPTED` | The transaction is a double spend attempt. Competing transaction(s) will be returned with this status. |
| 110 | `REJECTED` | The transaction has been rejected by the Bitcoin network. |
| 120 | `MINED` | The transaction has been mined into a block by a mining node. |
| Status | Description |
|--------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `UNKNOWN` | The transaction has been sent to metamorph, but no processing has taken place. This should never be the case, unless something goes wrong. |
| `QUEUED` | The transaction has been queued for processing. |
| `RECEIVED` | The transaction has been properly received by the metamorph processor. |
| `STORED` | The transaction has been stored in the metamorph store. This should ensure the transaction will be processed and retried if not picked up immediately by a mining node. |
| `ANNOUNCED_TO_NETWORK` | The transaction has been announced (INV message) to the Bitcoin network. |
| `REQUESTED_BY_NETWORK` | The transaction has been requested from metamorph by a Bitcoin node. |
| `SENT_TO_NETWORK` | The transaction has been sent to at least 1 Bitcoin node. |
| `ACCEPTED_BY_NETWORK` | The transaction has been accepted by a connected Bitcoin node on the ZMQ interface. If metamorph is not connected to ZMQ, this status will never by set. |
| `SEEN_IN_ORPHAN_MEMPOOL` | The transaction has been sent to at least 1 Bitcoin node but parent transaction was not found. |
| `SEEN_ON_NETWORK` | The transaction has been seen on the Bitcoin network and propagated to other nodes. This status is set when metamorph receives an INV message for the transaction from another node than it was sent to. |
| `DOUBLE_SPEND_ATTEMPTED` | The transaction is a double spend attempt. Competing transaction(s) will be returned with this status. |
| `REJECTED` | The transaction has been rejected by the Bitcoin network. |
| `MINED` | The transaction has been mined into a block by a mining node. |

The statuses have a difference between the codes in order to make it possible to add more statuses in between the existing ones without creating a breaking change.

Expand Down Expand Up @@ -283,7 +283,7 @@ The tests can be executed like this:
make clean_restart_e2e_test
```

The [docker-compose](./test/docker-compose.yml) file also shows the minimum setup that is needed for ARC to run.
The [docker-compose](./test/docker-compose.yaml) file also shows the minimum setup that is needed for ARC to run.


## Monitoring
Expand Down Expand Up @@ -350,7 +350,7 @@ make gen

### Generate REST API

The rest api is defined in a [yaml file](./api/arc.yml) following the OpenAPI 3.0.0 specification. Before the rest API can be generated install the necessary tools by running
The rest api is defined in a [yaml file](./api/arc.yaml) following the OpenAPI 3.0.0 specification. Before the rest API can be generated install the necessary tools by running
```
make install_gen
```
Expand Down
4 changes: 2 additions & 2 deletions cmd/arc/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ func parseFlags() (string, bool, bool, bool, bool, bool, string) {
startCallbacker := flag.Bool("callbacker", false, "start callbacker")
help := flag.Bool("help", false, "Show help")
dumpConfigFile := flag.String("dump_config", "", "dump config to specified file and exit")
configDir := flag.String("config", "", "path to configuration yaml file")
configDir := flag.String("config", "", "path to configuration file")

flag.Parse()

Expand All @@ -193,7 +193,7 @@ func parseFlags() (string, bool, bool, bool, bool, bool, string) {
fmt.Println(" whether to start callbacker (default=true)")
fmt.Println("")
fmt.Println(" -config=/location")
fmt.Println(" directory to look for config.yaml (default='')")
fmt.Println(" directory to look for config (default='')")
fmt.Println("")
fmt.Println(" -dump_config=/file.yaml")
fmt.Println(" dump config to specified file and exit (default='config/dumped_config.yaml')")
Expand Down
File renamed without changes.
1 change: 0 additions & 1 deletion deployments/config/bitcoin.conf

This file was deleted.

1 change: 0 additions & 1 deletion deployments/config/config.yaml

This file was deleted.

175 changes: 0 additions & 175 deletions deployments/docker-compose.yml

This file was deleted.

3 changes: 1 addition & 2 deletions doc/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -784,7 +784,7 @@ This endpoint is used to send a raw transaction to a miner for inclusion in the
|467|Unknown|Mined ancestors not found in BEEF|[ErrorMinedAncestorsNotFound](#schemaerrorminedancestorsnotfound)|
|468|Unknown|Invalid BUMPs in BEEF|[ErrorCalculatingMerkleRoots](#schemaerrorcalculatingmerkleroots)|
|469|Unknown|Invalid Merkle Roots|[ErrorValidatingMerkleRoots](#schemaerrorvalidatingmerkleroots)|
|473|Unknown|Cumulative Fee too low|[ErrorCumulativeFees](#schemaerrorcumulativefees)|
|473|Unknown|Cumulative Fee validation failed|[ErrorCumulativeFees](#schemaerrorcumulativefees)|

<aside class="warning">
To perform this operation, you must be authenticated by means of one of the following methods:
Expand Down Expand Up @@ -2257,4 +2257,3 @@ and
|instance|string¦null|false|none|(Optional) Link to actual error on server|
|txid|string¦null|false|none|Transaction ID this error is referring to|
|extraInfo|string¦null|false|none|Optional extra information about the error from the miner|

2 changes: 1 addition & 1 deletion doc/arc.json
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@
}
},
"473": {
"description": "Cumulative Fee too low",
"description": "Cumulative Fee validation failed",
"content": {
"application/json": {
"schema": {
Expand Down
2 changes: 1 addition & 1 deletion doc/errors.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,4 @@ ErrStatusFrozenPolicy: Input Frozen (blacklist manager policy blacklisted). The
ErrStatusFrozenConsensus: Input Frozen (blacklist manager consensus blacklisted) The transaction is attempting to spend frozen digital assets.

# 473
ErrStatusCumulativeFees: Cumulative fees of all transactions in chain is too low.
ErrStatusCumulativeFees: Cumulative fee validation failed
14 changes: 7 additions & 7 deletions pkg/api/arc.go

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

2 changes: 1 addition & 1 deletion pkg/api/arc.json
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@
}
},
"473": {
"description": "Cumulative Fee too low",
"description": "Cumulative Fee validation failed",
"content": {
"application/json": {
"schema": {
Expand Down
2 changes: 1 addition & 1 deletion pkg/api/arc.yml → pkg/api/arc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ paths:
schema:
$ref: '#/components/schemas/ErrorValidatingMerkleRoots'
473:
description: Cumulative Fee too low
description: Cumulative Fee validation failed
content:
application/json:
schema:
Expand Down
Loading
Loading