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

chore:rename ledgerwatch to erigontech in E2 #13163

Merged
merged 8 commits into from
Dec 19, 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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
6 changes: 3 additions & 3 deletions .buildkite/pipeline.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
steps:
- command: './nightly.sh'
label: 'build & run geth'
- command: "./nightly.sh"
label: "build & run geth"
env:
BUILDKITE_GOLANG_IMPORT_PATH: "github.com/ledgerwatch/erigon"
BUILDKITE_GOLANG_IMPORT_PATH: "github.com/erigontech/erigon"
38 changes: 19 additions & 19 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,40 +1,40 @@
# Contributing

Thank you for considering to help out with the source code! We welcome
contributions from anyone on the internet, and are grateful for even the
Thank you for considering to help out with the source code! We welcome
contributions from anyone on the internet, and are grateful for even the
smallest of fixes!

If you'd like to contribute to Erigon, please fork, fix, commit and send a
If you'd like to contribute to Erigon, please fork, fix, commit and send a
pull request for the maintainers to review and merge into the main code base. If
you wish to submit more complex changes though, please check up with the core
devs first on [Discord server](https://github.com/ledgerwatch/erigon#erigon-discord-server) to
ensure those changes are in line with the general philosophy of the project
you wish to submit more complex changes though, please check up with the core
devs first on [Discord server](https://github.com/erigontech/erigon#erigon-discord-server) to
ensure those changes are in line with the general philosophy of the project
and/or get some early feedback which can make both your efforts much lighter as
well as our review and merge procedures quick and simple.

## Coding guidelines

Please make sure your contributions adhere to our coding guidelines:

* Code must adhere to the official Go
[formatting](https://golang.org/doc/effective_go.html#formatting) guidelines
(i.e. uses [gofmt](https://golang.org/cmd/gofmt/)).
* Code must be documented adhering to the official Go
[commentary](https://golang.org/doc/effective_go.html#commentary) guidelines.
* Pull requests need to be based on and opened against the `devel` branch.
* Commit messages should be prefixed with the package(s) they modify.
* E.g. "eth, rpc: make trace configs optional"
- Code must adhere to the official Go
[formatting](https://golang.org/doc/effective_go.html#formatting) guidelines
(i.e. uses [gofmt](https://golang.org/cmd/gofmt/)).
- Code must be documented adhering to the official Go
[commentary](https://golang.org/doc/effective_go.html#commentary) guidelines.
- Pull requests need to be based on and opened against the `devel` branch.
- Commit messages should be prefixed with the package(s) they modify.
- E.g. "eth, rpc: make trace configs optional"

## Can I have feature X

Before you submit a feature request, please check and make sure that it isn't
possible through some other means. The JavaScript-enabled console is a powerful
feature in the right hands. Please check our
[Wiki page](https://github.com/ledgerwatch/erigon/wiki) for more info
Before you submit a feature request, please check and make sure that it isn't
possible through some other means. The JavaScript-enabled console is a powerful
feature in the right hands. Please check our
[Wiki page](https://github.com/erigontech/erigon/wiki) for more info
and help.

## Configuration, dependencies, and tests

Please see the [Readme](https://github.com/ledgerwatch/erigon#readme) file
Please see the [Readme](https://github.com/erigontech/erigon#readme) file
for more details on configuring your environment, managing project dependencies
and testing procedures.
8 changes: 4 additions & 4 deletions .github/ISSUE_TEMPLATE/question.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
---
name: Ask a question
about: Something is unclear
title: ''
labels: 'type:docs'
assignees: ''
title: ""
labels: "type:docs"
assignees: ""
---

This should only be used in very rare cases e.g. if you are not 100% sure if something is a bug or asking a question that leads to improving the documentation. For general questions please use [Erigon's discord](https://github.com/ledgerwatch/erigon#erigon-discord-server).
This should only be used in very rare cases e.g. if you are not 100% sure if something is a bug or asking a question that leads to improving the documentation. For general questions please use [Erigon's discord](https://github.com/erigontech/erigon#erigon-discord-server).
6 changes: 3 additions & 3 deletions .github/workflows/docker-tags.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Docker tags
on:
push:
tags:
- 'y*.*.*'
- "y*.*.*"
workflow_dispatch:

jobs:
Expand Down Expand Up @@ -33,9 +33,9 @@ jobs:
make release-dry-run
docker images
# docker image push --all-tags thorax/erigon
# docker image push --all-tags ghcr.io/ledgerwatch/erigon
# docker image push --all-tags ghcr.io/erigontech/erigon
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
VERSION: ${GITHUB_REF#refs/tags/}
DOCKER_USERNAME: ${{ secrets.DOCKERHUB }}
DOCKER_PASSWORD: ${{ secrets.DOCKERHUB_KEY }}
DOCKER_PASSWORD: ${{ secrets.DOCKERHUB_KEY }}
9 changes: 5 additions & 4 deletions .github/workflows/test-hive-eest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ name: Hive EEST tests
on:
push:
branches:
- release/*
- pectra_e2
- release/*
- pectra_e2
workflow_dispatch:

jobs:
Expand Down Expand Up @@ -34,7 +34,7 @@ jobs:
mv clients/erigon/Dockerfile.git clients/erigon/Dockerfile
branch_name=$(echo ${GITHUB_REF#refs/heads/} | sed 's/[&/\]/\\&/g')
echo Building Hive with Erigon branch - $branch_name
sed -i "s/^ARG github=ledgerwatch\/erigon$/ARG github=erigontech\/erigon/" clients/erigon/Dockerfile
sed -i "s/^ARG github=erigontech\/erigon$/ARG github=erigontech\/erigon/" clients/erigon/Dockerfile
sed -i "s/^ARG tag=main$/ARG tag=${branch_name}/" clients/erigon/Dockerfile
if [[ "$branch_name" != "main" ]]; then
sed -i "/$sync.parallel-state-flushing/d" clients/erigon/erigon.sh
Expand Down Expand Up @@ -78,4 +78,5 @@ jobs:
exit 1
fi
}
run_suite eest/consume-engine
run_suite eest/consume-engine
2 changes: 1 addition & 1 deletion .github/workflows/test-integration-caplin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
tests:
strategy:
matrix:
# disable macos-11 until https://github.com/ledgerwatch/erigon/issues/8789
# disable macos-11 until https://github.com/erigontech/erigon/issues/8789
os: [ ubuntu-22.04 ] # list of os: https://github.com/actions/virtual-environments
runs-on: ${{ matrix.os }}

Expand Down
2 changes: 1 addition & 1 deletion .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ linters:
- unused
- performance
disable:
- gosec # enable it after 1-2 weeks. it failing CI withoutt enough info to fix: https://github.com/ledgerwatch/erigon/actions/runs/5928644129/job/16074701625
- gosec # enable it after 1-2 weeks. it failing CI withoutt enough info to fix: https://github.com/erigontech/erigon/actions/runs/5928644129/job/16074701625
- exhaustive
- musttag
- contextcheck
Expand Down
161 changes: 81 additions & 80 deletions DEV_CHAIN.md
Original file line number Diff line number Diff line change
@@ -1,156 +1,157 @@
Steps to setup and run Erigon dev chain. This tutorial is made for macOS.

## 1. Clone and Build Erigon

## 1. Clone and Build Erigon
Open terminal 1 and type the following command

```bash
git clone --recurse-submodules -j8 https://github.com/ledgerwatch/erigon.git
```bash
git clone --recurse-submodules -j8 https://github.com/erigontech/erigon.git
cd erigon
make erigon
```


## 2. Build RPC daemon

On the same terminal folder you can build the RPC daemon.

```bash
make rpcdaemon
```

## 3. Start Node 1
## 3. Start Node 1

If everything is fine, by changing directory to erigon/build/bin you will see the two exec for erigon and rpc daemon.
On the terminal you can type the following command to start node1.

```bash
./erigon --datadir=dev --chain=dev --private.api.addr=localhost:9090 --mine
```

Or, you could start the rpcdaemon internally together

```bash
./erigon --datadir=dev --chain=dev --private.api.addr=localhost:9090 --mine --http.api=eth,erigon,web3,net,debug,trace,txpool,parity,admin --http.corsdomain="*"
```

Argument notes:
* datadir : Tells where the data is stored, default level is dev folder.
* chain : Tells that we want to run Erigon in the dev chain.
* private.api.addr=localhost:9090 : Tells where Eigon is going to listen for connections.
* mine : Add this if you want the node to mine.
* dev.period <number-of-seconds>: Add this to specify the timing interval among blocks. Number of seconds MUST be > 0 (if you want empty blocks) otherwise the default value 0 does not allow mining of empty blocks.
* http.api: List of services to start on http (rpc) access


Argument notes:

- datadir : Tells where the data is stored, default level is dev folder.
- chain : Tells that we want to run Erigon in the dev chain.
- private.api.addr=localhost:9090 : Tells where Eigon is going to listen for connections.
- mine : Add this if you want the node to mine.
- dev.period <number-of-seconds>: Add this to specify the timing interval among blocks. Number of seconds MUST be > 0 (if you want empty blocks) otherwise the default value 0 does not allow mining of empty blocks.
- http.api: List of services to start on http (rpc) access

The result will be something like this:

<img width="1652" alt="Node 1 start" src="https://user-images.githubusercontent.com/24697803/140478108-c93a131d-745d-45ac-a76f-9bb808e504df.png">


Now save the enode information generated in the logs, we will use this in a minute. Here there is an example.
```
enode://d30d079163d7b69fcb261c0538c0c3faba4fb4429652970e60fa25deb02a789b4811e98b468726ba0be63b9dc925a019f433177eb6b45c23bb78892f786d8f7a@127.0.0.1:53171

```
enode://d30d079163d7b69fcb261c0538c0c3faba4fb4429652970e60fa25deb02a789b4811e98b468726ba0be63b9dc925a019f433177eb6b45c23bb78892f786d8f7a@127.0.0.1:53171
```

## 4. Start RPC daemon

Open terminal 2 and navigate to erigon/build/bin folder. Here type the following command
```bash

```bash
./rpcdaemon --datadir=dev --private.api.addr=localhost:9090 --http.api=eth,erigon,web3,net,debug,trace,txpool,parity
```

The result will look like this:
<img width="1636" alt="rpc daemon start" src="https://user-images.githubusercontent.com/24697803/140478408-ac1be94a-4a63-42c6-8673-e24decadd658.png">



## 5. Start Node 2

Node 2 has to connect to Node 1 in order to sync. As such, we will use the argument --staticpeers.
To tell Node 2 where Node 1 is we will use the Enode info of Node 1 we saved before.

Open terminal 3 and navigate to erigon/build/bin folder. Paste in the following command the Enode info and run it, be careful to remove the last part ?discport=0.

The node info of the first peer can also be obtained with an admin RPC call

```bash
curl -X POST -H "Content-Type: application/json" --data '{"jsonrpc": "2.0", "method": "admin_nodeInfo", "params": [], "id":83}' localhost:8545
```
```

```bash
```bash
./erigon --datadir=dev2 --chain=dev --private.api.addr=localhost:9091 \
--staticpeers="enode://d30d079163d7b69fcb261c0538c0c3faba4fb4429652970e60fa25deb02a789b4811e98b468726ba0be63b9dc925a019f433177eb6b45c23bb78892f786d8f7a@127.0.0.1:53171" \
--nodiscover
```

You might face a conflict with ports if you run it on the same machine. To specify different ports use, for instance ``--torrent.port 42079``, you might consider specifying all the other flags too: ``--port --http.port --authrpc.port ``
You might face a conflict with ports if you run it on the same machine. To specify different ports use, for instance `--torrent.port 42079`, you might consider specifying all the other flags too: `--port --http.port --authrpc.port `

To check if the nodes are connected, you can go to the log of both nodes and look for the line
``` [p2p] GoodPeers eth66=1 ```

` [p2p] GoodPeers eth66=1`

Note: this might take a while it is not instantaneous, also if you see a 1 on either one of the two the node is fine.





## 6. Interact with the node using RPC

Open a terminal 4 and type


## 6. Interact with the node using RPC

Open a terminal 4 and type

```bash
curl -X POST -H "Content-Type: application/json" --data '{"jsonrpc": "2.0", "method": "eth_chainId", "params": [], "id":1}' localhost:8545

```
The result should look like this:


The result should look like this:

```json
{"jsonrpc":"2.0","id":1,"result":"0x539"}
{ "jsonrpc": "2.0", "id": 1, "result": "0x539" }
```

Other commands you can try:

```bash
curl -X POST -H "Content-Type: application/json" --data '{"jsonrpc": "2.0", "method": "eth_gasPrice", "params": [], "id":1}' localhost:8545
```
```bash
curl -X POST -H "Content-Type: application/json" --data '{"jsonrpc": "2.0", "method": "eth_mining", "params": [], "id":1}' localhost:8545
```
```bash
curl -X POST -H "Content-Type: application/json" --data '{"jsonrpc": "2.0", "method": "eth_syncing", "params": [], "id":1}' localhost:8545
```
```bash
curl -X POST -H "Content-Type: application/json" --data '{"jsonrpc": "2.0", "method": "net_peerCount", "params": [], "id":74}' localhost:8545
```
```bash
curl -X POST -H "Content-Type: application/json" --data '{"jsonrpc": "2.0", "method": "eth_blockNumber", "params": [], "id":83}' localhost:8545
```

```bash
curl -X POST -H "Content-Type: application/json" --data '{"jsonrpc": "2.0", "method": "eth_gasPrice", "params": [], "id":1}' localhost:8545
```

```bash
curl -X POST -H "Content-Type: application/json" --data '{"jsonrpc": "2.0", "method": "eth_mining", "params": [], "id":1}' localhost:8545
```

```bash
curl -X POST -H "Content-Type: application/json" --data '{"jsonrpc": "2.0", "method": "eth_syncing", "params": [], "id":1}' localhost:8545
```

```bash
curl -X POST -H "Content-Type: application/json" --data '{"jsonrpc": "2.0", "method": "net_peerCount", "params": [], "id":74}' localhost:8545
```

```bash
curl -X POST -H "Content-Type: application/json" --data '{"jsonrpc": "2.0", "method": "eth_blockNumber", "params": [], "id":83}' localhost:8545
```

## 7. Send a transaction with MetaMask

Finally, we want to try sending a transaction between two accounts.
For this example we will use dev accounts retrieved from Erigon code:

* Account with balance (Dev 1)
* address = ``` 0x67b1d87101671b127f5f8714789C7192f7ad340e ```
* privateKey = ``` 26e86e45f6fc45ec6e2ecd128cec80fa1d1505e5507dcd2ae58c3130a7a97b48 ```

* Empty account (Dev 2)
* address = ``` 0xa94f5374Fce5edBC8E2a8697C15331677e6EbF0B ```
* privateKey = ``` 45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8 ```



Now from MetaMask, you can import Dev 1 , and then send a transaction to pass some ethers from Dev 1 to Dev 2.

Finally, we want to try sending a transaction between two accounts.
For this example we will use dev accounts retrieved from Erigon code:

- Account with balance (Dev 1)

- address = `0x67b1d87101671b127f5f8714789C7192f7ad340e`
- privateKey = `26e86e45f6fc45ec6e2ecd128cec80fa1d1505e5507dcd2ae58c3130a7a97b48`

- Empty account (Dev 2)
- address = `0xa94f5374Fce5edBC8E2a8697C15331677e6EbF0B`
- privateKey = `45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8`

Now from MetaMask, you can import Dev 1 , and then send a transaction to pass some ethers from Dev 1 to Dev 2.
From the RPC daemon terminal, you will see something like this

<img width="1633" alt="Transaction example" src="https://user-images.githubusercontent.com/24697803/140479146-94b6e66c-22b7-4d8a-a160-b3643d27b612.png">

Finally you will see the ethers in the Dev 2 account balance.

Finally you will see the ethers in the Dev 2 account balance.

## 7. Check a mined block

## 7. Check a mined block

Now we want to check the creation of a new block and that all the nodes sync.
Now we want to check the creation of a new block and that all the nodes sync.

Below we can see that block 1 is created (blocn_num=1) and that the next block to be proposed increments from 1 to 2 ( block=2). The other nodes will see the same update.

<img width="1327" alt="Block" src="https://user-images.githubusercontent.com/24697803/140509913-b2fc3140-ad81-4bf3-a595-d102f7c75245.png">

2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ LABEL org.label-schema.build-date=$BUILD_DATE \
org.label-schema.schema-version="1.0" \
org.label-schema.url="https://torquem.ch" \
org.label-schema.vcs-ref=$VCS_REF \
org.label-schema.vcs-url="https://github.com/ledgerwatch/erigon.git" \
org.label-schema.vcs-url="https://github.com/erigontech/erigon.git" \
org.label-schema.vendor="Torquem" \
org.label-schema.version=$VERSION

Expand Down
Loading
Loading