Skip to content

Commit

Permalink
feat: Implement EIP-1559 (REST) (#308)
Browse files Browse the repository at this point in the history
  • Loading branch information
darioAnongba authored Sep 13, 2021
1 parent 8a54a55 commit 5746e66
Show file tree
Hide file tree
Showing 33 changed files with 732 additions and 250 deletions.
2 changes: 1 addition & 1 deletion .env.sample
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ AUTH_TLS_CA=/ca/ca.crt

AUTH_API_KEY_FILE=/apikey/sample.csv

TEST_DATA={"key_manager_url":"https://localhost:8080","health_key_manager_url":"https://localhost:8081","secret_stores":["hashicorp-secrets","akv-secrets","aws-secrets"],"key_stores":["hashicorp-keys"],"eth_stores":["eth-accounts"],"quorum_node_id":"quorum-node","besu_node_id":"besu-node"}
TEST_DATA={"key_manager_url":"https://localhost:8080","health_key_manager_url":"https://localhost:8081","secret_stores":["hashicorp-secrets","akv-secrets","aws-secrets"],"key_stores":["hashicorp-keys"],"eth_stores":["eth-accounts"],"quorum_node_id":"quorum-node","besu_node_id":"besu-node","geth_node_id":"geth-node"}

## Postgres SSL
#DB_TLS_SSLMODE=verify-ca
Expand Down
13 changes: 11 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,10 @@ coverage: run-coverage
dev: gobuild
@docker-compose -f ./docker-compose.yml up --force-recreate --build -d $(KEY_MANAGER_SERVICES)

up: deps go-quorum besu gobuild
up: deps go-quorum besu geth gobuild
@docker-compose -f ./docker-compose.yml up --build -d $(KEY_MANAGER_SERVICES)

down: down-go-quorum down-besu
down: down-go-quorum down-besu down-geth
@docker-compose -f ./docker-compose.yml down --volumes --timeout 0
@make down-deps

Expand Down Expand Up @@ -101,6 +101,15 @@ stop-besu:
down-besu:
@docker-compose -f deps/besu/docker-compose.yml down --volumes --timeout 0

geth:
@docker-compose -f deps/geth/docker-compose.yml up -d

stop-geth:
@docker-compose -f deps/geth/docker-compose.yml stop

down-geth:
@docker-compose -f deps/geth/docker-compose.yml down --volumes --timeout 0

generate-jwt: networks gobuild
@docker-compose -f ./docker-compose.yml up generate-jwt

Expand Down
2 changes: 1 addition & 1 deletion deps/besu/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ x-default-variables: &default-variables
x-besu-bootnode-def:
&besu-bootnode-def
restart: "on-failure"
image: hyperledger/besu:21.1.5
image: hyperledger/besu:21.7.3
entrypoint:
- /bin/bash
- -c
Expand Down
6 changes: 6 additions & 0 deletions deps/config/manifests/nodes.yml.template
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,9 @@
specs:
rpc:
addr: http://validator1:8545
- kind: Node
name: geth-node
version: 0.0.0
specs:
rpc:
addr: http://geth:8545
67 changes: 67 additions & 0 deletions deps/geth/config/genesis.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
{
"config": {
"chainId": 888,
"homesteadBlock": 0,
"eip150Block": 0,
"eip150Hash": "0x0000000000000000000000000000000000000000000000000000000000000000",
"eip155Block": 0,
"eip158Block": 0,
"byzantiumBlock": 0,
"constantinopleBlock": 0,
"petersburgBlock": 0,
"istanbulBlock": 0,
"muirGlacierBlock": 0,
"berlinBlock": 0,
"londonBlock": 1,
"clique": {
"period": 5,
"epoch": 30000
}
},
"nonce": "0x0",
"timestamp": "0x5d168461",
"extraData": "0x00000000000000000000000000000000000000000000000000000000000000007e654d251da770a068413677967f6d3ea2fea9e40000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"gasLimit": "0x1312D00",
"difficulty": "0x1",
"mixHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
"coinbase": "0x0000000000000000000000000000000000000000",
"alloc": {
"6009608a02a7a15fd6689d6dad560c44e9ab61ff": {
"privateKey": "0x86b021ccb810f26a30445b85f71e4c1596a11a97ddf9b9e348ac93d1da6735bc",
"balance": "0x200000000000000000000000000000000000000000000000000000000000000"
},
"664895b5fe3ddf049d2fb508cfa03923859763c6": {
"privateKey": "0xc4b172e72033581bc41c36fa0448fcf031e9a31c4a3e300e541802dfb7248307",
"balance": "0x200000000000000000000000000000000000000000000000000000000000000"
},
"7e654d251da770a068413677967f6d3ea2fea9e4": {
"privateKey": "0x56202652fdffd802b7252a456dbd8f3ecc0352bbde76c23b40afe8aebd714e2e",
"balance": "0x200000000000000000000000000000000000000000000000000000000000000"
},
"93f7274c9059e601be4512f656b57b830e019e41": {
"privateKey": "0x1476c66de79a57e8ab4cadceccbe858c99e5edf3bffea5404b15322b5421e18c",
"balance": "0x200000000000000000000000000000000000000000000000000000000000000"
},
"a8d8db1d8919665a18212374d623fc7c0dfda410": {
"balance": "0x200000000000000000000000000000000000000000000000000000000000000"
},
"bfc7137876d7ac275019d70434b0f0779824a969": {
"balance": "0x200000000000000000000000000000000000000000000000000000000000000"
},
"dbb881a51cd4023e4400cef3ef73046743f08da3": {
"balance": "0x200000000000000000000000000000000000000000000000000000000000000"
},
"f5956eb46b377ae41b41bda94e6270208d8202bb": {
"balance": "0x200000000000000000000000000000000000000000000000000000000000000"
},
"ff778b716fc07d98839f48ddb88d8be583beb684": {
"balance": "0x200000000000000000000000000000000000000000000000000000000000000"
},
"ffbba394def3ff1df0941c6429887107f58d4e9b": {
"balance": "0x200000000000000000000000000000000000000000000000000000000000000"
}
},
"number": "0x0",
"gasUsed": "0x0",
"parentHash": "0x0000000000000000000000000000000000000000000000000000000000000000"
}
1 change: 1 addition & 0 deletions deps/geth/config/keystore/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
These addresses are the same as the default accounts available in the Quorum key manager
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"address":"7e654d251da770a068413677967f6d3ea2fea9e4","crypto":{"cipher":"aes-128-ctr","ciphertext":"d6f726e0f8855550d121f3e173f1d3ae2da5b7c972bfbec611a984b78b69b5eb","cipherparams":{"iv":"3e322d22e2013549eab44a3d11365d46"},"kdf":"scrypt","kdfparams":{"dklen":32,"n":262144,"p":1,"r":8,"salt":"7db66650951384077634b2222af4ac0d24f2d0a464ae0a10d078f22349458be0"},"mac":"fda71fd859f20ceecb90fa400ac59bf505dd4cabf0ba1eafa43f948a994697aa"},"id":"646311d4-5e97-4e87-983e-c58d69b88121","version":3}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"address":"ff778b716fc07d98839f48ddb88d8be583beb684","crypto":{"cipher":"aes-128-ctr","ciphertext":"6ad63ecbca297a134b8f089931032efa2505ede6dc7186d79b140dd57d7848f7","cipherparams":{"iv":"c873727891a498872a37f1365fadd026"},"kdf":"scrypt","kdfparams":{"dklen":32,"n":262144,"p":1,"r":8,"salt":"6fe7b0c6c9913348b73dc3125fd7001576fe613b683a5ad55da5d509c507e14e"},"mac":"c5a888a0db3e38b3d4b1f348b82a2d2c06275b4787b9b8bc0503bf17b1e05733"},"id":"75775da1-60e5-425d-b2b8-625353ff3102","version":3}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"address":"664895b5fe3ddf049d2fb508cfa03923859763c6","crypto":{"cipher":"aes-128-ctr","ciphertext":"69cf979b9e4fd251b8d6fc9e85928af91ef300f11f863a22999ec6bf730f67a5","cipherparams":{"iv":"1f58072399b3071f4c72c19b61ffd458"},"kdf":"scrypt","kdfparams":{"dklen":32,"n":262144,"p":1,"r":8,"salt":"edb35cd57156787825e50ca98ac0e6998a42037fbf1d6020442020679825527a"},"mac":"65fe5bd9d75008e741a9927072f3bba3b01555a88db12a9825549286803dd010"},"id":"100eab9d-a320-484b-9f5c-aa39be76af74","version":3}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"address":"f5956eb46b377ae41b41bda94e6270208d8202bb","crypto":{"cipher":"aes-128-ctr","ciphertext":"685a7075fd11d994f0cfc77db89c1b12df443c2532a9cf046325dca0936c5a47","cipherparams":{"iv":"10555290374c95332513f8ca6dde6126"},"kdf":"scrypt","kdfparams":{"dklen":32,"n":262144,"p":1,"r":8,"salt":"fa8248242643370be811333860a8279810a23860ec6d09cc5dc076621373ff20"},"mac":"82fd6b68013b918be289af29a691f37a15939df6cf97482f31ec93073a6d9618"},"id":"5b4f104c-930f-4ad2-a664-2d97df912ce3","version":3}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"address":"93f7274c9059e601be4512f656b57b830e019e41","crypto":{"cipher":"aes-128-ctr","ciphertext":"6d8e724627e00ff8ef080ce7ff99c2b030ebf990207505d9d1d0f932f75083ed","cipherparams":{"iv":"dd5b18f1e348460d1e461e0060a84300"},"kdf":"scrypt","kdfparams":{"dklen":32,"n":262144,"p":1,"r":8,"salt":"0e78b5e5e5bebd52f42c5f3e4ad90d17bf2ce9284c04a69153d9368d531d9c27"},"mac":"666e21b64e68466aa13cc6aa03e8c1eddfb6550ab972bcb2480cc232a36e8e9d"},"id":"d82a8995-a375-4c60-9cb7-16ef3beadbf3","version":3}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"address":"bfc7137876d7ac275019d70434b0f0779824a969","crypto":{"cipher":"aes-128-ctr","ciphertext":"e3d17442508a5489b8eb8d094fd4c6072f4800d6a51c512a7bf8039c8fa81fd5","cipherparams":{"iv":"884e8b4bdfaf1863dd8a71e4cf563948"},"kdf":"scrypt","kdfparams":{"dklen":32,"n":262144,"p":1,"r":8,"salt":"f87aaa3d996d4c64ecc5626324d6cb7a33f0315653040b45e938519ccf018a62"},"mac":"062210f8b7aa7fbcb8c5331c96d23e31899e0f94df63459f9a1d36732b5f4d4d"},"id":"71639c81-ab5b-4f0f-be3a-84e4c4c5633b","version":3}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"address":"a8d8db1d8919665a18212374d623fc7c0dfda410","crypto":{"cipher":"aes-128-ctr","ciphertext":"8bc3de4fc583e44ccaafeabdb11a97e0798bb6548669a0b33e600c894b5a3f6e","cipherparams":{"iv":"588be3903d8ca6a1ade33a706510a349"},"kdf":"scrypt","kdfparams":{"dklen":32,"n":262144,"p":1,"r":8,"salt":"a6c010e087936702e1d724be0a7139be93b1c3c3678a2dc3dfbed354c17317fd"},"mac":"5cc77f6582aa102517d4d1052009142943749509cd076f21e197b8e47d327fd7"},"id":"fd3c15e4-74bf-42dc-9c32-9518cc0ae5df","version":3}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"address":"ffbba394def3ff1df0941c6429887107f58d4e9b","crypto":{"cipher":"aes-128-ctr","ciphertext":"1784492639e0c85581c4416fbf324b905f1b7ad7fe1207d6b7372566ebe362be","cipherparams":{"iv":"b1185845161f05e8abf0ec3815f5ad58"},"kdf":"scrypt","kdfparams":{"dklen":32,"n":262144,"p":1,"r":8,"salt":"63a3e22c1902b421210d259798a24c958c8cd1a2c70cfaf78e90fbf8e84699c3"},"mac":"bd22fab1df6d524f20be2e755b773ca3592fc855146c8df0013d4571aec02059"},"id":"9935f0ad-82bf-4b26-b1eb-7203151dbf5a","version":3}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"address":"dbb881a51cd4023e4400cef3ef73046743f08da3","crypto":{"cipher":"aes-128-ctr","ciphertext":"74dc5c68ce76e740fe64e9feb1988d47b1b01d4d0a40718a3202fe22b155982b","cipherparams":{"iv":"385472a83fc01509fb8061df6536525a"},"kdf":"scrypt","kdfparams":{"dklen":32,"n":262144,"p":1,"r":8,"salt":"197d96172e8bd7edf0ada50af94318fc15a800666f3b2ff8606df7cf52dc0b86"},"mac":"681775134e8257f73992d75b13902d20c9f7d018df02eb814b295ed109bcc5fa"},"id":"6e52009b-e312-4f9d-b8d0-f135b309f523","version":3}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"address":"6009608a02a7a15fd6689d6dad560c44e9ab61ff","crypto":{"cipher":"aes-128-ctr","ciphertext":"9aa0ee26b26e6537fe0d2a523a313acdb9a0c672c62c3f4d3bc7e4b398a3d64c","cipherparams":{"iv":"1afce84c8d2bfa3ce4bdf82529b3ab6f"},"kdf":"scrypt","kdfparams":{"dklen":32,"n":262144,"p":1,"r":8,"salt":"ac67a32cf648003cc21304ef30e6505ec6e4e85810ddf353e68659d09dbe5f32"},"mac":"e50116f4968dfb5cd7115092082fa5b9754f9e5a4b43b4d9bb7cd06af4a8cbad"},"id":"6e0e993e-f53f-46b0-acaa-de2962b4c86b","version":3}
1 change: 1 addition & 0 deletions deps/geth/config/password
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
password
57 changes: 57 additions & 0 deletions deps/geth/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
version: '3.7'

