Skip to content

Commit

Permalink
Revert "Added automatic support for reader-node-bootstrap-url flag"
Browse files Browse the repository at this point in the history
This reverts commit 4f227e9.
  • Loading branch information
colindickson committed Feb 27, 2024
1 parent e1c2da1 commit 194dd76
Show file tree
Hide file tree
Showing 15 changed files with 158 additions and 464 deletions.
26 changes: 0 additions & 26 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,32 +10,6 @@ If you were at `firehose-core` version `1.0.0` and are bumping to `1.1.0`, you s

## Unreleased

* The `reader-node-bootstrap-url` gained the ability to be bootstrapped from a `bash` script.

If the bootstrap URL is of the form `bash:///<path/to/script>?<parameters>`, the bash script at
`<path/to/script>` will be executed. The script is going to receive in environment variables the resolved
reader node variables in the form of `READER_NODE_<VARIABLE_NAME>`. The fully resolved node arguments
(from `reader-node-arguments`) are passed as args to the bash script. The query parameters accepted are:

- `arg=<value>` | Pass as extra argument to the script, prepended to the list of resolved node arguments
- `env=<key>%3d<value>` | Pass as extra environment variable as `<key>=<value>` with key being upper-cased (multiple(s) allowed)
- `env_<key>=<value>` | Pass as extra environment variable as `<key>=<value>` with key being upper-cased (multiple(s) allowed)
- `cwd=<path>` | Change the working directory to `<path>` before running the script
- `interpreter=<path>` | Use `<path>` as the interpreter to run the script
- `interpreter_arg=<arg>` | Pass `<interpreter_arg>` as arguments to the interpreter before the script path (multiple(s) allowed)

> [!NOTE]
> The `bash:///` script support is currently experimental and might change in upcoming releases, the behavior changes will be
clearly documented here.

* The `reader-node-bootstrap-url` gained the ability to be bootstrapped from a pre-made archive file ending with `tar.zst` or `tar.zstd`.

* The `reader-node-bootstrap-data-url` is now added automatically if `firecore.Chain#ReaderNodeBootstrapperFactory` is `non-nil`.

If the bootstrap URL ends with `tar.zst` or `tar.zstd`, the archive is read and extracted into the
`reader-node-data-dir` location. The archive is expected to contain the full content of the 'reader-node-data-dir'
and is expanded as is.

* Added `Beacon` to known list of Block model.

