-
Notifications
You must be signed in to change notification settings - Fork 60
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Truffle <> relay compatibility (#379)
* Add truffle-relay compatibility Signed-off-by: nikolay <[email protected]> * Add license headers Signed-off-by: nikolay <[email protected]> * Edit package.json Signed-off-by: nikolay <[email protected]> * Edit tests Signed-off-by: nikolay <[email protected]> * Add note Signed-off-by: nikolay <[email protected]>
- Loading branch information
Showing
9 changed files
with
20,751 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
name: Truffle Compatibility | ||
|
||
on: | ||
pull_request: | ||
branches: [ main, release/** ] | ||
push: | ||
branches: [ main, release/** ] | ||
tags: [ v* ] | ||
|
||
jobs: | ||
setup-local-hedera: | ||
name: Truffle Compatibility | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: write | ||
steps: | ||
- name: Setup node | ||
uses: actions/setup-node@v2 | ||
with: | ||
node-version: 16 | ||
|
||
- name: Checkout repo | ||
uses: actions/checkout@v2 | ||
|
||
- name: Install packages | ||
run: npm ci | ||
|
||
- name: Create .env file | ||
run: | | ||
cp ./tools/truffle-example/.env.example ./tools/truffle-example/.env | ||
cp ./packages/server/tests/localAcceptance.env .env | ||
- name: Lerna Bootstrap | ||
run: npm run setup | ||
|
||
- name: Install pnpm | ||
run: npm install -g pnpm | ||
|
||
- name: Build Typescript | ||
run: npx lerna run build | ||
|
||
- name: Run RPC Server | ||
run: npm run integration:prerequisite & | ||
|
||
- name: Install truffle dependencies | ||
run: cd ./tools/truffle-example/ && npm ci | ||
|
||
- name: Run the truffle tests | ||
uses: nick-fields/retry@v2 | ||
with: | ||
max_attempts: 10 | ||
timeout_minutes: 10 | ||
retry_wait_seconds: 45 | ||
command: cd ./tools/truffle-example/ && npx truffle test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# all available private keys and addresses can be found here https://github.com/hashgraph/hedera-local-node#commands | ||
OPERATOR_PRIVATE_KEY=0x105d050185ccb907fba04dd92d8de9e32c18305e097ab41dadda21489a211524 | ||
RECEIVER_PRIVATE_KEY=0x2e1d968b041d84dd120a5860cee60cd83f9374ef527ca86996317ada3d0d03e7 | ||
RELAY_URL='http://localhost' | ||
RELAY_PORT=7546 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
node_modules | ||
.env | ||
coverage | ||
coverage.json | ||
typechain | ||
typechain-types | ||
|
||
#Truffle files | ||
build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
//SPDX-License-Identifier: Unlicense | ||
pragma solidity ^0.8.0; | ||
|
||
contract Greeter { | ||
string private greeting; | ||
|
||
constructor(string memory _greeting) { | ||
greeting = _greeting; | ||
} | ||
|
||
function greet() public view returns (string memory) { | ||
return greeting; | ||
} | ||
|
||
function setGreeting(string memory _greeting) public { | ||
greeting = _greeting; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
/*- | ||
* | ||
* Hedera JSON RPC Relay - Truffle Example | ||
* | ||
* Copyright (C) 2022 Hedera Hashgraph, LLC | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
* | ||
*/ | ||
|
||
const Greeter = artifacts.require('Greeter'); | ||
|
||
module.exports = function (deployer) { | ||
deployer.deploy(Greeter, 'initial_msg'); | ||
}; |
Oops, something went wrong.