x-container-common: &container-common
restart: ${CONTAINER_RESTART-on-failure}
networks:
- qkm

services:
geth:
<<: *container-common
image: ethereum/client-go:stable
entrypoint:
- /bin/sh
- -c
- |
geth --datadir "/nodeData" init "/nodeData/genesis.json"
geth \
--rpc \
--rpcaddr "0.0.0.0" \
--rpcport "${GETH_RPC_PORT-8545}" \
--rpccorsdomain "*" \
--rpcvhosts "*" \
--datadir "/nodeData" \
--port "${GETH_PORT-30303}" \
--rpcapi "admin,eth,net,web3,personal,txpool" \
--networkid ${GETH_NETWORKID-888} \
--nodiscover \
--unlock "0" \
--password "/nodeData/password" \
--allow-insecure-unlock \
--mine \
--ipcdisable \
--syncmode "full"
volumes:
- ./config/genesis.json:/nodeData/genesis.json
- ./config/keystore:/nodeData/keystore
- ./config/password:/nodeData/password
- chain-data:/nodeData/geth
ports:
- 8546:8545
networks:
- qkm
healthcheck:
test: ["CMD", "wget", "--spider", "--proxy", "off", "http://localhost:8545"]
interval: 3s
timeout: 3s
retries: 10
start_period: 5s

volumes:
chain-data:
driver: local

networks:
qkm:
external:
name: deps_qkm
8 changes: 3 additions & 5 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ require (
github.com/containerd/containerd v1.4.4 // indirect
github.com/docker/docker v17.12.0-ce-rc1.0.20200618181300-9dc6525e6118+incompatible
github.com/docker/go-connections v0.4.0
github.com/ethereum/go-ethereum v1.9.25
github.com/ethereum/go-ethereum v1.10.8
github.com/fsnotify/fsnotify v1.4.9
github.com/go-pg/pg/v10 v10.10.1
github.com/go-playground/validator/v10 v10.5.0
Expand All @@ -38,15 +38,13 @@ require (
github.com/spf13/pflag v1.0.5
github.com/spf13/viper v1.7.1
github.com/stretchr/testify v1.7.0
github.com/swaggo/swag v1.7.1
go.elastic.co/ecszap v1.0.0
go.uber.org/atomic v1.8.0 // indirect
go.uber.org/multierr v1.7.0 // indirect
go.uber.org/zap v1.17.0
golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b
golang.org/x/net v0.0.0-20210525063256-abc453219eb5
golang.org/x/sys v0.0.0-20210603125802-9665404d3644 // indirect
golang.org/x/time v0.0.0-20200630173020-3af7569d3a1e
golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d
golang.org/x/time v0.0.0-20210220033141-f8bda1e9f3ba
google.golang.org/protobuf v1.26.0 // indirect
gopkg.in/square/go-jose.v2 v2.3.1
gopkg.in/yaml.v2 v2.4.0
Expand Down
Loading

0 comments on commit 5746e66

Please sign in to comment.