## v1.2.3
Expand Down
5 changes: 1 addition & 4 deletions chain.go
Original file line number Diff line number Diff line change
Expand Up @@ -289,11 +289,8 @@ func (c *Chain[B]) Validate() {
// **Caveats** Two chain in the same Go binary will not work today as `bstream` uses global
// variables to store configuration which presents multiple chain to exist in the same process.
func (c *Chain[B]) Init() {
c.BlockEncoder = NewBlockEncoder()

if c.ReaderNodeBootstrapperFactory == nil {
c.ReaderNodeBootstrapperFactory = DefaultReaderNodeBootstrapper(noOpReaderNodeBootstrapperFactory)
}
c.BlockEncoder = NewBlockEncoder()
}

// BinaryName represents the binary name for your Firehose on <Chain> is the [ShortName]
Expand Down
8 changes: 2 additions & 6 deletions cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,15 +108,11 @@ func Main[B firecore.Block](chain *firecore.Chain[B]) {
apps.RegisterIndexBuilderApp(chain, rootLog)
}

startFlags := apps.StartCmd.Flags()

if chain.RegisterExtraStartFlags != nil {
chain.RegisterExtraStartFlags(startFlags)
chain.RegisterExtraStartFlags(apps.StartCmd.Flags())
}

if chain.ReaderNodeBootstrapperFactory != nil && startFlags.Lookup("reader-node-bootstrap-data-url") == nil {
startFlags.String("reader-node-bootstrap-data-url", "", firecore.DefaultReaderNodeBootstrapDataURLFlagDescription())
}
apps.ConfigureStartCmd(chain, binaryName, rootLog)

if err := tools.ConfigureToolsCmd(chain, rootLog, rootTracer); err != nil {
exitWithError("registering tools command", err)
Expand Down
29 changes: 29 additions & 0 deletions node-manager/boot/eos_bp/config.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Chain
abi-serializer-max-time-ms = 500000
chain-state-db-size-mb = 5000
max-transaction-time = 5000

# P2P
agent-name = eos_bp
p2p-server-address = 0.0.0.0:9876
p2p-max-nodes-per-host = 5
connection-cleanup-period = 15

# HTTP
access-control-allow-origin = *
http-server-address = 0.0.0.0:8888
http-max-response-time-ms = 1000
http-validate-host = 0
verbose-http-errors = true

plugin = eosio::db_size_api_plugin
plugin = eosio::net_api_plugin
plugin = eosio::chain_api_plugin
plugin = eosio::producer_api_plugin

# We want to produce the block logs, no deep-mind instrumentation here.
producer-name = eosio
producer-name = eosio2
producer-name = eosio3
enable-stale-production = true
signature-provider = EOS5MHPYyhjBjnQZejzZHqHewPWhGTfQWSVTWYEhDmJu4SXkzgweP=KEY:5JpjqdhVCQTegTjrLtCSXHce7c9M8w7EXYZS7xC13jVFF4Phcrx
4 changes: 4 additions & 0 deletions node-manager/boot/eos_bp/genesis.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"initial_key": "EOS5MHPYyhjBjnQZejzZHqHewPWhGTfQWSVTWYEhDmJu4SXkzgweP",
"initial_timestamp": "2019-05-23T19:18:34"
}
44 changes: 44 additions & 0 deletions node-manager/boot/eos_jungle/config.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
http-server-address = 0.0.0.0:8888
p2p-listen-endpoint = 0.0.0.0:9876
p2p-server-address = 0.0.0.0:9876
p2p-max-nodes-per-host = 2
connection-cleanup-period = 60
verbose-http-errors = true
chain-state-db-size-mb = 64000
# shared-memory-size-mb = 2048
reversible-blocks-db-size-mb = 2048
http-validate-host = false
max-transaction-time = 5000
abi-serializer-max-time-ms = 500000
# read-mode = read-only # we want internal connectivity

plugin = eosio::net_api_plugin
plugin = eosio::chain_api_plugin
plugin = eosio::db_size_api_plugin
plugin = eosio::producer_api_plugin

# Max speed for replay
# validation-mode = light
# wasm-runtime = wavm

# Enable deep mind
# deep-mind = 1
# deep-mind-console = 1

agent-name = dfuse dev
p2p-peer-address = 145.239.133.201:9876
p2p-peer-address = 163.172.34.128:9876
p2p-peer-address = 34.73.143.228:9876
p2p-peer-address = 47.244.11.76:9876
p2p-peer-address = 88.99.193.44:9876
p2p-peer-address = bp4-d3.eos42.io:9876
p2p-peer-address = jungle2.cryptolions.io:19876
p2p-peer-address = jungle2.cryptolions.io:9876
p2p-peer-address = jungle2-eos.blckchnd.com:9876
p2p-peer-address = jungle2.eosdac.io:9872
p2p-peer-address = jungle.eosamsterdam.net:9876
p2p-peer-address = jungle.eoscafeblock.com:9876
p2p-peer-address = jungle.eosusa.news:19876
p2p-peer-address = junglepeer.eossweden.se:9876
p2p-peer-address = peer1-jungle.eosphere.io:9876
p2p-peer-address = peer.jungle.alohaeos.com:9876
24 changes: 24 additions & 0 deletions node-manager/boot/eos_jungle/genesis.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"initial_configuration": {
"base_per_transaction_net_usage": 12,
"context_free_discount_net_usage_den": 100,
"context_free_discount_net_usage_num": 20,
"deferred_trx_expiration_window": 600,
"max_authority_depth": 6,
"max_block_cpu_usage": 200000,
"max_block_net_usage": 1048576,
"max_inline_action_depth": 4,
"max_inline_action_size": 4096,
"max_ram_size": 34359738368,
"max_transaction_cpu_usage": 150000,
"max_transaction_delay": 3888000,
"max_transaction_lifetime": 3600,
"max_transaction_net_usage": 524288,
"min_transaction_cpu_usage": 100,
"net_usage_leeway": 500,
"target_block_cpu_usage_pct": 2000,
"target_block_net_usage_pct": 1000
},
"initial_key": "EOS8bRkmrfsQSmb87ix1EuFSe2NDsepKGCjUNgLEt1SDqw1fuhG4v",
"initial_timestamp": "2018-11-23T16:20:00"
}
27 changes: 27 additions & 0 deletions node-manager/boot/eos_mainnet/config.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
http-server-address = 0.0.0.0:8888
agent-name = dfuse dev
p2p-server-address = 0.0.0.0:9876
p2p-max-nodes-per-host = 2
connection-cleanup-period = 60
verbose-http-errors = true
chain-state-db-size-mb = 64000
reversible-blocks-db-size-mb = 2048
# shared-memory-size-mb = 2048
http-validate-host = false
max-transaction-time = 5000
abi-serializer-max-time-ms = 500000
read-mode = read-only

plugin = eosio::net_api_plugin
plugin = eosio::chain_api_plugin
plugin = eosio::db_size_api_plugin
plugin = eosio::producer_api_plugin

# Enable deep mind
# deep-mind = 1
# deep-mind-console = 1

p2p-peer-address = publicnode.cypherglass.com:9876
p2p-peer-address = mars.fnp2p.eosbixin.com:443
p2p-peer-address = fullnode.eoslaomao.com:443
p2p-peer-address = peer.main.alohaeos.com:9876
23 changes: 23 additions & 0 deletions node-manager/boot/eos_mainnet/genesis.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"initial_timestamp": "2018-06-08T08:08:08.888",
"initial_key": "EOS7EarnUhcyYqmdnPon8rm7mBCTnBoot6o7fE2WzjvEX2TdggbL3",
"initial_configuration": {
"max_block_net_usage": 1048576,
"target_block_net_usage_pct": 1000,
"max_transaction_net_usage": 524288,
"base_per_transaction_net_usage": 12,
"net_usage_leeway": 500,
"context_free_discount_net_usage_num": 20,
"context_free_discount_net_usage_den": 100,
"max_block_cpu_usage": 200000,
"target_block_cpu_usage_pct": 1000,
"max_transaction_cpu_usage": 150000,
"min_transaction_cpu_usage": 100,
"max_transaction_lifetime": 3600,
"deferred_trx_expiration_window": 600,
"max_transaction_delay": 3888000,
"max_inline_action_size": 4096,
"max_inline_action_depth": 4,
"max_authority_depth": 6
}
}
5 changes: 0 additions & 5 deletions node-manager/operator/bootstrap.go

This file was deleted.

4 changes: 4 additions & 0 deletions node-manager/operator/operator.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,10 @@ type Operator struct {
zlogger *zap.Logger
}

type Bootstrapper interface {
Bootstrap() error
}

type Options struct {
Bootstrapper Bootstrapper

Expand Down
22 changes: 0 additions & 22 deletions reader_node.go

This file was deleted.

126 changes: 0 additions & 126 deletions reader_node_bootstrap.go

This file was deleted.

Loading

0 comments on commit 194dd76

Please sign in to comment.