Skip to content

Commit

Permalink
Updated Modules (#20)
Browse files Browse the repository at this point in the history
* - Renamed config_template.json to config_defaults.json

* - Updated to latest appconfig and modules

* - Add config header and replace some topic names
  • Loading branch information
alexsporn authored Jul 13, 2022
1 parent 536d899 commit 27a5ef1
Show file tree
Hide file tree
Showing 12 changed files with 1,239 additions and 51 deletions.
41 changes: 41 additions & 0 deletions .github/workflows/gendoc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: gendoc

on:
push:
branches:
- develop

jobs:
gendoc:
runs-on: ubuntu-latest
steps:
- name: Set up Go
uses: actions/setup-go@v1
with:
go-version: 1.18
id: go

- name: Print Go version
run: go version

- name: Check out code into the Go module directory
uses: actions/checkout@v2

- name: Run gendoc
working-directory: tools/gendoc
run: go mod tidy && go run main.go

- name: Create Pull Request
uses: peter-evans/create-pull-request@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
title: "chore(gendoc): update docs"
commit-message: "chore(gendoc): update docs"
body: |
Generated new config documentation.
This PR is auto generated by [gendoc workflow](https://github.com/${{ github.repository }}/actions?query=workflow%3Agendoc).
branch: chore/gendoc
base: develop
add-paths: |
*.json
*.md
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ RUN go mod verify
RUN go build -o /app/inx-faucet -a

# Copy the assets
COPY ./config.json /app/config.json
COPY ./config_defaults.json /app/config.json

############################
# Image
Expand Down
3 changes: 1 addition & 2 deletions config_template.json → config_defaults.json
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
{
"app": {
"checkForUpdates": true,
"disablePlugins": [],
"enablePlugins": [],
"stopGracePeriod": "5m"
},
"inx": {
Expand All @@ -23,6 +21,7 @@
}
},
"profiling": {
"enabled": false,
"bindAddress": "localhost:6060"
}
}
2 changes: 1 addition & 1 deletion core/app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ var (
Name = "inx-faucet"

// Version of the app.
Version = "0.9.1"
Version = "0.10.0"
)

func App() *app.App {
Expand Down
7 changes: 4 additions & 3 deletions core/faucet/plugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,16 +107,17 @@ func provide(c *dig.Container) error {
return nil, err
}

falseCondition := false
query := &nodeclient.BasicOutputsQuery{
AddressBech32: address.Bech32(protoParas.Bech32HRP),
IndexerExpirationParas: nodeclient.IndexerExpirationParas{
HasExpirationCondition: false,
HasExpirationCondition: &falseCondition,
},
IndexerTimelockParas: nodeclient.IndexerTimelockParas{
HasTimelockCondition: false,
HasTimelockCondition: &falseCondition,
},
IndexerStorageDepositParas: nodeclient.IndexerStorageDepositParas{
RequiresStorageDepositReturn: false,
RequiresStorageDepositReturn: &falseCondition,
},
}

Expand Down
124 changes: 124 additions & 0 deletions documentation/docs/configuration.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
---
description: This section describes the configuration parameters and their types for INX-Faucet.
keywords:
- IOTA Node
- Hornet Node
- Faucet
- Configuration
- JSON
- Customize
- Config
- reference
---


# Core Configuration

INX-Faucet uses a JSON standard format as a config file. If you are unsure about JSON syntax, you can find more information in the [official JSON specs](https://www.json.org).

You can change the path of the config file by using the `-c` or `--config` argument while executing `inx-faucet` executable.

For example:
```bash
inx-faucet -c config_defaults.json
```

You can always get the most up-to-date description of the config parameters by running:

```bash
inx-faucet -h --full
```
## <a id="app"></a> 1. Application

| Name | Description | Type | Default value |
| --------------- | ------------------------------------------------------------------------------------------------------ | ------- | ------------- |
| checkForUpdates | Whether to check for updates of the application or not | boolean | true |
| stopGracePeriod | The maximum time to wait for background processes to finish during shutdown before terminating the app | string | "5m" |

Example:

```json
{
"app": {
"checkForUpdates": true,
"stopGracePeriod": "5m"
}
}
```

## <a id="inx"></a> 2. INX

| Name | Description | Type | Default value |
| ------- | -------------------------------------- | ------ | ---------------- |
| address | The INX address to which to connect to | string | "localhost:9029" |

Example:

```json
{
"inx": {
"address": "localhost:9029"
}
}
```

## <a id="faucet"></a> 3. Faucet

| Name | Description | Type | Default value |
| ------------------------------ | ---------------------------------------------------------------------------------------------------------------------------- | ------ | ---------------- |
| amount | The amount of funds the requester receives | uint | 1000000000 |
| smallAmount | The amount of funds the requester receives if the target address has more funds than the faucet amount and less than maximum | uint | 100000000 |
| maxAddressBalance | The maximum allowed amount of funds on the target address | uint | 2000000000 |
| maxOutputCount | The maximum output count per faucet message | int | 128 |
| tagMessage | The faucet transaction tag payload | string | "HORNET FAUCET" |
| batchTimeout | The maximum duration for collecting faucet batches | string | "2s" |
| bindAddress | The bind address on which the faucet website can be accessed from | string | "localhost:8091" |
| [rateLimit](#faucet_ratelimit) | Configuration for rateLimit | object | |

### <a id="faucet_ratelimit"></a> RateLimit

| Name | Description | Type | Default value |
| ----------- | ----------------------------------------------- | ------ | ------------- |
| period | The period for rate limiting | string | "5m" |
| maxRequests | The maximum number of requests per period | int | 10 |
| maxBurst | Additional requests allowed in the burst period | int | 20 |

Example:

```json
{
"faucet": {
"amount": 1000000000,
"smallAmount": 100000000,
"maxAddressBalance": 2000000000,
"maxOutputCount": 128,
"tagMessage": "HORNET FAUCET",
"batchTimeout": "2s",
"bindAddress": "localhost:8091",
"rateLimit": {
"period": "5m",
"maxRequests": 10,
"maxBurst": 20
}
}
}
```

## <a id="profiling"></a> 4. Profiling

| Name | Description | Type | Default value |
| ----------- | ------------------------------------------------- | ------- | ---------------- |
| enabled | Whether the profiling plugin is enabled | boolean | false |
| bindAddress | The bind address on which the profiler listens on | string | "localhost:6060" |

Example:

```json
{
"profiling": {
"enabled": false,
"bindAddress": "localhost:6060"
}
}
```

27 changes: 13 additions & 14 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,18 @@ module github.com/iotaledger/inx-faucet
go 1.18

require (
github.com/iotaledger/hive.go v0.0.0-20220707144500-ae0ecb7af9bf
github.com/iotaledger/hive.go/serializer/v2 v2.0.0-20220707144500-ae0ecb7af9bf
github.com/iotaledger/hornet v1.1.0-rc1.0.20220711110438-e716d1c534c0
github.com/iotaledger/inx-app v0.0.0-20220705125128-ee367df6181f
github.com/iotaledger/hive.go v0.0.0-20220713112541-3bfe06a592ed
github.com/iotaledger/hive.go/serializer/v2 v2.0.0-20220713112541-3bfe06a592ed
github.com/iotaledger/hornet v1.1.0-rc1.0.20220713113822-e9068836a87f
github.com/iotaledger/inx-app v0.0.0-20220713113726-e61674a965b5
github.com/iotaledger/inx/go v0.0.0-20220705124918-775bb201b49e
github.com/iotaledger/iota.go/v3 v3.0.0-20220705124454-acc836567dfb
github.com/iotaledger/iota.go/v3 v3.0.0-20220713111307-e56bfeff5451
github.com/labstack/echo/v4 v4.7.2
github.com/pkg/errors v0.9.1
github.com/stretchr/testify v1.8.0
go.uber.org/dig v1.14.1
golang.org/x/time v0.0.0-20220609170525-579cf78fd858
google.golang.org/grpc v1.47.0
google.golang.org/grpc v1.48.0
)

require (
Expand Down Expand Up @@ -58,11 +58,11 @@ require (
github.com/ipfs/go-log/v2 v2.5.1 // indirect
github.com/jbenet/goprocess v0.1.4 // indirect
github.com/klauspost/compress v1.15.7 // indirect
github.com/klauspost/cpuid/v2 v2.0.14 // indirect
github.com/klauspost/cpuid/v2 v2.1.0 // indirect
github.com/knadh/koanf v1.4.2 // indirect
github.com/kr/pretty v0.3.0 // indirect
github.com/kr/text v0.2.0 // indirect
github.com/labstack/gommon v0.3.2-0.20220410183028-64116baad496 // indirect
github.com/labstack/gommon v0.3.1 // indirect
github.com/libp2p/go-buffer-pool v0.1.0 // indirect
github.com/libp2p/go-libp2p-core v0.19.1 // indirect
github.com/libp2p/go-libp2p-peerstore v0.7.1 // indirect
Expand All @@ -83,15 +83,15 @@ require (
github.com/multiformats/go-multicodec v0.5.0 // indirect
github.com/multiformats/go-multihash v0.2.0 // indirect
github.com/multiformats/go-varint v0.0.6 // indirect
github.com/onsi/gomega v1.19.0 // indirect
github.com/panjf2000/ants/v2 v2.5.0 // indirect
github.com/pasztorpisti/qs v0.0.0-20171216220353-8d6c33ee906c // indirect
github.com/pelletier/go-toml v1.9.5 // indirect
github.com/pelletier/go-toml/v2 v2.0.2 // indirect
github.com/petermattis/goid v0.0.0-20220526132513-07eaf5d0b9f4 // indirect
github.com/petermattis/goid v0.0.0-20220712135657-ac599d9cba15 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/prometheus/client_golang v1.12.2 // indirect
github.com/prometheus/client_model v0.2.0 // indirect
github.com/prometheus/common v0.35.0 // indirect
github.com/prometheus/common v0.36.0 // indirect
github.com/prometheus/procfs v0.7.3 // indirect
github.com/rogpeppe/go-internal v1.8.1 // indirect
github.com/sasha-s/go-deadlock v0.3.1 // indirect
Expand All @@ -104,17 +104,16 @@ require (
github.com/valyala/fasttemplate v1.2.1 // indirect
github.com/wollac/iota-crypto-demo v0.0.0-20220407192531-0c9bc107c733 // indirect
go.uber.org/atomic v1.9.0 // indirect
go.uber.org/goleak v1.1.12 // indirect
go.uber.org/multierr v1.8.0 // indirect
go.uber.org/zap v1.21.0 // indirect
golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d // indirect
golang.org/x/exp v0.0.0-20220706164943-b4a6d9510983 // indirect
golang.org/x/net v0.0.0-20220708220712-1185a9018129 // indirect
golang.org/x/sync v0.0.0-20220601150217-0de741cfad7f // indirect
golang.org/x/sys v0.0.0-20220708085239-5a0f0661e09d // indirect
golang.org/x/sys v0.0.0-20220712014510-0a85c31ab51e // indirect
golang.org/x/text v0.3.7 // indirect
golang.org/x/xerrors v0.0.0-20220609144429-65e65417b02f // indirect
google.golang.org/genproto v0.0.0-20220708155623-50e5f4832e73 // indirect
google.golang.org/genproto v0.0.0-20220712132514-bdd2acd4974d // indirect
google.golang.org/protobuf v1.28.0 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
Expand Down
Loading

0 comments on commit 27a5ef1

Please sign in to comment.