Commit 1479cda3 authored by mergify[bot]'s avatar mergify[bot] Committed by GitHub

Merge pull request #3783 from ethereum-optimism/feat/beta-1-artifacts

ctb: Add beta-1 artifacts
parents 26b1d32e 4f5cd706
......@@ -45,6 +45,9 @@ RUN cd /tmp && \
tar -C / -Jxpf /tmp/s6-overlay-x86_64.tar.xz && \
chmod +x /usr/local/bin/op-init.sh
# Give Geth enough time to start up
ENV S6_CMD_WAIT_FOR_SERVICES_MAXTIME=10000
ENV OP_NODE_L1_ETH_RPC=dummy \
OP_NODE_RPC_ADDR=0.0.0.0 \
OP_NODE_RPC_PORT=9545 \
......
......@@ -55,4 +55,17 @@ Oneshot uses s6-overlay under the hood to supervise the processes it runs. It in
1. `op-init`: A oneshot service that `op-init` and `op-node` use to initialize themselves.
2. `op-geth`: A longrun service that manages the Geth node.
3. `op-node`: A longrun service that manages the opnode.
\ No newline at end of file
3. `op-node`: A longrun service that manages the opnode.
## Creating a oneshot
The `create.py` script in this directory creates a oneshot container given an op-node/op-geth image and a network name. The script essentially wraps `docker build`, but specifies the proper build args. Usage:
```bash
python3 create.py --op-node-image 7037cc6c528fc967009136e863c771f737f3d231 \
--op-geth-image ca157997a49b06c3cb01191a04a96b913ae0c19d \
--network-name beta-1 \
--tag v0.1.0-beta.1
```
Nothing other than the Python standard library is required.
\ No newline at end of file
import argparse
import logging
import os
import subprocess
from logging.config import dictConfig
log_level = os.getenv('LOG_LEVEL')
log_config = {
'version': 1,
'loggers': {
'': {
'handlers': ['console'],
'level': log_level if log_level is not None else 'INFO'
},
},
'handlers': {
'console': {
'formatter': 'stderr',
'class': 'logging.StreamHandler',
'stream': 'ext://sys.stdout'
}
},
'formatters': {
'stderr': {
'format': '[%(levelname)s|%(asctime)s] %(message)s',
'datefmt': '%m-%d-%Y %I:%M:%S'
}
},
}
dictConfig(log_config)
lgr = logging.getLogger()
parser = argparse.ArgumentParser(description='Creates a Bedrock oneshot container.')
parser.add_argument('--op-node-image', help='op-node image to use inside the container.', required=True)
parser.add_argument('--op-geth-image', help='op-geth image to use inside the container.', required=True)
parser.add_argument('--network-name', help='Network name.', required=True)
parser.add_argument('--tag', help='Docker tag.', required=True)
def main():
args = parser.parse_args()
full_tag = f'us-central1-docker.pkg.dev/bedrock-goerli-development/images/bedrock-oneshot:{args.tag}'
build_args = (
('op_node_image', args.op_node_image),
('op_geth_image', args.op_geth_image),
('network_name', args.network_name)
)
cmd_args = ['docker', 'build', '-f', 'Dockerfile.oneshot', '-t', full_tag]
for arg in build_args:
cmd_args.append('--build-arg')
cmd_args.append(f'{arg[0]}={arg[1]}')
cmd_args.append(os.getcwd())
run_command(cmd_args)
def run_command(args, check=True, shell=False, cwd=None, env=None):
env = env if env else {}
return subprocess.run(
args,
check=check,
shell=shell,
env={
**os.environ,
**env
},
cwd=cwd
)
if __name__ == '__main__':
main()
#!/command/with-contenv bash
set -eu
GETH_DATA_DIR=/db
......
#!/command/with-contenv bash
set -eu
GETH_DATA_DIR=/db
CHAIN_ID=$(cat "/etc/op-geth/genesis.json" | jq -r .config.chainId)
# We must set miner.gaslimit to the gas limit in genesis
# in the command below!
GAS_LIMIT_HEX=$(jq -r .gasLimit < "/etc/op-geth/genesis.json" | sed s/0x//i | tr '[:lower:]' '[:upper:]')
GAS_LIMIT=$(echo "obase=10; ibase=16; $GAS_LIMIT_HEX" | bc)
# Warning: Archive mode is required, otherwise old trie nodes will be
# pruned within minutes of starting the devnet.
......@@ -24,9 +28,11 @@ exec geth \
--ws.api=debug,eth,txpool,net,engine \
--syncmode=full \
--nodiscover \
--miner.gaslimit=$GAS_LIMIT \
--maxpeers="$OP_GETH_MAX_PEERS" \
--networkid=$CHAIN_ID \
--gcmode=archive \
--rollup.disabletxpoolgossip=true \
--rollup.sequencerhttp="$OP_GETH_SEQUENCER_HTTP" \
--authrpc.jwtsecret=/etc/secrets/jwt-secret.txt
"$@"
\ No newline at end of file
......@@ -9,6 +9,4 @@ export OP_NODE_P2P_PRIV_PATH=/etc/secrets/p2p-private-key.txt
export OP_NODE_P2P_PEERSTORE_PATH=/p2p/
export OP_NODE_P2P_DISCOVERY_PATH=/p2p/discovery
printenv
exec op-node
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment